From e38166061d7509d8da7c5918e65ee11c93edc455 Mon Sep 17 00:00:00 2001 From: Edwin van den Houdt Date: Mon, 27 Jul 2026 13:22:53 +0200 Subject: [PATCH] docs(backlog): fix stale WP-27 undo/redo implementation claim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WP-27's Decisions said undo/redo is a hand-rolled past/future: Brief[] stack in BriefStore. WP-31 later extracted that into the shared createHistory helper (the backlog's own phase-7 ordering note says as much: "32 reuses the createHistory helper 31 extracts") — BriefStore now calls .record/.undo/.redo on it, same cap-50/push-on-edit/clear-on-new-edit semantics. Noted the supersession rather than leaving the WP describing code that no longer exists verbatim. Co-Authored-By: Claude Sonnet 5 --- docs/project/backlog/WP-27-brief-ux-layer.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/project/backlog/WP-27-brief-ux-layer.md b/docs/project/backlog/WP-27-brief-ux-layer.md index 3571f8c..598a00c 100644 --- a/docs/project/backlog/WP-27-brief-ux-layer.md +++ b/docs/project/backlog/WP-27-brief-ux-layer.md @@ -23,9 +23,13 @@ pure function over two values. Say so in code comments and stories. block-level rejection-diff badges. OUT (deferred, one line each in Out of scope): soft lock/takeover, case-context panel, 401 autosave grace, per-user usage counts, shortcut-overlay dialog, inline character-level text diff. -- **Undo/redo is shell state, not machine state**: `past`/`future: Brief[]` in +- **Undo/redo is shell state, not machine state**: a `past`/`future: Brief[]` stack in `BriefStore` (cap 50; push on `edit()`; clear `future` on a new edit); restore dispatches the **existing `Seed` Msg** — zero machine changes — then `scheduleSave()`. + (Superseded by WP-31: the hand-rolled stack was later extracted into the shared + `createHistory(cap)` helper — `BriefStore` now holds `this.history = +createHistory(50)` and calls `.record`/`.undo`/`.redo`/`.clear` on it; same + cap-50, push-on-edit, clear-on-new-edit semantics, just generalized for reuse.) - **Standaardbrief**: backend seeds `IsDefault` on 2–3 kern passages (`LibraryPassageDto` gains the flag); one button, visible only while the kern section is empty, dispatches the existing `PassagesInserted` with the default set —