Repository navigation
Description
Split from #1533 §3, found during the audit in that issue's latest comment. Re-measured on c44baf05a.
Context
#1533's PR (landing alongside this issue) defines --color-warning: #d97706 — the token four call sites (GroupActionRunner.tsx:414,466, ActionUseFlow.tsx:316, BattleMap.tsx:508) already referenced via var(--color-warning, #d97706) but which was undefined anywhere in the CSS cascade until now. That PR is deliberately narrow: it defines the token at the exact value those call sites already fell back to (zero visual change) and does not touch any of the raw Tailwind color usage described below.
The remaining problem
amber-* Tailwind utility classes are still used directly for semantic warning state across the app, instead of resolving through --color-warning (now that it exists) or the --cf-* semantic alias family (--cf-success, --cf-danger, etc. at index.css:415-419). Sampled sites (not exhaustive — re-grep before starting):
AudienceField.tsx:61StaleWriteConflict.tsx:64EntityRevealDialog.tsx:64VisibleToPlayersBar.tsx:95,113EncounterWhisperComposer.tsx:65QuickRollButtons.tsx:171RunSessionPage.tsx:4434,4458,4489SpellbookPanel.tsx:260,463,484- A dozen+ admin cards:
CampaignAuditPage.tsx:294,StorageCard.tsx:188,UsersCard.tsx:666,673,AiPricingEditor.tsx:198,TokensCard.tsx:288,293,380,MembersPage.tsx:483,862,863,1612,1614,1617,AuditLogCard.tsx:173,ResetRequestsCard.tsx:117,118,RulePacksCard.tsx:385,386,OidcCard.tsx:333,340,campaignAuditDisplay.tsx:96
The original #1533 measurement cited "126 amber-, 376 slate-, and 130 rose-* raw Tailwind colours used for semantic state" (the rose/slate figures likely overlap with #593's separate raw-text-color tracking — re-verify before scoping). This has the same shape as #1688 (the --spacing-* bridge): a large call-site count with essentially no dedicated visual-regression coverage for the affected surfaces.
Scope
- Re-measure the actual amber-for-warning-semantics population precisely (the original count is unverified and this backlog has repeatedly found stale/wrong counts on re-measurement — see Why the design system keeps getting bypassed: no Tailwind @theme bridge, and the density ramp has no step below 36px #1533's audit comment and the corrections on Why the design system keeps getting bypassed: no Tailwind @theme bridge, and the density ramp has no step below 36px #1533#issuecomment-5109030461).
- Decide a staging approach before any code, same requirement Design system: stage the --spacing-* @theme bridge — 2,124 call sites shift -30% at once #1688 states for spacing: per-surface rollout, or expand golden/visual coverage over the affected routes first.
- Migrate call sites onto
--color-warning(or a--cf-warningalias, if introduced) rather than rawamber-*utilities. - A guard test (in the spirit of
design-system-density.unit.spec.ts's scan) that a new rawamber-*warning-semantic usage cannot be reintroduced once migrated. - Leave decorative/non-semantic amber usage alone (e.g.
--cf-critatindex.css:419, natural-20 crit flourishes) — this is about semantic warning state, not every amber pixel in the app.
Depends on
The --color-warning token definition, landing in the PR referenced from #1533.
Related
- Why the design system keeps getting bypassed: no Tailwind @theme bridge, and the density ramp has no step below 36px #1533 — parent
- Design system: stage the --spacing-* @theme bridge — 2,124 call sites shift -30% at once #1688 — the
--spacing-*bridge, same "large call-site count, thin visual coverage" shape - Accessibility: raise secondary-text contrast and introduce semantic contrast-safe tokens #593 — raw text colours (566 sites), may overlap with the slate-* figure above
Activity
AwsomeFox commentedon Aug 11, 2026
Agent Workpad
State: CLAIM_CANDIDATE
Tool: claude
Run ID: claude-20260810T235000Z-2161
Claimed at: 2026-08-10T23:50:00Z
Lease until: 2026-08-11T01:20:00Z
Branch:
claude/backlog-2161-semantic-warning-tokenMigrate raw amber/slate/rose Tailwind classes used for semantic warning state onto
--color-warning.Blocker: None
Generated by Claude Code
AwsomeFox commentedon Aug 11, 2026
Agent Workpad — state update (run
claude-20260810T235000Z-2161)State: WAITING_CI
Continues: claim comment 5247743181
Branch:
claude/backlog-2161-semantic-warning-tokenPR: #2203 (draft)
Latest head:
3bd47ad085a0a80de57b95314a39c98b8499e48e(base88e8175f4)Scope delivered
16 sites migrated across 12 files — border/background-tint only, plus one solid-fill button. ~136 of 152 re-measured raw
amber-*sites deliberately excluded, each with a stated reason: readable warning text colour (no text-safe tonal variant exists for--color-warningthe way it does for--color-danger),amber-950muted dark surfaces that would visibly lighten, a decorative admin-card-heading pattern that titles cards rather than warning, and multi-state interactive controls. Noslate-*orrose-*site was touched — every candidate checked turned out to be neutral chrome or unrelated danger state, which is the answer I'd expect and wanted confirmed rather than assumed.That ratio is the right shape for this issue. A sweep of all 152 would have recoloured a lot of things that are amber without meaning "warning."
The measurement that changed the work
The worker initially treated
amber-600as byte-identical to--color-warning(#d97706), which would have made this a no-op formalization. Measuring through real Chromium showed otherwise: Tailwind v4 ships colours asoklch(), andamber-600resolves torgb(225,113,0)against--color-warning'srgb(217,119,6). Small, but real — and it means every migrated site is an actual pixel change requiring contrast verification, not a rename.Sixth instance this session of a source-level assumption falling to a measurement. Consistent enough now to be a property of this codebase rather than a run of bad luck.
Coordinator caveat for review — one number worth a second look
The solid-fill button (white on amber) is reported as moving 3.20:1 → 3.19:1. The worker flagged it honestly as a pre-existing sub-AA condition not introduced here, and that framing is fair. But two things should be checked in review rather than accepted from the report:
If it turns out to be normal-size text below 4.5:1, that deserves its own issue rather than being absorbed here — the fix is a token or a foreground change, not a scope expansion of this PR.
Validation
lintclean,typecheckclean,test:unit:web2666/2666 including 13 new guard assertions inwarning-token-migration.unit.spec.ts.test:e2enot run locally; the worker verified specifically thatcontrol-surface-goldens.spec.tsdoes not screenshot or pin any of the 16 changed declarations, checking itsLocatorscopes rather than assuming. CI'se2e-webaxecolor-contrastcheck is authoritative for anything that reasoning missed — which, given this session's record, is the right place to put the trust.Remaining
CI on #2203, then the review loop. This PR has had no independent review from me — I'm out of context to do one properly, and a rubber stamp would be worse than the gap.
Generated by Claude Code
test(web): computed-cascade verification + exact-count guard (#2161)
test(web): computed-cascade verification + exact-count guard (#2161)
feat(web): migrate semantic-warning banners onto --color-warning (#2203)