Editor has no undo history panel — user can press Cmd+Z to step back one entry at a time, no way to see the full history list and click to jump to a specific state (parallel to #255 for the editor) #265

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

Finding

src/pages/Editor.tsx has history: StitchPath[] and historyIndex: number in state. The user can step through with Cmd+Z and Cmd+Shift+Z (per the keyboard hook). But there's no UI to see the history list or click on a specific entry.

grep -n 'HistoryList\|history.*panel' src/components/editor/ returns 0.

A user who:

  • Draws a path
  • Edits it
  • Edits it again
  • Realizes they want the first version
  • Tries Cmd+Z several times
  • Doesn't know when to stop
  • Goes back too far

Figma/Illustrator/Sketch have a "History" panel that lists every action with timestamps. The user clicks an entry to revert.

Where

  • History state: src/pages/Editor.tsx:460-470 (history, historyIndex)
  • No panel: grep -rn 'HistoryList' src/components/editor/ returns 0
  • Cmd+Z: src/components/editor/useKeyboardShortcuts.ts (wired)
  • #255 (filed in previous turn) — Workspace's same gap

Suggested fix shape

Add a "History" panel toggle to the editor's toolbar (next to the Settings gear):

<button
  onClick={() => setShowHistoryPanel((v) => !v)}
  data-testid="toggle-history"
  title="Show history"
>
  <History size={14} />
</button>

The panel slides in from the right:

{showHistoryPanel && (
  <div className="fixed right-0 top-0 bottom-0 w-80 bg-white border-l">
    <h3>History</h3>
    <ul>
      {history.map((entry, i) => (
        <li
          key={i}
          onClick={() => jumpToHistoryEntry(i)}
          className={i === historyIndex ? 'active' : ''}
        >
          <span>{describeHistoryEntry(entry)}</span>
          <span>{i === historyIndex ? 'current' : ''}</span>
        </li>
      ))}
    </ul>
  </div>
)}

This requires the history to store an "action label" string per entry. Add actionLabel: string to the history entries:

const pushHistory = useCallback((snapshot: StitchPath[], actionLabel: string) => {
  // ...
  const newEntry = { paths: deepSnapshot, actionLabel };
  // ...
});

describeHistoryEntry(entry):

  • "Initial state" (i = 0)
  • "Add path: 'Path 1'"
  • "Move node (5 nodes)" — count-based summary
  • "Delete selected nodes"
  • "Change color: 'red'"

jumpToHistoryEntry(i) sets historyIndex = i and applies history[i].

Severity

Low. The user can step through. Power users with many edits notice.

Discovered by

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

  • #255 (open) — Workspace's history panel. The editor's is the parallel.
  • #206 (open) — Editor's undo history panel. Same gap, different issue number (filed in earlier turn).
  • The 50-entry cap (per #196 fix) is a related concern: the history list is bounded.
## Finding `src/pages/Editor.tsx` has `history: StitchPath[]` and `historyIndex: number` in state. The user can step through with Cmd+Z and Cmd+Shift+Z (per the keyboard hook). But there's no UI to see the history list or click on a specific entry. `grep -n 'HistoryList\|history.*panel' src/components/editor/` returns 0. A user who: - Draws a path - Edits it - Edits it again - Realizes they want the first version - Tries Cmd+Z several times - Doesn't know when to stop - Goes back too far Figma/Illustrator/Sketch have a "History" panel that lists every action with timestamps. The user clicks an entry to revert. ## Where - History state: `src/pages/Editor.tsx:460-470` (history, historyIndex) - No panel: `grep -rn 'HistoryList' src/components/editor/` returns 0 - Cmd+Z: `src/components/editor/useKeyboardShortcuts.ts` (wired) - #255 (filed in previous turn) — Workspace's same gap ## Suggested fix shape Add a "History" panel toggle to the editor's toolbar (next to the Settings gear): ```tsx <button onClick={() => setShowHistoryPanel((v) => !v)} data-testid="toggle-history" title="Show history" > <History size={14} /> </button> ``` The panel slides in from the right: ```tsx {showHistoryPanel && ( <div className="fixed right-0 top-0 bottom-0 w-80 bg-white border-l"> <h3>History</h3> <ul> {history.map((entry, i) => ( <li key={i} onClick={() => jumpToHistoryEntry(i)} className={i === historyIndex ? 'active' : ''} > <span>{describeHistoryEntry(entry)}</span> <span>{i === historyIndex ? 'current' : ''}</span> </li> ))} </ul> </div> )} ``` This requires the history to store an "action label" string per entry. Add `actionLabel: string` to the history entries: ```ts const pushHistory = useCallback((snapshot: StitchPath[], actionLabel: string) => { // ... const newEntry = { paths: deepSnapshot, actionLabel }; // ... }); ``` `describeHistoryEntry(entry)`: - "Initial state" (i = 0) - "Add path: 'Path 1'" - "Move node (5 nodes)" — count-based summary - "Delete selected nodes" - "Change color: 'red'" `jumpToHistoryEntry(i)` sets `historyIndex = i` and applies `history[i]`. ## Severity Low. The user can step through. Power users with many edits notice. ## Discovered by Gap analysis (2026-10-02) of editor history affordances. ## Related - #255 (open) — Workspace's history panel. The editor's is the parallel. - #206 (open) — Editor's undo history panel. Same gap, different issue number (filed in earlier turn). - The 50-entry cap (per #196 fix) is a related concern: the history list is bounded.
Author
Owner

Closing as a duplicate of #206, which already shipped this feature on main (commit 33d7f4b — "fix(#206): Editor undo history panel — see stack, jump to entry, clear").

Evidence the gap described in this issue is already closed:

  • src/components/editor/EditorRightPanel.tsx:2142-2240 renders a History section (data-testid="history-section") inside the right panel.
  • One row per snapshot (history-row-${i}), newest-first, clickable to call onJumpToHistoryEntry(i) → Editor's handleJumpToHistoryEntry at src/pages/Editor.tsx:1449 deep-clones the snapshot and updates paths + historyIndex.
  • Active row highlighted (data-active="true"), Undo / Redo / Clear buttons wired to onUndo / onRedo / onClearHistory.
  • Coverage in src/components/editor/EditorRightPanel.test.tsx:1256+ ("EditorRightPanel — History panel (#206)" describe block).

#206 itself is state: closed with labels feature-request, triage-approved. The 50-entry cap referenced in the related-issues section is already enforced by #196.

Filed-by: triage-runner via kanban t_9197829e.

Closing as a duplicate of #206, which already shipped this feature on main (commit 33d7f4b — "fix(#206): Editor undo history panel — see stack, jump to entry, clear"). Evidence the gap described in this issue is already closed: - `src/components/editor/EditorRightPanel.tsx:2142-2240` renders a History section (`data-testid="history-section"`) inside the right panel. - One row per snapshot (`history-row-${i}`), newest-first, clickable to call `onJumpToHistoryEntry(i)` → Editor's `handleJumpToHistoryEntry` at `src/pages/Editor.tsx:1449` deep-clones the snapshot and updates `paths` + `historyIndex`. - Active row highlighted (`data-active="true"`), Undo / Redo / Clear buttons wired to `onUndo` / `onRedo` / `onClearHistory`. - Coverage in `src/components/editor/EditorRightPanel.test.tsx:1256+` ("EditorRightPanel — History panel (#206)" describe block). #206 itself is `state: closed` with labels feature-request, triage-approved. The 50-entry cap referenced in the related-issues section is already enforced by #196. Filed-by: triage-runner via kanban t_9197829e.
Mark closed this issue 2026-10-04 12:04:11 +00:00
Sign in to join this conversation.
No description provided.