Skip to content

editor: keep active connected tab Close actions visible in high contrast - #339957

Merged
Cherry Wang (chryw) merged 3 commits into
mainfrom
dev/cherwan/agents/hc-theme-tab-close-button-fix
Oct 6, 2026
Merged

Cherry Wang (chryw) merged 3 commits into
mainfrom
dev/cherwan/agents/hc-theme-tab-close-button-fix

Conversation

@chryw

@chryw Cherry Wang (chryw) commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #339858.

Connected editor tabs lost the active tab's Close action in high-contrast themes when workbench.editor.tabActionReserveSpace was disabled. Keep that action visible without changing Pill or Legacy tab behavior.

Changes

  • Preserve active Close visibility in both HC themes, including dimming in an unfocused editor group.
  • Keep reserved action slots transparent so they do not cover tab accents. In regular themes, preserve the rounded button's normal hover background and apply explicit action-color overrides to that button instead of a full-height rectangle.
  • Add missing HC scenarios and organize color fixtures by border customization, tab/action customization, fallback behavior, and continuity. Update the browser checks to use the new paths.

Testing

  1. Enable workbench.experimental.modernUI, set workbench.experimental.modernUIEditorTabStyle to connected, and set workbench.editor.tabActionReserveSpace to false.
  2. Open several saved, unmodified files. In Dark High Contrast and Light High Contrast, move the pointer away from the tabs: the active tab's Close action stays visible; clean inactive actions remain hidden until hover or keyboard focus.
  3. Split the editor into two groups. Confirm the active tab's action remains visible but dimmed in the unfocused group, and hover/focus makes it fully visible.
  4. Set workbench.editor.tabActionCloseVisibility to false and confirm no Close action appears. Restore it, then compare Pill tabs and Modern UI disabled to confirm their existing visibility behavior is unchanged.
  5. In regular dark and light themes, reserve action space and hover selected, active, and modified tabs. Only the rounded Close button gets a hover background; its surrounding slot remains transparent, and the dirty indicator does not move. Set distinct modernEditorTab.*ActionBackground overrides and confirm they color the rounded target.
  6. Open Component Explorer at editor/tabs/Colors and editor/tabs/Layout/ActionsUnreserved to inspect the renamed color scenarios and the close-visibility regression scene.

Validation

  • npm run compile-client — passed.
  • ./scripts/test.sh --run src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts — passed.
  • npm --prefix test/componentFixtures/playwright test -- editorTabBar.spec.ts --workers=2 — passed.
  • npm run stylelint --silent — passed.
  • git diff --check — passed.
  • Component Explorer rendering checks passed for the color, HC, and unreserved-action scenarios.

Visual evidence

Before and after in Dark High Contrast and Light High Contrast, with an unhovered clean active tab and action-space reservation disabled

Matched headless component-fixture captures: merge-base styling on the left, updated styling on the right. Both use Connected tabs with workbench.editor.tabActionReserveSpace: false.

Other pre-existing HC border and customized-background shoulder issues are deferred to separate work.

Cherry Wang (chryw) and others added 2 commits October 5, 2026 16:37
Scope the high-contrast override to connected tabs without changing Pill or Legacy action visibility, and expand high-contrast tab fixture coverage.\n\nFixes #339858\n\nCo-authored-by: Copilot <[email protected]>
Keep reserved action slots transparent while preserving rounded hover targets, explicit color overrides, and high-contrast visibility. Consolidate CSS state handling and organize the color fixtures by purpose.

Fixes #339858

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 00:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Theme-authored action colors are ignored by the new rounded-button styling.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes Connected tab Close-action visibility in high-contrast themes while preserving other tab styles.

Changes:

  • Keeps active Connected-tab actions visible and dims unfocused actions.
  • Makes reserved action overlays transparent while retaining button hover colors.
  • Expands and reorganizes tab fixtures and tests.
File Description
build/​lib/​stylelint/​vscode-known-variables.json Registers new CSS variables.
src/​vs/​workbench/​contrib/​modernUI/​README.md Documents action styling behavior.
src/​vs/​workbench/​contrib/​modernUI/​browser/​media/​tabs.css Updates action visibility and backgrounds.
src/​vs/​workbench/​contrib/​modernUI/​test/​browser/​modernUI.contribution.test.ts Tests visibility and reserved backgrounds.
src/​vs/​workbench/​services/​themes/​browser/​modernTabColorCustomizations.ts Emits action-color variables.
src/​vs/​workbench/​test/​browser/​componentFixtures/​editor/​tabs.fixture.ts Adds and reorganizes visual fixtures.
test/​componentFixtures/​playwright/​tests/​editorTabBar.spec.ts Updates fixture paths and color assertions.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 1f2e1f2e Current: 2c82158b

Changed (1)

chat/generatedImages/chatGeneratedImages/LoadingLifecycle/Light
Before After
before after

Added (6)

editor/tabs/Colors/BorderCustomizations/ConnectedMultiSelection/FocusedEditorGroup/Light

current

editor/tabs/Colors/BorderCustomizations/ConnectedMultiSelection/UnfocusedEditorGroup/Light

current

editor/tabs/Colors/ColorFallbacks/SelectedTopBorder/FocusedEditorGroup/Light

current

editor/tabs/Colors/ColorFallbacks/SelectedTopBorder/UnfocusedEditorGroup/Light

current

editor/tabs/Colors/ColorFallbacks/UnfocusedHoverAndDividers/Light

current

editor/tabs/Layout/ActionsUnreserved/Light

current

Removed (5)

editor/tabs/Colors/ConnectedLegacyBorders/ActiveGroup/Light

baseline

editor/tabs/Colors/ConnectedLegacyBorders/InactiveGroup/Light

baseline

editor/tabs/Colors/DerivedColors/Light

baseline

editor/tabs/Colors/SelectedBorderFallback/ActiveGroup/Light

baseline

editor/tabs/Colors/SelectedBorderFallback/InactiveGroup/Light

baseline

roblourens
roblourens previously approved these changes Oct 6, 2026
Recognize dedicated action colors supplied by themes as well as user overrides. Cover theme definitions, user precedence, and the default toolbar-hover fallback.

Addresses review feedback on #339957.

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

High contrast themes hide the close button on active tab

3 participants