Repository navigation
fix(web): make the unchecked switch thumb visible in dark mode - #10477
deathemperor wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused one-line visual fix that improves unchecked switch contrast only in dark mode. It leaves switch behavior, state semantics, light-mode styling, and product defaults unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between acc0a219ea5bd88bf860d35e10f30cc651c84417 and 68ec96b. 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe switch thumb now uses the foreground color for unchecked switches in dark mode. No other behavior changes. ChangesSwitch styling
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Bug fix Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
In the default dark theme the switch thumb uses bg-background, which is the same colour as the page, and the unchecked track is an 8% white fill. An unchecked switch is therefore a faint pill with no visible knob, and a disabled one (64% opacity on top) disappears entirely — the Connections toggles were unreadable. Give the unchecked thumb the foreground colour under the dark variant only. Light mode, the checked state and the disabled opacity are unchanged; custom dark themes pick it up through the existing .dark variant. Claude Fable 5.1 via Claude Code
acc0a21 to
68ec96b
Compare
|
Thanks for this! We tried it in dark mode, and we prefer the current unchecked switch. The brighter thumb draws too much attention, with a lot of white on dark surfaces, and the current contrast is intentional. Closing for now. If you see a real visibility problem on a specific display or theme, please open an issue with a screenshot. |
What Changed
The switch thumb gets the foreground colour when the switch is unchecked in dark mode (
dark:data-unchecked:bg-foregroundon the thumb inapps/web/src/components/ui/switch.tsx). One class, nothing else touched: light mode, the checked state and the disabled opacity are unchanged, and custom dark themes pick it up through the existing.darkvariant.Surfaces: web and desktop (desktop renders the web UI). Mobile is unaffected, it uses its own native switch.
Why
In the default dark theme the thumb is
bg-background, which is the page colour, and the unchecked track is an 8% white fill. So an unchecked switch is a faint pill with no visible knob. A disabled one adds 64% opacity on top and vanishes. On Settings → Connections the Network access, Tailscale HTTPS and Publish agent activity toggles were unreadable on a dark monitor.Making the thumb readable is the smallest change that fixes it. The track is left as the theme intends (the dark theme deliberately relies on edges rather than milky fills), and the checked state already has a dark thumb on the primary colour.
UI Changes
Settings → Connections, default dark theme, disabled unchecked switch (web dev server, Chrome).
Full row:
Before

After

Checklist
Verified with
vp lint apps/web/src/components/ui/switch.tsxandvp run --filter @t3tools/web typecheck.Claude Fable 5.1 via Claude Code
Summary by CodeRabbit