Skip to content

fix(ui): keep warn text readable on warn tints in light palettes - #20184

Merged
iamwhatever merged 1 commit into
mainfrom
fix/warn-contrast-20071
Oct 14, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/warn-contrast-20071

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Warn-coloured text on a warn-tinted chip, pill or notice is readable in every light theme.

In a light theme, text-warn on a bg-warn-subtle or bg-warn/N fill reads as gold on pale yellow: 1.9:1 in rosepine-light, 2.1:1 in catppuccin-light, 4.2:1 in the default light palette, all under the 4.5:1 WCAG text floor. 64 source lines pair the two. #20056 fixed the same hue on glass-warn panes only.

Why it matters

Status pills ("running", "needs update", "fails validation"), warning notices and filter chips are where the dashboard tells the user something needs attention. In a light theme they are the hardest text on the page to read.

Not a goal

  • Dark palettes: they keep plain --warn, and a test pins that.
  • The warn tints themselves (bg-warn-subtle, bg-warn/N): fills and borders do not change.
  • Solid bg-warn buttons with text-warn-fg: already black-or-white on the hue.
  • Theme packs installed at runtime.

What changed (motivation → approach → change)

Plain --warn is a mid-yellow in every light palette, and the fills are that same yellow at 10-30% over a near-white surface, so the text and its background share a hue and a brightness.

One token now carries the fix for the glass and the fills alike. --warn-text is --warn in dark palettes and, under [data-mode="light"], half the hue darkened toward black: it stays amber-brown, so it still reads as a warning. The share is set by the strongest tint the source pairs it with (bg-warn/30, the VectorMemoryCard filter pill): 50% clears it at 5.4:1 in the worst light palette, 60% would drop it to 4.2:1. Like --shadow-float, the token lives outside the [data-theme] blocks so a pack cannot set it.

tailwind-theme.css bridges it as text-warn-text; the 61 lines that put plain text-warn on a warn tint paint that utility, a mechanical rename across website/src/components, website/src/pages, website/src/apps and website/src/app-sdk, and .glass-warn-fg reads the same token, so #20056's rule is now an alias. Three controls with no tint at rest (the connections prerequisite tip, the auto-nudge button, the PR auto-merge button) keep plain text-warn and take hover:text-warn-text with their hover tint. The artifact sync notice's button sits inside the tinted notice, so it takes the darker text at rest like its notice.

Palette before, --warn on warn-subtle after, worst tint (bg-warn/30)
rosepine-light 1.91:1 5.42:1
everforest-light 2.05:1 5.68:1
light 4.15:1 7.53:1
dark palettes unchanged unchanged

Backwards compatibility

Compatible: a new token and a new utility; text-warn, --warn and every fill keep their values, and .glass-warn-fg paints the same colour family it did.

Removes nothing: the diff adds a token and renames class strings; no path, record, key or function goes away.

Tests

website/src/test/glassWarnTextContrast.test.ts (extended from #20056):

  • reads the light-mode share from index.css and measures --warn-text against every warn tint the source pairs with text-warn-text (-subtle, /10, /15, /30), over --bg, --bg-elevated and --card, in all 18 light palettes: every pairing is at least 5.4:1;
  • the glass-warn tint keeps its own 4.5:1 check;
  • dark palettes resolve --warn-text to var(--warn) and no [data-mode="dark"] rule sets it;
  • a source line that pairs plain text-warn with bg-warn-subtle, bg-warn/N or glass-warn fails the test; a tint that only appears under hover: must come with hover:text-warn-text.

Mutation checks run locally: a 60% share fails on amoled-light bg-warn/30 (4.20:1); reverting one site to text-warn is named by the scan.

KiroPrerequisiteGate.test.tsx and the CrewLogPanel snapshot follow the class rename. Determinism: the suite reads files and does arithmetic, no timers or network; the three touched test files ran 3 times (252 tests each, green), and the 37 test files that name text-warn ran once plain and once under --sequence.shuffle (1510 tests, green both times); after the share change the 41 related files ran green again (1529 tests).

Manual verification

website/scripts/capture-warn-text-contrast.mjs renders the built stylesheet on the chip, pill and notice shapes in rosepine-light, everforest-light, light and dark, before and after (below).

Screenshots / video

rosepine-light, before (gold on pale yellow) and after:

before rosepine-light

after rosepine-light

everforest-light, light and dark (the control)

before everforest-light

after everforest-light

before light

after light

before dark

after dark

Related Issues

Closes #20071

Pattern harvest

Rule candidate: review-prompt
Pattern: a status hue used as text on its own tinted fill, with no light-mode variant of the text token

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 14, 2026 07:29
@bolichen97
bolichen97 requested a review from mbriones98 October 14, 2026 07:29
@bolichen97
bolichen97 enabled auto-merge (squash) October 14, 2026 07:29
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 168a915c824dc4dff656ff324eae566c823509f7 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 168a915

Description read

[DESCRIPTION-READ] 4bc2398828956fc9def2375a19c3cadc0578ad28ca3b4f114b327600c3cd3bb2

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 168a915c824dc4dff656ff324eae566c823509f7 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Check by eye that the three hover-only controls (connections tip, auto-nudge, PR auto-merge) still read as warnings when hovered in a light theme.

[UX-REVIEWED] 168a915

Description read

[DESCRIPTION-READ] 562b71a503e0e6577590ff00e03d0e94ec7ecb90f37271e6740c27efbf3ae7e7

That sha256 names everything this verdict read: the PR description, plus the 11 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 168a915c824dc4dff656ff324eae566c823509f7 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check that the queued-message card and the memory-mode chip still look right in light mode: their glass text now mixes toward black at 50%, where it used to mix toward --text-strong at 30%.

What this change ships

Inventory (7 items) — 7 justified

Intent: make warn-coloured text on warn-tinted chips, pills and notices readable in every light theme. This is a FIX (closes #20071).

  1. In light palettes, warn text on bg-warn-subtle / bg-warn/N fills is now a darker amber across 61 sites — justified
  2. Dark palettes keep the plain --warn text colour — justified
  3. Text on glass-warn panes in light mode now paints the shared token, a different mix from fix(ui): give read-only queue cards a read-only cue #20056's — justified
  4. Three controls with no tint at rest keep plain warn at rest and darken only on hover — justified
  5. The artifact sync-notice button takes the darker text at rest, matching its tinted notice — justified
  6. The test fails any new source line that puts plain text-warn on a warn tint, and it measures contrast for every paired tint — justified
  7. New dev-only screenshot script capture-warn-text-contrast.mjs, one of 745 capture-* scripts in website/scripts — justified

[FIRST-PRINCIPLES-REVIEWED] 168a915

Description read

[DESCRIPTION-READ] 8eede5246201349cae10b4c338ca6a03b9abc9789ecd073332dcc86abe8dfe47

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 168a915c824dc4dff656ff324eae566c823509f7 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 168a915

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 168a915c824dc4dff656ff324eae566c823509f7: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 168a915c824dc4dff656ff324eae566c823509f7 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 168a915

Verdict parsed from the review's SHA-scoped output markers for commit 168a915c824dc4dff656ff324eae566c823509f7.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 168a915c824dc4dff656ff324eae566c823509f7: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@bolichen97
bolichen97 force-pushed the fix/warn-contrast-20071 branch from 95df4ed to 7f83446 Compare October 14, 2026 07:57
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@bolichen97
bolichen97 force-pushed the fix/warn-contrast-20071 branch from 7f83446 to 1095f4e Compare October 14, 2026 08:02
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/app-sdk/ChatEmbed.tsx (same directory as app-sdk/messageRenderers.tsx) since this head went green (a4c0852 -> f0016d7); CI re-running.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • accepted-and-deferred: span=6e3d770ea6b7

ok and danger text on their own tints fail in light palettes too (measured on main: 17 of 18 light palettes below 4.5:1 for ok, 16 of 18 for danger). Same fix shape, own PR: #20201 (deferred-finding, assigned, Due 2026-11-13).
Glass panes (the PASS punchline): they read the same token, now 50% hue toward black. Measured over the 12% glass-warn tint on --bg and --bg-elevated, the worst light palette is 6.15:1 (rosepine-light); main's 30% mix toward --text-strong was 4.54:1 at its worst (everforest-light). glassWarnTextContrast.test.ts pins it at 4.5:1 or better in all 18.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • rebutted: span=fa46bbe9f23e

One token serves every light palette, so its share is set by the palette that needs it most: the issue is a 4.5:1 text floor, and rosepine-light bg-warn/30 (4.2:1 at 60%, 5.4:1 at 50%) is what bounds it. The default light palette ends higher because its hue is already darker, not because the share is wrong for it.
The text is still warn-hued: amber-brown against the page's neutral grey text (see the light-after screenshot, where the pills sit beside normal text), and the tint, the border and the icon carry the cue as before. Dark palettes are byte-identical.
A per-palette share would need a table of 18 numbers kept in step with every palette edit, for a hue difference the user cannot tell apart; it can be asked for as its own issue if the brown proves too quiet.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • rebutted: span=77680ee5df2b

_SYNC_TONES.warn.btn is not tint-free: the button is a child of the notice that carries _SYNC_TONES.warn.wrap (bg-warn-subtle), so at rest its text is on a warn tint and needs the darker token. The three tint-free controls (connections tip, auto-nudge button, PR auto-merge button) keep text-warn at rest.
The scan did not cause it: it is the same pairing the issue lists (ArtifactDetailPage.tsx:2527). The PR body now says so in one sentence.
Glass panes (the PASS punchline): same token, 50% hue toward black; worst light palette 6.15:1 over the 12% glass tint (main's 30% mix was 4.54:1), pinned in glassWarnTextContrast.test.ts.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
In light palettes, `text-warn` on a `bg-warn-subtle` or `bg-warn/N` fill
sat below the 4.5:1 text floor (1.9:1 in rosepine-light, 4.2:1 in
`light`). #20056 fixed the same hue on `glass-warn` panes only.

One token now carries both. `--warn-text` is `--warn` in dark palettes and,
under `[data-mode="light"]`, half the hue darkened toward black, so it
stays amber-brown and still reads as a warning. The share is set by the
strongest tint the source pairs it with (`bg-warn/30`): 50% clears it at
5.4:1 in the worst light palette, 60% would drop it to 4.2:1. The
`text-warn-text` utility paints it on the lines that put plain `text-warn`
on a warn tint; `.glass-warn-fg` reads the same token. Controls whose tint
only appears on hover keep plain `text-warn` at rest and take
`hover:text-warn-text`.

glassWarnTextContrast.test.ts reads the share from index.css, measures the
token against every tint the source pairs with it in every light palette,
pins dark palettes to plain `--warn`, and refuses a source line that still
puts plain `text-warn` on a warn tint or a `glass-warn` pane.

Closes #20071
@bolichen97
bolichen97 force-pushed the fix/warn-contrast-20071 branch from 1095f4e to 168a915 Compare October 14, 2026 10:08
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/test/ChatEmbed.optimisticSend.test.tsx (#20212, the red-main fix) and 40+ other commits since this head went green (f0016d7 -> 8545798); CI re-running.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • answered: PASS punchline (no span)

Glass panes: both read --warn-text through .glass-warn-fg. Measured over the 12% glass tint on --bg and --bg-elevated, the worst light palette is 6.15:1 (rosepine-light); the old 30% mix toward --text-strong was 4.54:1 at its worst. glassWarnTextContrast.test.ts pins it at 4.5:1 or better in all 18 light palettes, and dark palettes are unchanged.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • answered: PASS punchline (no span)

The three hover-only controls keep plain text-warn at rest and switch to hover:text-warn-text with their hover tint. The hover pair is measured by the same test (bg-warn/10 and bg-warn-subtle over --bg, --bg-elevated, --card in every light palette, 5.4:1 or better); the amber-brown text and the tint still read as a warning, as in the light-after screenshot.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 14, 2026

@iamwhatever iamwhatever 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.

APPROVE at 168a915.

One derived token, --warn-text, fixes warn text on warn tints in light palettes. It is plain --warn by default and 50% toward black under [data-mode="light"] (index.css#L676-L677). It is bridged as text-warn-text, and .glass-warn-fg reuses it (#L3611). Dark palettes are unchanged. The renames are mechanical, and the extended contrast test both measures every paired tint in all 18 light palettes and refuses new plain text-warn on a tint. The UX and First Principles punchlines have current-head answers, and the ok/danger follow-up is tracked in #20201 (deferred-finding, assigned, due date). All checks on this head are green, and the branch merges cleanly into current main. No tests were run locally.

— crew-pr-reviewer (r100)

@iamwhatever
iamwhatever merged commit 25699ac into main Oct 14, 2026
101 checks passed
@iamwhatever
iamwhatever deleted the fix/warn-contrast-20071 branch October 14, 2026 16:21
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 14, 2026
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.

Light-theme contrast: text-warn on bg-warn tints below 4.5:1 outside glass-warn panes

2 participants