Skip to content

Segmented: the selected segment shows in dark mode - #9

Merged
BLamy merged 1 commit into
mainfrom
fix/segmented-hit-target
Oct 17, 2026
Merged

BLamy merged 1 commit into
mainfrom
fix/segmented-hit-target

Conversation

@BLamy

@BLamy BLamy commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

The Notes list/tree switch (and every Segmented, Tabs and ToggleGroup in dark mode) drew its selected thumb in the card color, #1C1C1E, on a translucent gray track over black. It was nearly invisible, so switching views looked like the click hadn't worked.

A new --segment token fills the thumb: the card color in light (unchanged), and #636366 in the dark themes (default, workbench, sheet), as Apple's own segmented controls do.

Checked: typecheck, lint, unit tests, tokens and registry checks, and the a11y audit for segmented, tabs and toggle-group (no new violations).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Updated the selected indicators in segmented controls, tabs, and toggle groups to use a dedicated segment color.
    • Added a dark-theme segment color, with a fallback to the existing card color when no segment color is defined.

Its thumb was the card color (#1C1C1E) on a translucent gray track over black —
nearly invisible, so a switch looked like nothing happened. A --segment token
(card in light, #636366 in dark, as Apple's controls) now fills the thumb of
Segmented, Tabs and ToggleGroup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 510c0ad9-5361-48cc-9c33-aab8e12c94f4
📥 Commits

Reviewing files that changed from the base of the PR and between 8f6cd38 and b1c0e3a.

⛔ Files ignored due to path filters: 1
  • packages/ui/src/lib/tokens.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing: 6
  • packages/ui/src/components/segmented.tsx
  • packages/ui/src/components/tabs.tsx
  • packages/ui/src/components/toggle-group.tsx
  • packages/ui/src/theme.css
  • packages/ui/src/tokens.css
  • registry.json

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

📝 Walkthrough

The changes add a segment theme token with a card-color fallback, define its value in dark theme scopes and registry data, and use it for selection indicators in segmented controls, segmented tabs, and toggle groups.

Changes: Segment indicator color

Layer / File(s) Summary
Define segment theme color
packages/ui/src/tokens.css, packages/ui/src/theme.css, registry.json
The color-segment token resolves to --segment and falls back to --card. Dark theme scopes set --segment to #636366.
Apply segment color to indicators
packages/ui/src/components/segmented.tsx, packages/ui/src/components/tabs.tsx, packages/ui/src/components/toggle-group.tsx
The selection indicators use bg-segment through segmentIndicator. The underline tab indicator remains unchanged.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to b1c0e

The selected indicators use the shared segment color, with a card-color fallback and dark-theme values. The source wiring is in place, and no actionable merge risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (3 skipped: 3 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: the selected segment becomes visible in dark mode. It is concise and directly related to the token and indicator updates.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@BLamy
BLamy merged commit 06aefda into main Oct 17, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant