fix(context-menu): preserve selection when right-clicking selected block#2991
Merged
waleedlatif1 merged 2 commits intostagingfrom Jan 25, 2026
Merged
fix(context-menu): preserve selection when right-clicking selected block#2991waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile OverviewGreptile SummaryFixed context menu selection behavior to preserve multi-selection when right-clicking already selected blocks, and cleaned up non-TSDoc comments.
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ContextMenu as handleNodeContextMenu
participant Nodes as Node State
participant Menu as Context Menu
alt Right-click on already selected node
User->>ContextMenu: Right-click selected node
ContextMenu->>Nodes: getNodes().filter(selected)
Note over ContextMenu: isClickedNodeSelected = true
ContextMenu->>ContextMenu: nodesToUse = currentSelectedNodes
Note over ContextMenu: No selection state change
ContextMenu->>Menu: Show menu with all selected
else Right-click with multi-select modifier
User->>ContextMenu: Shift/Cmd/Ctrl + Right-click
ContextMenu->>Nodes: getNodes().filter(selected)
Note over ContextMenu: isMultiSelect = true
ContextMenu->>Nodes: Add clicked node to selection
ContextMenu->>ContextMenu: nodesToUse = [...selected, node]
ContextMenu->>Menu: Show menu with updated selection
else Right-click without modifiers
User->>ContextMenu: Right-click unselected node
Note over ContextMenu: Single select mode
ContextMenu->>Nodes: Select only clicked node
ContextMenu->>ContextMenu: nodesToUse = [node]
ContextMenu->>Menu: Show menu for single node
end
ContextMenu->>Menu: setPosition(x, y)
ContextMenu->>Menu: setSelectedBlocks(nodesToBlockInfos)
ContextMenu->>Menu: setActiveMenu('block')
|
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-canvas-context-menu.ts
Show resolved
Hide resolved
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
Type of Change
Testing
Tested manually
Checklist