Pick tab bar text color by WCAG contrast
Tab bar text chose black or white with a gamma-space brightness cutoff at 0.5. Saturated mid-tone backgrounds such as #E44330 (Hot Dog Stand) were called dark and got white text at 3.2:1, where black reads at 5.4:1. The cmux sidebar already picks by WCAG contrast, so the sidebar and tab bar disagreed on the same background.
isBonsplitLightColor now compares WCAG contrast of black and white against the relative luminance. It also drives the hover and active-tab shading direction, which now agrees with the text.
Testing: swift test, 231 tests pass, including new TabBarTextSchemeTests (red takes dark text, dark green light text, neutral light and dark unchanged). Used by https://github.com/manaflow-ai/cmux/pull/15112, where a sweep of all 463 built-in themes found this.
🤖 Generated with Claude Code
Summary by cubic
Picks tab bar text color by WCAG contrast instead of a gamma-space brightness cutoff, so saturated mid-tone backgrounds like #E44330 now get the more readable text color and the tab bar matches the host sidebar's choice.
- Adds
TabBarTextSchemeTestscovering red, dark green, and neutral backgrounds. - Hover and active-tab shading now follow the same contrast-based direction as the text.
- The Cmd-hold shortcut-hint pill now uses an opaque palette chosen by the same rule, so a light theme in a dark window no longer shows a dark pill with dark text.
Summary by CodeRabbit
- Bug Fixes
- Improved tab bar text contrast on colored backgrounds, including saturated red and dark green, while preserving expected colors on light and dark neutral backgrounds.
- Visual Updates
- Shortcut-hint pills now adapt to the tab bar’s appearance, falling back to the system color scheme when needed.