Skip to content

fix(autolayout): autolayout with sockets#543

Closed
icecrasher321 wants to merge 3 commits intorefactor/workspace-idfrom
fix/autolayout
Closed

fix(autolayout): autolayout with sockets#543
icecrasher321 wants to merge 3 commits intorefactor/workspace-idfrom
fix/autolayout

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

Description

Do sockets update function only at the end of the autolayout rendering.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test autolayout with two tabs open

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.

Vikhyath Mondreti added 2 commits June 25, 2025 10:28
@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 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2025 8:30pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jun 25, 2025 8:30pm

@delve-auditor
Copy link
Copy Markdown

delve-auditor Bot commented Jun 25, 2025

No security or compliance issues detected. Reviewed everything up to 318c05d.

Security Overview
  • 🔎 Scanned files: 2 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► utils.ts
    Added onComplete callback for auto-layout
    Modified animation handling
► workflow.tsx
    Extracted orientation config logic
    Updated auto-layout implementation
    Added collaborative position updates
Refactor ► workflow.tsx
    Moved orientation config to separate function

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

Optimizes autolayout animation by deferring socket updates until completion to prevent performance issues in multi-tab scenarios.

  • Added onComplete callback to applyAutoLayoutSmooth in apps/sim/app/w/[id]/utils.ts to handle socket updates after animation finishes
  • Introduced batched position updates in apps/sim/app/w/[id]/workflow.tsx to reduce network traffic during collaborative editing
  • Extracted orientation configuration into getOrientationConfig helper function for better code organization
  • Implemented proper cleanup of animation states to prevent memory leaks and race conditions

2 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

Comment thread apps/sim/app/w/[id]/workflow.tsx
Comment thread apps/sim/app/w/[id]/workflow.tsx
@icecrasher321 icecrasher321 changed the base branch from staging to refactor/workspace-id June 25, 2025 20:24
@vercel vercel Bot temporarily deployed to Preview – docs June 25, 2025 20:25 Inactive
@waleedlatif1 waleedlatif1 changed the base branch from refactor/workspace-id to staging June 25, 2025 23:29
@waleedlatif1 waleedlatif1 changed the base branch from staging to refactor/workspace-id June 25, 2025 23:30
@waleedlatif1 waleedlatif1 changed the base branch from refactor/workspace-id to staging June 25, 2025 23:31
@waleedlatif1 waleedlatif1 changed the base branch from staging to refactor/workspace-id June 25, 2025 23:31
@waleedlatif1
Copy link
Copy Markdown
Collaborator

duplicate of #546

@waleedlatif1 waleedlatif1 deleted the fix/autolayout branch June 28, 2025 04:46
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.

2 participants