Repository navigation
Description
Part of #1425.
Scope
Deliver stage 5 of the approved console plan: Baselines grouped table and disk usage. This is a reviewable slice of the single feature stack, not permission to merge a partial console into main. The parent Shared values owns every cross-stage value/interface. No issue is claimed or ready until independent spec checking finishes.
In short
The operator gets baselines grouped table and disk usage in the approved visual style, with existing identity, session and action semantics. The parent defines render, holder and view-only behavior; quantities below are CSS pixels for layout and milliseconds for request waits unless explicitly stated otherwise.
flowchart LR
O[Operator] --> P["Stage 5 page or shared UI — changed"]
P --> S[Existing state hooks]
S --> M[Pure view models]
P --> D[Shared design components]
S --> A[Existing API and live connection]
If this goes wrong, the operator sees a missing control, a misleading value or content that cannot be read at the selected window size.
Technical spec
Facts
Commit a4e5e7d. Source Facts use this main-reachable commit; the approved design/reference authority remains 3b8c44d, whose source blobs are identical.
| # | Fact | Source |
|---|---|---|
| F1 | The baseline row has saved time, size, worker and stale reason. | ui/src/model/baselines.ts:11-53 |
| F2 | The hook reads /v1/baselines and /v1/workers and pages the rows. | ui/src/state/baselines.ts:18-29 |
| F3 | The schema has no in-progress baseline build or progress field. | src/contract/device-schemas.ts:119-133 |
| F4 | baseline.save requires an existing lease id and a baseline name. | src/contract/operations.ts:711-723 |
| F5 | Worker load supplies optional disk freeBytes/totalBytes through the load model. | ui/src/model/load.ts:35-42 |
| F6 | The lane has full-response stubs to avoid ETag 304 bodies. | e2e/console/stub-answers.ts:6-13 |
| F7 | Playwright has named Chromium, Firefox and WebKit projects and a bounded test timeout. | playwright.config.ts:8-22 |
| F8 | Read-resource mapping distinguishes loading, refusal, unsupported and retained data. | ui/src/state/resource.ts:22-46 |
| F9 | API requests use a 10000ms default timeout, counted from request setup. | ui/src/data/api.ts:1-10 |
Modules touched
Searches: rg -n 'baselineRows|useBaselines|sizeBytes|staleReason' ui/src e2e/console src/contract returned 30 matching lines at the Facts commit. Opened the source surrounding the Facts rows and the stage's model/state/screen entry points. Scope is the explicit file ownership below, not a repository-wide redesign.
ui/src/screens/baselinesui/src/model/baselines.tsui/src/state/baselines.tse2e/console/baselines.spec.tse2e/console/render-cases/baselines.ts (new)website/src/content/docs/docs/worker/console.mdxand other described website pages, only the owned sections below.
Changed callers follow screen → state → model/data and screen → ds. The In short diagram shows those arrows. The task adds no daemon module or new module factory. DS exports are React components with plain props; new hooks reuse the existing providers.
Implement PLAN stage 5 and render 7: All / Stale / Ready filter and search; grouped iOS/Android table with count and size on group rows; Baseline name with model/runtime, size text, worker, Built from savedAt, state pill plus stale reason second line and reserved empty menu-column space; the unsupported row-menu trigger is omitted under the explicit amendment below. Keep stable worker-id/name identity across gateway results, not worker labels alone. Add one Disk used by baselines card, two worker columns, each meter equal to known baseline bytes / worker disk totalBytes, never fraction of fleet baseline bytes. Missing sizes or disk totals are unavailable, not zero. Group size reports known subtotal explicitly when incomplete. Do not add build history or runtimes-without-baseline sections.
Baselines amendment: use only supported ready/stale statuses. The harness substitutes a ready row for the fictitious building row as a documented DATA difference with the same row/pill geometry. Use All / Stale / Ready and an equally styled Prepare baseline link to https://callstackincubator.github.io/simlock/docs/worker/baselines, replacing Building and Build baseline. The URL follows website/astro.config.mjs:20-29,117 and website/src/site/content.ts:8-16; preparation content already exists at website/src/content/docs/docs/worker/baselines.mdx. baseline.save requires a held lease and ends it (src/contract/operations.ts:711-725; src/http/admin-declarations.ts:158-174), so this presentation adds no save workflow or progress wire field. Keep original render files unchanged; PLAN and DESIGN record the filter/link amendment and the stage-5 PR records these explicit visual differences. (decided in delivery, pending the maintainer)
Use foundation grouped table API and plain meters. Filtering/searching happens before grouping and paging; group counts are for matching rows, not an accidental page slice. Use existing baseline model/state tests for unknown workers and unavailable sizes, and browser tests for grouping and filter visibility. Existing actions may be presented only when their model supplies them; no inert menu or action may pretend to be operational. Baselines row-menu amendment: there is no existing baseline-action model. Omit the unsupported row-menu trigger and retain its empty reserved column width, row height and pill geometry; do not render an inert control or invent an operation. Record the missing trigger as an explicit reference exception in paired stage-5/stage-7 images. Foundation records this amendment in PLAN and DESIGN without changing original PNGs. (decided in delivery, pending the maintainer) Prepare baseline is a real navigation link, never a button that calls baseline.save.
Contract and event changes
None. Search: rg -n 'baselineEntrySchema|requesterIdSchema|stream|baseline.save' src/contract src/http and the stage symbol search above. No daemon wire shape, operation, input socket or business event is added. Reuse existing route paths and validation; no protocol bump. The parent Baselines amendment uses only ready/stale list data and a documentation link; no baseline-saving workflow or progress field is added.
Other code on the same state
Searches: rg -n 'baselines|sizeBytes|totalBytes' ui/src e2e/console returned 59 matching lines at the Facts commit. Existing readers/writers are the route-query cache and live invalidation in state/live.tsx and state/queries.ts, session/API connection classification, state/actions.ts per-item in-flight guard, state/router.ts navigation and shared recent feed in state/events.ts. New presentation consumes these owners, never replaces their persistence, timers or duplicate-write rules.
| Component or parallel stage | Interaction and winner |
|---|---|
| Live events and polling | Query/cache remains authoritative; server facts update the view, never fixture or screenshot values in production. Renewal changes use the existing renewal path. |
| Row, inspector, Inbox and search actions | One state/actions runner shares the item key; the first active action wins, later clicks stay disabled until completion. No screen sends its own write. |
| Browser history, page selection and disappearance | URL and latest loaded server identity decide selection; missing subject renders the existing missing/refused state, with no stale action target. |
| Shared recent feed and Activity | Existing recent feed owns drawer/inspector subscriptions; Activity owns its own feed, and stage 6 changes only its hook body. Navigation releases the consumer. |
| Stages 0–7 | Parent Shared values is the ownership contract. Stage 0 APIs are frozen at reviewed baseline; stages 1–6 use disjoint page files/hunks/cases/docs sections; stage 7 integrates serially. A necessary shared API change goes back to the foundation owner and is merged forward before consumers continue. |
| External device/settings drafts and Screens PR | Parent Shared values and Tasks schedule redesign first on the current committed baseline. Redesign owns overlapping DevicesTab/actions, Warm pool and DeviceDrawer hunks throughout this feature; external drafts adapt afterward through normal merge-forward resolution. Stage 4 rechecks actual Screens PR merge-base/head and preserves compatible capture APIs; foundation changes only its owned shell docs. No external task is a prerequisite, claimed, edited or imported. |
Failure modes
| Call | Outcome | What happens | Limit, counted from |
|---|---|---|---|
| Existing route query → API | ok, 200/304 | Render mapped data; 304 retains cached identity. Visual/functional Tests below cover the changed presentation. | Existing default 10000ms from request setup; no new wait |
| Same | error reply / malformed reply | Existing LoadView refusal/unsupported or cached data plus refusal is rendered; no success counts fabricated. Visual Tests include refused/unavailable data. | Same request bound |
| Same | absent worker/device/lease | Existing missing-subject view; clear actionable selection and avoid stale target. Functional cases below cover missing identity where applicable; shared foundation behavior is exercised by existing workers/leases specs. | After bounded request settles, no additional wait |
| Same | network unavailable / throws / no answer | Preserve cache and connection/session handling; do not show connection loss as a page-specific business failure. Existing queries/live/session tests own transport classification; this task adds no transport branch. | Existing API timeout from request setup |
| Existing action runner | ok / refused / no answer / concurrent click | Keep confirm, cancel, daemon message and shared in-flight behavior. Existing actions.spec.ts owns unchanged runner behavior; changed presentation cases below extend that seam, not duplicate it. | Existing action timeoutMs or API default from send; task adds no write |
Presentation/filter/selection state is tab-local; a reload rebuilds from URL and server data. Two tabs read independently and share no new mutable store. The daemon resolves conflicting writes; UI uses the existing runner. A process restart creates no new durable partial state. Existing session/connection tests cover unchanged restart behavior; page Tests exercise remount and selection where changed.
Rules in play
- coding rule 1, “body is the spec”: implement this stage and parent shared decisions, apply the recorded pending-maintainer delivery decisions.
- delivery rules 7/14/15, “checked before it is ready” and “one stack”: independent spec/review gates, reviewed foundation baseline and merge-forward integration, no early main merge.
- documentation rule 9, “same change”: update the owned website section and every other page describing the changed behavior.
- ui/AGENTS.md Layers, “A screen never fetches”: state hooks expose view models; DS receives plain values, no screen-to-screen imports in final code.
- ADR 0011 §§1–5, “No inline script and no <style> element”: bundle assets, retain CSP provider and existing session.
- ADR 0037 §§3–5, “One list of actions per kind of item”: reuse runner, model availability, confirmation, errors and toast semantics.
- ADR 0044 §§1–3, “One query cache”: consume existing keys, clock and feed; no new independent polling.
- ADR 0045 §§1,3–6, “route names a worker and a device”: keep identity/lifetime and existing policy, view-only console.
Tests
Seam: signed-in console browser, model pure exports where explicitly named; extend e2e/console/baselines.spec.ts, ui/src/model/baselines.test.ts and model the screenshots on e2e/console/views.spec.ts. Do not duplicate unchanged transport or action-runner tests. Copy these parent Behaviours rows, one test per line with cases in a table.
- An operator filters or searches Baselines and sees platform-grouped matching rows with counts, sizes, Built and state: cases iOS, Android, stale reason, no match, duplicate names across workers, unknown worker and paging; All includes ready and stale, Stale selects stale rows, Ready selects ready rows, and search combines with each filter.
- An operator reads Disk used by baselines and sees each worker share against its own disk: cases zero known bytes, missing size, missing disk, multiple workers, duplicate labels and a stale worker view.
- An operator reads or acts on a baseline and sees only daemon-backed status and available actions: cases ready, stale, refused list and disappearing row; Prepare baseline is a keyboard-accessible link to https://callstackincubator.github.io/simlock/docs/worker/baselines, follows the preparation instructions and sends no baseline.save request; no Building filter, build-progress value or unsupported row-menu trigger is shown; ready/stale rows retain the reserved menu-column width and send no new action request.
- A reviewer inspects stage 5 pages and sees the approved shape with no overflow or accessibility violations: cases 7-baselines.png, 1440×900, 1280×800, 390×844, dark and light; compare each dark reference and current PNG, run both-theme axe and list DATA differences plus the explicit Ready-filter/Prepare-baseline-link/omitted-row-menu and evidence-backed WCAG-AA colour amendments, retaining all other reference geometry.
Done when
- Every Tests line is covered at its named seam; relevant model/unit tests and touched Chromium page specs pass. The browser lane uses faked drivers, not native hardware.
- Capture this stage's pages through
pnpm test:console --project=chromium e2e/console/renders.spec.ts(page-specific --grep permitted). Compare current PNGs to 7-baselines.png; record the explicit All / Stale / Ready filter and Prepare baseline link amendment, then inspect every other non-data difference and fix/rerun until none remain except the explicit Baselines/Fleet, preserved-collapse header-control and evidence-backed WCAG-AA colour amendments recorded in PLAN. The PR includes paired images for each reference page and lists remaining data differences; no-render pages include current images. Do not commit generated current/ or prototype/screens/. - Check the same pages at 1440×900, 1280×800 and 390×844: no horizontal page scroll, card escape or text collision. Axe in both light and dark has no WCAG AA violations and actually evaluates color contrast. Per-page verification is required in this stage, not deferred to stage 7.
- Update website pages describing this stage in the same change. Ownership: Own Baselines sections in worker/console.mdx and gateway/fleet-console.mdx. Run
pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjswhen the website changes. - The PR records the ready-row DATA substitution and explicit filter/link/omitted-row-menu amendments against the unchanged original render; row/pill geometry and every other reference requirement remain enforced.
Out of scope
Other stages' owned files/hunks; new device management, warm-target editing, Settings or multi-device Screens behavior; backend/protocol/native capture changes; new input sockets. Apply the parent delivery decisions and document the explicit Baselines amendment; preserve every other reference requirement.
Depends on
Written by an agent.
Activity
V3RON commentedon Nov 7, 2026
Spec updated: reconciled source citations, test ownership/cases and explicit reference exceptions; targeted checks precede readiness.
Written by an agent.
V3RON commentedon Nov 9, 2026
Delivered in #1454 (merged with #1435,
caa5b4e40on main): this stage was built on its own branch and merged into the integrated PR.Written by an agent.