Skip to content

fix(web): expose subtitle swatch selection to screen readers and forced colors - #5922

Open
Tobechukwu-Njoku wants to merge 2 commits into
Silo-Server:mainfrom
Tobechukwu-Njoku:fix/subtitle-swatch-a11y
Open

Tobechukwu-Njoku wants to merge 2 commits into
Silo-Server:mainfrom
Tobechukwu-Njoku:fix/subtitle-swatch-a11y

Conversation

@Tobechukwu-Njoku

@Tobechukwu-Njoku Tobechukwu-Njoku commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Tobechukwu Njoku

Problem

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

Other clients: Apple N/A (web settings page); Android N/A (web settings page); Roku N/A (web settings page)

In Settings > Subtitle appearance, the Font color, Outline color, and Background color swatch buttons do not expose which swatch is selected to screen readers, and forced-colors mode (Windows contrast themes) hides the swatches and their selection ring completely. This affects people using screen readers or contrast themes in the web app. This change exposes each palette as a radio group with checked state and keyboard arrow navigation, and keeps swatch colors and selection visible in forced colors.

The swatches previously rendered as plain buttons inside role="group" without aria-checked or aria-pressed, so assistive technology announced only each color's name. Under forced-colors: active, the browser overrode each swatch's inline background-color and stripped the box-shadow selection ring, leaving blank rows with no visible color or selection mark.

Approach

  • Exposed each swatch palette in web/src/pages/settings/SubtitleAppearanceSettings.tsx as role="radiogroup" with role="radio" swatches, case-insensitive aria-checked matching, roving tabIndex (omitted when disabled), and direction-aware arrow-key navigation with wrapping. This follows the radio-group pattern used by other mutually exclusive settings controls in the web app rather than toggle buttons with aria-pressed.

  • Marked swatch buttons with data-slot="color-swatch" and excluded them from the generic selected-radio rule in web/src/app.css, which would otherwise fill checked radios with Highlight and obscure the swatch color. Under @media (forced-colors: active), swatches keep their own color (forced-color-adjust: none), render a 1px solid CanvasText frame so dark and light swatches stay visible on either canvas, mark the checked swatch with a 3px solid Highlight border and an inner 2px Canvas gap (keeping the outer :focus-visible outline separate), and switch disabled borders to GrayText.

  • Added unit tests covering all three palettes for radio-group semantics, checked state, click and arrow-key selection, roving tabIndex, modifier-key handling, and disabled state.

  • Follow-up 4bbb0c48a: extracted ColorPalette into its own component. Subtitle settings dropped from 826 to 746 lines. Behavior and screenshots are unchanged.

Validation

  • Focused web unit tests for subtitle appearance: failed before the change on cdf344f9d, passed after on ec2bc83fc (4/4).

  • The full web unit test run had three timeouts. All three suites passed on isolated reruns.

  • Web ESLint, Prettier format check, TypeScript typecheck, production Vite build, and bundle budget check: passed.

  • Headless Chromium forced-colors check (normal mode, desktop dark/light forced colors, and mobile dark forced colors): confirmed normal-mode appearance is unchanged, and forced colors preserves swatch fills, CanvasText frames, Highlight + inner Canvas selection rings, and GrayText disabled borders.

  • On 4bbb0c48a, the size ratchet, bidi and case-collision checks, size-ratchet tests, all four subtitle appearance tests, focused lint and formatting, typecheck, production build, and bundle budget passed.

Evidence

Before (cdf344f9d) vs after (ec2bc83fc) in headless Chromium with forced-colors: active, showing the Font color, Outline color, and Background color palettes on Settings > Subtitle appearance.

Surface & theme Before (cdf344f9d) After (ec2bc83fc)
Desktop web, dark forced colors swatches and selection invisible swatch colors preserved, CanvasText border, Highlight + inner Canvas ring on selected
Desktop web, light forced colors swatches and selection invisible swatch colors preserved, CanvasText border, Highlight + inner Canvas ring on selected
Mobile web, dark forced colors swatches and selection invisible swatch colors preserved, CanvasText border, Highlight + inner Canvas ring on selected

Surface and build: Web UI (desktop and mobile) — Settings > Subtitle appearance (origin/main cdf344f9d before; fix/subtitle-swatch-a11y ec2bc83fc after).

Risks

None identified. Normal-mode swatch styling is unchanged, and the forced-colors rules apply only to [data-slot="color-swatch"].

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.

AI Disclosure

  • Harness: Antigravity (via T3 Code)
  • Tool(s): Antigravity, GitHub CLI, Chromium (headless)
  • Model(s): gemini-4-neon (low thinking for implementation, tests, and resumed draft and evidence verification)
  • Involvement: Fully AI-generated, human verification pending. The owner verified the original ec2bc83fc diff.
  • Adversarial review: Codex gpt-6.2-sol (low effort, T3 Code) approved ec2bc83fc and independently approved the extraction at 4bbb0c48a with no findings.

Note

Fix subtitle color swatch accessibility for screen readers and forced colors

  • Extracts the inline swatch picker from SubtitleAppearanceSettings.tsx into a reusable ColorPalette component in ColorPalette.tsx, with radiogroup/radio semantics, aria-checked state, and roving-tabindex arrow-key navigation with wrapping
  • The selected color now matches case-insensitively, and the first swatch gets the initial tab stop when no color matches
  • Adds forced-colors rules in app.css: swatches keep their own color with a CanvasText border, checked swatches get a thicker Highlight border, and disabled swatches use GrayText
  • Adds a test suite in SubtitleAppearanceSettings.test.tsx covering selection, tab stops, keyboard navigation, and disabled states
  • Risk: forced-colors styling no longer applies the generic checked-radio Highlight fill to swatches with data-slot="color-swatch" or radio-prefixed slots; verify no other swatch variants relied on that rule

Macroscope summarized 4bbb0c4.

…ed colors

Expose the subtitle color swatch palettes in SubtitleAppearanceSettings as
radiogroups with radio buttons, aria-checked state, roving tabindex, and
direction-aware arrow-key navigation. In forced colors, preserve each
swatch's color, frame every swatch with CanvasText, and mark the selected
swatch with a Highlight border and an inner Canvas gap (or GrayText when
disabled).

Co-Authored-By: gemini-4-neon <noreply@google.com>
@silo-triage silo-triage Bot added the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Dec 6, 2026
@silo-kody

silo-kody Bot commented Dec 6, 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 ❌

@coderabbitai

coderabbitai Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Subtitle color palettes now expose selected swatches through radio semantics, support arrow-key navigation, and use dedicated forced-colors styling for swatch colors and selection.

Changes: Subtitle color palette accessibility

Layer / File(s) Summary
Radio semantics and keyboard navigation
web/src/pages/settings/ColorPalette.tsx, web/src/pages/settings/SubtitleAppearanceSettings.tsx, web/src/pages/settings/SubtitleAppearanceSettings.test.tsx
The extracted ColorPalette component renders swatches as radios with checked state and roving tab indices. Unmodified arrow keys move selection and focus with wrapping. Tests cover selection, navigation, and disabled swatches.
Forced-colors swatch styling
web/src/app.css
Generic selected-radio styling excludes color swatches. Dedicated rules set swatch borders and show checked and disabled states in forced-colors mode.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: rhainland, quick104

Merge Risk: Minimal · up to 4bbb0

This change makes subtitle color swatches announce their selection to screen readers, support arrow-key navigation, and remain visible in forced-colors mode. It is a localized web UI change, and no actionable merge-blocking risk remains.

Security architecture risk: Minimal · up to 4bbb0

Keyboard and screen-reader users can now select subtitle colors through the existing settings page. Selecting a swatch still edits only the page draft; saving remains a separate action.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: exposing subtitle swatch selection to screen readers and forced-colors mode. The changeset adds radiogroup/radio semantics with checked state to the ColorPalette swatc…
Linked Issues check Passed [#5779] requires (a) screen-reader exposure of the selected subtitle color swatch and (b) a visible selected swatch in forced-colors mode. (a) Verified at head: `web/src/pages/settings/ColorPalette.ts…
Out of Scope Changes check Passed All changes sit in the subtitle appearance color palettes. The changes are: the ColorPalette component in ColorPalette.tsx, which is the extracted and ARIA-updated palette; the import swap and rem…
Description check Passed The description clearly relates to the changeset. It explains that the Subtitle appearance Font, Outline, and Background color swatch palettes are exposed as radio groups with checked state and arrow-…
Full details: Title check

Explanation

The title names the main change: exposing subtitle swatch selection to screen readers and forced-colors mode. The changeset adds radiogroup/radio semantics with checked state to the ColorPalette swatches, and adds forced-colors CSS rules for those swatches. The title is specific and accurate. It uses the conventional fix(web) prefix.

Full details: Linked Issues check

Explanation

[#5779] requires (a) screen-reader exposure of the selected subtitle color swatch and (b) a visible selected swatch in forced-colors mode. (a) Verified at head: web/src/pages/settings/ColorPalette.tsx (new file in the incremental diff, moved out of SubtitleAppearanceSettings.tsx) renders role="radiogroup" and each swatch as role="radio" with aria-checked={isSelected}. Matching is case-insensitive. Roving tabIndex is set, and it is undefined when disabled. Arrow keys move selection and focus with wrapping. The issue allows radio-group semantics, so (a) is met. (b) The forced-colors rules live in web/src/app.css. The incremental diff for app.css returned no readable text, and the whole-PR app.css diff against base was unavailable. The forced-colors behavior therefore rests on the AI-generated CSS summary and the PR's Evidence section, not on a readable diff. The summary describes [data-slot="color-swatch"] rules that keep swatch colors, add a CanvasText frame, and give the selected swatch a Highlight border with an inner Canvas gap. This matches the issue's expected behavior. Because the generic selected-radio rule is narrowed to exclude swatches, swatch selection depends on the new rule, which could not be read directly.

Full details: Out of Scope Changes check

Explanation

All changes sit in the subtitle appearance color palettes. The changes are: the ColorPalette component in ColorPalette.tsx, which is the extracted and ARIA-updated palette; the import swap and removal of the local palette in SubtitleAppearanceSettings.tsx; the data-slot="color-swatch" marker and forced-colors rules in web/src/app.css; and unit tests for those palettes. The extraction into a separate module supports the same palette objective and does not change unrelated behavior. The ColorPalette.tsx code imports only readingArrowKey and React hooks/types, and contains no unrelated functional change. The CSS change could not be read directly in this assessment. Its described scope is limited to swatch elements, so no unrelated change is shown.

Full details: Description check

Explanation

The description clearly relates to the changeset. It explains that the Subtitle appearance Font, Outline, and Background color swatch palettes are exposed as radio groups with checked state and arrow-key navigation, and that forced-colors styling keeps swatch colors and selection visible. It also names the changed files (SubtitleAppearanceSettings.tsx, app.css, the new tests, and the extracted ColorPalette component), lists validation steps, and includes before/after evidence. Some boilerplate, such as the unchecked checklist items and AI disclosure, does not affect relevance, and the description is not vague.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

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: 071169ea-6c65-4ff5-9d67-0101a36bea28
Commits

Reviewing files that changed from the base of the PR and between ec2bc83 and 4bbb0c4.

Files selected for processing: 2

  • web/src/pages/settings/ColorPalette.tsx
  • web/src/pages/settings/SubtitleAppearanceSettings.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@silo-triage silo-triage Bot added bug Something isn't working impact: usability Core flow broken or severely blocked priority: P2 Limited scope, workaround exists, or polish labels Dec 6, 2026
Move ColorPalette and ColorPaletteProps into their own module next to
SubtitleAppearanceSettings so the page stays under the 800-line size
ratchet (746 lines, down from 826) without changing behavior.

Co-Authored-By: gemini-4-neon <noreply@google.com>
@silo-kody

silo-kody Bot commented Dec 6, 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 ❌

⚠️ Note: some checks couldn't be completed in this run, so auto-approval (when enabled) was skipped. Check the details at https://kodus.siloserver.org/pull-requests and then comment @kody review on this PR to retry once the issue is resolved.

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: usability Core flow broken or severely blocked priority: P2 Limited scope, workaround exists, or polish size/L 200–499 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Subtitle color swatches don't expose which color is selected to screen readers or forced colors

1 participant