Editor tools convert_node and scissors are in the toolbar (TOOL_MODES) but EditorCanvas.tsx ignores them — picking them does nothing on the canvas (2 of 8 tools) #143

Closed
opened 2026-10-03 04:07:31 +00:00 by Mark · 1 comment
Owner

Finding

The Editor's toolbar exposes 8 tools (TOOL_MODES in src/components/editor/constants.ts:34-43):

  • select_nodes (wired in EditorCanvas.tsx)
  • add_node (wired)
  • delete_node (wired)
  • convert_node — NOT wired in EditorCanvas.tsx
  • draw_path (wired)
  • scissors — NOT wired in EditorCanvas.tsx
  • smooth (wired)
  • zoom (wired)

A user picks "Convert Node" or "Scissors / Split" from the toolbar; the tool highlights; nothing happens on the canvas. The mode state tracks the selection but EditorCanvas.tsx's event handlers do not branch on these modes.

This is a partial regression of the round 1 fix that closed #91 ("~170 lines of dead Sequence/Underlay branches"). The Sequence/Underlay dead code was removed but the Convert Node and Scissors tools were left in the toolbar without their canvas behavior.

Where

  • Tools definition: src/components/editor/constants.ts:34-43
  • EditorCanvas mode check: src/components/editor/EditorCanvas.tsx:158, 165, 170, 193, 216, 244 (handles zoom, draw_path, select_nodes, add_node, delete_node, smooth but NOT convert_node or scissors)
  • Test coverage: src/components/editor/EditorCanvas.test.tsx doesn't test convert_node or scissors

Suggested fix shape

Wire convert_node and scissors into EditorCanvas.tsx:

  1. convert_node: when the user clicks a node while this mode is active, cycle its type (corner → smooth → symmetric → corner). The existing onUpdateNodeType prop in EditorRightPanel.tsx shows the same 3-way toggle; the canvas click just calls it with the next value.

  2. scissors: when the user clicks a segment between two nodes, split the segment by inserting a new node at the click point. The new node is a corner type. The pathToNodes array gets a new entry; the onUpdatePath prop (or equivalent) commits the change.

Both are small additions to the click handler. The handler already has the canvas coordinates; the only addition is the mode branch and the side effect (cycle node type or insert node).

Severity

Medium. Two of eight advertised editor tools do nothing on the canvas. The user picks them, the toolbar highlights them, the canvas ignores them.

Discovered by

Gap analysis (2026-10-02) of editor tool mode handling.

  • #91 (closed) — removed dead Sequence/Underlay branches. Convert Node and Scissors were left behind as un-wired tools.
  • #95 (closed) — same family of "toolbar button does nothing" in the Workspace. The Workspace's LeftToolbar had 5 of 6 tools being cosmetic; the Editor has 2 of 8.
## Finding The Editor's toolbar exposes 8 tools (`TOOL_MODES` in `src/components/editor/constants.ts:34-43`): - select_nodes (wired in `EditorCanvas.tsx`) - add_node (wired) - delete_node (wired) - **convert_node** — NOT wired in `EditorCanvas.tsx` - draw_path (wired) - **scissors** — NOT wired in `EditorCanvas.tsx` - smooth (wired) - zoom (wired) A user picks "Convert Node" or "Scissors / Split" from the toolbar; the tool highlights; nothing happens on the canvas. The mode state tracks the selection but `EditorCanvas.tsx`'s event handlers do not branch on these modes. This is a partial regression of the round 1 fix that closed #91 ("~170 lines of dead Sequence/Underlay branches"). The Sequence/Underlay dead code was removed but the Convert Node and Scissors tools were left in the toolbar without their canvas behavior. ## Where - Tools definition: `src/components/editor/constants.ts:34-43` - EditorCanvas mode check: `src/components/editor/EditorCanvas.tsx:158, 165, 170, 193, 216, 244` (handles `zoom`, `draw_path`, `select_nodes`, `add_node`, `delete_node`, `smooth` but NOT `convert_node` or `scissors`) - Test coverage: `src/components/editor/EditorCanvas.test.tsx` doesn't test convert_node or scissors ## Suggested fix shape Wire `convert_node` and `scissors` into `EditorCanvas.tsx`: 1. **`convert_node`**: when the user clicks a node while this mode is active, cycle its type (`corner` → `smooth` → `symmetric` → `corner`). The existing `onUpdateNodeType` prop in `EditorRightPanel.tsx` shows the same 3-way toggle; the canvas click just calls it with the next value. 2. **`scissors`**: when the user clicks a segment between two nodes, split the segment by inserting a new node at the click point. The new node is a `corner` type. The `pathToNodes` array gets a new entry; the `onUpdatePath` prop (or equivalent) commits the change. Both are small additions to the click handler. The handler already has the canvas coordinates; the only addition is the mode branch and the side effect (cycle node type or insert node). ## Severity Medium. Two of eight advertised editor tools do nothing on the canvas. The user picks them, the toolbar highlights them, the canvas ignores them. ## Discovered by Gap analysis (2026-10-02) of editor tool mode handling. ## Related - #91 (closed) — removed dead Sequence/Underlay branches. Convert Node and Scissors were left behind as un-wired tools. - #95 (closed) — same family of "toolbar button does nothing" in the Workspace. The Workspace's `LeftToolbar` had 5 of 6 tools being cosmetic; the Editor has 2 of 8.
Author
Owner

Fixed in commit accd8f6 on main.

  • convert_node: clicking a node cycles its type (corner → smooth → symmetric → corner) and selects it.
  • scissors: clicking a segment splits it by inserting a new node at the click point (reuses the existing onAddNodeAt path).
  • Hover highlights added so the user can see what they will click.
  • 5 new tests cover both tools.
Fixed in commit accd8f6 on main. - **convert_node**: clicking a node cycles its type (corner → smooth → symmetric → corner) and selects it. - **scissors**: clicking a segment splits it by inserting a new node at the click point (reuses the existing onAddNodeAt path). - Hover highlights added so the user can see what they will click. - 5 new tests cover both tools.
Mark closed this issue 2026-10-03 05:47:18 +00:00
Sign in to join this conversation.
No description provided.