Skip to content

feat(web): migrate semantic-warning banners onto --color-warning - #2203

Merged
AwsomeFox merged 4 commits into
mainfrom
claude/backlog-2161-semantic-warning-token
Aug 12, 2026
Merged

AwsomeFox merged 4 commits into
mainfrom
claude/backlog-2161-semantic-warning-token

Conversation

@AwsomeFox

@AwsomeFox AwsomeFox commented Aug 11, 2026 •

Copy link
Copy Markdown
Owner

Fixes #2161

What

Migrates 12 raw amber-* Tailwind call sites, across 9 components, that render genuinely semantic warning state onto --color-warning (defined in #1533, previously referenced by only 4 sites total). This is a staged, non-text-only migration, not the full sweep — see "Deliberately excluded" below and the issue's own required staging decision.

This PR originally migrated 16 sites. Review found 4 of them were cascade no-ops — see "Cascade issue found and reverted" below. Those 4 were reverted to raw amber rather than shipped with source that claims --color-warning while painting something else, and are tracked in follow-up issue #2208.

Re-measurement (issue's first checklist item)

grep -rn "amber-" apps/web/src --include="*.tsx" --include="*.ts" | grep -v '\.spec\.\|\.test\.' at this PR's original base commit (88e8175f4) found 152 raw amber-* call sites across 63 files (the issue's original "126 amber-*" figure was stale, consistent with every other re-measurement in this backlog). Of those, only a minority are genuinely semantic-warning; most are decorative (icon/avatar accents, "amber-mosquito" icon slug, natural-20 crit flourish, section-heading brand color) or selection-state highlights, not warning.

Why only 12 of ~152

--color-warning: #d97706 (#1533) is a single flat hex, unlike --color-danger's multi-role family (--color-danger, --color-danger-solid*, --color-danger-border, --color-danger-focus, --color-danger-ghost-*, --color-danger-disabled-*). I was told not to invent new token family members, so I could only move the border/background-tint role the existing single value actually covers safely.

Left untouched, and why:

  • Readable warning TEXT color (text-amber-300/400/100/200 etc.) at every site — --color-warning has no text-safe tonal variant the way --color-danger does, and swapping text color requires a contrast re-measurement I can't safely eyeball. Recommend a --color-warning-text/-solid/-border family mirroring danger's, as tracked follow-up, not invented here.
  • Dark "muted surface" tints (bg-amber-950/* — StaleWriteConflict.tsx:64, SpellbookPanel.tsx:260's concentration banner, QuickRollButtons.tsx:205): amber-950 is much darker than --color-warning; swapping would visibly lighten the surface. Different role, not covered.
  • Decorative section-heading accent (text-[10px] font-bold text-amber-500 uppercase tracking-widest + cf-inset border-amber-500/30), repeated across StorageCard.tsx, TokensCard.tsx, UsersCard.tsx, RulePacksCard.tsx, AiConsoleCard.tsx, AiPricingEditor.tsx, MembersPage.tsx (862-863, 1612-1617): these are card titles ("New token", "Orphan cleanup", "Install a rule system"), not caution messages — amber is being used as a generic "highlighted subsection" brand accent here, inconsistently, across both warning and non-warning content. That inconsistency is itself the kind of drift Design system: migrate raw amber/slate/rose Tailwind colors used for semantic warning state onto --color-warning #2161 is about, but fixing it means componentizing a shared "admin callout" pattern and making an explicit semantic call per site — out of scope for this PR; flagging as a follow-up candidate rather than guessing site-by-site.
  • OidcCard.tsx:333,340: identical cf-inset border-amber-500/30 ... text-amber-300/90 recipe used for one informational notice (env-var override) and one genuine caution (no e2e-verified login). Migrating one but not the other would leave two identically-styled boxes silently diverging — excluded both, flagged for a follow-up review of that one file.
  • InventoryPage.tsx / inventoryShared.tsx / MyNotesPage.tsx:1073: text-only amber on a neutral (var(--color-neutral-800)) background, no border/bg-tint role to move without touching text.
  • Multi-state interactive controls (QuickRollButtons.tsx:205: base + hover:bg-amber-900/40 + focus:ring-amber-400 + text-amber-300 on a dark-muted surface) — too many roles to move partially without an actual --color-warning-* family.
  • NewCharacterForm.tsx:230,243 (has-[:checked]:border-amber-600/60): a radio-selection highlight, not a warning — decorative, correctly out of scope per the issue's own guidance.
  • No slate-* or rose-* sites were touched at all — re-checked every candidate and every one was either neutral chrome (slate) or an unrelated danger/error state (rose), not warning.

Cascade issue found and reverted

Review (Codex) found that CampaignAuditPage.tsx:294 renders through <Card>, whose cf-card class carries an unlayered background/border shorthand (index.css:1254-1257) that always wins over a layered Tailwind utility (including an arbitrary-value one like border-[var(--color-warning)]/30) regardless of specificity or source order — index.css/nocturne.css are imported unlayered. Measuring with real Chromium getComputedStyle against the actual compiled theme found three more sites with the same bug that Codex's report didn't cover:

Site Computed border Computed background Root cause
CampaignAuditPage.tsx:294 --color-divider --cf-card <Card>'s unlayered cf-card rule
MembersPage.tsx:483 --color-divider n/a cf-inset's unlayered rule
InboxPage.tsx:700 --color-divider n/a cf-inset's unlayered rule
SpellbookPanel.tsx:484 (untouched, accent) fully transparent .btn's unlayered background: 0 0 reset

For each, the bare utility class alone (no Card/cf-inset/.btn wrapper) against the same backdrop does resolve to --color-warning — confirming the bug is the unlayered wrapper rule, not the utility class. This also corrects an earlier contrast claim I made: I'd reported SpellbookPanel.tsx:484's white-on-button contrast as 3.20:1 → 3.19:1, assuming a solid amber/warning fill. That fill was never actually painted — the real background is the modal's bg-neutral-900, so the real contrast is 14.15:1.

Decision: reverted all 4 to raw amber rather than fixed in this PR. Both realistic fixes are design decisions, not mechanical ones: an !important escape (a narrow precedent already exists at MembersPage.tsx:1617, but spreading it is exactly the kind of design-system bypass #1533 exists to stop) or a new unlayered semantic modifier class (.cf-card--warning, .cf-inset--warning, .btn-warning mirroring the existing .btn-danger pattern) — the latter needs its own review, not a rider on a color migration. Filed as #2208 with the full measurement table, options, and the four sites to re-migrate once a pattern is chosen.

Sites migrated (12, across 9 files) — all confirmed to actually paint --color-warning

File:line Change
AudienceField.tsx:61 border-amber-500/30 bg-amber-500/10 → border-[var(--color-warning)]/30 bg-[var(--color-warning)]/10
EntityRevealDialog.tsx:64 same
HandoutsCard.tsx:295 same
VisibleToPlayersBar.tsx:95,113 border-amber-500/35 bg-amber-500/10 → warning equivalent
RunSessionPage.tsx:4496,4520,4551 border-amber-500/40 bg-amber-500/10 → warning equivalent (no amber text at these sites — full migration)
EncounterWhisperComposer.tsx:65 border-amber-500/30 → warning (border only; title text and focus ring stay raw amber, no covered role)
AuditLogCard.tsx:173 border-amber-500/30 bg-amber-500/5 → warning equivalent
ResetRequestsCard.tsx:117 border-amber-500/30 → warning (border only; heading stays raw amber)
SpellbookPanel.tsx:463 border-amber-500/50 → warning (modal border)

Contrast evidence

Measured with real Chromium (playwright-core, headless, canvas fillStyle + getImageData) against this app's actual compiled theme — Tailwind v4 ships its palette as oklch(), not hex, which matters for anyone assuming a same-family swap is a no-op.

Text-bearing sites (background changed, text unchanged) — WCAG 1.4.3 (binding criterion):

Site Text Old bg contrast New bg contrast
AudienceField (text-amber-400/90) rgb(255,185,0)@90% 8.83:1 9.05:1
EntityRevealDialog/HandoutsCard (text-amber-300/90) rgb(255,210,48)@90% 10.52:1 10.77:1
VisibleToPlayersBar (text-amber-100) rgb(254,243,198) 13.66:1 13.99:1
VisibleToPlayersBar secondary (text-amber-200/80) rgb(254,230,132)@80% 12.22:1 12.52:1
AuditLogCard (text-amber-200) rgb(254,230,133) 13.20:1 13.37:1

Every migrated text-bearing site is unchanged-to-slightly-improved; none approaches the 4.5:1 AA floor either before or after.

Decorative border-only sites (non-text framing; the actual warning content is conveyed by text inside, not the border): border-vs-backdrop contrast was already below the WCAG 1.4.11 3:1 non-text floor before this PR (1.74-2.78:1 across the 30/35/40/50% opacity steps used) and moves down by a further 0.2-0.6 with the new color (1.53-2.22:1). Flagging honestly rather than hiding it: this is a pre-existing, already-failing metric that gets marginally weaker, not a passing-to-failing regression, and fixing it is a different, unscoped problem (the border alone was never the sole conveyor of the warning — the text is).

Checked apps/web/e2e/tests/control-surface-goldens.spec.ts (the repo's only golden/screenshot spec besides login/print) precisely rather than assuming: it navigates to RunSessionPage's route three times but every toHaveScreenshot/measureBox call is scoped to a Locator (turn-workspace, encounter-vtt-header, .cf-vtt-panel-tabs) that doesn't contain any of the 12 changed sites. No pixel baseline needs updating or is invalidated by this PR.

Guard tests

  • apps/web/e2e/tests/warning-token-migration.unit.spec.ts (source-scanning, cheap smoke check) — pins the migrated declaration at each of the 12 sites with an exact occurrence count per file (VisibleToPlayersBar.tsx: 2, RunSessionPage.tsx: 3) rather than "at least one," so a partial regression (one of several sites in a file reverting while others stay migrated) fails here. Verified this actually catches what a presence-only check would miss, including a reversion to a different amber shade the file's bannedPatterns regex doesn't match. Its docstring now says plainly it's necessary but not sufficient — see next.
  • apps/web/e2e/tests/warning-token-cascade.spec.ts (browser-backed, real getComputedStyle via renderCssFixture) — the check that actually proves each of the 12 sites paints --color-warning rather than just referencing it in source, which is what caught the 4 no-op sites above in the first place.

Validation

  • npm run lint — clean (0 errors, 213 pre-existing warnings repo-wide, none new)
  • npm run typecheck — clean
  • npm run test:unit:web -- e2e/tests/warning-token-migration.unit.spec.ts — 10/10 pass
  • npx vite build (apps/web) — clean; used to extract the real compiled CSS/theme for every measurement above, including a second full rebuild after reverting the 4 no-op sites
  • warning-token-cascade.spec.ts could not be run through this sandbox's standard npm run test:e2e — a pre-existing, documented environment limitation (no network path to fetch the pinned Chromium headless-shell revision the harness defaults to) that blocks the whole browser e2e tier here, not something specific to this file. Validated the identical measurement logic (same real compiled CSS, same DOM fixtures) via an equivalent ad hoc script using an explicit local Chromium binary (playwright-core + executablePath) — all 12 sites confirmed effective against that logic, including after the final revert. CI is authoritative for actually executing the spec.

@AwsomeFox
AwsomeFox marked this pull request as ready for review August 11, 2026 11:44
Copilot AI lite review requested due to automatic review settings August 11, 2026 11:44

Copy link
Copy Markdown
Owner Author

Green at 3bd47ad08 — out of draft, with the contrast question still open

CI is 16/16 success, including all four e2e-web shards and therefore the repository's axe color-contrast assertions.

What that does and does not settle

It is partial evidence on the one number I flagged. Axe passing tells us no scanned surface has a contrast violation. It does not tell us the solid-fill button reported at 3.20:1 → 3.19:1 was inside any scan's include() scope — several of this repo's axe assertions are scoped to specific containers ([data-testid="dashboard-table-rail"], for instance) rather than the whole page. So a reviewer still needs to determine:

  1. Is that button covered by an axe scan at all? If yes, green CI means it clears whichever threshold axe applied and this is closed.
  2. If not scanned — is the label normal-size text? 3:1 is the floor for large text and non-text UI component boundaries; normal-size text on a filled button needs 4.5:1. At 3.19:1 both the before and after values fail that bar.

The worker's framing — pre-existing, not introduced here — is fair either way. My concern is narrower: a known-failing contrast getting fractionally worse should be a decision on the record, not a rounding error that rides along. If it turns out to be normal-size text below 4.5:1, that wants its own issue and a foreground or token fix, not a scope expansion of this PR.

The rest of the diff

16 sites migrated across 12 files, ~136 of 152 candidates deliberately excluded with a stated reason each — readable warning text (no text-safe tonal variant exists for --color-warning, unlike --color-danger), amber-950 muted dark surfaces that would visibly lighten, a decorative admin-card-heading pattern that titles cards rather than warning, and multi-state interactive controls. No slate-* or rose-* site was touched; every candidate checked turned out to be neutral chrome or unrelated danger state.

That ratio is the right shape. Migrating all 152 would have recoloured a great deal that is amber without meaning "warning."

Worth recording: this began as an assumed no-op — amber-600 was taken to be byte-identical to --color-warning (#d97706). Measuring through real Chromium showed Tailwind v4 ships colours as oklch(), resolving amber-600 to rgb(225,113,0) against --color-warning's rgb(217,119,6). Small, real, and it converted this from a rename into a change requiring exactly the contrast verification above. Sixth time in this session a source-level assumption fell to a measurement.

Review status — stated plainly

I have not done an independent review of this diff. I am at the end of my usable context and a rubber stamp would be worse than the gap. Green CI plus the worker's own contrast measurements are what exists; a fresh reader should verify the 16 migrated sites are genuinely semantic-warning and settle the button question above before merging.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR advances the staged migration from raw Tailwind amber-* utilities to the semantic --color-warning token in the web app, focusing specifically on non-text warning surfaces (borders/background tints + one solid-fill).

Changes:

  • Replaced border-amber-* / bg-amber-* warning-semantic usages with border-[var(--color-warning)]/* and bg-[var(--color-warning)]/* across multiple warning banners/callouts.
  • Updated the concentration-warning modal styling in SpellbookPanel to use --color-warning for border and the confirm button background.
  • Added a Playwright “unit” guard test to prevent the migrated sites from silently regressing back to raw amber-*.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/web/src/features/notes/InboxPage.tsx Migrates the disabled-provider warning border color to --color-warning.
apps/web/src/features/encounters/SpellbookPanel.tsx Migrates concentration-warning modal border and confirm button background to --color-warning.
apps/web/src/features/encounters/RunSessionPage.tsx Migrates multiple reconcile/sync warning banners’ border + bg tint to --color-warning.
apps/web/src/features/encounters/EncounterWhisperComposer.tsx Migrates the composer warning border color to --color-warning.
apps/web/src/features/dashboard/HandoutsCard.tsx Migrates handout reveal warning callout border + bg tint to --color-warning.
apps/web/src/features/admin/ResetRequestsCard.tsx Migrates the reset-link disclosure border to --color-warning.
apps/web/src/features/admin/MembersPage.tsx Migrates the invites-suspended banner border to --color-warning.
apps/web/src/features/admin/CampaignAuditPage.tsx Migrates audit retention disclosure card border + bg tint to --color-warning.
apps/web/src/features/admin/AuditLogCard.tsx Migrates audit retention policy callout border + bg tint to --color-warning.
apps/web/src/components/VisibleToPlayersBar.tsx Migrates visible/hidden bars border + bg tint to --color-warning.
apps/web/src/components/EntityRevealDialog.tsx Migrates irreversible-reveal warning callout border + bg tint to --color-warning.
apps/web/src/components/AudienceField.tsx Migrates public-audience warning callout border + bg tint to --color-warning.
apps/web/e2e/tests/warning-token-migration.unit.spec.ts Adds a source-scan guard test intended to pin the migrated sites to --color-warning.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3bd47ad085

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@AwsomeFox
AwsomeFox marked this pull request as draft August 11, 2026 11:49
AwsomeFox pushed a commit that referenced this pull request Aug 11, 2026
Two review findings on #2203:

1. Codex (P2): four of the sixteen "migrated" sites are cascade no-ops.
   index.css/nocturne.css are imported unlayered, which always beats a
   layered Tailwind utility (including arbitrary-value ones) regardless
   of specificity or source order. Measured with real Chromium against
   the actual compiled theme:
     - CampaignAuditPage.tsx:294 renders through <Card>, whose cf-card
       class carries an unlayered `background`/`border` shorthand
       (index.css) that wins outright over the arbitrary utility.
     - MembersPage.tsx:483 / InboxPage.tsx:700 carry cf-inset, same
       unlayered background/border shorthand, same effect.
     - SpellbookPanel.tsx:484's button carries `.btn`, whose unlayered
       `background: 0 0` (nocturne.css) resets it to fully transparent
       before `.btn-primary` ever applies anything; :hover/:active paint
       an unrelated accent-tinted color-mix() overlay instead, both
       before and after this migration.
   Adds warning-token-cascade.spec.ts (browser-backed, real
   getComputedStyle via renderCssFixture) that measures all 16 sites
   against the actual painted color rather than source text, documents
   the four known-inert sites precisely (KNOWN_INERT), and proves via a
   bare-utility reference fixture that the bug is the unlayered wrapper
   rule, not the utility class itself. Not fixed here — the fix is a
   design decision (unlayered semantic modifier vs an `!important`
   escape mirroring the existing MembersPage.tsx:1617 precedent) left
   for the coordinator per review.

2. Copilot: the source-string guard only asserted "at least one"
   occurrence of the migrated pattern per file, so a partial regression
   (one of several sites in the same file reverting to raw amber) could
   pass silently. VisibleToPlayersBar.tsx (2 sites) and RunSessionPage.tsx
   (3 sites) were exactly this shape. warning-token-migration.unit.spec.ts
   now asserts an exact occurrence COUNT per file. Verified by manually
   reverting one of two VisibleToPlayersBar sites to raw amber (including
   a different amber shade the banned-pattern regex doesn't match) and
   confirming the count assertion fails where the old "at least one"
   check would have passed.

Copilot's SpellbookPanel.tsx:485 hover:bg-amber-500 finding is deferred:
the button's base background is one of the four known-inert sites above,
so fixing only the hover class would be an equally inert change pending
the same design decision.
@AwsomeFox
AwsomeFox force-pushed the claude/backlog-2161-semantic-warning-token branch from 3bd47ad to 9aa55e4 Compare August 11, 2026 12:15
AwsomeFox pushed a commit that referenced this pull request Aug 11, 2026
Coordinator decision on #2203's review: neither an `!important` escape
nor a new unlayered semantic modifier class belongs in a color
migration PR — both are real design decisions. Revert
CampaignAuditPage.tsx:294, MembersPage.tsx:483, InboxPage.tsx:700, and
SpellbookPanel.tsx:484 to their original raw-amber classes (all four
render identically either way, since none of them were actually
painting --color-warning in the first place) rather than ship source
that claims the token while painting --color-divider/--cf-card/
transparent.

Tracked in follow-up issue #2208 with the full computed-style table,
root-cause per site, and fix options.

Updates both guard tests to the 12 sites that remain migrated and are
confirmed effective:
- warning-token-migration.unit.spec.ts: removes the 4 reverted
  entries, corrects SpellbookPanel.tsx's entry to its one remaining
  migrated declaration (the modal border), and rewrites the docstring
  to describe what actually happened rather than a still-open question.
- warning-token-cascade.spec.ts: drops KNOWN_INERT and the
  reference-fixture diagnostics (no longer needed once the inert sites
  are gone) and becomes a straightforward regression guard for the 12
  sites that do paint the token.
@AwsomeFox
AwsomeFox marked this pull request as ready for review August 11, 2026 21:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f171db24fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@AwsomeFox
AwsomeFox marked this pull request as draft August 11, 2026 21:42
claude added 4 commits August 11, 2026 21:50
Twelve components used raw amber-* Tailwind utilities for genuinely
semantic warning state (visibility/audience disclosures, sync-conflict
banners, audit-retention notices, a "shown once" caution, a
concentration-warning confirm) instead of resolving through
--color-warning (#1533). Only the non-text roles (border, background
tint, and one near-exact-value solid fill) are migrated here --
--color-warning is a single flat hex, unlike --color-danger's
multi-role family, so it has no text-safe or dark-muted-surface
variant; those roles and every decorative/selection use of amber are
left alone (see PR description for the full excluded population).

Contrast measured in a real Chromium canvas against this app's actual
compiled theme (Tailwind v4 ships oklch, not hex, so amber-600 and
--color-warning are close but not byte-identical): every migrated
text-bearing site is unchanged or slightly improved (8.8-13.7:1),
decorative border contrast (already below 3:1 pre-existing) moves by
well under half a ratio point.

Adds a guard test pinning the migrated sites so they cannot silently
regress back onto raw amber.
Two review findings on #2203:

1. Codex (P2): four of the sixteen "migrated" sites are cascade no-ops.
   index.css/nocturne.css are imported unlayered, which always beats a
   layered Tailwind utility (including arbitrary-value ones) regardless
   of specificity or source order. Measured with real Chromium against
   the actual compiled theme:
     - CampaignAuditPage.tsx:294 renders through <Card>, whose cf-card
       class carries an unlayered `background`/`border` shorthand
       (index.css) that wins outright over the arbitrary utility.
     - MembersPage.tsx:483 / InboxPage.tsx:700 carry cf-inset, same
       unlayered background/border shorthand, same effect.
     - SpellbookPanel.tsx:484's button carries `.btn`, whose unlayered
       `background: 0 0` (nocturne.css) resets it to fully transparent
       before `.btn-primary` ever applies anything; :hover/:active paint
       an unrelated accent-tinted color-mix() overlay instead, both
       before and after this migration.
   Adds warning-token-cascade.spec.ts (browser-backed, real
   getComputedStyle via renderCssFixture) that measures all 16 sites
   against the actual painted color rather than source text, documents
   the four known-inert sites precisely (KNOWN_INERT), and proves via a
   bare-utility reference fixture that the bug is the unlayered wrapper
   rule, not the utility class itself. Not fixed here — the fix is a
   design decision (unlayered semantic modifier vs an `!important`
   escape mirroring the existing MembersPage.tsx:1617 precedent) left
   for the coordinator per review.

2. Copilot: the source-string guard only asserted "at least one"
   occurrence of the migrated pattern per file, so a partial regression
   (one of several sites in the same file reverting to raw amber) could
   pass silently. VisibleToPlayersBar.tsx (2 sites) and RunSessionPage.tsx
   (3 sites) were exactly this shape. warning-token-migration.unit.spec.ts
   now asserts an exact occurrence COUNT per file. Verified by manually
   reverting one of two VisibleToPlayersBar sites to raw amber (including
   a different amber shade the banned-pattern regex doesn't match) and
   confirming the count assertion fails where the old "at least one"
   check would have passed.

Copilot's SpellbookPanel.tsx:485 hover:bg-amber-500 finding is deferred:
the button's base background is one of the four known-inert sites above,
so fixing only the hover class would be an equally inert change pending
the same design decision.
Coordinator decision on #2203's review: neither an `!important` escape
nor a new unlayered semantic modifier class belongs in a color
migration PR — both are real design decisions. Revert
CampaignAuditPage.tsx:294, MembersPage.tsx:483, InboxPage.tsx:700, and
SpellbookPanel.tsx:484 to their original raw-amber classes (all four
render identically either way, since none of them were actually
painting --color-warning in the first place) rather than ship source
that claims the token while painting --color-divider/--cf-card/
transparent.

Tracked in follow-up issue #2208 with the full computed-style table,
root-cause per site, and fix options.

Updates both guard tests to the 12 sites that remain migrated and are
confirmed effective:
- warning-token-migration.unit.spec.ts: removes the 4 reverted
  entries, corrects SpellbookPanel.tsx's entry to its one remaining
  migrated declaration (the modal border), and rewrites the docstring
  to describe what actually happened rather than a still-open question.
- warning-token-cascade.spec.ts: drops KNOWN_INERT and the
  reference-fixture diagnostics (no longer needed once the inert sites
  are gone) and becomes a straightforward regression guard for the 12
  sites that do paint the token.
…fallback"

Codex (P2, warning-token-cascade.spec.ts:118): the previous version
asserted only `computed !== --color-divider` / `!== --cf-card` — the
two known no-op fallback colors this same review round found. That is
the identical structural flaw one level up from what this spec exists
to catch: if a future Tailwind change stopped emitting
`border-[var(--color-warning)]/N`, the element would fall back to
`currentColor`/`transparent`, neither of which equals the two excluded
values, so the old assertion would keep passing with zero sites
actually painting warning.

Verified the failure mode directly: rendering a site's markup with a
nonexistent utility class in place of the real one resolves to
`currentColor` (rgb(233,233,237) here) — the old `!== --color-divider`
check does not catch it, the new equality check does.

Rewrote to assert EXACT equality against an independently-derived
expected color: `color-mix(in oklab, var(--color-warning) N%,
transparent)`, built from the live --color-warning custom property
(never hardcoded) and evaluated on an element that never carries the
Tailwind utility class at all, so it does not depend on Tailwind
having emitted anything for the comparison to be meaningful. Verified
empirically that this independently-constructed expression is
byte-identical (canvas-normalized RGBA) to Tailwind's own compiled
output across every opacity step used (5/10/30/35/40/50%) — both
route through the same browser color-mix() primitive with the same
inputs, so zero tolerance is used rather than a loose one that would
risk admitting the currentColor/transparent fallback this check exists
to catch.

Re-checked warning-token-migration.unit.spec.ts's requiredPatterns
(already exact-count, not "at least one" — fixed last round) and
bannedPatterns (a legitimate negative source-text pin, not a
correctness proxy) for the same shape; neither needed a change.
@AwsomeFox
AwsomeFox force-pushed the claude/backlog-2161-semantic-warning-token branch from f171db2 to fd10021 Compare August 11, 2026 21:51
@AwsomeFox
AwsomeFox marked this pull request as ready for review August 12, 2026 01:11
@AwsomeFox
AwsomeFox merged commit 679c434 into main Aug 12, 2026
16 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.

Design system: migrate raw amber/slate/rose Tailwind colors used for semantic warning state onto --color-warning

3 participants