Conversation
There was a problem hiding this comment.
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:
-
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. -
Reversion of control bar integration: The
control-bar.tsxfile has been updated to import and use the sharedauto-layoututility instead of the local implementation. The function call changes fromapplyLocalAutoLayoutAndUpdateStoretoapplyAutoLayoutAndUpdateStore, 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
Summary
Revert auto layout
Type of Change
Checklist