Repository navigation
fix(web): keep accent-colored text readable on Cinema Dark - #4780
Conversation
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>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Quick104
left a comment
There was a problem hiding this comment.
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.
Quick104
left a comment
There was a problem hiding this comment.
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).
| /* 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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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:
backdrop-blur-noneis overridden on premiere badges (inline onweb/src/lib/upcomingEventPresentation.ts:39): all three callers hardcodebackdrop-blur-smwithoutcn(), and Tailwind v4 emits.backdrop-blur-smafter.backdrop-blur-none, sobackdrop-filter: blur(...)stays active.- Additional dimmed child under
text-primary:web/src/pages/ItemDetail/components/ScoreRow.tsx:18rendersRatingEntry(web/src/components/ratings/RatingEntry.tsx:31), which dims non-TMDB rating names ("IMDb", "RT", etc.) withopacity-75. On--background(#141417), that brings--primary-textdown 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). - No contrast assertions for the new tokens (inline on
web/src/lib/accentColor.ts:152): extendingweb/src/lib/accentColor.test.tswould catch regressions inmixToward/accentText.
AI disclosure: written by Gemini 4 Neon via T3 Code, read-only adversarial review.
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 — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Quick104
left a comment
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
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-primarynow resolves to a new--primary-texttoken. Tailwind 4 looks up--text-color-primarybefore--color-primary, so one line inapp.cssmoves everytext-primaryuse, 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.accentDeclarationssets--primary-textto 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-darkalready used. A second value targets high contrast's lighter surfaces, and the accent's high contrast rule inBrandingProviderswaps it in. Presets that already pass, such as amber, keep their color in normal mode.var(--primary)and now usestext-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.mdandweb/docs/design-system.mddescribe the new token, andaccentColor.test.tschecks 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-75inRatingEntry) 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
.text-primary{color:var(--primary-text,var(--primary))}, andbg-primaryandtext-primary-foregroundare unchanged.make lint-changedreports no Go changes.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
Council review
Rounds: 2, last reviewed c155203
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)
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
🤖 Generated with Claude Code
Note
Fix unreadable accent-colored text on Cinema Dark with new
--primary-texttokenaccentDeclarationsin accentColor.ts now computesprimary-textandprimary-text-high-contrastvalues 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.text-primarytoken in app.css uses--primary-textwhen set and falls back to--primary. TheapplyAccenthelper in BrandingProvider.tsx sets--primary-textfrom--primary-text-high-contrastwhen high contrast is active.text-primary.accentTextreturns 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.