Repository navigation
fix(appearance): changed divider colors also paint workspace splits - #37342
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit details
No actionable comments were generated in the recent review.
|
337cfcf to
fa60b8b
Compare
Co-authored-by: mmarabel <mmarabel@users.noreply.github.com>
fa60b8b to
4556d9b
Compare
Summary
Settings → Appearance → Dark/Light Divider Color says it controls "the split divider line between panes", but it only painted splits inside a terminal tab. The workspace tab-group split (terminal | editor, stacked groups) always used the
--split-dividertoken.Now, when a divider color is changed from its default, the tab-group split uses it too. At the default nothing changes.
How "changed" is detected: the stored value is compared (case-insensitively) with the shipped default (
#3f3f46dark /#d4d4d8light). No new setting, schema change or migration.Precedence: user setting → theme token
--split-divider→ built-in 3:1 color.useSplitDividerSettingsets--split-divider-settingon:rootonly when the color differs from its default and is a valid CSS color. Otherwise it removes the property. The split readsvar(--split-divider-setting, var(--split-divider)), so a plugin theme's inline--split-dividerstill wins over the built-in color.Which slot (dark or light): the same one the terminal panes use (
selectTerminalTheme(...).useLightVariant). With "Use separate light theme" off, Settings shows only the dark field and the panes use it, so the split follows it too.Builds on #14893 by @mmarabel. That PR added separate tab-group divider settings; this version reuses the existing divider settings instead, with no new keys.
Closes #14887
Visual proof
Dark divider set to
#ef4444, light divider set to#2563eb. The "before" shots come from the same profile running origin/main's code.At the default settings the computed split color is unchanged:
rgb(113,113,122)dark andrgb(134,134,144)light, both before and after.--split-divider-settingis not set.Merge-risk assessment: Low
var()fallback.CSS.supports('color', …)and fall back to the theme or built-in color.Negative user-facing tradeoffs
#171717) will now see that color on the workspace split as well. It may have less contrast on--cardthan the built-in 3:1 default. This is what [Feature]: Make the workspace tab-group split divider color configurable #14887 asks for, and resetting the setting restores the default.--split-divider-hover. A custom divider color does not tint the hover state.Validation
pnpm tc:webpasses.oxlintandoxfmtpass on the changed files.pnpm test src/renderer/src/app-shell/use-document-appearance.test.tsx src/renderer/src/lib/terminal-theme.test.tspasses (26 tests).ORCA_BACKGROUND_LAUNCH=1) with a throwaway userData and HOME, driven over CDP. Checked computed::aftercolors of.tab-group-split-resize-handle:#3F3F46) also set nothing.--split-dividerwith the setting at default: the theme color shows. With a custom setting: the setting wins.gpt-6.1-sol, xhigh). Both flagged choosing the slot from the app mode instead of the terminal slot; fixed. Codex also flagged lowercasing breaking a case-sensitivevar(--X)value; fixed (the value is lowercased only for the default comparison).Perf
Scanned with the perf-scan skill: the diff and the
useDocumentAppearancesubscriber path.selectTerminalThemebeing a few string comparisons, plus one effect keyed on[color, light].setProperty/removePropertycalls for--split-divider-setting) and 0 style recalcs. Changing the divider color caused 1 effect run and about 16 style recalcs totalling about 7 ms. Main also repaints the terminal panes on that same change, and it is a user-driven settings action.