Workspace right panel's Object List has no per-object rename — user can't name a stitch object (e.g., 'flower' or 'border') so the Object List shows the generated default like 'Object 1' #218

Closed
opened 2026-10-04 00:04:20 +00:00 by Mark · 1 comment
Owner

Finding

src/components/workspace/RightPanel.tsx's ObjectList (per the #182 comment) renders one row per stitch object. Each row has:

  • GripVertical drag handle (for reordering, per #182)
  • Color swatch
  • Stitch count
  • Object name (presumably the obj.name field)

grep -n 'onRenameObject\|RENAME_OBJECT' src/ returns 0 hits. There's no UI to rename an object and no reducer action for it.

A user with 4 stitch objects after auto-digitize:

  • "Object 1, Object 2, Object 3, Object 4"
  • Identifying which is which requires reading the color swatch + bounding box
  • Naming would let the user say "Background", "Stem", "Leaves", "Outline"

The StitchObject type may have a name field (let me check), but even if it does, there's no editor for it.

Where

  • Object list: src/components/workspace/RightPanel.tsx (ObjectList subcomponent)
  • No rename: grep -n 'onRenameObject\|RENAME_OBJECT' src/ returns 0
  • StitchObject type: src/components/workspace/types.ts (need to check if name field exists)
  • Editor has no rename: per #210 the editor's StitchPath has no name field; the workspace's StitchObject may be the same

Suggested fix shape

  1. Type check: confirm StitchObject has a name?: string field. If not, add one (same as the editor's StitchPath per #210).

  2. UI: in the Object List row, make the name editable inline (double-click to rename, like the gallery's DesignCard rename):

{editingName ? (
  <input
    value={name}
    onChange={(e) => setName(e.target.value)}
    onBlur={() => onRenameObject(obj.id, name.trim()) || setName(obj.name ?? `Object ${i + 1}`)}
    onKeyDown={(e) => {
      if (e.key === 'Enter') onRenameObject(obj.id, name.trim());
      if (e.key === 'Escape') setName(obj.name ?? `Object ${i + 1}`);
    }}
    autoFocus
  />
) : (
  <span onDoubleClick={() => setEditingName(true)}>
    {obj.name ?? `Object ${i + 1}`}
  </span>
)}
  1. Auto-naming on auto-digitize: when useWorkspace produces stitch objects from auto-digitize, name them by their position in the bounding box ("Top", "Bottom", "Center") or by the color ("Red region", "Blue region"). This gives the user meaningful defaults.

  2. Persistence: the name is part of the stitch object; saving a design includes the name; loading preserves it.

Severity

Low. The user can identify objects by color and position. Power users with many objects notice.

Discovered by

Gap analysis (2026-10-02) of workspace object identification.

  • #210 (open) — Editor path naming. Same family of "user wants to name things."
  • #182 (closed) — Object List reordering. The same surface.
  • #198 (open) — Editor default stitch type. Same family of "missing default for new X".
## Finding `src/components/workspace/RightPanel.tsx`'s `ObjectList` (per the `#182` comment) renders one row per stitch object. Each row has: - GripVertical drag handle (for reordering, per #182) - Color swatch - Stitch count - Object name (presumably the `obj.name` field) `grep -n 'onRenameObject\|RENAME_OBJECT' src/` returns 0 hits. There's no UI to rename an object and no reducer action for it. A user with 4 stitch objects after auto-digitize: - "Object 1, Object 2, Object 3, Object 4" - Identifying which is which requires reading the color swatch + bounding box - Naming would let the user say "Background", "Stem", "Leaves", "Outline" The `StitchObject` type may have a `name` field (let me check), but even if it does, there's no editor for it. ## Where - Object list: `src/components/workspace/RightPanel.tsx` (ObjectList subcomponent) - No rename: `grep -n 'onRenameObject\|RENAME_OBJECT' src/` returns 0 - StitchObject type: `src/components/workspace/types.ts` (need to check if `name` field exists) - Editor has no rename: per #210 the editor's `StitchPath` has no name field; the workspace's `StitchObject` may be the same ## Suggested fix shape 1. **Type check**: confirm `StitchObject` has a `name?: string` field. If not, add one (same as the editor's `StitchPath` per #210). 2. **UI**: in the Object List row, make the name editable inline (double-click to rename, like the gallery's DesignCard rename): ```tsx {editingName ? ( <input value={name} onChange={(e) => setName(e.target.value)} onBlur={() => onRenameObject(obj.id, name.trim()) || setName(obj.name ?? `Object ${i + 1}`)} onKeyDown={(e) => { if (e.key === 'Enter') onRenameObject(obj.id, name.trim()); if (e.key === 'Escape') setName(obj.name ?? `Object ${i + 1}`); }} autoFocus /> ) : ( <span onDoubleClick={() => setEditingName(true)}> {obj.name ?? `Object ${i + 1}`} </span> )} ``` 3. **Auto-naming on auto-digitize**: when `useWorkspace` produces stitch objects from auto-digitize, name them by their position in the bounding box ("Top", "Bottom", "Center") or by the color ("Red region", "Blue region"). This gives the user meaningful defaults. 4. **Persistence**: the name is part of the stitch object; saving a design includes the name; loading preserves it. ## Severity Low. The user can identify objects by color and position. Power users with many objects notice. ## Discovered by Gap analysis (2026-10-02) of workspace object identification. ## Related - #210 (open) — Editor path naming. Same family of "user wants to name things." - #182 (closed) — Object List reordering. The same surface. - #198 (open) — Editor default stitch type. Same family of "missing default for new X".
Author
Owner

Shipped #218. Commit 46ab5f2 on origin/main.

What changed

  • src/components/workspace/RightPanel.tsx: each row's stitch-object name is now editable in place. Double-click the label or click the pencil icon to open an inline <input>. Enter or blur commits the new name via the existing UPDATE_OBJECT reducer action — same dispatch shape the visible/lock toggles already use, and the reducer already pushes history so undo/redo round-trip the rename.
  • src/components/workspace/issue-218.test.tsx: 8 new regression tests covering name render, double-click input, Enter/blur commit, empty/unchanged/whitespace-only rejection, Escape revert, no-bubble to row SELECT, and colorRegion rows render plain text during digitizing.

Scope

  • stitchObjects (the digitized state) get the rename affordance — this is what the issue is about.
  • colorRegions (the digitizing state) keep a plain name span. There is no UPDATE_REGION action today and adding one is out of scope. The Object List rows during digitizing render colorRegions, where the rename is intentionally not wired (the affordance is hidden).

Mirror parity with the editor's PathNameField (#210) and the gallery's DesignCard: empty / whitespace-only / unchanged commits are rejected so the object keeps its existing name. Escape reverts.

Tests / gates

  • 1079 tests pass (1071 prior + 8 new).
  • tsc -b clean.
  • eslint clean on changed files.
  • Build clean.
Shipped #218. Commit 46ab5f2 on origin/main. **What changed** - `src/components/workspace/RightPanel.tsx`: each row's stitch-object name is now editable in place. Double-click the label or click the pencil icon to open an inline `<input>`. Enter or blur commits the new name via the existing `UPDATE_OBJECT` reducer action — same dispatch shape the visible/lock toggles already use, and the reducer already pushes history so undo/redo round-trip the rename. - `src/components/workspace/issue-218.test.tsx`: 8 new regression tests covering name render, double-click input, Enter/blur commit, empty/unchanged/whitespace-only rejection, Escape revert, no-bubble to row SELECT, and colorRegion rows render plain text during `digitizing`. **Scope** - stitchObjects (the `digitized` state) get the rename affordance — this is what the issue is about. - colorRegions (the `digitizing` state) keep a plain name span. There is no `UPDATE_REGION` action today and adding one is out of scope. The Object List rows during digitizing render colorRegions, where the rename is intentionally not wired (the affordance is hidden). **Mirror parity** with the editor's PathNameField (#210) and the gallery's DesignCard: empty / whitespace-only / unchanged commits are rejected so the object keeps its existing name. Escape reverts. **Tests / gates** - 1079 tests pass (1071 prior + 8 new). - `tsc -b` clean. - `eslint` clean on changed files. - Build clean.
Mark closed this issue 2026-10-04 04:27:04 +00:00
Sign in to join this conversation.
No description provided.