Skip to content

EVA-121: right-click context menus for canvas, nodes, and edges#116

Merged
suzil merged 1 commit intomainfrom
susannahjd/eva-121-right-click-context-menus-for-canvas-nodes-and-edges-u1-u2
Mar 2, 2026
Merged

EVA-121: right-click context menus for canvas, nodes, and edges#116
suzil merged 1 commit intomainfrom
susannahjd/eva-121-right-click-context-menus-for-canvas-nodes-and-edges-u1-u2

Conversation

@suzil
Copy link
Owner

@suzil suzil commented Mar 2, 2026

Summary

  • New ContextMenu.tsx component: portalled floating menu with action/submenu/separator items; dismisses on outside click, Escape, or scroll; clamps to viewport edges
  • canvasStore gains deleteNode, duplicateNode, deleteEdge actions (all undoable via existing applyNodeChanges/applyEdgeChanges)
  • CanvasContainer wires onPaneContextMenu (Add Node submenu for all 5 types), onNodeContextMenu (Duplicate / Delete), onEdgeContextMenu (Delete); all gated behind !isOperate
  • EdgePanel gets a keyboard-accessible "Delete edge" footer button (Trash2 icon, focus-visible ring)

Test plan

  • Right-click empty canvas → Add Node submenu → each type places node at cursor position
  • Right-click a node → Duplicate creates offset copy with same config; Delete removes it (both undo with Cmd+Z)
  • Right-click an edge → Delete removes it
  • Click "Delete edge" button in EdgePanel → edge removed, panel closes
  • All buttons reachable by keyboard (Tab, Enter/Space)
  • Context menus do not appear in Operate mode

Closes EVA-121

Made with Cursor

…U2, D9)

- ContextMenu.tsx: portalled floating menu with action/submenu/separator items,
  outside-click + Escape + scroll dismiss, viewport edge clamping
- canvasStore: add deleteNode, duplicateNode, deleteEdge actions
- CanvasContainer: wire onPaneContextMenu (Add Node submenu), onNodeContextMenu
  (Duplicate / Delete), onEdgeContextMenu (Delete); gated behind !isOperate
- EdgePanel: add keyboard-accessible Delete edge footer button (Trash2)

Made-with: Cursor
@suzil suzil merged commit e6bb717 into main Mar 2, 2026
2 of 4 checks passed
@suzil suzil deleted the susannahjd/eva-121-right-click-context-menus-for-canvas-nodes-and-edges-u1-u2 branch March 2, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant