Skip to content

Modern UI: Keep connected editor tab widths stable at the right edge - #336885

Open
na2co3 (na2co3-ftw) wants to merge 4 commits into
microsoft:mainfrom
na2co3-ftw:fix/modern-ui-connected-tab-last-width
Open

na2co3 (na2co3-ftw) wants to merge 4 commits into
microsoft:mainfrom
na2co3-ftw:fix/modern-ui-connected-tab-last-width

Conversation

@na2co3-ftw

Copy link
Copy Markdown

Problem

In Modern UI with conected tabs, selecting the last tab narrows its background to make room for the terminal shoulder.
This makes the hover and active areas inconsistent and can cause the modified indicator to extend beyond the active tab surface.

The hover and active areas of the last tab:
スクリーンショット 2026-09-19 221941

When workbench.editor.highlightModifiedTabs is enabled:
スクリーンショット 2026-09-19 222028

Fix

  • Keep the active tab background at its full width.
  • Reserve space for the terminal shoulder with a margin on the last tab.
  • Preserve that space when tabs wrap, so wrapping and editor-action clearance remain stable.
スクリーンショット 2026-09-20 005254

Clipping Regression Test Update

connected-tab-right-edge used to shrink .tab-fill by 5px. Clearing clipping during a dirty-state update therefore changed the fill bounds, which the existing regression test used to distinguish stale geometry from rebuilt geometry.

This PR instead reserves the terminal shoulder with tab margin-right, so clearing the clipping class no longer changes fill bounds. The test now verifies the actual contract directly: dirty and capability updates clear stale clipping geometry, and the next layout rebuilds it.

Reserve the terminal shoulder outside the active tab fill instead of shrinking the fill at the right edge.
Update connected-tab layout test inputs and expectations for the additional 5px terminal shoulder space.
Update the connected clipping regression test to assert invalidation and rebuild directly since `connected-tab-right-edge` invalidation no longer changes the fill bounds.
Copilot AI balanced review requested due to automatic review settings September 19, 2026 15:59

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

The selector misses final tabs followed by an add-tab control, and the new !important violates CSS conventions.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Keeps connected tab surfaces full-width while reserving space for terminal shoulders.

Changes:

  • Replaces fill shrinking with tab margins.
  • Preserves wrapped-tab action clearance.
  • Updates clipping and layout regression tests.
File Description
multiEditorTabsControl.test.ts Updates geometry tests and adds wrapped-margin coverage.
modernUI.contribution.test.ts Verifies stable tab and fill bounds.
connectedEditorTabs.css Reserves shoulder space using margins.

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

Comment thread src/vs/workbench/contrib/modernUI/browser/media/connectedEditorTabs.css Outdated
Remove `!important` from the Modern UI wrapped-tab margin rule and align the
Modern UI selector with the base wrapped-tab rule in multieditortabscontrol.css.

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

🟢 Approval recommended

The CSS behavior and regression tests consistently implement stable connected-tab geometry.

Review effort: Balanced
Findings: None

Resolved since last review (2)

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.

4 participants