fix(apollo-react): add resize lifecycle callbacks [MST-10602]#770
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Dependency License Review
License distribution
Excluded packages
|
Contributor
📦 Dev Packages🧹 Dev packages cleaned up after PR close. Last updated: 2026-06-03 07:43:38 PT |
There was a problem hiding this comment.
Pull request overview
Adds resize lifecycle callbacks to key canvas nodes so downstream consumers (e.g., undo/redo transaction logic) can reliably bracket resize interactions, with onResizeEnd deferred to run after React Flow’s final dimension update.
Changes:
- Added
onResizeStart/onResizeEndpublic props toStickyNoteNodeandLoopNode. - Deferred
onResizeEndviaqueueMicrotaskwhile preserving existingonResizebehavior. - Added focused component tests covering resize start/end lifecycle ordering and microtask deferral.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/apollo-react/src/canvas/components/StickyNoteNode/StickyNoteNode.tsx | Adds onResizeStart/onResizeEnd hooks; defers end callback with queueMicrotask while keeping existing onResize(params.width, params.height) behavior. |
| packages/apollo-react/src/canvas/components/StickyNoteNode/StickyNoteNode.test.tsx | New tests validating onResizeStart fires on start and onResizeEnd is deferred while onResize remains synchronous. |
| packages/apollo-react/src/canvas/components/LoopNode/LoopNode.types.ts | Extends LoopNodeProps with optional onResizeStart/onResizeEnd callbacks. |
| packages/apollo-react/src/canvas/components/LoopNode/LoopNode.tsx | Wires lifecycle callbacks into resize handlers and defers onResizeEnd with queueMicrotask. |
| packages/apollo-react/src/canvas/components/LoopNode/LoopNode.test.tsx | Extends resize control mock to emit onResize during drag and adds tests for deferred onResizeEnd + start callback. |
snuziale
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
queueMicrotaskso consumers commit after React Flow's final dimensions update.Verification
pnpm --filter @uipath/apollo-react exec vitest --run src/canvas/components/LoopNode/LoopNode.test.tsx src/canvas/components/StickyNoteNode/StickyNoteNode.test.tsxpnpm --filter @uipath/apollo-react exec tsc --noEmit