carlos / platform Public

Console round design: Part 3, the operator pages on the Rastrillo design system

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev f4ed9f2e52a6bfc90e0af63c61ebf88c41f9a287 parent e9f42e1
1 file changed, +151 −1
  • docs/superpowers/specs/2026-10-25-console-ux-perf-design.md +151 −1
diff --git a/docs/superpowers/specs/2026-10-25-console-ux-perf-design.md b/docs/superpowers/specs/2026-10-25-console-ux-perf-design.md
index b005c5e88..aaf8fdc6e 100644
--- a/docs/superpowers/specs/2026-10-25-console-ux-perf-design.md
+++ b/docs/superpowers/specs/2026-10-25-console-ux-perf-design.md
@@ -1,6 +1,6 @@
# Console round: app navigation and a 150 ms page budget
-Status: Parts 1 and 2 approved by Paul 2026-10-25 ("console users: stick to the plan"); Part 3 (operator /fleet on the Rastrillo design system) in design. Branch `console-ux-perf`.
+Status: Parts 1 and 2 approved by Paul 2026-10-25 ("console users: stick to the plan"); Part 3 (operator /fleet on the Rastrillo design system) approved 2026-10-25 from the dashboard mockup. Branch `console-ux-perf`.
## Why
@@ -325,6 +325,156 @@ speed table shows every screen's p95 under 150 ms after a day of use.
The first view of an app after a console restart is allowed to show
placeholders; it must still arrive within 150 ms.
+## Part 3: the operator pages on the Rastrillo design system
+
+Paul (2026-10-25): "console users: stick to the plan. me as an operator
+looking at the /fleet screens: Rastrillo design system." The customer
+console keeps its look. The operator pages, which today have no designed
+shape and no navigation, take Rastrillo's console shell and components.
+Paul approved the dashboard mockup ("Fleet mockup looks perfect",
+`fleet-dashboard.html`, described in 3.3).
+
+What Paul wants from the dashboard, in his words: "how many current users
+there are, new users, new activity, and if everything is running
+smoothly."
+
+### 3.1 Bringing the design system in
+
+- **Copy in, don't import.** Copy Rastrillo **v0.28.0**'s `ui/tokens.css`,
+ `ui/themes/day.css` and `ui/shell.css`, plus the scripts the shell
+ needs (`shell.js`, and `rastrillo.js` only if the menus need it), into
+ `internal/console/static/rastrillo/`, embedded with `go:embed` and
+ served from the console's own origin with long-lived cache headers and
+ a content hash in the URL. The platform takes no Rastrillo module
+ dependency: `ui` pulls in Rastrillo's root package, and Rastrillo
+ ships a `carlos/` package that points the other way. *(My call; it is
+ also the model Rastrillo itself recommends: "yours from that moment".)*
+- A `VERSION` file beside the copies names the tag and commit they came
+ from. A test checks the files' hashes against that record, so a hand
+ edit is visible in review.
+- MPL-2.0: the copied files keep their licence headers; the platform's
+ own templates and CSS are unaffected (file-level copyleft).
+- No `light.js` (it isn't in v0.28.0, and the still design is fine for an
+ operator page).
+- The console's "fetches nothing from anywhere" rule holds: everything is
+ served from the console.
+
+### 3.2 The shell
+
+- One layout template, `opshell`, written to Rastrillo's console-shell
+ markup (bar across the top, rail down the side, `rst-page` main),
+ ported by hand from v0.28.0's `ui/layouts/console.html` with the
+ console's inline-SVG icons.
+- Bar: "CARLOS operator" brand; at the end, the operator's address as an
+ account menu holding **Customer console** (back to the account the
+ operator last used) and **Sign out**.
+- Rail, in this order: **Dashboard · People and accounts · Activity ·
+ Boxes · Metrics · Storage requests · Economics · Architecture.**
+ Labels go through copy review.
+- Below 800 px the shell's own index/page behaviour applies.
+- Light and dark follow the system through the theme's `light-dark()`
+ tokens.
+- The operator gate (`operatorOnly`) is unchanged on every page.
+
+### 3.3 The dashboard (`/fleet`)
+
+`/fleet` becomes the dashboard. Today's `/fleet` content moves to
+**Boxes** at `/fleet/boxes`. Top to bottom, as in the approved mockup:
+
+1. **Page header**: "Dashboard", one line saying what the page is for.
+2. **Needs attention**: one `callout`. Positive and short when nothing
+ is wrong. Otherwise warning (or negative for an outage-class item),
+ listing each item with a link to the page that deals with it. Items:
+ a box that is silent or stale; a service down; a firing alert
+ (`alert_seen`); storage requests waiting; a background job whose last
+ run failed.
+3. **Headline numbers**, one `rst-stats` band:
+ - **People** (lead): total, with "N signed in within 30 days".
+ - **New people this week**, with the change on last week.
+ - **New accounts this week**, with the change on last week.
+ - **Apps**, with the change this week.
+ - **Deploys today**, with how many apps they covered.
+4. **New people, last 30 days**: a bar per day. Rastrillo has no chart
+ component, so this is the console's own small CSS component under its
+ own prefix (`co-`), with the numbers available to a screen reader (a
+ visually hidden table or `aria-label` per bar).
+5. **Newest people**: person, account, joined, apps; link to People and
+ accounts.
+6. **Latest activity**: when, who, what, app; the newest 10 across every
+ account; link to Activity.
+7. **Boxes**: name, status pill (Healthy / Busy / Silent / Stale), region,
+ load meter, last report; link to Boxes.
+8. **Background jobs**: job, status (OK / Failed / Not run yet), last
+ ran, the last error's first line.
+
+Out of scope for this round: errors and edge failures across all apps.
+There is no platform-wide rollup, and summing per-app S3 objects on
+view would break both the 150 ms rule and the S3 budget. A later piece
+can add a rollup written by the boxes.
+
+### 3.4 What the dashboard needs that the console doesn't record yet
+
+- **Last seen.** A `users.last_seen` column, set on an authenticated
+ request **at most once an hour per person** (an in-memory throttle), so
+ "signed in within 30 days" becomes "active within 30 days / 7 days /
+ today" and survives session expiry. No write on most GETs.
+- **Account-level activity.** Audit rows (app empty, `account_id` set)
+ for: first sign-in (a new person), sign-in, invite sent, invite
+ accepted, account created, account deleted. Activity's feed reads the
+ `audit` table newest-first (`ORDER BY id DESC LIMIT n`, cheap without
+ a new index); any time-window count gets an index on `created_at`.
+- **Background job status.** Each `Start*` pass reports each run's
+ start, finish and error to a small in-process registry; the dashboard
+ and Boxes read it. Persisting it is not needed (one console process;
+ after a restart a job shows "Not run yet" until its next run).
+- **Counts** come from SQLite (`users.created_at`, `accounts.created_at`,
+ `apps.created_at`, `audit`) and `status/fleet.json` (boxes), read
+ through the Part 2 view cache. `HostRows`' per-box reads stay off the
+ dashboard.
+
+All of it within Part 2's rule: the dashboard arrives in 150 ms and makes
+no more than one S3 read on a warm cache.
+
+### 3.5 The other operator pages
+
+Each moves into the shell and onto Rastrillo components; what each shows
+is unchanged except where noted.
+
+- **People and accounts** (`/fleet/people`, new): people with joined,
+ last seen, accounts; accounts with created, plan, apps, members.
+ Searchable, paged (`list-bar`, `pagination`).
+- **Activity** (`/fleet/activity`, new): the platform-wide feed, paged,
+ filterable by account and kind.
+- **Boxes** (`/fleet/boxes`): today's `/fleet` content (instances,
+ capacity, replication, adoption, boxes, apps, services, hosts) plus
+ background jobs.
+- **Metrics** (`/fleet/metrics`): unchanged content, plus Part 2's
+ Console speed table.
+- **Storage requests** (`/fleet/store`), **Economics** (`/fleet/economics`,
+ with Accounts as a `seg-tabs` inside it), **Architecture**
+ (`/fleet/architecture`): content unchanged; the economics accounts
+ toolbar becomes a `list-bar`.
+- Old URLs keep working; nothing moves except `/fleet`'s old content.
+
+### 3.6 Checks
+
+- Rastrillo's contrast tests cover its themes; the console adds a test
+ that every operator page renders inside `opshell` with exactly one
+ `<h1>`, the rail's `aria-current` on the right item, and no inline
+ `style` attribute except the chart bars' heights (or those move to
+ classes).
+- A headless screenshot of each operator page at 1280 px and 390 px,
+ light and dark, for review.
+- Every operator page is in Part 2's CI walk.
+- Copy (rail labels, headings, empty states, callout items, status
+ words) goes through the Luna copy pass.
+
+### 3.7 Order
+
+Part 3 lands after Part 2's plan 1 (so the dashboard is measured from
+day one) and can run alongside plan 2 and Part 1. Its plan:
+`docs/superpowers/plans/2026-10-25-operator-pages.md`.
+
## Constraints
- **Copy review.** Every new or changed user-facing string (tab labels,