Skip to content

History, Rollback, Audit trail, Nodes and Compare in Storybook - #161

Merged
sgomez merged 2 commits into
frontend-rebuildfrom
agent/frontend/149
Nov 25, 2026
Merged

sgomez merged 2 commits into
frontend-rebuildfrom
agent/frontend/149

Conversation

@sgomez

@sgomez sgomez commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Closes #149. Part of #135.

Summary

History (Snapshots), the Rollback confirmation, the Audit trail, Nodes and the Override comparison (board Compare), as pages over domain slices with ports. They are Storybook-only: not routed, no HTTP adapter. Each slice has a port and a memory adapter with the board's fixtures, so wiring the API later is an app/http/<slice>.ts and a route.

frontend/src/
├── domain/
│   ├── publication/   + history.ts (HistoryPort), Snapshots, RollbackReview/Bar, useRollback, HistoryTabs
│   ├── audit/         new slice: AuditPort, AuditTrail (filters, rows, pager), useAuditTrail (query string)
│   ├── nodes/         new slice: NodesPort, Nodes, NodeRows
│   └── overrides/     new slice: OverridesPort, OverrideCompare, useComparison (Mark as reviewed)
├── design-system/     + Fold (a card row that opens in place); Page widths slim (920) and compare (1180);
│                        Callout title takes markup; Input type date
├── lib/time.ts        "22 Nov 2026, 14:10", "21 Nov 2026", "20 s ago"
├── pages/             HistoryPage, RollbackPage, AuditPage, NodesPage, OverridePage (+ stories, jsdom tests)
└── app/
    ├── adapters/memory/  history, audit, nodes, overrides (board fixtures)
    └── test/StoryScreens  routes the five pages among themselves in Storybook, so the sidebar's History and
                           Nodes, "Roll back to this", the tabs and the Rollback outcome all navigate

frontend/lint/layers.js: new slices nodes: [session], audit: [session], overrides: [session, entities].

The Publish slice files (#145) are untouched; only domain/publication/index.ts gains a block of exports at its end.

Stories (all screenshot):

  • Pages/History: Board, Draft: Nothing published
  • Pages/Rollback: Board, Draft: Lost race, Draft: Damaged Snapshot, Draft: Module missing on this node, Draft: Rolled back
  • Pages/Audit trail: Board, Draft: Publication and Rollback rows, Draft: Full document after a change, Draft: No match
  • Pages/Nodes: Board, Single (NodesSingle), Draft: Problems on another node
  • Pages/Compare: Board, Draft: Never reviewed
  • Design system/Fold: Folded, Open, Keyboard

Evidence

  • Stories compared with the boards in light and dark at 1440 and 400 px: same layout, wording and spacing apart from the differences below.
  • npm test 518 passed, lines 99.3 %; npm run test:visual three runs of 216 with zero diffs (64 new references, none changed); lint and type check clean; composer test 607 passed; composer static ok; composer build committed with no further diff. No PHP changed.

Board differences

  • Rollback callout. The board says "Snapshot Page shell, fonts and language selector #40 becomes live again as Minimum database engine versions and their limits #42." SPEC 8.5 and the glossary say a Rollback creates no Snapshot and gives no number, so the page says "Snapshot Page shell, fonts and language selector #40 becomes live again." Needs a maintainer ruling: the board wins on wording, but here it contradicts the model.
  • Audit trail, "Full document after this change". On the board it's a link, but no route shows a document as of an Audit trail row. Here it's a fold (Disclosure) that opens the PHP text in place.
  • Audit trail, action filter. The board lists Saved, Published, Disabled, Deleted, Rolled back. SPEC 4.4 has eleven actions, so the select keeps the board's five first and adds Created, Enabled, Discarded, Imported, Reviewed, Migrated.
  • Audit trail, open rows. The board opens the first two rows. Here, rows with a diff open and the rest stay folded, which gives the board's result on its data.
  • Callout body. The board puts 2 px between a callout's title and text; .callout-body has no gap. This affects every callout in the Console, so it's left alone here.
  • Header at 400 px. "Review 7 changes" shows as "7", as everywhere since Shell, sidebar and navigation as the boards show them #141.

Departures (states without a board, Draft:)

  • After a Rollback the interface moves to Nodes with "Snapshot Page shell, fonts and language selector #40 is live again.". The board's button points to PublishDone, which is the Publish screen's state after a Publication.
  • Lost race: warning callout "The live Snapshot changed while this page was open" with "Snapshot #N is live now. This is the current difference.", and the plan loaded again.
  • A target that fails its checksum or format version: an error callout and no button. A missing module: a warning callout, Rollback still offered.
  • Nodes: a node is red when it serves another number ("2 behind", "not live", "Serves nothing"), amber when it has problems or has not checked for 5 minutes ("Last checked 12 min ago"). Another node's problems read "has problems" with "The problems of another node can only be read on that node." Empty list: "No node has checked in yet".
  • Compare: an Override never reviewed reads "The source has not been reviewed". Mark as reviewed returns to the edit screen with "Marked as reviewed.".
  • The issue named Compare "the Snapshot comparison", but the Compare board is the Override comparison of SPEC 10.13 (managed against source, Mark as reviewed). It lives in a new overrides slice, not in publication.
  • .storybook/preview.tsx destroys React Aria's live announcer before each story, so a pending button's announcement does not fail axe in the next story. Draft: Rolled back destroys it at the end of its play function, because its button leaves with the page.

Merge Danger

Door: two-way

Blast Radius: small

Nothing is routed in production. Shared files touched: Callout (title type widened), Input (date), Page (two widths), console.css (one appended block), the Storybook preview. Adds 64 reference screenshots, so this waits for the maintainer's visual-change label.

@sgomez
sgomez merged commit 0e57c32 into frontend-rebuild Nov 25, 2026
16 checks passed
@sgomez
sgomez deleted the agent/frontend/149 branch November 25, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant