Editor has no right-click context menu — workspace has 7-item context menu (Select All, Duplicate, Delete, Group, Ungroup, Bring to Front, Send to Back) but editor has nothing #191

Closed
opened 2026-10-03 23:47:49 +00:00 by Mark · 1 comment
Owner

Finding

The workspace's canvas (src/components/workspace/CanvasArea.tsx:246-365) wires a handleContextMenu that opens a 7-item context menu via <ContextMenu /> (per src/components/workspace/ContextMenu.tsx):

  1. Select All (Ctrl+A)
  2. Duplicate (Ctrl+D)
  3. Delete (Del)
  4. Group (Ctrl+G)
  5. Ungroup (Ctrl+Shift+G, only when a group member is selected)
  6. Bring to Front
  7. Send to Back

The editor's canvas (src/components/editor/EditorCanvas.tsx) has no onContextMenu handler. grep -n 'ContextMenu\|onContextMenu' src/components/editor/ returns 0 hits.

A user editing a path in the Editor can't right-click for a quick "Duplicate this path" or "Delete this node" — they have to find the buttons in the right panel or use keyboard shortcuts.

grep -n 'handleDuplicate\|onDuplicate' src/components/editor/ returns 0 hits too — there's no duplicate path action at all (see also #187). The right-click affordance for path operations is missing.

Where

  • Workspace context menu: src/components/workspace/ContextMenu.tsx (full 7-item menu)
  • Workspace trigger: src/components/workspace/CanvasArea.tsx:365 (onContextMenu={handleContextMenu})
  • Editor: src/components/editor/EditorCanvas.tsx (no onContextMenu handler)
  • Editor file list: ls src/components/editor/ shows no ContextMenu component

Suggested fix shape

  1. Create src/components/editor/EditorContextMenu.tsx with editor-appropriate items:

    • Add Node (when a segment is hovered)
    • Delete Node / Path
    • Duplicate Path
    • Convert Node Type (corner / smooth / symmetric submenu)
    • Path Color (open the color picker from the right panel)
    • Hide / Show Path
    • Fit to View (this path)
  2. Wire onContextMenu on the editor canvas. The handler opens the menu with the appropriate items based on:

    • What's under the cursor (a node? a segment? nothing?)
    • The current tool mode (add_node vs. select_nodes vs. draw_path)
  3. Plumb the actions through the existing onAddNodeToSelection, onDeleteSelectedNodes, onDuplicateSelectedPath (the latter is a new prop needed for #187).

Severity

Medium. Power users with multi-path designs feel the friction; new users don't notice.

Discovered by

Gap analysis (2026-10-02) of editor right-click affordances.

  • #187 (open) — Editor path duplicate. Context menu duplicate is the discoverable entry point.
  • #188 (open) — Editor multi-path selection. Context menu items should respect multi-select.
## Finding The workspace's canvas (`src/components/workspace/CanvasArea.tsx:246-365`) wires a `handleContextMenu` that opens a 7-item context menu via `<ContextMenu />` (per `src/components/workspace/ContextMenu.tsx`): 1. Select All (`Ctrl+A`) 2. Duplicate (`Ctrl+D`) 3. Delete (`Del`) 4. Group (`Ctrl+G`) 5. Ungroup (`Ctrl+Shift+G`, only when a group member is selected) 6. Bring to Front 7. Send to Back The editor's canvas (`src/components/editor/EditorCanvas.tsx`) has no `onContextMenu` handler. `grep -n 'ContextMenu\|onContextMenu' src/components/editor/` returns 0 hits. A user editing a path in the Editor can't right-click for a quick "Duplicate this path" or "Delete this node" — they have to find the buttons in the right panel or use keyboard shortcuts. `grep -n 'handleDuplicate\|onDuplicate' src/components/editor/` returns 0 hits too — there's no duplicate path action at all (see also #187). The right-click affordance for path operations is missing. ## Where - Workspace context menu: `src/components/workspace/ContextMenu.tsx` (full 7-item menu) - Workspace trigger: `src/components/workspace/CanvasArea.tsx:365` (`onContextMenu={handleContextMenu}`) - Editor: `src/components/editor/EditorCanvas.tsx` (no onContextMenu handler) - Editor file list: `ls src/components/editor/` shows no ContextMenu component ## Suggested fix shape 1. Create `src/components/editor/EditorContextMenu.tsx` with editor-appropriate items: - Add Node (when a segment is hovered) - Delete Node / Path - Duplicate Path - Convert Node Type (corner / smooth / symmetric submenu) - Path Color (open the color picker from the right panel) - Hide / Show Path - Fit to View (this path) 2. Wire `onContextMenu` on the editor canvas. The handler opens the menu with the appropriate items based on: - What's under the cursor (a node? a segment? nothing?) - The current tool mode (add_node vs. select_nodes vs. draw_path) 3. Plumb the actions through the existing `onAddNodeToSelection`, `onDeleteSelectedNodes`, `onDuplicateSelectedPath` (the latter is a new prop needed for #187). ## Severity Medium. Power users with multi-path designs feel the friction; new users don't notice. ## Discovered by Gap analysis (2026-10-02) of editor right-click affordances. ## Related - #187 (open) — Editor path duplicate. Context menu duplicate is the discoverable entry point. - #188 (open) — Editor multi-path selection. Context menu items should respect multi-select.
Author
Owner

Fixed in cf9d558.

Added EditorContextMenu mirroring the workspace's pattern. Hit-aware items:

  • Empty + selected path -> Delete Path / Duplicate Path / Hide/Show / Fit to View
  • Segment hit -> Add Node (uses pre-computed point)
  • Node hit -> Delete Node (promotes selection)
  • Nodes selected -> Convert Node Type submenu (corner / smooth / symmetric)

Right-click anywhere on the editor canvas opens it; pointerdown elsewhere or Escape closes it.

Plumbing through Editor.tsx added handleDeleteNode and handleTogglePathVisibilitySingle. 143 editor tests pass (12 new for #191, 11 for the menu + 6 canvas integration). tsc -b clean, eslint clean.

Note: Forgejo Actions on this repo are currently all cancelled since 2026-10-03 - pre-existing CI infra issue. Local vitest run is the operative gate; all 880 tests pass.

Fixed in cf9d558. Added EditorContextMenu mirroring the workspace's pattern. Hit-aware items: * Empty + selected path -> Delete Path / Duplicate Path / Hide/Show / Fit to View * Segment hit -> Add Node (uses pre-computed point) * Node hit -> Delete Node (promotes selection) * Nodes selected -> Convert Node Type submenu (corner / smooth / symmetric) Right-click anywhere on the editor canvas opens it; pointerdown elsewhere or Escape closes it. Plumbing through Editor.tsx added handleDeleteNode and handleTogglePathVisibilitySingle. 143 editor tests pass (12 new for #191, 11 for the menu + 6 canvas integration). tsc -b clean, eslint clean. Note: Forgejo Actions on this repo are currently all `cancelled` since 2026-10-03 - pre-existing CI infra issue. Local `vitest run` is the operative gate; all 880 tests pass.
Mark closed this issue 2026-10-04 00:41:56 +00:00
Sign in to join this conversation.
No description provided.