Skip to content

fix(web): keep red text readable with high contrast on - #4852

Merged
Quick104 merged 3 commits into
mainfrom
fix/high-contrast-destructive-text
Nov 21, 2026
Merged

Quick104 merged 3 commits into
mainfrom
fix/high-contrast-destructive-text

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #4856
Related issue: N/A
Validation tasks: none

Other clients: Apple N/A (web stylesheet token; apps have their own palettes); Android N/A (same); Roku N/A (same)

With high contrast on, the web app lightens panels, rows and raised surfaces toward white but left the red --destructive colour as it was. Red status text drawn directly on those surfaces drops below the 4.5:1 WCAG AA minimum, while the same text passes with high contrast off. On the admin Devices page, the red anomaly count in the stats strip measures 3.80:1 and the red "Anomaly" status in the device readout 3.50:1. About 240 text-destructive uses sit on these surfaces, so this affects the whole app, not one page.

Approach

High contrast now lightens --destructive itself, the same way it already lightens the surface, border and muted-text tokens. The theme's literal moves to --destructive-base, and the high-contrast block mixes --destructive 65% toward --contrast-boost. That keeps red text at 4.5:1 on the lightest surface high contrast produces (--surface-raised, 4.77:1). Red text does sit on that surface, for example in a dragged collection row.

Solid red backgrounds under white text (destructive buttons and badges) already use --destructive-fill, which doesn't change. The remaining bg-destructive uses are small dots and bars. They get lighter too, and that helps them: base red reaches only 2.0 to 2.5:1 against the lightened hover and raised surfaces, below the 3:1 minimum for graphics, and the lighter red reaches 4.8 to 5.9:1. The red 10% tints behind small labels now come from the lighter red, so the high-contrast --destructive-label becomes that same red (4.75:1 on its tint over a hovered row). Without that change it would fall to about 4.4:1.

A rule targeting .text-destructive, like the existing high-contrast rule for .text-muted-foreground, would leave the tints alone. It would miss hover:text-destructive (31 uses), the opacity variants, and red icons and borders, though.

The Downloads preparation state bar drew its segments touching, so with high contrast on the lighter red "failed" segment ran into the near-white "encoding" one (1.31:1 between them). The bar now leaves a small gap between segments, as the storage meter on the same page already does, so each boundary shows whatever the colours or admin accent. That gap is the one change visible with high contrast off. Nothing else changes there.

Validation

  • Reproduced on unfixed main in a local Vite harness that renders the real admin Devices page with seeded data. With high contrast on, red text measured 3.15 to 3.80:1. After the fix, the same elements measure 6.44 to 8.95:1. With high contrast off the values are identical before and after, and the high-contrast-off captures match pixel for pixel.
  • Contrast was measured by compositing each element's computed colours over every ancestor background in headless Chromium.
  • The preparation bar was captured on main, on the first PR head, and after the gap, with high contrast on and off, in a harness that renders the real Downloads preparation tab with seeded counts.
  • A new case in highContrastContrast.test.ts checks high-contrast red against high-contrast --surface-raised. It fails on main and also fails when the mix drops to 50%.
  • Web gate: lint, format check, build, bundle budget, make test-web (3095 tests), local-path and size-ratchet checks all pass.

Evidence

Before and after captures of the admin Devices page at phone, tablet and desktop widths with high contrast on, plus desktop with high contrast off, the per-element contrast measurements, and the Downloads preparation state bar before and after the segment gap.

Evidence: https://evidence.siloserver.org/r/silo-server/hc-destructive-text/

Risks

With high contrast on, red reads as a lighter, pinker red, including status dots. Each dot checked has a text label beside it. Success, warning and info text have the same problem on lightened surfaces. That is tracked in #4851 and not changed here.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

Council review

This ran as a follow-up run: one reviewer per round.

Rounds: 2, last reviewed da69f09

Member Round 1 Round 2
Sol (gpt-6.2-sol, high) 8/10 9/10

Visual review: 1 round, captures from this change's token values

Member Round 1
Sol better, 9/10

Fixed: the preparation state bar's red and near-white segments ran together in high contrast (Sol S1, da69f09). Answered: the storage meter's cleanup and scratch ticks are harder to tell apart by lightness in high contrast when set a point apart (Sol S2). They were already under 3:1 from each other, hue still separates them, and the legend names each. The visual review's findings were all outside this change. The red-tint badges at default contrast belong to #4845, and the device row's dot, the faint DEFAULT badge and the clipped phone search placeholder looked the same before the fix.

AI Disclosure

  • Harness: Claude Code, run inside T3 Code
  • Tool(s): Claude Code; T3 Code delegated tasks for review (Codex); playwright-core with headless Chromium for contrast measurement and captures
  • Model(s): claude-opus-5-5 (implementation and plan check); review by gpt-6.2-sol and claude-sonnet-5-5
  • Involvement: Fully AI-generated; a maintainer reviews it before merge
  • Adversarial review: One Opus plan check at medium effort kept the token approach and added the label alias, a margin note and the test case. A medium-level code review (three finders and a 1.0 validation check) found no regressions. It led to a corrected comment and an updated web/docs/design-system.md. It also raised the dot colour change, which is answered under Approach. A simplify pass trimmed duplicate comments. For the visual and background reviews, see Council review above.

🤖 Generated with Claude Code

Note

Fix unreadable red destructive text in high-contrast mode

  • Red destructive text was hard to read when high contrast was on. In app.css, --destructive now derives from a new --destructive-base token and, in high-contrast mode, mixes 65% toward --contrast-boost. --destructive-label uses that same lightened value.
  • The Midnight Cinema theme sets --destructive-base to #ef4444; its destructive foreground and fill colors are unchanged.
  • Adds per-theme contrast tests in highContrastContrast.test.ts requiring the high-contrast destructive color to hit at least AA_TEXT against the raised surface.
  • Updates the guidance in design-system.md to document the new base token and high-contrast behavior.
  • Also adds a small gap-0.5 between state segments in the admin downloads preparation summary bar.

Macroscope summarized d76f415.

High contrast lightens panels and rows toward white but left the red
--destructive token alone, so red status text on a panel fell to
3.5-3.8:1. Move the theme literal to --destructive-base and, in high
contrast only, mix --destructive 65% toward --contrast-boost so it keeps
4.5:1 on the lightest surface (--surface-raised, 4.77:1). Solid fills
under white text already use --destructive-fill and are unchanged.

Red's 10% tint now derives from the lightened red, so the high-contrast
--destructive-label is that same red (4.75:1 on its tint over a hovered
row).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 877e9242-a6dc-4a5c-a2f8-1403e4ce0112
Commits

Reviewing files that changed from the base of the PR and between 50cbe1f and d76f415.

Files selected for processing: 4

  • web/docs/design-system.md
  • web/src/app.css
  • web/src/highContrastContrast.test.ts
  • web/src/pages/admin-downloads/PreparationTab.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T05:32:29.300692Z d76f415 New commits
🔒 Security Review ✅ Completed 2026-11-21T05:32:48.949311Z d76f415 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread web/src/highContrastContrast.test.ts Resolved
@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish triaged High-confidence review completed; does not mean fixed, validated, or accepted for release. labels Nov 21, 2026
With high contrast on, the lightened red of the failed segment sits
within 1.3:1 of the near-white encoding segment, so the two run together
when they are adjacent. Put a small gap between segments, as the storage
meter on the same page already does, so each boundary shows whatever
the colours or the admin accent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

silo-kody Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adversarial review (gpt-6.2-sol, reviewed f7a2985)

Score: 8/10. One finding.

S1 (low): the Downloads preparation state bar loses a segment boundary in high contrast.

  • Trigger: high contrast on, default accent, and both Encoding and Failed jobs present. web/src/pages/admin-downloads/PreparationTab.tsx draws the state bar as touching segments, and failed uses bg-destructive.
  • Impact: the lightened red sits next to the near-white Encoding segment at 1.31:1 (3.08:1 before this change), so the two segments run together and the bar's proportions are hard to read at a glance. The legend still shows the counts.
  • Evidence: reproduced in Chromium with the pinned stylesheet and the chart's classes.
  • Repair: add a contrasting separator or gap between segments so each boundary shows whatever the colours or accent.

The new test fails on main and with a 50% mix, all seven focused tests pass, and plain red text measures 4.78:1 on the raised surface.

Posted by the implementing run on the reviewer's behalf, because the reviewer's tool couldn't attach the commit. Resolution: fixed in da69f09, which puts a gap between the bar's segments, as the storage meter on the same page already does.

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adversarial review (gpt-6.2-sol, reviewed da69f09)

Score: 9/10. S1 is resolved: the 2px gap shows the panel between every adjacent pair whatever the accent, the rounded ends clip only the outside of the bar, and the flex items shrink to absorb the gaps without overflowing.

S2 (low): the storage meter's two threshold ticks are harder to tell apart in high contrast.

  • Trigger: a filesystem that shares scratch space, with the cleanup ceiling set to 94%. The cleanup tick (bg-warning) and the scratch tick (bg-destructive) in web/src/pages/admin-downloads/StorageTab.tsx are identical 2px lines at 94% and 95%, so they touch on a narrow meter.
  • Impact: their computed lightness contrast drops from 2.00:1 to 1.18:1 with high contrast on, so it is harder to see where cleanup starts and playback admission stops.
  • Repair: give the ticks distinct shapes or put them on opposite edges of the meter, with matching symbols in the legend.

Posted by the implementing run on the reviewer's behalf. Resolution: not changed in this PR. The two ticks were already below 3:1 from each other before it (2.00:1). Hue, not lightness, tells them apart in both versions (yellow against red before, yellow against pink now), and the legend under the meter names each tick. Overlapping thresholds are a property of the meter's design rather than of this colour change.

…tructive-text

# Conflicts:
#	web/docs/design-system.md
@Quick104
Quick104 merged commit 0ad4c13 into main Nov 21, 2026
22 checks passed
@Quick104
Quick104 deleted the fix/high-contrast-destructive-text branch November 21, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority. triaged High-confidence review completed; does not mean fixed, validated, or accepted for release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin Devices: the "Anomaly" status value is below 4.5:1 in high contrast

1 participant