Editor's path 'close path' is not visible as an action — user with an open path (line) wanting to make it a closed path (polygon) has to either delete the last node or no documented way to do it #315

Closed
opened 2026-10-04 03:51:07 +00:00 by Mark · 0 comments
Owner

Finding

grep -rn 'closePath\|onClosePath' src/components/editor/ returns 0. The editor has no explicit "Close path" action.

A user drawing a path:

  • Clicks 4 points: (10,10), (50,10), (50,50), (10,50)
  • The path is open (4 nodes, 3 segments, no closing segment)
  • Wants to close it: add a segment from (10,50) back to (10,10)
  • Currently: can Enter to finish (but the path is still open); can manually drag the first node near the last node (no snap to close)

The fix is a "Close path" button (or automatic detection of "user clicked near the start node = close").

Where

  • Draw Path tool: src/components/editor/EditorCanvas.tsx (the pointer handler)
  • No close: grep -rn 'closePath' src/components/editor/ returns 0
  • Path type: src/components/editor/types.ts (StitchPath has nodes and... let me check for isClosed)

Suggested fix shape

  1. Type: add isClosed: boolean to the StitchPath type.

  2. UI: a "Close path" button in the EditorContextMenu (per #191) and in the right panel's Path Properties:

<button onClick={onToggleClose} data-testid="toggle-close">
  {p.isClosed ? <X size={12} /> : <Link2 size={12} />}
  {p.isClosed ? 'Open path' : 'Close path'}
</button>
  1. Auto-close during draw: when the user is drawing a path and clicks near the first node (within 5mm), close the path automatically.

  2. Visual feedback: a closed path renders with a closing segment (line from last node back to first); an open path doesn't.

  3. History: the close/open toggle is a single undoable action.

Severity

Low. The user can manually drag the last node to the first. Power users notice.

Discovered by

Gap analysis (2026-10-02) of editor path operations.

  • The Draw Path tool (per EditorCanvas.tsx) is the entry point; the close is the completion.
  • The EditorContextMenu (per #191) has Duplicate, Delete, etc. Close is the parallel "modify the path" action.
  • Figma/Illustrator have "Close Path" in the right-click menu. Standard.
## Finding `grep -rn 'closePath\|onClosePath' src/components/editor/` returns 0. The editor has no explicit "Close path" action. A user drawing a path: - Clicks 4 points: (10,10), (50,10), (50,50), (10,50) - The path is open (4 nodes, 3 segments, no closing segment) - Wants to close it: add a segment from (10,50) back to (10,10) - Currently: can Enter to finish (but the path is still open); can manually drag the first node near the last node (no snap to close) The fix is a "Close path" button (or automatic detection of "user clicked near the start node = close"). ## Where - Draw Path tool: `src/components/editor/EditorCanvas.tsx` (the pointer handler) - No close: `grep -rn 'closePath' src/components/editor/` returns 0 - Path type: `src/components/editor/types.ts` (StitchPath has nodes and... let me check for `isClosed`) ## Suggested fix shape 1. **Type**: add `isClosed: boolean` to the StitchPath type. 2. **UI**: a "Close path" button in the EditorContextMenu (per #191) and in the right panel's Path Properties: ```tsx <button onClick={onToggleClose} data-testid="toggle-close"> {p.isClosed ? <X size={12} /> : <Link2 size={12} />} {p.isClosed ? 'Open path' : 'Close path'} </button> ``` 3. **Auto-close during draw**: when the user is drawing a path and clicks near the first node (within 5mm), close the path automatically. 4. **Visual feedback**: a closed path renders with a closing segment (line from last node back to first); an open path doesn't. 5. **History**: the close/open toggle is a single undoable action. ## Severity Low. The user can manually drag the last node to the first. Power users notice. ## Discovered by Gap analysis (2026-10-02) of editor path operations. ## Related - The Draw Path tool (per `EditorCanvas.tsx`) is the entry point; the close is the completion. - The EditorContextMenu (per #191) has Duplicate, Delete, etc. Close is the parallel "modify the path" action. - Figma/Illustrator have "Close Path" in the right-click menu. Standard.
Mark closed this issue 2026-10-04 23:14:24 +00:00
Sign in to join this conversation.
No description provided.