-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(copilot-autolayout): more subflow cases and deal with resizing #2236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR fixes two key issues: autolayout overlap prevention for wide containers, and hydration mismatches in the sidebar component. Autolayout Improvements:
Hydration Fixes:
Additional Changes:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Copilot
participant AutoLayout
participant Core
participant Utils
participant Store
participant Sidebar
User->>Copilot: Add/modify blocks in workflow
Copilot->>AutoLayout: applyTargetedLayout(blocks, edges, changedBlockIds)
AutoLayout->>Utils: prepareContainerDimensions(blocks, edges)
Note over Utils: Calculate nesting depth for containers
Utils->>Utils: Sort containers by depth (deepest first)
loop For each container (bottom-up)
Utils->>Core: layoutBlocksCore(childBlocks, childEdges)
Core->>Core: assignLayers() with cumulative width
Core->>Core: calculatePositions() using layerXPositions
Core-->>Utils: Return dimensions
Utils->>Utils: Update container width/height
end
Utils-->>AutoLayout: Containers dimensioned
AutoLayout->>Core: layoutBlocksCore(rootBlocks, edges)
Core->>Core: Calculate layerWidths (max width per layer)
Core->>Core: Calculate cumulative X positions
Core->>Core: resolveVerticalOverlaps() within layers
Core-->>AutoLayout: Return positioned nodes
AutoLayout-->>Copilot: Updated block positions
Note over Store,Sidebar: Hydration Fix Flow
User->>Sidebar: Page loads (SSR)
Sidebar->>Store: Check _hasHydrated flag
Store-->>Sidebar: _hasHydrated = false
Sidebar->>Sidebar: Use default state (expanded)
Note over Sidebar: Render with isCollapsed = false
Store->>Store: onRehydrateStorage() runs
Store->>Store: Set _hasHydrated = true
Store->>Sidebar: Trigger re-render
Sidebar->>Store: Read isCollapsed (hydrated value)
Sidebar->>Sidebar: Update UI with persisted state
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
13 files reviewed, no comments
Summary
Targeted autolayout improved. Wide container in layer 1 naturally pushes layer 2 further right, preventing the overlap that was causing the weird vertical displacement.
Correctly fix occasional hydration issues by restructuring component nesting.
Empty workflow loading returned 400 should not be doing that.
Type of Change
Testing
Tested manually.
Checklist