Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Keyboard focus indicators disappear in Windows contrast themes #47762

Openakj(GitHub profile, opens in a new tab) opened this issue 0 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Turn on a Windows contrast theme (Settings → Accessibility → Contrast themes), or enable forced-colors: active emulation in Chromium DevTools.
  2. Open T3 Code in the web or desktop app.
  3. Press Tab to move keyboard focus through buttons, switches, toggles, select dropdowns, text inputs, sidebar thread rows, and the Appearance settings sliders.
  4. In a normal theme as well, press Tab into the chat composer editor, a filled primary button, and a checked switch.

Expected behavior

Every interactive control should show a clear, high-contrast keyboard focus indicator in both Windows contrast themes and normal themes, meeting WCAG 2.1 SC 2.4.7 (Focus Visible, which requires a clearly visible focus indicator) and SC 1.4.11 (Non-text Contrast, at least 3:1).

Actual behavior

A low vision user who navigates with a keyboard in a Windows contrast theme (a system high-contrast mode, known in CSS as forced-colors) is likely to see no focus indicator at all on most controls. This came up in a low vision audit prompted by a user who found highlighting hard to see; we don't yet know whether that user runs a Windows contrast theme.

Most shared UI primitives strip the browser's focus outline (outline-none) and draw keyboard focus using a CSS box-shadow (a decorative shadow effect, via Tailwind's focus-visible:ring-* utilities). Windows contrast themes strip box-shadow rules, leaving nothing visible when these controls receive keyboard focus. The settings sliders also set outline: none on :focus-visible; although index.css already has a @media (forced-colors: active) block that reverts the slider track and thumb, it does not restore the focus outline. By contrast, checkbox.tsx and radio-group.tsx use a real focus-visible:outline-2, which survives forced colors.

Two closely related focus gaps also affect normal themes:

  • Chat composer: The TipTap editor sets outline: none on :focus, and the surrounding ComposerSurface adds no visual change when keyboard focus is inside it.
  • Filled primary buttons and checked switches: Both draw an inset focus-visible:ring-ring over a bg-primary background, where --ring is defined as var(--primary) — drawing the same colour on top of itself and leaving little visible change.

Unverified: Actual rendering under Windows contrast themes has not been checked in the running app yet; verify with a real Windows contrast theme or Chromium DevTools forced-colors: active emulation.

Where it comes from

  • apps/web/src/components/ui/button.tsx:9 — outline-none with focus-visible:ring-* (and filled primary bg-primary at line 46).
  • apps/web/src/components/ui/switch.tsx:14 — outline-none with focus-visible:ring-* over data-checked:bg-primary.
  • apps/web/src/components/ui/toggle.tsx:7 — outline-none with focus-visible:ring-*.
  • apps/web/src/components/ui/select.tsx:23,32,34 — outline-none with focus-visible:ring-*.
  • apps/web/src/components/ui/input.tsx:22,64 — outline-none on the input and has-focus-visible:ring-[3px] on the wrapper.
  • apps/web/src/components/sidebar/SidebarThreadRow.tsx:1141 — outline-none with focus-visible:ring-2.
  • apps/web/src/index.css:1085-1117 — .settings-slider:focus-visible sets outline: none and draws thumb focus with box-shadow; the @media (forced-colors: active) block at lines 1101-1117 reverts track and thumb styles without restoring outline.
  • apps/web/src/index.css:2603-2606 and apps/web/src/components/chat/ComposerSurface.tsx — .composer-tiptap:focus removes the outline and ComposerSurface has no focus-within state.
  • apps/web/src/index.css:1195 — --ring: var(--primary).
  • Working reference in this repo: apps/web/src/components/ui/checkbox.tsx:6 and apps/web/src/components/ui/radio-group.tsx:20 use focus-visible:outline-2.

Suggested direction

  • Replace outline-none + box-shadow focus rings in the shared primitives with a real CSS outline (either a transparent outline via outline-hidden that forced colors turns visible, or focus-visible:outline-2 as in checkbox.tsx and radio-group.tsx), and restore outline on .settings-slider:focus-visible under forced colors.
  • Add Highlight-coloured outlines for focus and selected/highlighted states inside @media (forced-colors: active).
  • Add a visible focus-within indicator on ComposerSurface.
  • Use a contrasting focus ring colour or outer offset on filled primary buttons and checked switches.

Impact

Major degradation or frequent failure

Version or commit

0.1.13, main @ ca36afaeb1d

Environment

Web and desktop (shared apps/web UI). Found by reading the source at ca36afaeb1d; actual rendering under Windows contrast themes (forced-colors: active) has not been measured in the running app. Mobile was not checked (it does not use these components).

Logs or stack traces

No response

Screenshots, recordings, or supporting files

No response

Workaround

None in Windows contrast themes; keyboard users cannot reliably see which control is focused.

Drafted by Gemini 4 Neon and reviewed by Claude Opus 5.5 in T3 Code.

  1. akj(GitHub profile, opens in a new tab) added labelsbug

  2. akj(GitHub profile, opens in a new tab) added labelsneeds-triage

Sign in to join this conversation.