Consolidate run-status tone onto react-ui's canonical map - #261
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.RUN_STATUS_TONEwas an exact-name shadow of react-ui's export (same identifier, different object, no import relationship). Removed outright;RunStatusCellnow normalizes the platform's run-status strings onto react-ui'sRunStatusand reads tone via a smallrunStatusTonehelper.statusTonemappedstopped/cancelled→warning; canonical saysstopped→neutral. Rewrote it to normalizeWorkflowRunStatus(@intx/types) ontoRunStatusand delegate toRUN_STATUS_TONE."accent"/"info"literals that happened to already agree with canonical — now readsRUN_STATUS_TONE.awaiting/.runningdirectly so it can't silently drift.AGENT_ROSTER_STATUS_TONEis 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.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'sRUN_STATUS_TONEfor every status name the two vocabularies share. Chose a test over ascripts/checks/-style static scan (the patternreact-ui-drift.tsalready uses in this repo) because the actual bug was a value mismatch inside aswitchstatement, 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 intoapps/web's existingbun testrun.Confirmed red/green: temporarily reintroduced the original
stopped → "warning"bug instatusToneand the test failed withExpected: "neutral", Received: "warning"; reverting to the fix makes it pass again. Fullapps/webtest suite (293 tests) stays green,tsc --noEmitandeslintare 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:90declaresSTATUS_TONE: Record<"deployed" | "stopped", BadgeTone>with the exact same shape/values asagents-page.tsx'sDEFINITION_STATUS_TONE(deployed: "success", stopped: "neutral") — different identifier, same object, two files. A genuine duplicate, just not theRUN_STATUS_TONEclass this ticket targeted.Test plan
bun test src/pages/run-status-tone-parity.test.ts(apps/web) — 4 passbun test ./src(apps/web) — 293 pass, 0 failbunx tsc --noEmit -p apps/web— cleanbunx eslinton changed files — clean