Skip to content

fix(tab-bar): correct active-tab surface in light mode (#16283) - #16481

Closed
BorjaLL wants to merge 2 commits into
stablyai:mainfrom
BorjaLL:BorjaLL/fix-light-mode-tab-surface
Closed

BorjaLL wants to merge 2 commits into
stablyai:mainfrom
BorjaLL:BorjaLL/fix-light-mode-tab-surface

Conversation

@BorjaLL

@BorjaLL BorjaLL commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

In light mode the selected tab looked darker than the unselected ones, so the active tab appeared receded and an inactive tab looked selected. This makes the active tab read as active in both themes.

What Changed

The active tab used color-mix(in srgb, var(--foreground) X%, var(--card)) to highlight itself. In dark mode --foreground (#fafafa) is lighter than --card (#171717), so the mix lightens the active tab (correct). In light mode --foreground is #0a0a0a and --card is #fff (already max lightness), so the same mix darkens the active tab below the untouched-white inactive tabs (backwards). The bottom selection bar had the same problem at 60% mix.

Fix (tokens only, no new colors):

  • main.css: theme-scoped --tab-strip-active-surface / --tab-strip-inactive-surface. In light mode the mix moves to the inactive tab (active stays pure --card white); in dark mode it stays on the active tab exactly as before - same 6% magnitude, applied to the correct side per theme so active is always lighter than inactive.
  • drop-indicator.ts: tab classes read the new tokens; the active-indicator bar uses bg-ring (STYLEGUIDE.md's documented token for active selection halos, a fixed per-theme gray) instead of the color-mix, so it can't flip direction.

All three tab types (SortableTab, EditorFileTab, BrowserTab) share these helpers, so the fix applies uniformly.

Why

Per STYLEGUIDE.md, use existing tokens rather than inventing values. The bug was a color-mix formula that is only correct when --foreground is lighter than --card; scoping the surface tokens per theme fixes the direction without new color values.

Linked Issue

Fixes #16283

Visual Proof

Validated on a static HTML mockup reproducing the exact :root/.dark tokens and Tailwind classes (before/after, both themes), rendered in-browser: light-mode active tab is now the brighter one with a subtle ring-gray underline; dark mode is visually unchanged. Real-app before/after screenshots still to attach (@BorjaLL).

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Updated drop-indicator.test.ts assertions to the new tokens.

  • pnpm typecheck exit 0; oxlint src/renderer/src clean; vitest run on tab-bar = 49 files / 391 tests pass.

AI Disclosure

Implemented with Claude Code (Anthropic; Claude Sonnet). Root-cause analysis, the fix, and the tests were AI-generated and human-reviewed before opening.

Review

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer source, tests, fixtures, or docs are copied or translated.

Notes

Tokens only; no component structure change. Light and dark both verified against the styleguide's surface roles.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots for UI changes attached (mockup validated; real-app capture pending)
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path impact considered (or N/A)
  • pnpm typecheck, lint, tests pass locally (CI covers build)

Author

  • X / Twitter: @bo_ns_ai

@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: b5bc2309-4591-485a-987c-284edc523117

📥 Commits

Reviewing files that changed from the base of the PR and between b82efcc and 776ccba.

📒 Files selected for processing (2)
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/tab-bar/drop-indicator.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Added active and inactive tab-strip surface tokens to the shared theme for light and dark modes. Updated tab roots to use these tokens. Updated the active drop indicator to use bg-ring. Updated tests to verify the new tab surface and indicator classes.

Priority: ⬇️ Low

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the user impact, implementation, rationale, linked issue, testing, AI use, and checklist status. However, the required real-app before/after visual proof for this UI change is… Attach real-application before/after screenshots or a video showing both themes, and confirm the manual testing performed, including the tested platforms.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: correcting the active tab surface in light mode.
Linked Issues check ✅ Passed Issue #16283 requires the selected tab to appear lighter than the unselected tab in light mode, while preserving the dark-mode treatment. main.css defines theme-scoped --tab-strip-active-surface a…
Out of Scope Changes check ✅ Passed The reviewed changes stay within Issue #16283. They adjust tab surface tokens, the active-tab indicator, shared tab-state classes, and the related tests. These changes directly support the selected-ta…
Full details: Description check

Explanation

The description explains the user impact, implementation, rationale, linked issue, testing, AI use, and checklist status. However, the required real-app before/after visual proof for this UI change is still missing, and manual testing is not confirmed.

Full details: Docstring Coverage

Explanation

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

  • Fix all pre-merge checks with AI

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.

# Conflicts:
#	src/renderer/src/components/tab-bar/drop-indicator.ts
@nwparker

nwparker commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #36561, which fixes the built-in color defaults (WCAG AA pairs, light-mode active tab and the TOC scrollbar). Thank you for this PR, it shaped the design.

@nwparker nwparker closed this Nov 2, 2026
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.

[Bug] Wrong tab design in light mode

2 participants