feat(editor): the element History sheet and its two menu entries #284
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle#284
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Give the editor the read-only element history: a
History…entry in the element card's three-dot menu and in the element form's More menu, opening a sheet that lists the publishes that changed the element with a per-field diff, exactly as the mockup indocs/mockups/element-history/shows (issue #282; artifact https://claude.ai/artifact/22NW7Pjqc1QUSUEJCxv1qT, private to the owner). The data comes fromGET /api/element/history(#283); the client renders what the server computed and derives nothing.Current behavior
web/src/components/ElementCard.tsx) has a menu with Move up, Move down, Copy, Cut, Duplicate, Paste inside and Delete (element.menu.*catalog keys); the element form's docheader has a More menu with the same actions (form.menu.*). Neither has a history entry.web/src/components/Sheet.tsx) is the bottom sheet the pickers and dialogs open in; the pending-changes panel behind the "N changes" chip is the closest existing list of changes.web/src/undoinfo.ts) is the only place the editor shows anything about history.Desired behavior
History…in both menus, below the clipboard group and above Delete, with a clock icon, as the mockup's frames 1 and 2 show. The card menu entry opens the sheet for that element without opening the form; the form's entry opens it over the form. A guard on unsaved form edits is not needed: the sheet is read-only and the form stays mounted beneath it.pendingentry is the first row with the blue badge; it reads "working tree, not on main" where the others show the author. The first two rows open by default; the rest fold.imagePicker; item rows as a list marked kept, added, removed or changed, a changed row listing its own field changes;enabledas Hidden/Visible using the switch's on/off labels.createdshows before as "none". On a phone the row stacks and the pair columns become one, as the mockup's narrow layout does.Show olderbutton when the answer carriednext; it fetches the next window withbeforeand appends the rows; when the chain is exhausted the button reads "No older entries" and is disabled. A request in flight disables the button.unavailableanswer shows the reason in the sheet body (the coded message translated as everywhere); a404for the uid closes with the coded message in the editor's usual error surface. Opening the sheet performs the one request; nothing is fetched before the user asks for the history (the server call is the whole cost; the editor never polls it).en.jsonandde.jsonfollowingweb/src/i18n/glossary.md's register (German: "Verlauf" for History, "Noch nicht veröffentlicht", "Geändert", "Erstellt", "Entfernt", "Ältere anzeigen"); the parity and leak tests pass.Decisions
Key interfaces
GET /api/element/historyasdocs/api.mddocuments it after #283 lands: the response's identity block,pending,entries,next,unavailableweb/src/api/— a client for the route in the shape the other API modules takeElementCard.tsxand the form docheader's More menu (ElementForm.tsx,Docheader.tsx) — the new entry;Sheet.tsx— the containerHistorySheetcomponent and its vitest suite underweb/src/test/, using the fixture pattern the other sheet tests useweb/src/i18n/en.json,de.json— the keys;glossary.mdif a new term is introducedweb/src/components/Sheet.tsx,ElementCard.tsx,ElementForm.tsx, the pending panel component behind the changes chip,web/src/test/Sheet.test.tsx,i18nParity.test.tsAcceptance criteria
History…appears in the element card menu and in the form's More menu, below the clipboard group and above Delete, in both languagesShow olderappears only withnext, appends the next window without duplicates, and ends disabled as "No older entries"unavailableand404are shown with the translated coded message; no raw code reaches the usergo test ./...still passes (the embeddedweb/distbuilds)How to verify
cd web && npm test;make buildand./harness serve --site testdata/siteon a checkout whosetestdata/sitehas a scriptedmainwith a few publishes, then open the history from both menus and compare with the mockup (sh docs/mockups/editing-screens/wrap.sh docs/mockups/element-history/element-history.html > /tmp/h.html)next,unavailableand404Assumptions to check
GET /api/element/historyas landed by #283 (field names, the runs of the word diff, howenabled's labels travel); readdocs/api.md, do not work from this brief's proseOut of scope
Blocked by