Repository navigation
Description
Part of #1425.
Scope
Deliver stage 2 of the approved console plan: Fleet and worker page. 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 fleet and worker page 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 2 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 | FleetScreen dispatches to worker pages and FleetBody uses WorkersTable. | ui/src/screens/fleet/index.tsx:27-69 |
| F2 | Worker filters are all/issues/busy; busy is derived from capacity usage. | ui/src/model/worker-page.ts:37-47 |
| F3 | The worker page has worker-wide tabs including host and events. | ui/src/model/worker-page.ts:617-625 |
| F4 | Worker events have a separate page-owned feed hook. | ui/src/state/workers.ts:215-238 |
| F5 | The lane has full-response stubs to avoid ETag 304 bodies. | e2e/console/stub-answers.ts:6-13 |
| F6 | Playwright has named Chromium, Firefox and WebKit projects and a bounded test timeout. | playwright.config.ts:8-22 |
| F7 | Read-resource mapping distinguishes loading, refusal, unsupported and retained data. | ui/src/state/resource.ts:22-46 |
| F8 | API requests use a 10000ms default timeout, counted from request setup. | ui/src/data/api.ts:1-10 |
Modules touched
Foundation mechanically moves the existing Fleet worker-action cases from e2e/console/actions.spec.ts into e2e/console/workers.spec.ts before page branches fork, preserving their titles, assertions and action semantics. It splits the combined lease/worker case at that point without dropping either half. Stage 2 owns subsequent worker-layout locator adaptation and coverage in workers.spec.ts; it leaves actions.spec.ts untouched. Stage 3 owns only the remaining lease-inspector assertions in actions.spec.ts. No parallel page owner edits the same test hunks. (decided in delivery, pending the maintainer)
Searches: rg -n 'WorkerPageBody|DevicesTab|useFleet|useWorkerPage|useWorkerEvents' ui/src e2e/console src/contract returned 28 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/fleet/index.tsx (FleetBody and table compatibility only)ui/src/screens/fleet/worker-page.tsxui/src/screens/fleet/fleet.cssui/src/model/fleet.tsui/src/model/worker-page.ts (worker view only)ui/src/state/workers.ts (fleet and worker hooks only)e2e/console/workers.spec.tse2e/console/render-cases/fleet.ts (new)website/src/content/docs/docs/worker/console.mdxand other described website pages, only the owned sections below.
Redesign owns WorkerPageBody/DevicesTab/action hunks overlapping #1133 and Warm pool hunks overlapping #1145 throughout this feature. Those product tasks remain drafts and adapt afterward; no external dependency or change to their specs is introduced. (decided in delivery, pending the maintainer)
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 2 and renders 2 and 3. Explicit visual exception: Add worker is a real link to the published gateway/joining-workers instructions, resolved from website site/base configuration; the reference Release leases control becomes an equally styled View leases link to /leases. Neither link sends a write or starts a new workflow. Existing per-lease release remains available on Leases. Keep their reference control placement and geometry, record both label/destination exceptions in paired images (decided in delivery, pending the maintainer). Replace FleetBody's table presentation with All / Issues / Busy and search, Needs attention cards, Healthy tiles and a full-width Worker events log. Retain filter semantics, worker mode action gating and the model's existing health precedence. Large cards show OS, separate pill, clamped reason, labelled slot rows, meters, actions and lease count. Healthy cards use foundation worker tiles. Keep WorkersTable export as compatibility only for stage 1's old baseline; remove when unused in stage 7. Do not add Groups/Table switching.
Worker page becomes a breadcrumb header with status, Drain and menu; CPU, memory, disk and slot rings; left Slots, Host facts and Baselines here; right Devices/Warm pool tabs and an always-present worker event log. Remove redundant Host/Events tabs; links asking for host or events land on the same page with that section visible. Preserve ?tab=warm-pool and all existing warm-pool information, protocol/update banners, unavailable capabilities and driver failures. Device tile status is beside runtime, never the growing name. Present holder chip, TTL and granted/booted time from model values. Stage 4 owns DeviceDrawer and the streaming destination. Device-tile Watch is a plain link built here through foundation state/navigation.streamPath; it becomes usable when stage 4 joins the stack. Stage 4 edits no worker-page layout or action slot, so neither page branch depends on the other. Never start a capture here.
Avoid FleetScreen's route dispatch hunk, model/paths.ts, DeviceDrawer, ScreenPanel and state/screen.ts (owned by stages 0/4). Do not change useFleetAddress or useDeviceDrawer; add worker view helpers beside existing functions. Aggregate Fleet log from a dedicated page-owned hook built on the existing EventFeed; release it on navigation and preserve history/error semantics. WorkerPage keeps its filtered worker feed (F4).
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 'workers|deviceId|warmPool|tab' ui/src e2e/console returned 1172 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/workers.spec.ts, ui/src/state/worker-events.test.tsx 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 Fleet and sees attention cards, healthy tiles and a worker log: cases All, Issues, Busy, search hit or none, disconnected, drained, high disk, unknown load, twenty slots and a long .local hostname.
- An operator opens a worker and sees gauges, slots, host facts, baselines and Devices or Warm pool with an always-visible event log: cases devices, warm-pool, old host/events links, missing worker, absent capability, no devices and protocol mismatch.
- An operator uses worker controls and retains their confirmation and availability: cases gateway or worker mode, drain, undrain, refused write, a concurrent action, Add worker opening the existing joining-worker instructions and View leases opening /leases without a write; extend workers.spec.ts at the signed-in browser seam; existing shared action-runner tests remain in actions.spec.ts.
- An operator reads Fleet or worker events without mixing workers or duplicating events: cases live event, replay duplicate, older-page failure, worker switch and navigation away; extend worker-events state tests and workers.spec.ts.
- A reviewer inspects stage 2 pages and sees the approved shape with no overflow or accessibility violations: cases 2-fleet.png, 3-worker.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 and only the explicit Baselines/Fleet, preserved-collapse header-control and evidence-backed WCAG-AA colour amendments recorded in PLAN.
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 2-fleet.png, 3-worker.png; inspect every non-data difference, 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 plus the explicit Add worker/View leases link exceptions; 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 Fleet sections except Open a device / Watch instructions in worker/console.mdx and Fleet in gateway/fleet-console.mdx. Run
pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjswhen the website changes.
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.