plans(web): a delete is one keystroke and nothing takes it back #2421

Merged
jaylouisw merged 1 commit from plan/1121-1237 into main 2026-11-21 13:08:07 +00:00
Owner

Forward plan only — no code.

docs/plans/board-undo.md — the canvas has no undo of any kind. Every edit is a one-way request through api() (web/app.js:318), Backspace deletes the selected device and its cables (:3030 → :2924), and nothing keeps the board it replaced. The only confirm() in the UI is the blank-board button (:2999).

The replacement mechanism already exists: POST /api/topologies/:id/load (server/index.js:1403-1422) validates a document, replaces the board, drops its console sessions and broadcasts. The client's own topo is already a valid document (fullState() → serialize(), engine/topology.js:770-807), so undo needs no new server surface.

Steps (all S/M):

  1. web/history.js — a pure ring of documents, 50 deep, with coalescing so one drag is one step.
  2. Record the pre-call board at the one funnel, api(), for non-GET methods.
  3. Restore through /load, keeping the replaced document as the redo entry.
  4. Ctrl/Cmd+Z, Ctrl/Cmd+Shift+Z, Ctrl+Y in the handler that already owns Delete, plus two toolbar buttons.
  5. Clear the stack when a socket frame shows the board moved underneath (no origin tag on the frame today, server/index.js:624).
  6. One section in docs/ARCHITECTURE.md saying what an undo does not restore (ARP/MAC, console sessions).

Deliberately left out: multi-select / copy-paste / snapping (the rest of ROADMAP.md:35), server-side history (needs Jay's approval), undo of setLinkState (a convergence re-base, not an inverse), and persistence across reloads.

Closes no open issue — the queue holds one device request (#130). No engine, server or workflow change.

Forward plan only — no code. **`docs/plans/board-undo.md`** — the canvas has no undo of any kind. Every edit is a one-way request through `api()` (`web/app.js:318`), `Backspace` deletes the selected device and its cables (`:3030` → `:2924`), and nothing keeps the board it replaced. The only `confirm()` in the UI is the blank-board button (`:2999`). The replacement mechanism already exists: `POST /api/topologies/:id/load` (`server/index.js:1403-1422`) validates a document, replaces the board, drops its console sessions and broadcasts. The client's own `topo` is already a valid document (`fullState()` → `serialize()`, `engine/topology.js:770-807`), so undo needs no new server surface. Steps (all S/M): 1. `web/history.js` — a pure ring of documents, 50 deep, with coalescing so one drag is one step. 2. Record the pre-call board at the one funnel, `api()`, for non-GET methods. 3. Restore through `/load`, keeping the replaced document as the redo entry. 4. `Ctrl/Cmd+Z`, `Ctrl/Cmd+Shift+Z`, `Ctrl+Y` in the handler that already owns Delete, plus two toolbar buttons. 5. Clear the stack when a socket frame shows the board moved underneath (no origin tag on the frame today, `server/index.js:624`). 6. One section in `docs/ARCHITECTURE.md` saying what an undo does not restore (ARP/MAC, console sessions). Deliberately left out: multi-select / copy-paste / snapping (the rest of `ROADMAP.md:35`), server-side history (**needs Jay's approval**), undo of `setLinkState` (a convergence re-base, not an inverse), and persistence across reloads. Closes no open issue — the queue holds one device request (#130). No engine, server or workflow change.
plans(web): a delete is one keystroke and nothing takes it back
All checks were successful
CI / Server smoke and Docker build (pull_request) Successful in 30s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 6s
CI / Test (Node 18) (pull_request) Successful in 54s
CI / Test (Node 20) (pull_request) Successful in 57s
CI / Test (Node 22) (pull_request) Successful in 54s
CI / Arm auto-merge (pull_request) Successful in 3s
d47a5e25f8
The canvas has no undo of any kind: every edit is a one-way request through
api() (web/app.js:318), Backspace deletes the selected device and its cables
(:3030, :2924), and nothing keeps the board it replaced. The plan takes the
undo/redo quarter of the unchecked ROADMAP row (:35) and restores through the
/load endpoint the server already has (server/index.js:1403-1422), from a
per-tab ring of documents recorded at the one funnel. Six steps, all in web/
plus one docs section; no engine, server or workflow change.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-21 12:42:02 +00:00
jaylouisw deleted branch plan/1121-1237 2026-11-21 13:08:12 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!2421
No description provided.