-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(autolayout): subflow calculation #2223
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 subflow node positioning in autolayout by accounting for the internal depth of subflow containers (loop and parallel blocks). When edges originate from subflow end handles ( Key Changes:
The implementation correctly handles edge cases like empty subflows (depth=1) and uses Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant applyAutoLayout
participant calculateSubflowDepths
participant assignLayers
participant layoutBlocksCore
participant layoutContainers
User->>applyAutoLayout: Layout workflow blocks
applyAutoLayout->>calculateSubflowDepths: Calculate depth of all subflows
loop For each subflow container
calculateSubflowDepths->>assignLayers: Get layers of child blocks
assignLayers-->>calculateSubflowDepths: Return max layer
calculateSubflowDepths->>calculateSubflowDepths: Store depth (maxLayer + 1)
end
calculateSubflowDepths-->>applyAutoLayout: Return subflowDepths map
applyAutoLayout->>layoutBlocksCore: Layout root blocks + subflowDepths
layoutBlocksCore->>assignLayers: Assign layers with subflow depths
loop For each node with incoming edges
assignLayers->>assignLayers: Check if edge has subflow end handle
alt Edge from subflow end
assignLayers->>assignLayers: Add subflow depth - 1 to layer calculation
else Normal edge
assignLayers->>assignLayers: Use standard layer calculation
end
end
assignLayers-->>layoutBlocksCore: Return nodes with adjusted layers
layoutBlocksCore-->>applyAutoLayout: Return positioned blocks
applyAutoLayout->>layoutContainers: Layout blocks inside containers
layoutContainers-->>applyAutoLayout: Update container dimensions
applyAutoLayout-->>User: Return laid out blocks
|
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.
3 files reviewed, 1 comment
Summary
Need to include subflow node in calculations for layering and position.
Type of Change
Testing
Tested manually
Checklist