Skip to content

refactor(web): serve the Supervisor as a static page instead of a server-rendered string - #830

Merged
unohee merged 1 commit into
mainfrom
claude/dashboard-supervisor
Oct 19, 2026
Merged

unohee merged 1 commit into
mainfrom
claude/dashboard-supervisor

Conversation

@unohee

@unohee unohee commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Dashboard redesign, step 6a: the mechanical half of the Supervisor migration. The Departure Board redesign (6b) lands on top of this.

What

  • src/support/dashboardHtml.ts (1958-line template literal) → web/static/supervisor.html + web/static/js/supervisor.js, served at / and /index.html through PAGE_SHELLS like every other page. No behaviour change.
  • Provider toggle: was injected server-side from the adapter registry (INT-3284); now built in the page from new GET /api/providers (listAdapterNames()), so it still cannot drift from isKnownAdapter.
  • Script stays classic for now (markup calls it via inline onclick) → file-level no-unused-vars disable; 6b replaces both with modules + listeners. Legacy colour aliases in emitted strings swapped for semantic tokens.

Tests

  • tests/web/supervisorActions.test.ts runs the real page + script in jsdom.
  • The source-shape checks in dashboardHtml.test.ts became behaviour tests: registry-built buttons with the active default; stage status escaped in class and label (AGT-3476) — verified to fail with the escaper removed.
  • src/support/web.providers.test.ts covers the route.
  • Real browser: / renders identically, 11 provider buttons, no page errors.

…ver-rendered string

The Supervisor was the last page built from a 1958-line TS template literal
(src/support/dashboardHtml.ts). It now lives in web/static/supervisor.html plus
web/static/js/supervisor.js, served at `/` and `/index.html` through
PAGE_SHELLS like every other page. Behaviour is unchanged; this is the
mechanical half of redesign step 6 so the Departure Board rewrite can land as a
reviewable diff on top of real module boundaries.

- The provider toggle used to be injected server-side from the adapter
  registry (INT-3284). The page now builds it from GET /api/providers, which
  returns listAdapterNames(), so it still cannot drift from isKnownAdapter.
- The script keeps its inline onclick handlers for now, hence a file-level
  no-unused-vars disable; legacy colour aliases in the strings it emits are
  replaced with the semantic tokens.
- Tests: supervisorActions runs the real page + script in jsdom; the
  source-shape checks from dashboardHtml.test.ts became behaviour tests
  (registry-built buttons with the active default, stage-status escaping,
  verified to fail with the escaper removed); web.providers.test.ts covers
  the new route.
@unohee
unohee merged commit 1ca17fc into main Oct 19, 2026
7 checks passed
@unohee
unohee deleted the claude/dashboard-supervisor branch October 19, 2026 05:36
unohee added a commit that referenced this pull request Oct 19, 2026
Redesign step 6b, on top of the static-page migration (#830). The page now
reads top to bottom in the order an on-call operator needs it:

- Notice band (timetable yellow, hidden when empty): open human questions with
  "Answer in Chat", parked runs, and stuck/failed tracker issues with
  "Move all to Todo". Counts come from /api/shell-status, the same source as
  the shell status line, so the two never disagree. A tracker error is shown
  as an error instead of reading as "nothing stuck"; issue links are http(s)
  only.
- Fleet counts: running, queued, waiting on you, failed, done today, recent
  cost. Colour appears only when a count is non-zero.
- Controls in two groups: Routine (Heartbeat, PR review, Provider, Thinking)
  and, behind a rule, Service (daemon state, Stop daemon, Restart daemon).
  The 11 provider buttons became one select from GET /api/providers, staged
  and confirmed like Thinking.
- Live work: a departure-board table built from /api/tasks (startedAt, stage)
  plus runs that ended while the page was open; failed runs carry a vermilion
  tag. Below it, the log and the raw stage events share one tabbed panel.
- References (repositories, agent chat, PR processor, monitors and processes,
  agent coordination) sit beside the board, each naming its source.
- Under 900px the page is one scrolling document in that order; the board
  rows stack, so nothing scrolls sideways. The mobile tab bar and the
  duplicate SSE badge are gone. Unicode glyph icons in the controls and
  dialogs are replaced with text or SVG.
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