Skip to content

feat(frontend): state pages, 403 and 404 over the database and session slices - #159

Merged
sgomez merged 3 commits into
frontend-rebuildfrom
agent/frontend/146
Nov 25, 2026
Merged

sgomez merged 3 commits into
frontend-rebuildfrom
agent/frontend/146

Conversation

@sgomez

@sgomez sgomez commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Closes #146.

Summary

The state pages, the Run migrations outcomes, 403 and 404 become pages over the database and session slices; screens/StatePage.tsx, screens/RunMessage.tsx and app/failure.tsx are gone.

 frontend/src/
 ├── domain/database/
+│   ├── port.ts               # DatabasePort.migrate()
+│   ├── useMigrate.ts         # the run, its failure callout via an injected settle (no database→session edge)
+│   ├── DatabaseState.tsx     # picks the card for the state
+│   ├── StateCards.tsx        # Unreachable, SQLite too old, Console older; stateCrumb
+│   ├── PendingMigrations.tsx # the Migration board card + "N migrations to apply"
+│   └── RunMessage.tsx
 ├── pages/
+│   ├── DatabaseStatePage.tsx
+│   ├── RequestRefusedPage.tsx
+│   └── NotFoundPage.tsx      # path and object variants
 └── app/
+    ├── http/database.ts
+    ├── adapters/memory/database.ts   # Migration board fixtures
-    ├── failure.tsx                   # crumbs → crumbs.ts failureCrumbs, pages → pages/
     └── Page.tsx                      # + OutcomeMessage, runOf (Said is app's)

The Migration card now follows the board and SPEC 10.5: "The module was upgraded to 1.4. Nodes keep serving Snapshot #41 meanwhile.", then the backup warning, "Update database", "3 steps". New layout class .state-text (the board's inline max-width:52ch).

API: unchanged. The 503 body does not carry the module version or the current Snapshot, so DatabaseRefusal gets them as optional fields: the memory adapter supplies them (story Board), the HTTP adapter does not, and production shows only the backup warning (story Draft: Milestone 1 server). Serving them is a server change for a later issue.

Stories:

Pages/… Stories
Database states Board; Draft: Milestone 1 server, Fresh install, One migration, Database unreachable (05a), SQLite too old (05b), Console older than the database (05c)
Run migrations Draft: Applied, Lost to a concurrent run, Failed (05d), Failed outside a migration, Not run (server error), Not run (no answer); Review: Already up to date
Failures Draft: Request refused (03), Not found, object (04a), Not found, path (04b)

Decision under review (5): api/migrate in Ready answers Applied with nothing applied, and the requested screen shows the info callout "The database schema is already up to date." SPEC 4.7 and the 10.5 table now specify this, so the story Review: Already up to date is both the SPEC variant and the built one; there is no other variant to set beside it.

Evidence

  • npm test: 86 files, 451 tests pass; coverage 99.38 % lines. Moved tests (screens/*Migration*, StatePages, app/failure.test.tsx → pages/) keep their assertions, except the Migration card's text (SPEC 10.5 dropped "Sign-in is not affected.", added "3 steps") and a new breadcrumb test for a missing object.
  • npm run test:visual: 124 pass, three runs, zero diffs. Existing references unchanged; 76 new ones.
  • composer test, composer static, npm run lint, npm run typecheck, composer size, composer build (no diff): green. No PHP touched.

Board Migration vs story Board, computed styles, light and dark, 1440 and 400: colours, card, title, button and "steps" type match. The only offsets come from the extra line of the backup warning.

Board differences

Element Board Page Why
Migration text "The module was upgraded to 1.4. Nodes keep serving Snapshot #41 meanwhile." Same, then "A migration cannot be undone without restoring a backup." (card +21 px) SPEC 10.5 / 4.7 require the warning; #146 asks for it
Steps line "3 steps · about a second" "3 steps" SPEC 10.5; no estimate is available
Migration list absent "3 migrations to apply" with numbers and titles below the card SPEC 10.5
Module version, Snapshot always only from the memory adapter; production shows the warning alone capability: not in the 503 body
404 path (draft 04b) "Service providers" active in the sidebar (per the #98 summary) no item active the draft file is not available to compare; left as built
Drafts 03, 04a, 04b, 05a–05d, run outcomes no board file available built as before, Draft: stories the maintainer rules at the final review

Merge Danger

Door: two-way

Blast Radius: state and failure pages

Wording of the pending migrations card changes; routing of 403/404/503 is unchanged (covered by the moved integration tests). New screenshots wait for visual-change.

@sgomez
sgomez merged commit 8ac089f into frontend-rebuild Nov 25, 2026
16 checks passed
@sgomez
sgomez deleted the agent/frontend/146 branch November 25, 2026 19:21
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