feat(workflow): open command palette on empty edge drop and auto-connection#3321
Open
bhushan6 wants to merge 1 commit intosimstudioai:stagingfrom
Open
Conversation
|
@bhushan6 is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Greptile SummaryImplements edge-drag-to-create workflow by opening command palette when dropping edge on empty canvas, creating selected block at drop position, and auto-connecting with proper subflow boundary validation.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant onConnectEnd
participant setPendingConnectionContext
participant SearchModal
participant handleAddBlockFromToolbar
participant handleToolbarDrop
participant createPendingConnectionEdge
participant addBlock
User->>onConnectEnd: Drag edge & drop on empty canvas
onConnectEnd->>onConnectEnd: Detect drop inside canvas
onConnectEnd->>setPendingConnectionContext: Store sourceNodeId, handleId, dropPosition
onConnectEnd->>SearchModal: Open modal
User->>SearchModal: Select block type
SearchModal->>handleAddBlockFromToolbar: Fire event with block type
handleAddBlockFromToolbar->>handleAddBlockFromToolbar: consumePendingConnectionContext()
handleAddBlockFromToolbar->>handleToolbarDrop: Call with pendingConnectionContext
handleToolbarDrop->>createPendingConnectionEdge: Create edge with boundary validation
alt Subflow boundary valid
createPendingConnectionEdge-->>handleToolbarDrop: Return edge
handleToolbarDrop->>addBlock: Add block + auto-connect edge
else Subflow boundary invalid
createPendingConnectionEdge->>User: Show info notification
createPendingConnectionEdge-->>handleToolbarDrop: Return undefined
handleToolbarDrop->>addBlock: Add block without edge
end
alt User closes modal without selection
SearchModal->>SearchModal: Close event
SearchModal->>SearchModal: clearPendingConnectionContext()
end
Last reviewed commit: e590c00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new workflow UX path for faster node creation while connecting edges:
Fixes #(issue)
N/A (no issue filed)
Type of Change
Testing
Tested locally with:
bunx biome check --files-ignore-unknown=true 'apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx'bun run --cwd apps/sim type-checkReviewer focus:
Checklist
Screenshots/Videos
edge-drag-empty-drop-auto-connect.mp4