Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): switched-off controls stay visible in dark mode #14984

MergedGigioxx(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/14984/headmerged by juliusmarminge View on GitHub

Fixes #14979.

In dark mode an unchecked switch is close to invisible. Its thumb is bg-background, the same color as the page, and the track is an 8% white fill. On Settings → Connections it gets worse. A switched-off environment row is drawn at 60% opacity, switch included, so an enabled-but-off switch looks the same as a disabled one. The reporter read both saved environments as unavailable and lost track of their remote threads.

The fix has two parts:

  • Switch: an unchecked thumb in dark mode uses muted-foreground, the theme's secondary text gray, instead of the page color. Light mode, the checked state, and the disabled opacity are unchanged. #10477 tried a foreground (near-white) thumb and was closed because it pulled too much attention. This uses the same gray as the row's "Off" text, so the knob reads as a control without adding white to dark surfaces.
  • EnvironmentRow: a switched-off row now dims only the icon, name, and subtitle. The switch and menu stay at full strength, so "off" and "unavailable" look different.

Dark theme, web dev server, Chrome:

BeforeAfter
Connections, switched-off environmentConnections beforeConnections after
General, any unchecked switchGeneral beforeGeneral after

Reproduced with a worktree dev server and a second local server paired as a remote environment, then switched off. After the change I checked the same row switched on (unchanged blue switch) and the disabled "Network access" switch (still dimmed by its own disabled opacity). vp fmt --check and vp lint on both files and vp run --filter @t3tools/web typecheck pass. Desktop renders the same web UI. Mobile uses its own native switch and is not affected. I did not check custom app themes.

Created with Claude Opus 5.5 in Claude Code.

Fixes #17874.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 1e1361c

      Macroscope's review found this PR approvable — This is a small, self-contained web UI styling fix that improves dark-mode switch visibility and distinguishes switched-off rows from disabled controls. It does not alter control semantics, stored settings, product defaults, or deployment behavior.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. juliusmarminge added labelsmacroscope-review

    4. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 646d227c-8df8-4208-9af3-b6c79359a1a7

      📥 Commits

      Reviewing files that changed from the base of the PR and between 73a6984012b913c2c26f15f8da9ad5538f49c356 and 1e1361cdfaf3f00fcc4e5b3c6cf7da0fbb25791e.


      📒 Files selected for processing (2)
      • apps/web/src/components/settings/EnvironmentRow.tsx
      • apps/web/src/components/ui/switch.tsx

      🚧 Files skipped from review as they are similar to previous changes (1)
      • apps/web/src/components/settings/EnvironmentRow.tsx

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



      📝 Walkthrough

      Walkthrough

      Environment settings now dim the machine icon and identity content without dimming row controls or details. The unchecked switch thumb uses a muted foreground background in dark mode.

      Changes

      Settings appearance

      Layer / File(s)Summary
      Environment row and switch appearance
      apps/web/src/components/settings/EnvironmentRow.tsx, apps/web/src/components/ui/switch.tsx
      When dimmed is true, the machine icon and identity block use reduced opacity instead of the entire row. The unchecked switch thumb uses a muted foreground background in dark mode.

      Priority: ➖ Normal

      Estimated code review effort: 1 (Trivial) | ~5 minutes

      Change: Bug fix · Severity of issue fixed: Low

      Suggested reviewers: juliusmarminge


      Merge Risk: ⚪ Minimal · up to 1e136

      The changes improve visibility of unchecked switches and keep switched-off environment controls prominent. The supplied default-dark contrast evidence exceeds the cited target, and no actionable merge risk remains.

      Pre-merge checks | Passed 3 | Inconclusive 1

      ❌ Failed checks (1 inconclusive)

      Check nameStatusExplanationResolution
      Linked Issues checkInconclusiveFor [#14979], EnvironmentRow.tsx dims only the icon and identity block when dimmed is true. Its switch and menu remain in the full-strength controls container. switch.tsx changes only the unchec…Provide reviewable evidence that the default dark-theme unchecked switch meets the 3:1 non-text contrast requirement, such as computed colors and a contrast calculation or an equivalent automated accessibility test.
      ✅ Passed checks (3 passed)
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main dark-mode visibility fix for switched-off controls.
      Description checkPassedThe description covers the problem, implementation, linked issues, screenshots, verification steps, limitations, and agent attribution. It does not explicitly document maintainer approval or explain w…
      Out of Scope Changes checkPassedThe reviewed changes are limited to the shared switch thumb styling and the environment-row dimming scope. Both changes directly support [#14979] and [#17874]. No unrelated behavior or files appear in…

      Full details: Linked Issues check

      Explanation

      For [#14979], EnvironmentRow.tsx dims only the icon and identity block when dimmed is true. Its switch and menu remain in the full-strength controls container. switch.tsx changes only the unchecked dark-mode thumb to muted-foreground. These changes address the requested distinction between off and unavailable controls. For [#17874], the shared switch receives a more visible unchecked thumb, but the reviewed evidence does not provide the rendered token values or a contrast measurement. The required 3:1 control contrast cannot be established from the class names alone.


      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.
    5. This is definitely needed! I spent almost an hour trying to figure out why one PC couldn't connect to another. And then I finally realized something was simply not toggled on, when I thought it was completely disabled. I didn't even see the toggle!

      image
    6. juliusmarminge merged this8a94807

    7. juliusmarminge closed this

Sign in to join this conversation.