Repository navigation
Editor: refine connected document tabs and high-contrast document wells - #335605
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Four review findings remain, including three moderate issues and one nit.
Pull request overview
This PR refines Modern UI editor tabs with configurable pill/connected styles, connected document wells, improved sizing, theming, and high-contrast support.
Changes:
- Adds connected-tab layout, labels, actions, and responsive sizing.
- Adds tab-style configuration and high-contrast theme integration.
- Expands tests, fixtures, documentation, bundled themes, and build resources.
File summaries
| File | Reviewed changes |
|---|---|
src/vs/workbench/test/browser/parts/editor/multiEditorTabsControl.test.ts |
Layout and accessibility tests |
src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts |
Bundled fixture theme resources |
src/vs/workbench/test/browser/componentFixtures/editor/editorTabBar.fixture.ts |
Tab fixtures and galleries. Nit (1 vote): modernEditorTab.* colors are no longer exercised by the connected default. |
src/vs/workbench/test/browser/componentFixtures/editor/editorTabBar.fixture.css |
Fixture state styling |
src/vs/workbench/services/themes/browser/modernTabColorCustomizations.ts |
Theme color customization mapping |
src/vs/workbench/services/layout/browser/layoutService.ts |
Tab-style setting constants |
src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts |
Contribution and theming tests |
src/vs/workbench/contrib/modernUI/README.md |
Connected-tab documentation |
src/vs/workbench/contrib/modernUI/browser/modernUI.contribution.ts |
Setting and window integration |
src/vs/workbench/contrib/modernUI/browser/media/tabs.css |
Shared tab and high-contrast styling. Moderate (1 vote): the selected stroke is not restored for an active multi-selected tab. |
src/vs/workbench/contrib/modernUI/browser/media/connectedEditorTabs.css |
Connected wells and high-contrast styling. Moderate (1 vote): the editor frame can disappear in high contrast when tabs are none or single. |
src/vs/workbench/contrib/modernUI/browser/connectedEditorTabs.ts |
Connected surface theming |
src/vs/workbench/browser/workbench.contribution.ts |
Tab-style setting registration |
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts |
Connected-tab layout and label sizing. Moderate (1 vote): badge width measurement can reserve zero space for content-only pseudo-elements. |
src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css |
Tab fill elements |
src/vs/workbench/browser/parts/editor/editorTabsControl.ts |
Connected-tab height handling |
src/vs/workbench/browser/labels.ts |
Label suffix forwarding |
extensions/theme-defaults/themes/light_vs.json |
Light classic palette updates |
extensions/theme-defaults/themes/light_modern.json |
Light Modern palette updates |
extensions/theme-defaults/themes/dark_vs.json |
Dark classic palette updates |
extensions/theme-defaults/themes/dark_modern.json |
Dark Modern palette updates |
extensions/theme-defaults/themes/2026-light.json |
Light 2026 palette updates |
extensions/theme-defaults/themes/2026-dark.json |
Dark 2026 palette updates |
build/rspack/rspack.serve-out.config.mts |
Theme JSON loading |
build/lib/stylelint/vscode-known-variables.json |
Connected-tab CSS variable registration |
Review details
Suppressed comments (4)
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts:2123
- Decoration badges are generated with
contentand color only, so their pseudo-element normally has no explicitwidth; parsingbadge.widthcan therefore contribute 0 for the badge glyph. Because this value feeds the tab's minimum width, a fixed/shrink connected tab can let the badge consume space needed by the ellipsis or action column, breaking the identity guarantee. Measure the badge's intrinsic content (or otherwise reserve its rendered width) instead of relying only on a CSS width declaration.
const badge = label.classList.contains('monaco-decoration-badge') ? getWindow(label).getComputedStyle(label, '::after') : undefined;
const badgeWidth = badge ? (parseFloat(badge.width) || 0) + (parseFloat(badge.marginLeft) || 0) + (parseFloat(badge.marginRight) || 0) : 0;
src/vs/workbench/contrib/modernUI/browser/media/connectedEditorTabs.css:10
- In high-contrast mode this hides the editor part's only frame whenever connected tabs are enabled, including
workbench.editor.showTabs: "none"and"single". The replacement frame below is only emitted by selectors requiring.title.tabs(lines 28–45), so those layouts have no inner stroke and lose the contrast/focus boundary. Keep the outer HC stroke when no multi-tab title exists, or add an equivalent state class/frame for those layouts.
.modern-ui.modern-ui-connected-editor-tabs.monaco-workbench:is(.hc-black, .hc-light) .part.editor:not(.modal-editor-part) {
border-color: transparent !important;
--modern-ui-floating-card-stroke-color: transparent;
src/vs/workbench/contrib/modernUI/browser/media/tabs.css:825
- In high-contrast themes the shared rule above suppresses the tab outline, but this connected branch restores
contrastActiveBorderonly for.selected:not(.active). An active tab that is also multi-selected therefore has only the ordinary connected well border and is visually indistinguishable from an active-only tab; include.active.multi-selectedhere as the non-connected branch does, or otherwise restore the selected stroke.
:is(.hc-black, .hc-light).modern-ui-tabs.monaco-workbench.modern-ui-connected-editor-tabs .part.editor > .content .editor-group-container > .title .tabs-and-actions-container .tabs-container > .tab.selected:not(.active):not(:focus) > .tab-fill,
src/vs/workbench/test/browser/componentFixtures/editor/editorTabBar.fixture.ts:779
- These fixtures inject
modernEditorTab.*colors, butrenderEditorTabBarFixturenow defaultseditorTabStyletoconnected. Connected styling intentionally replaces the active/inactive fills with the editor surface/strip colors, andmodernEditorTab.activeBackgroundis only meaningful for pill tabs, so theThemeColorsfixtures no longer exercise the colors they are named for. Render this helper witheditorTabStyle: ModernUIEditorTabStyle.Pill(or add separate connected-color coverage).
modernUI: true,
colorCustomizations: getModernEditorTabColorCustomizations(ctx.theme),
});
- Files reviewed: 25/25 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
e2c41fa to
66c40e9
Compare
|
Addressed all four findings from the review:
Published the signed feedback fix in 66c40e9, rebased onto main at d20c17c, using an explicit force-with-lease. Validation: 96 unit tests pass; full-PR scoped hygiene passes (27 paths requested, 19 checked); 135 geometry/theme fixtures cover 330 states; 8 additional review-follow-up captures render without errors. The PR description now shows 185 distinct images inline, including the new HC selection/focus, Pill-color, and intrinsic-badge evidence. Every hosted image was publicly fetched and SHA-256 verified. No collapsed image sections or report-download instructions remain. |
Screenshot ChangesBase: The screenshot report exceeds GitHub's comment size limit. View the full report in the workflow summary. |
Prevent additional tab themes from leaking colors into later fixtures sharing the same light or dark scheme. Cover theming participants and nested editor variables in both installation orders; retain the existing screenshot baselines. Refs #335605 Co-authored-by: Copilot <[email protected]>
|
CI fixes are verified on 08c5197. Screenshots & Tests and the complete Code OSS cross-platform run pass.
All 32 completed PR checks pass; only the separate VS Code PR Check remains pending. The PR remains draft. Its inline review retains all 185 images and now includes the final CI evidence. |
08c5197 to
1cd61e6
Compare
Prevent additional tab themes from leaking colors into later fixtures sharing the same light or dark scheme. Cover theming participants and nested editor variables in both installation orders; retain the existing screenshot baselines. Refs #335605 Co-authored-by: Copilot <[email protected]>
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
There was a problem hiding this comment.
🟡 Changes recommended
The fixture matrix duplicates a theme and the new stylesheet unnecessarily escalates the cascade with !important.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 31/31 changed files
- Comments generated: 2
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
There was a problem hiding this comment.
🔵 Needs a closer look
Left-edge automatic reveal can still clip the selected tab’s shoulder, contrary to the documented reveal behavior.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts:2418
- Automatic reveal only budgets the right shoulder. For a non-first tab revealed against the left viewport edge, the later scroll target starts at
fillLeft, so the left shoulder remains clipped even though the documented contract promises the complete shoulder. Please include the left shoulder in both this fit calculation and the left-side reveal target, while preserving the first-tab/row-start exception.
- Files reviewed: 31/31 changed files
- Comments generated: 0 new
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
|
Addressed the additional left-shoulder concern from the latest Copilot review in 809b86f. A regression test reproduced the clipping before the fix. Automatic reveal now budgets both shoulders with outward-rounded bounds, while first tabs and row starts remain flush. The test covers leftward reveal, narrow fitting tabs, oversized tabs, and first-tab alignment. All 102 targeted tab/theme tests and 18 representative render/dispose checks pass. |
There was a problem hiding this comment.
🔵 Needs a closer look
Arbitrary editor titles containing periods can be misclassified as filename extensions, preventing intended tab compression.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts:1833
tabLabel.nameis an arbitrary editor title, not necessarily a filename (for example, browser and webview inputs return page-supplied titles). Splitting at every last dot therefore treats text such asRelease 1.2 notes and announcementsas a non-shrinking “extension”; because the suffix isflex-shrink: 0and included in the computed minimum, these tabs can retain almost their full title and defeat the new compression behavior. Derive the protected suffix from the editor resource's actual basename/extension (and only split when the displayed name corresponds to it), otherwise leave the whole title in the ellipsizing name container.
- Files reviewed: 31/31 changed files
- Comments generated: 0 new
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
|
Addressed the dotted-title concern from the latest review in ea46739. A regression test reproduced the issue before the fix. Protected extensions now come from the resource only when the displayed title matches its actual basename; arbitrary browser/webview-style and resource-less titles remain fully ellipsizable. Dotfiles, trailing dots, compound filenames, and complete ARIA names are covered. All 103 targeted tab/theme tests and 18 representative render/dispose checks pass. |
|
Updated 21 screenshot baselines in 71c348e after reviewing every old/new pair. The source-head screenshot job rendered all 2,161 fixtures without errors and passed all 43 Playwright tests; only the expected-image hash gate failed. Differences are theme-isolated response/input backgrounds and small corner blends, with unchanged dimensions and layout. Current-head CI is running again. |
- Added functionality to manage connected tab clipping and overflow edges in MultiEditorTabsControl. - Introduced new CSS styles for connected editor tabs to improve visual consistency and interaction. - Updated tests to validate the behavior of connected tabs, including clipping and overflow scenarios. - Refactored tab rendering logic to accommodate new connected tab features and ensure proper layout.
There was a problem hiding this comment.
🔵 Needs a closer look
The extensive cross-theme visual and layout changes warrant final human verification despite strong automated coverage.
Review details
- Files reviewed: 33/33 changed files
- Comments generated: 0 new
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
|
Question: the video doesn't show any kind of horizontal scrolling for tabs, has that been removed? |
|
This is great so far. Some questions that the video didn't clear up:
|
Move every strip background introduced by #335605 to editorGroupHeader.connectedTabsBackground while preserving the original shared tab backgrounds and independent foreground contrast fixes. Refs #336320 Co-authored-by: Copilot <[email protected]>
* Editor: stabilize connected tabs across zoom levels Let bottom-row connected tabs own the strip geometry directly instead of cancelling inherited pill gutters with negative offsets. This keeps their cap and document boundary aligned when Chromium rounds fractional zoom values while preserving upper-row pill spacing. Co-authored-by: Copilot <[email protected]> * test: update connected tab strip geometry Update the editor-tab layout expectations for direct bottom-row geometry and the intentional one-stroke overlap with the document surface. Co-authored-by: Copilot <[email protected]> * Editor: align connected tab actions to the top edge Top-align the non-wrapping connected strip and give editor actions the same full row height so their controls remain vertically centered with tab labels. Co-authored-by: Copilot <[email protected]> * test: update component screenshot baseline Accept the Ubuntu CI hash for the dark responsive model resize fixture after verifying the delta is limited to corner antialiasing. Co-authored-by: Copilot <[email protected]> * Editor: share modern tab row geometry Own the non-wrapping row-height formula in the shared Modern UI tab layout so connected editor actions cannot drift from tab density changes. Co-authored-by: Copilot <[email protected]> * test: restore stable component screenshot baseline Restore the original dark responsive model resize hash after CI oscillated back, confirming the alternate corner-antialias hash was nondeterministic. Co-authored-by: Copilot <[email protected]> * Editor: isolate connected tab colors and borders Give connected document tabs their own strip color, restore shared 2026 tab colors for Classic and Agents surfaces, and use the existing strip separator color for connected cap and shoulder outlines. Refs #336320 Co-authored-by: Copilot <[email protected]> * Editor: share connected tab left border Overlap first and wrapped-row-start connected fills by one stroke so their left edge reuses the editor body border instead of drawing an adjacent double border. Co-authored-by: Copilot <[email protected]> * Editor: simplify connected tab color ownership Use a single editorGroupHeader.connectedTabsBackground token and emit its derived styles only under the connected-tabs root marker. Co-authored-by: Copilot <[email protected]> * Editor: describe connected tab color as reusable Document editorGroupHeader.connectedTabsBackground by visual role rather than feature enablement so it remains suitable for any connected tab treatment. Co-authored-by: Copilot <[email protected]> * Editor: centralize connected tab ownership Share the connected-tab root marker across editor controls, contribution setup, and theming, and document the dedicated stylesheet scoping invariant. Co-authored-by: Copilot <[email protected]> * docs: define connected tab ownership Document the reusable connected header color, border ownership, marker lifecycle, and separation between CSS geometry and editor control behavior. Co-authored-by: Copilot <[email protected]> * Editor: derive connected action height from the row Use flex stretch and the existing separator stroke so connected editor actions follow default and compact row heights without a special row-height variable. Co-authored-by: Copilot <[email protected]> * Editor: isolate all connected tab palettes Move every strip background introduced by #335605 to editorGroupHeader.connectedTabsBackground while preserving the original shared tab backgrounds and independent foreground contrast fixes. Refs #336320 Co-authored-by: Copilot <[email protected]> * Editor: balance connected tab close spacing Reserve upper-row pill insets consistently in tab width and close-action positioning, with single, terminal, wrapped, and left-action regression coverage. Consolidates #336791 Co-authored-by: Copilot <[email protected]> * Editor: complete connected tab spacing Restore the terminal close-action shoulder reservation from the consolidated fix and remove the generic wrapped-row top inset so connected strips meet the header edge directly.\n\nCo-authored-by: Copilot <[email protected]> * Editor: balance terminal tab actions Let the external shoulder reservation own terminal geometry so close actions keep the same visible inset as ordinary and wrapped tabs. Add a regression assertion for balanced label- and edge-side action spacing.\n\nCo-authored-by: Copilot <[email protected]> * Editor: share connected tab frame borders Classify the outermost connected tab row explicitly so active tabs can reuse the editor frame's top stroke. First-position active tabs also reuse the left stroke, while inner wrapped rows retain pill gutters and balanced close actions.\n\nCo-authored-by: Copilot <[email protected]> * Editor: give frame sole border ownership Avoid overlapping the connected tab and editor frame strokes. The outermost tab now starts at the frame's inner edge with transparent top and left borders, allowing the editor frame and its clipping radius to be the sole painter at every zoom level.\n\nCo-authored-by: Copilot <[email protected]> * Editor: center connected tab actions Center the close glyph in its painted action surface and shift that surface outward by the same inset so label- and shoulder-side spacing remain balanced. Preserve sole editor-frame ownership of the outer border.\n\nCo-authored-by: Copilot <[email protected]> * Editor: repair connected tab outline regressions Preserve high contrast outlines where the outer editor frame is transparent. Account for both cap radii when hiding clipped tab slivers, and update stale assertions for centered actions and editor-owned first-tab borders. Co-authored-by: Copilot <[email protected]> * Editor: derive close clearance from the tab surface Share action clearance across row densities and label reservation, accounting for painted borders instead of shoulder width. Keep standard row starts on the editor frame and join top-row side strokes directly to its shared top edge. Co-authored-by: Copilot <[email protected]> * Editor: keep compact tab outlines visible under actions Let the selected tab fill own its surface instead of painting a second opaque action-container background over the trailing cap stroke. Preserve the close target's own hover and keyboard focus treatment. Co-authored-by: Copilot <[email protected]> * Editor: keep wrapped tab reservation width invariant Reserve the pill inset and active shoulder before classifying rows, and consume the inset in fill and action positioning rather than changing fit widths through row markers. Exercise wrapping boundary widths in both resize directions and with changing active tabs. Co-authored-by: Copilot <[email protected]> * Editor: explicitly retain high contrast close indicators Draw hover and focus outlines on the close action itself while keeping the surrounding action container transparent. Cover focused actions in both high contrast themes and both wrapped rows; account for Electron's hidden test window when checking CSS focus state. Co-authored-by: Copilot <[email protected]> * Editor: stabilize connected tab surfaces and close targets Keep wrapped fills contiguous, round free corners, and reserve close-action stroke clearance independently of selection. Preserve high-contrast target indicators without a second action-container border. Add geometry and selection regressions. Co-authored-by: Copilot <[email protected]> * Editor: respect disabled connected tab action hover state Exclude disabled actions without raising hover specificity over keyboard focus. Cover the real Alt-to-Close-Others transition in both high-contrast themes. Co-authored-by: Copilot <[email protected]> * Editor: consolidate connected tab high-contrast frames Share the HC editor-group frame without changing close-target geometry, keep shared strip theming separate from the Modern UI editor palette, and update regression coverage and documentation. Co-authored-by: Copilot <[email protected]> * Editor: ignore unrendered frame color in connected tab tests All four browser and Electron CI failures asserted black for an absent frame whose unused border color inherits currentColor. Assert the color only for the rendered HC frame, retaining geometry and frame-presence coverage. Seed a non-black foreground so focused runs reproduce the full-suite inheritance. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
Summary
Connected document tabs make the selected tab and editor read as one surface, with a distinct background for inactive tabs. Refs #331104.
Default themes - full OSS workbench
Native 2x, lossless PNG captures at 2880 x 1880. Open either image to inspect the original resolution.
Default Dark (Dark 2026)
Default Light (Light 2026)
Default Dark - tab interactions
40 seconds, 2560 x 640, 30 fps; lossless RGB WebM (12.32 MB). Real OSS hover, selection, and sidebar resizing, cropped to the tab area and upper editor without scaling.
default-dark-interactions-lossless.webm
The clip has no audio. Hover fills and actions are visible; the system pointer is not captured.
Other bundled themes
13 themes - one full OSS workbench screenshot per theme
The same four-tab scenario in each theme, including dark and light high contrast. All captures are native 2x lossless PNGs.
Dark Modern
Light Modern
Dark+
Light+
Dark (Visual Studio)
Light (Visual Studio)
Dark High Contrast
Light High Contrast
Abyss
Monokai
Quiet Light
Solarized Dark
Solarized Light
Design
editor.background; the inactive strip and tabs shareeditorGroupHeader.tabsBackground, composited once over the document surface for translucent customizations. There are no gaps between tabs, so adjacent hover begins at the selected tab's edge. Inactive labels usetab.inactiveForeground, with explicit theme customizations preserved.focusBorderfor the active group andcontrastBorderfor inactive groups. The empty editor retains a boundary after the last tab closes. Normal themes reserve the same geometry with a transparent stroke.#E4E4E4strip against the#F5F5F5document,#54494Binactive/modern-hover text, and#765500warning text. Its warning color applies theme-wide, not only to tabs.Accessibility and consistency
These are targeted automated and visual checks, not an end-to-end screen-reader audit or comprehensive WCAG certification.
Validation
Enable
{ "workbench.experimental.modernUI": true, "workbench.experimental.modernUIEditorTabStyle": "connected" }Use
workbench.editor.wrapTabsfor multiple rows andworkbench.editor.tabSizing: "shrink"for constrained widths. Set the tab style to"pill"to compare. The tab-style setting requires Modern UI to be enabled.