fix(web): make the active Standard / Fast option clearly visible in dark mode #41917
Closedzs-andy(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/41917/headopened View on GitHubzs-andy(GitHub profile, opens in a new tab) linked this to fix #41864
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
juliusmarminge added labelstakeover:in-progress
juliusmarminge added labelstakeover:blocked
juliusmarminge removed labelstakeover:in-progress
- @@ -148,0 +228,21 @@228+ "--foreground": "#f2eaf5",229+ "--muted-foreground": "#b8a6bf",230+ } as React.CSSProperties)231+ : undefined232+ }233+ >234+ <ComposerPickerFooter235+ traits={traits}236+ runtimeMode="full-access"237+ runtimeModeOptions={[]}238+ onRuntimeModeChange={() => {}}239+ />240+ </div>241+ );242+}243+244+it.each([245+ ["default dark", false],246+ ["dark purple theme", true],247+] as const)(248+ "renders a clearly visible active state on the Standard / Fast selector in %s",@@ -148,0 +256,21 @@256+257+ const selectedBg = effectiveBackground(standard);258+ const unselectedBg = effectiveBackground(fast);259+ const selectedStyle = getComputedStyle(standard);260+ const unselectedStyle = getComputedStyle(fast);261+ const selectedBorder = compositeOver(selectedStyle.borderTopColor, unselectedBg);262+ const selectedText = compositeOver(selectedStyle.color, selectedBg);263+264+ expect(Number(selectedStyle.fontWeight)).toBeGreaterThan(Number(unselectedStyle.fontWeight));265+ expect(Number.parseFloat(selectedStyle.borderTopWidth)).toBeGreaterThanOrEqual(1);266+ expect(contrastRatio(selectedBg, unselectedBg)).toBeGreaterThanOrEqual(1.6);267+ expect(contrastRatio(selectedBorder, unselectedBg)).toBeGreaterThanOrEqual(2.0);268+ expect(contrastRatio(selectedText, selectedBg)).toBeGreaterThanOrEqual(7.0);269+270+ await userEvent.click(screen.getByRole("radio", { name: "Fast" }));271+ await expect272+ .element(screen.getByRole("radio", { name: "Fast" }))273+ .toHaveAttribute("aria-checked", "true");274+ expect(275+ contrastRatio(effectiveBackground(fast), effectiveBackground(standard)),276+ ).toBeGreaterThanOrEqual(1.6);
Pushedaa05d0c
zs-andy(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.



Walkthrough
The composer footer now uses a shared segmented-group style for the speed and Ultracode controls. Browser tests check the Standard/Fast selector’s selected state and text readability in dark, custom dark-purple, and light themes.
Changes: Composer selector styling
apps/web/src/components/chat/ComposerModelEffort.tsx,apps/web/src/components/chat/ComposerModelEffort.browser.test.tsxEstimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarmingeMerge Risk:
Moderate · up to
6176aThe styling change should make the active Standard / Fast option easier to see in dark mode. The new browser test fails CI because it measures colors during a 150 ms transition, so the PR cannot merge until the assertion waits for the settled colors. The runtime risk is small, since only class names change. The tests also conflict with the repository's guidance to prove visual fixes with before/after captures.
Pre-merge checks:
4
#41864requires the active Standard / Fast segment to be visibly distinct in dark mode, using a contrasting background or outline, with both labels readable. The PR summary and r…#41864. It has a Change section that lists …Full details: Title check
Explanation
The title names the change (dark-mode visibility of the active Standard / Fast option) and the scope (web). It follows conventional commit form and matches the changeset's main purpose: a more visible active segment in the footer control.
Full details: Linked Issues check
Explanation
Directly linked issue
#41864requires the active Standard / Fast segment to be visibly distinct in dark mode, using a contrasting background or outline, with both labels readable. The PR summary and raw summary report these code changes in ComposerModelEffort.tsx (FOOTER_SEGMENT_GROUP and FOOTER_SEGMENT, used by SpeedControl and UltracodeControl): a bordered, recessed dark track; a checked segment with a visible border, a stronger background fill (bg-background in light mode, dark:data-checked:bg-foreground/20 in dark mode), medium font weight, and a rounded pill. The PR also adds Chromium browser tests (ComposerModelEffort.browser.test.tsx) that check fill, border, and text contrast in dark, dark purple, and light themes, and they report that the tests fail on main and pass after the fix. The issue names a checkmark only as an example ('such as'), so its absence does not fail the requirement. Limits: the git diff tool could not read changed blobs in this checkout, so the class names and test contents are taken from the supplied PR summary, not from a read of the diff. Live verification in the Windows desktop app was not performed; the issue's own screenshot environment is not reproduced.Full details: Out of Scope Changes check
Explanation
All changes fall in apps/web/src/components/chat/ComposerModelEffort.tsx (footer segment styling for SpeedControl and UltracodeControl) and its new browser test file ComposerModelEffort.browser.test.tsx. The styling changes directly address the segmented control state visibility in
#41864, and the tests verify that behavior. The summary reports no changes to exported declarations. No unrelated files are reported. The diff tool was unavailable for the changed blobs, so this verdict relies on the supplied file-level summary.Full details: Description check
Explanation
The description follows the repository template closely. It has a Problem section that explains the low-contrast active segment in dark mode and links issue
#41864. It has a Change section that lists the edited style constants and the visual intent. It has a Scope section that states this is a CSS-only bug fix and links the issue. It has a Verification section with before/after screenshots for three themes, the commands run and their results, and a note that the Windows desktop app was not checked live. The template asks for the agent model and harness at the end, and the author supplied that (Gemini 4 Neon in T3 Code). The content is specific and complete enough to review.Finishing Touches
Generate unit tests (beta)
Fix failing CI checks