Uh oh!
There was an error while loading. Please reload this page.
improvement(subflow): remove all associated edges when moving a block into a subflow - #2145
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR improves subflow edge management by ensuring all connected edges are removed when moving a block into a subflow container, matching the existing behavior when removing blocks from subflows. Key Changes:
The implementation properly handles undo/redo by batching edge operations with the parent update event, preventing individual edge recordings that would clutter the history. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Workflow
participant removeEdgesForNode
participant updateNodeParent
participant UndoRedo
alt Moving Block INTO Subflow
User->>Workflow: Drag block into subflow container
Workflow->>Workflow: Filter edges connected to block
Workflow->>removeEdgesForNode: removeEdgesForNode(blockId, edgesToRemove)
removeEdgesForNode->>removeEdgesForNode: Dispatch skip-edge-recording (true)
loop For each edge
removeEdgesForNode->>Workflow: removeEdge(edge.id)
end
removeEdgesForNode->>removeEdgesForNode: Dispatch skip-edge-recording (false)
Workflow->>Workflow: Compute auto-connect edges (edgesToAdd)
Workflow->>Workflow: Combine affectedEdges = [...edgesToRemove, ...edgesToAdd]
Workflow->>updateNodeParent: updateNodeParent(blockId, parentId, affectedEdges)
updateNodeParent->>UndoRedo: Record parent update with all affected edges
loop For each new edge
Workflow->>Workflow: addEdge(edge)
end
end
alt Moving Block OUT of Subflow
User->>Workflow: Trigger remove-from-subflow event
Workflow->>Workflow: Filter edges connected to block
Workflow->>removeEdgesForNode: removeEdgesForNode(blockId, edgesToRemove)
removeEdgesForNode->>removeEdgesForNode: Dispatch skip-edge-recording (true)
loop For each edge
removeEdgesForNode->>Workflow: removeEdge(edge.id)
end
removeEdgesForNode->>removeEdgesForNode: Dispatch skip-edge-recording (false)
Workflow->>updateNodeParent: updateNodeParent(blockId, null, edgesToRemove)
updateNodeParent->>UndoRedo: Record parent update with removed edges
end
|
There was a problem hiding this comment.
Additional Comments (1)
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx, line 2006-2020 (link)logic: Missing
removeEdgesForNodeandedgesForDisplayin dependency array
1 file reviewed, 1 comment
waleedlatif1
commented
Dec 1, 2025
Uh oh!
There was an error while loading. Please reload this page.
… sendgrid, linkedin, more tools (#2148) * feat(tools): added smtp, sendgrid, mailgun, linkedin, fixed permissions in context menu (#2133) * feat(tools): added twilio sendgrid integration * feat(tools): added smtp, sendgrid, mailgun, fixed permissions in context menu * added top level mocks for sporadically failing tests * incr type safety * fix(team-plans): track departed member usage so value not lost (#2118) * fix(team-plans): track departed member usage so value not lost * reset usage to 0 when they leave team * prep merge with stagig * regen migrations * fix org invite + ws selection' --------- Co-authored-by: Waleed <walif6@gmail.com> * feat(i18n): update translations (#2134) Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com> * feat(creators): add verification for creators (#2135) * feat(tools): added apify block/tools (#2136) * feat(tools): added apify * cleanup * feat(i18n): update translations (#2137) Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com> * feat(env): added more optional env var examples (#2138) * feat(statuspage): added statuspage, updated list of tools in footer, renamed routes (#2139) * feat(statuspage): added statuspage, updated list of tools in footer, renamed routes * ack PR comments * feat(tools): add generic search tool (#2140) * feat(i18n): update translations (#2141) * fix(sdks): bump sdk versions (#2142) * fix(webhooks): count test webhooks towards usage limit (#2143) * fix(bill): add requestId to webhook processing (#2144) * improvement(subflow): remove all associated edges when moving a block into a subflow (#2145) * improvement(subflow): remove all associated edges when moving a block into a subflow * ack PR comments * fix(polling): mark webhook failed on webhook trigger errors (#2146) * fix(deps): declare core transient deps explicitly (#2147) * fix(deps): declare core transient deps explicitly * ack PR comments --------- Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>
Summary
Type of Change
Testing
Tested manually
Checklist