Skip to content

fix(auto-layout): revert#1148

Merged
emir-karabeg merged 1 commit intostagingfrom
fix/auto-layout
Aug 27, 2025
Merged

fix(auto-layout): revert#1148
emir-karabeg merged 1 commit intostagingfrom
fix/auto-layout

Conversation

@emir-karabeg
Copy link
Collaborator

Summary

Revert auto layout

Type of Change

  • Bug fix

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Aug 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim Ready Ready Preview Comment Aug 27, 2025 5:02am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Aug 27, 2025 5:02am

Copy link
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.

Greptile Summary

This PR reverts the auto-layout functionality in the workflow editor from a local client-side implementation back to the original API-based approach. The changes involve two key modifications:

  1. Complete removal of local auto-layout implementation: The file local-auto-layout.ts (615 lines) has been entirely deleted. This file contained a sophisticated client-side layout algorithm that included graph structure building, topological sorting for layer assignment, barycentric crossing minimization, and intelligent block positioning calculations.

  2. Reversion of control bar integration: The control-bar.tsx file has been updated to import and use the shared auto-layout utility instead of the local implementation. The function call changes from applyLocalAutoLayoutAndUpdateStore to applyAutoLayoutAndUpdateStore, effectively switching back to server-side layout processing via API endpoints.

This change represents a significant architectural shift from complex client-side graph layout calculations back to centralized server-side processing. The shared auto-layout utility utilizes the /api/workflows/${workflowId}/autolayout endpoint and supports various layout algorithms (smart, hierarchical, layered, force-directed). The reversion suggests the local implementation may have encountered issues with accuracy, performance, or edge case handling that the mature server-side implementation handles more reliably.

The workflow editor maintains its auto-layout functionality for users, but the underlying implementation is now simplified and centralized, making it easier to maintain and debug while ensuring consistent behavior across the application.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it reverts to a previously working implementation
  • Score reflects the straightforward nature of reverting to established functionality, though the large amount of removed code warrants careful testing
  • Pay close attention to the control-bar.tsx changes to ensure the auto-layout feature still works correctly for end users

2 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@emir-karabeg emir-karabeg merged commit 923c052 into staging Aug 27, 2025
5 checks passed
@emir-karabeg emir-karabeg deleted the fix/auto-layout branch August 27, 2025 06:24
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
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