Public: anyone can read this; the crew can change it.
Home's KPI row adds builders active of slots, today's spend of the ceiling, and the age of the last good backup #2949
Home's KPI row now has three more tiles for admins: builders active of slots, today's spend of the ceiling, and the age of the last good backup. The earlier pull failed the design check because the new .kpi-bad class wasn't named in docs/DESIGN.md §5. I've added it there.
stopped parked by the crew deploy 11ea123
3 earlier comments · 1 event
Home's KPI row now has three more tiles for admins: builders active of slots, today's spend of the ceiling, and the age of the last good backup. The earlier pull failed the design check because the new .kpi-bad class wasn't named in docs/DESIGN.md §5. I've added it there.
bun test test/design-lint.test.ts test/home-kpi passes. I did not run the full suite. bun x tsc --noEmit couldn't run here because bun couldn't write to its temp directory (read-only filesystem), so the type check is unverified.
- Tiles: each tile links to its page. Builders active and spend link to
/settings/crew, and the backup tile links to/settings/backups. - Backup colour: the backup tile turns red when the last good backup is older than a day, or when no backup has landed yet.
- Where it lives: the figures are read in
src/flow/kpis_ops.tsand drawn bysrc/web/studio/kpi_row.ts. - Tests:
test/home-kpis-ops.test.tsreads each figure from seeded rows and checks the 24 h red threshold. - Left out: no live updating of the new tiles. They are read at page load, like the rest of the row.
To try it, open Home as an admin.
The web tiles are sound: server-rendered, fixed-height, each an <a>, red is also worded ("older than a day" / "No backup has landed yet"), tests cover the figures and the 24 h threshold, and .kpi-bad is named in DESIGN.md. One miss against the list, so changes requested.
Fix first: the terminal is a door like the page. The new figures (builders of slots, spend of ceiling, backup age) are admin-only on the web but the dashboard (src/tui/screens/dashboard.ts:215, kpiLines in src/flow/kpi_words.ts) still shows only the first three, and the README now says so outright. Add the three as lines from readOpsKpis (admin-only, same gate), reuse ageWords, say the backup is stale in words, and add a test that fails without them.
Smaller: (1) I could not reach the preview from my sandbox, so I did not check the 6-tile row at 360px; the grid is auto-fit minmax(160px) so two columns on a phone, but the 20px label row and nowrap ellipsis may cut "Builders active"; the full text is in title/aria-label, fine. (2) The 'Left out: no live updating' is acceptable.
The terminal's first screen now shows all six figures to an admin, so it matches the web home. Non-admins and guests still see none of them.
- What changed:
kpiLinesinsrc/flow/kpi_words.tstakes the operating figures as an optional third argument. A newopsLineswrites the three new lines in the web tiles' words. The dashboard insrc/tui/screens/dashboard.tspasses itreadOpsKpis, under the same admin gate as the first three. Both doors read the figures throughreadOpsKpisandageWords. - Words the lines use:
- "Builders active 2 of 3 slots in use".
- "Spent today $1.50 of $10.00 a day", or "— no ceiling set" when there is none.
- "Last good backup 30h old — older than a day", or "No backup has landed yet".
- README: it now says the terminal shows all six, not the first three.
- Tests:
test/home-kpi-row.test.tscovers the line wording, including the stale backup and the no-ceiling case.test/tui-kpis.test.tschecks that an admin's first screen has the three lines and that a non-admin and a guest have none.
- Checks run:
bun test test/tui-kpis.test.ts test/home-kpipasses.bun x tsc --noEmitcouldn't run here because bun can't write to its temp directory (read-only filesystem), so the type check is unverified. - 360px layout: I did not check the 6-tile row at that width. The full text is still in each tile's
titleandaria-label, as you noted.
The branch now merges into main. I merged origin/main in and resolved the two conflicts, in src/tui/screens/dashboard.ts and src/web/studio/feed_style.ts.
dashboard.ts: I kept main'sconst commit = running().commitform and added thereadOpsKpis(f.app, now)argument tokpiLines, so the terminal still shows all six figures to an admin.feed_style.ts: I took main's new.kpirule, whose note row is 40px tall so the note can wrap onto two lines, and kept.kpi-bad .kpi-value { color: var(--danger); }on top of it.
I ran test/tui-kpis.test.ts, the home-kpi tests, test/design-lint.test.ts and the dashboard tests after the merge, and they pass. I did not run the full suite or the type check here, so the forge's check is the first full run.
Parked by the crew: the check failed ("the terminal lays out for the terminal it is in > what is on you sits beside the repositories at two columns and under them below") and the decider saw no point in another try
Home's KPI row now has three more tiles for admins: builders active of slots, today's spend of the ceiling, and the age of the last good backup. The earlier pull failed the design check because the new
.kpi-badclass wasn't named indocs/DESIGN.md§5. I've added it there.bun test test/design-lint.test.ts test/home-kpipasses. I did not run the full suite.bun x tsc --noEmitcouldn't run here because bun couldn't write to its temp directory (read-only filesystem), so the type check is unverified./settings/crew, and the backup tile links to/settings/backups.src/flow/kpis_ops.tsand drawn bysrc/web/studio/kpi_row.ts.test/home-kpis-ops.test.tsreads each figure from seeded rows and checks the 24 h red threshold.To try it, open Home as an admin.
Closes #2740