fix(autolayout): fixed autolayout with sockets#546
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
|
✅ No security or compliance issues detected. Reviewed everything up to 2699679. Security Overview
Detected Code Changes
Reply to this PR with |
There was a problem hiding this comment.
PR Summary
Enhanced auto-layout functionality for workflow blocks with improved socket connection handling and collaborative synchronization.
- Refactored orientation logic into
getOrientationConfiginapps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsxfor better maintainability - Added completion callback to
applyAutoLayoutSmoothinutils.tsto ensure proper collaborative state sync - Implemented two-phase update strategy: local store updates during animation, collaborative updates post-completion
- Improved position synchronization across collaborative sessions through socket-based updates
2 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile
| // Emit collaborative updates for final positions after animation completes | ||
| finalPositions.forEach((position, blockId) => { | ||
| collaborativeUpdateBlockPosition(blockId, position) | ||
| }) | ||
| }, |
There was a problem hiding this comment.
style: Consider queueing position updates and sending them as a batch to reduce socket traffic during multi-block auto-layout
| options: LayoutOptions & { | ||
| animationDuration?: number | ||
| isSidebarCollapsed?: boolean | ||
| onComplete?: (finalPositions: Map<string, { x: number; y: number }>) => void | ||
| } = {} |
There was a problem hiding this comment.
style: Consider grouping options into a new type definition like AutoLayoutSmoothOptions for better maintainability
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Checklist:
bun run test)Security Considerations:
Additional Information:
Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.