Skip to content

fix(autolayout): fixed autolayout with sockets#546

Merged
waleedlatif1 merged 1 commit intostagingfrom
fix/al
Jun 25, 2025
Merged

fix(autolayout): fixed autolayout with sockets#546
waleedlatif1 merged 1 commit intostagingfrom
fix/al

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Security enhancement
  • Performance improvement
  • Code refactoring (no functional changes)

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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

Additional Information:

Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 25, 2025 11:38pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jun 25, 2025 11:38pm

@waleedlatif1 waleedlatif1 merged commit d30e116 into staging Jun 25, 2025
2 of 4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/al branch June 25, 2025 23:39
@delve-auditor
Copy link
Copy Markdown

delve-auditor Bot commented Jun 25, 2025

No security or compliance issues detected. Reviewed everything up to 2699679.

Security Overview
  • 🔎 Scanned files: 2 changed file(s)
Detected Code Changes
Change Type Relevant files
Bug Fix ► autolayout.ts
    Fix autolayout functionality

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Enhanced auto-layout functionality for workflow blocks with improved socket connection handling and collaborative synchronization.

  • Refactored orientation logic into getOrientationConfig in apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx for better maintainability
  • Added completion callback to applyAutoLayoutSmooth in utils.ts to 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

Comment on lines +276 to +280
// Emit collaborative updates for final positions after animation completes
finalPositions.forEach((position, blockId) => {
collaborativeUpdateBlockPosition(blockId, position)
})
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider queueing position updates and sending them as a batch to reduce socket traffic during multi-block auto-layout

Comment on lines 986 to 990
options: LayoutOptions & {
animationDuration?: number
isSidebarCollapsed?: boolean
onComplete?: (finalPositions: Map<string, { x: number; y: number }>) => void
} = {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider grouping options into a new type definition like AutoLayoutSmoothOptions for better maintainability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant