Skip to content

Consolidate run-status tone onto react-ui's canonical map - #261

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-status-tone-dedupe
Aug 21, 2026
Merged

Consolidate run-status tone onto react-ui's canonical map#261
TheGreatAxios merged 2 commits into
mainfrom
cl-status-tone-dedupe

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • Fixes a design-review finding: Routines, Insights, and Mission Control each grew their own run-status → tone opinion instead of reading react-ui's canonical RUN_STATUS_TONE (workflow-run.ts), and disagreed on a shared status — a cancelled run read neutral grey on Routines and amber warning on Insights.
  • Routines' RUN_STATUS_TONE was an exact-name shadow of react-ui's export (same identifier, different object, no import relationship). Removed outright; RunStatusCell now normalizes the platform's run-status strings onto react-ui's RunStatus and reads tone via a small runStatusTone helper.
  • Insights' statusTone mapped stopped/cancelledwarning; canonical says stoppedneutral. Rewrote it to normalize WorkflowRunStatus (@intx/types) onto RunStatus and delegate to RUN_STATUS_TONE.
  • Mission Control hand-picked "accent"/"info" literals that happened to already agree with canonical — now reads RUN_STATUS_TONE.awaiting/.running directly so it can't silently drift.
  • Agents' AGENT_ROSTER_STATUS_TONE is a genuinely different enum (AgentRosterStatus) and is left as-is per the design review — exported it so the new parity test can assert it still agrees with canonical on the one status name (running) the two vocabularies share.
  • Evals' page already did this right (imports canonical, no local map) — untouched.

Guard

Added apps/web/src/pages/run-status-tone-parity.test.ts: a unit test that calls each page's real status-tone code and asserts it equals react-ui's RUN_STATUS_TONE for every status name the two vocabularies share. Chose a test over a scripts/checks/-style static scan (the pattern react-ui-drift.ts already uses in this repo) because the actual bug was a value mismatch inside a switch statement, not a detectable syntactic shape — verifying "does this tone equal canonical" needs to run the real code, not parse it. A regex/AST scanner would need to handle both switch-statements and object literals to catch this class, which risks becoming exactly the general-purpose lint framework this ticket says not to build. The test is cheap, precise, and already wired into apps/web's existing bun test run.

Confirmed red/green: temporarily reintroduced the original stopped → "warning" bug in statusTone and the test failed with Expected: "neutral", Received: "warning"; reverting to the fix makes it pass again. Full apps/web test suite (293 tests) stays green, tsc --noEmit and eslint are clean on the changed files.

Other same-name-different-object shadowing noticed (not fixed, out of scope for this ticket)

  • apps/web/src/pages/agent-detail-page.tsx:90 declares STATUS_TONE: Record<"deployed" | "stopped", BadgeTone> with the exact same shape/values as agents-page.tsx's DEFINITION_STATUS_TONE (deployed: "success", stopped: "neutral") — different identifier, same object, two files. A genuine duplicate, just not the RUN_STATUS_TONE class this ticket targeted.

Test plan

  • bun test src/pages/run-status-tone-parity.test.ts (apps/web) — 4 pass
  • Reintroduced the original bug, confirmed the guard fails; reverted, confirmed it passes
  • bun test ./src (apps/web) — 293 pass, 0 fail
  • bunx tsc --noEmit -p apps/web — clean
  • bunx eslint on changed files — clean

Routines, Insights, and Mission Control each grew their own run-status
tone map/function instead of reading react-ui's canonical
RUN_STATUS_TONE, and quietly disagreed on a shared status (a cancelled
run read neutral on Routines, warning on Insights). This test calls
each page's real status-tone code and asserts it matches canonical for
every status the vocabularies share, so a reintroduced local tone
opinion fails loudly instead of drifting silently.
Routines declared its own RUN_STATUS_TONE (same identifier as
react-ui's export, no import relationship — a name-shadow), Insights'
statusTone mapped stopped/cancelled to warning where canonical says
neutral, and Mission Control hand-picked "accent"/"info" literals.
Each surface now normalizes its own status vocabulary onto react-ui's
RunStatus and reads the tone from RUN_STATUS_TONE directly, so a
cancelled/stopped run reads the same tone everywhere.
@TheGreatAxios
TheGreatAxios merged commit 3641dd8 into main Aug 21, 2026
5 checks passed
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