Uh oh!
There was an error while loading. Please reload this page.
feat(workflow): added context menu for block, pane, and multi-block selection on canvas - #2656
Merged
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryAdded comprehensive context menu support for the workflow canvas with right-click actions for blocks, panes, and multi-block selections. The implementation includes:
The implementation follows established patterns for event handling, collaborative operations, and permissions checking. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Canvas as ReactFlow Canvas
participant Hook as useCanvasContextMenu
participant Menu as Context Menu
participant Workflow as workflow.tsx
participant Store as Zustand Stores
participant Collab as Collaborative System
alt Right-click on Block
User->>Canvas: Right-click block
Canvas->>Hook: handleNodeContextMenu(event, node)
Hook->>Hook: Get selected nodes
Hook->>Hook: Convert nodes to block info
Hook->>Menu: Open block menu with position & blocks
Menu->>User: Display block context menu
User->>Menu: Click action (e.g., Delete)
Menu->>Workflow: handleContextDelete()
Workflow->>Collab: collaborativeBatchRemoveBlocks(blockIds)
Collab->>Store: Update workflow state
Menu->>Hook: closeMenu()
end
alt Right-click on Pane
User->>Canvas: Right-click empty canvas
Canvas->>Hook: handlePaneContextMenu(event)
Hook->>Menu: Open pane menu with position
Menu->>User: Display pane context menu
User->>Menu: Click action (e.g., Add Block)
Menu->>Workflow: handleContextAddBlock()
Workflow->>Store: useSearchModalStore.open()
Menu->>Hook: closeMenu()
end
alt Right-click on Multi-Selection
User->>Canvas: Right-click selection box
Canvas->>Hook: handleSelectionContextMenu(event)
Hook->>Hook: Get all selected nodes
Hook->>Hook: Convert to block infos
Hook->>Menu: Open block menu with multiple blocks
Menu->>User: Display multi-block menu
User->>Menu: Click action (e.g., Toggle Enabled)
Menu->>Workflow: handleContextToggleEnabled()
loop For each block
Workflow->>Collab: collaborativeToggleBlockEnabled(blockId)
Collab->>Store: Update block state
end
Menu->>Hook: closeMenu()
end
alt Rename Action Flow
User->>Menu: Click Rename
Menu->>Workflow: handleContextRename()
Workflow->>Store: setPanelEditorStore.setCurrentBlockId(id)
Workflow->>Store: setShouldFocusRename(true)
Store->>Menu: closeMenu()
Note over Store: Editor component detects flag
Store->>User: Focus rename input
end
alt Close Menu (Click Outside)
User->>Canvas: Click outside menu
Hook->>Hook: Detect click outside via ref
Hook->>Menu: closeMenu()
Menu->>User: Menu closes
end
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
waleedlatif1
commented
Dec 31, 2025
CollaboratorAuthor
Uh oh!
There was an error while loading. Please reload this page.
waleedlatif1force-pushed
the
feat/workflow
branch
from
December 31, 2025 22:35
5bb2424 to
52534ffComparewaleedlatif1
commented
Dec 31, 2025
CollaboratorAuthor
Uh oh!
There was an error while loading. Please reload this page.
waleedlatif1 added a commit
that referenced
this pull request
Jan 8, 2026
…election on canvas (#2656) * feat(workflow): added context menu for block, pane, and multi-block selection on canvas * added more * ack PR comments
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 freeto 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