Skip to content

fix(web): keep accent-colored text readable on Cinema Dark - #4780

Merged
Quick104 merged 2 commits into
mainfrom
fix/accent-text-contrast-dark
Nov 21, 2026
Merged

Quick104 merged 2 commits into
mainfrom
fix/accent-text-contrast-dark

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: changes #1136 C1, changes #1229 C1

Other clients: Apple N/A (reads only the server name from branding); Android N/A (uses the accent only as a dark background tint on first-run screens, never as text); Roku N/A (reads only the server name from branding)

When an admin picks an accent color, the web app draws text in that exact color on Cinema Dark's dark surfaces. Five of the eight presets then read below WCAG AA's 4.5:1. The clearest case is the active sidebar item: violet reads at 3.69:1 there and indigo at 2.49:1. High contrast mode makes it worse, at 2.36:1 and 1.59:1, because its surfaces are lighter. Links, the calendar's today marker, accent pills, and the current episode's caption have the same problem. Servers that keep Cinema Dark's own accent aren't affected.

This change draws accent-colored text in a lighter version of the accent that reads at 4.5:1 or more, for any hex an admin can pick. Buttons, fills, borders, and focus rings keep the exact color the admin chose.

Approach

  • text-primary now resolves to a new --primary-text token. Tailwind 4 looks up --text-color-primary before --color-primary, so one line in app.css moves every text-primary use, including hover and opacity variants, onto the new token. No call site changes for this. Without an admin accent the token falls back to --primary.
  • accentDeclarations sets --primary-text to the accent lightened in small steps until it reads at 4.5:1 on Cinema Dark's lightest surface under text (--surface-raised) and on the accent's own 20% tint over it, the strongest tint text sits on. It uses the same loop the player's --accent-on-dark already used. A second value targets high contrast's lighter surfaces, and the accent's high contrast rule in BrandingProvider swaps it in. Presets that already pass, such as amber, keep their color in normal mode.
  • Four kinds of call site dimmed or bypassed the token. The current episode's caption used an inline var(--primary) and now uses text-primary. Seven text links faded to 80% on hover; they underline instead. The FFmpeg logs link sat at 80% opacity and is now set apart by weight. Premiere badges were a translucent accent tint over poster artwork; they now have an opaque fill, 12% accent over --background, like the dark fills of the finale and release badges beside them.
  • docs/settings-api.md and web/docs/design-system.md describe the new token, and accentColor.test.ts checks both text tokens at 4.5:1 on the lightest surface and the accent's 20% tint, in normal and high contrast.

Not in this change: accent borders, rings, and fills (border-primary, fill-primary) still use the stored color and can fall below 3:1 on dark surfaces. They need a non-text variant that touches the same code, so a follow-up waits for this to merge. Dimmed text inside accent chips was fixed separately in #4772. Faded rating names (opacity-75 in RatingEntry) and the watched-card dimming that covers calendar badges each have their own fix in progress.

Follow-ups: #4781 (accent borders and rings, waits for this PR). User manual: Silo-Server/siloserver.org#447, draft docs PR Silo-Server/siloserver.org#448.

Validation

  • Reproduced on a dev sandbox built from main with violet and then indigo set under Admin > Settings > Appearance. Computed colors of the active admin and settings sidebar items matched the ratios above. After the change, the same items read 6.41:1 (violet) and 5.60:1 (indigo), and 6.80:1 and 6.25:1 in high contrast mode. The current episode caption went from 2.92:1 to 6.58:1, and the episode page's quality pills and the calendar's today marker and links all moved above 5.5:1.
  • The built CSS emits .text-primary{color:var(--primary-text,var(--primary))}, and bg-primary and text-primary-foreground are unchanged.
  • The new accent text test fails on main, where the tokens don't exist, and passes here. Web typecheck, ESLint, Prettier, and the web tests for the changed files pass. make lint-changed reports no Go changes.
  • Premiere badges, the hover underline, and the FFmpeg logs link weren't seen live, because the sandbox data has no premieres this week and none of the changed links. They were checked in the built CSS and the source.

Evidence

Before and after captures of the admin and settings sidebars, the calendar (desktop and phone), high contrast mode, and an episode page, with violet and indigo, are on the evidence page.

Evidence: https://evidence.siloserver.org/r/silo-server/accent-text-contrast/

Risks

Accent-colored text now looks lighter than the stored hex, most visibly for dark accents. Validators who check that "the accent is applied" (#1229 C1) will see the exact accent on buttons and the sidebar's indicator bar, and a lighter shade on text. Premiere badges look different (#1136 C1). The color math runs once per branding load.

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

Rounds: 2, last reviewed c155203

Member Round 1 (ca9c6bf) Round 2 (c155203)
Sol (gpt-6.2-sol, xhigh) 7/10 7/10
Opus (claude-opus-5-5, high) 8.5/10 8.5/10
Gemini (gemini-4-neon, xhigh) 8.5/10 9/10

Visual review: 1 round, on captures from an earlier head of this branch; the captured screens have not changed since apart from the base's label fix (#4728)

Member Round 1
Sol better, 8/10
Opus better, 8/10
Gemini unavailable

Fixed: the high contrast target moved to its lightest surface; premiere badges and the dimmed links were covered; the inline caption was moved onto the token; round 1 led to the darker premiere fill, the test, two doc corrections, and dropping a dead blur class. Answered: labels on violet buttons were fixed in #4728; the calendar's tinted day is the today marker (it has aria-current="date"), not the selection; ratings over a bright hero backdrop rely on the same scrim as the title beside them. Left for the maintainer: with a near-black accent, ratings over mid-gray hero artwork (S2) and a watched premiere badge over a light poster (S3) read lower than before; S3 goes away with the watched-dimming follow-up. Pre-existing and moved to follow-ups: watched-card badge dimming, dimmed rating names, and non-text accent marks (#4781).

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code; T3 Code delegated tasks for the plan, visual, and adversarial reviews (Codex, Claude, and Antigravity providers); headless Chromium (Playwright) for captures
  • Model(s): claude-opus-5-5 (implementation, review); gpt-6.2-sol, claude-opus-5-5, gemini-4-neon (council); claude-sonnet-5-5 (code-review finder and validation check)
  • Involvement: Fully AI-generated; the agent verified it on a dev sandbox, a person hasn't yet
  • Adversarial review: a multi-agent code review at high effort led to the premiere badge's accent tint, the FFmpeg link's weight, the two doc additions, and deriving the high contrast surface instead of copying it. A simplify pass found nothing to change. Round 1 of the background review led to the darker premiere fill, the new test, and two doc fixes. The plan, visual, and background reviews are under Council review.

🤖 Generated with Claude Code

Note

Fix unreadable accent-colored text on Cinema Dark with new --primary-text token

  • Accent-colored text previously used the raw accent color, which could fail contrast on dark surfaces. accentDeclarations in accentColor.ts now computes primary-text and primary-text-high-contrast values that meet a 4.5:1 ratio on the lightest Cinema Dark surface and its 20% accent tint, falling back to white if no lightened accent works.
  • A new text-primary token in app.css uses --primary-text when set and falls back to --primary. The applyAccent helper in BrandingProvider.tsx sets --primary-text from --primary-text-high-contrast when high contrast is active.
  • Several hover styles switch from reduced opacity to underline on accent text (retry buttons, provider toggle, watchlist "find more" link), and the current-episode caption in EpisodeCardCaption.tsx uses text-primary.
  • Behavioral Change: accentText returns white when no lightened accent passes the 4.5:1 check on both surfaces; premiere badges in upcomingEventPresentation.ts use a 12% mixed background plus a shadow instead of a 20% tint; fills, borders, and the focus ring outside high contrast still use the stored accent.

Macroscope summarized c155203.

An admin accent was drawn as text in its raw color, so five of the eight
presets read below 4.5:1 on Cinema Dark's surfaces, most visibly on the
active sidebar item. text-primary now resolves to --primary-text, which
the accent sets to itself lightened just enough to read on the lightest
surface and on its own strongest tint, with a second value for high
contrast's lighter surfaces. Fills, borders, and rings keep the exact
accent.

Text that bypassed or faded the token now reads too: the current
episode's caption uses text-primary, text links underline on hover
instead of fading to 80%, and premiere badges get an opaque,
accent-tinted fill over artwork.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added the size/M 50–199 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 34 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: 1ab99ba8-d0c5-448c-b050-27095b89af53
Commits

Reviewing files that changed from the base of the PR and between 26701f7 and c155203.

Files selected for processing: 15

  • docs/settings-api.md
  • web/docs/design-system.md
  • web/src/app.css
  • web/src/components/admin/libraries/LibraryFormSections.tsx
  • web/src/components/watchlist/WatchlistTitlesTab.tsx
  • web/src/contexts/BrandingProvider.tsx
  • web/src/lib/accentColor.test.ts
  • web/src/lib/accentColor.ts
  • web/src/lib/upcomingEventPresentation.ts
  • web/src/pages/AdminPlaybackHistory.tsx
  • web/src/pages/ItemDetail/components/EpisodeCardCaption.tsx
  • web/src/pages/Recommendations.tsx
  • web/src/pages/RecommendationsSection.tsx
  • web/src/pages/RequestDiscoverSection.tsx
  • web/src/pages/Requests.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 ❌

@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-21T02:56:24.869433Z c155203 New commits
🔒 Security Review ✅ Completed 2026-11-21T02:58:26.890356Z c155203 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.

@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 labels Nov 21, 2026

@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 of the head commit. The code change holds up: I recomputed primary-text and primary-text-high-contrast for the eight presets plus black, white and mid-gray, and every value reads at 4.5:1 or better on each Cinema Dark surface text sits on (background, card, accent, surface-raised, sidebar) and on the 20% tint, and on high contrast's surface-raised, accent and surface-hover. The premiere badge's opaque fill is mixed over --accent, which is darker than the surface the check uses in both modes, so the badge text clears the same bar. No component overrides --primary locally, so the root --primary-text can't drift from a scoped primary. Two small doc inaccuracies are inline.

Not run: the vitest suites (no installed dependencies in my checkout).

AI disclosure: written by claude-opus-5-5 via T3 Code, read-only adversarial review.

Comment thread docs/settings-api.md Resolved
Comment thread web/docs/design-system.md Resolved

@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 ca9c6bf)

Two findings, both about accent text drawn over artwork rather than Cinema Dark's own surfaces. Score for the change as it stands: 7/10.

Posted by the run that opened this PR on the reviewer's behalf, after checking each finding against the source; the reviewer's own posting step failed.

AI disclosure: findings by gpt-6.2-sol via T3 Code, read-only adversarial review; posted by 🤖 Claude Code (claude-opus-5-5).

Comment thread web/src/app.css
/* Text in the primary color. An admin accent sets --primary-text to a
variant that reads on Cinema Dark's surfaces (lib/accentColor.ts); fills,
borders, and rings keep the accent itself. */
--text-color-primary: var(--primary-text, var(--primary));

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.

S2 (medium): ratings can lose contrast over bright detail artwork. --primary-text assumes a dark surface, but ScoreRow (ScoreRow.tsx:18) draws text-primary directly over the hero artwork. With a custom black accent and a bright backdrop in a mobile fixture, the rating text measured 13.76:1 before, 1.87:1 after, and 1.05:1 after with high contrast on. The ratio depends on the artwork and layout.

Suggested repair: give the ratings a dark backing, or make sure the hero scrim keeps their whole text area dark.

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.

No change here. ScoreRow sits in the detail hero beside the title and overview, which use --foreground (#e8e8ec), lighter than any --primary-text. Wherever a backdrop is bright enough to drop the lightened rating below 4.5:1, the title and overview fail first, so the hero's dark scrim already has to keep that area dark; this PR follows the same contract. On the scrim as designed, a black accent read about 1.1:1 before this change and about 6:1 after. 🤖 Claude Code (claude-opus-5-5)

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.

Round 2 measured this with a black accent and high contrast on, over mid-gray artwork behind the scrim: 4.50:1 before, 2.90:1 after, while white text on the same pixel reads 4.66:1. So my earlier point that the title fails first doesn't hold for that case; I was wrong there. The regression needs a near-black accent: it read well before only because black is dark and the art behind it was light. Every shipped preset gains on the same pixel (indigo goes from about 1.6:1 to above 4.5:1), and on the scrim as designed all accents now pass. Backing the ratings, or strengthening the scrim behind them, would change the hero's design for an edge case, so I'm leaving this PR as is and flagging the decision to the maintainer. 🤖 Claude Code (claude-opus-5-5)

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

Checked the Tailwind v4 --text-color-primary lookup, #silo-accent cascade order (normal, high contrast toggle, and cleared accent), sRGB contrast math across all presets and a 4,096-color RGB grid, and the remaining text-primary / var(--primary) call sites. The core token mechanism and contrast calculations hold.

Three low-severity findings:

  1. backdrop-blur-none is overridden on premiere badges (inline on web/src/lib/upcomingEventPresentation.ts:39): all three callers hardcode backdrop-blur-sm without cn(), and Tailwind v4 emits .backdrop-blur-sm after .backdrop-blur-none, so backdrop-filter: blur(...) stays active.
  2. Additional dimmed child under text-primary: web/src/pages/ItemDetail/components/ScoreRow.tsx:18 renders RatingEntry (web/src/components/ratings/RatingEntry.tsx:31), which dims non-TMDB rating names ("IMDb", "RT", etc.) with opacity-75. On --background (#141417), that brings --primary-text down to 4.22:1 for indigo (#4f46e5) and 4.43:1 for red (#ef4444) — an improvement over raw accents, but worth including in the follow-up covering the three dimmed accent chips (ImageSelectorTab.tsx:294, PlaybackRouteBadges.tsx:33, PreparationTab.tsx:725).
  3. No contrast assertions for the new tokens (inline on web/src/lib/accentColor.ts:152): extending web/src/lib/accentColor.test.ts would catch regressions in mixToward / accentText.

AI disclosure: written by Gemini 4 Neon via T3 Code, read-only adversarial review.

Comment thread web/src/lib/accentColor.ts Resolved
Premiere badges mix 12% of the accent into the page background, which
keeps their label at 4.5:1 or more when a watched card dims them; the
lighter fill over --accent fell below it with Cinema Dark's own accent.
The badge drops a backdrop-blur-none that its callers' backdrop-blur-sm
overrode anyway.

accentColor.test.ts checks that both text tokens read at 4.5:1 on the
lightest surface and on the accent's 20% tint, in normal and high
contrast. The docs no longer say the focus ring keeps the stored color
under high contrast, or that every accent is lightened.

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 c155203)

Round 2. Resolved from round 1: O1, O2, S1 (default accent, dark poster: 5.06:1 before and after), G1, G2 (tracked in its follow-up), G3 (the new cases pass on this head and fail against the merge base). Still open: S2, with new measurements in its thread. New: S3. Score for the change as it stands: 7/10.

Posted by the run that opened this PR on the reviewer's behalf, after checking each finding against the source; the reviewer's own posting step failed.

AI disclosure: findings by gpt-6.2-sol via T3 Code, read-only adversarial review; posted by 🤖 Claude Code (claude-opus-5-5).

case "series_premiere":
case "season_premiere":
return "border-primary/40 bg-primary/20 text-primary";
return "border-primary/40 bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))] text-primary shadow-sm";

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.

S3 (medium, new): watched premiere badge with a black accent over a light poster. With a black admin accent and standard contrast, a watched premiere badge over a white poster measured 5.28:1 before this change and 3.15:1 after in Chromium; a #f0f0f0 poster gave 4.80:1 before and 3.15:1 after. The watched card's opacity-60 grayscale (CalendarEventCard.tsx:40) applies to the badge as well as the artwork. Suggested repair: apply those effects to the artwork only, so the opaque badge keeps its contrast. Synthetic posters.

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.

Same cause as S1's remainder: opacity-60 grayscale on the watched card covers the badge row, so no fill keeps 4.5:1 there for every accent and poster. The follow-up run for that defect moves the dimming off the badges, which fixes this case too. Tuning the fill for a black accent here would trade it against the default accent, which S1 brought back to 5.1:1. Leaving this open until that follow-up lands. 🤖 Claude Code (claude-opus-5-5)

@Quick104
Quick104 merged commit 8206d60 into main Nov 21, 2026
36 checks passed
@Quick104
Quick104 deleted the fix/accent-text-contrast-dark branch November 21, 2026 03:10
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/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant