Repository navigation
workbench: don't nest rounded clips around modal editors - #350120
Merged
Merged
Conversation
The modal editor's shadow wrapper, bordered part and (with Modern UI) content each rounded and clipped the same surface. Chromium supports one rounded clip per draw quad, so nested clips force offscreen render surfaces while scrolling. The content's 8px curve also sat inside the part's 7px padding-edge curve. Let only the part clip the modal surface. Keep the shadow's rounded paint but remove its overflow clip, and exclude modal content from floating-panel rounding. The part still clips the header, optional sidebar and content inside its border, with equal radii on all four corners for Core Animation. Resize handles remain outside the clip. This also removes the redundant shadow clip without Modern UI. With the underlying main editor's #350107 clip fix applied equally to both arms, eight alternating pairs per workload give: - Settings: GPU-process CPU time 1.49 -> 1.20 ms per scroll frame; paired median difference -0.21 ms, 8/8 pairs lower; render passes 1.45 -> 0. - Modal text: 1.75 -> 1.21 ms; paired median difference -0.57 ms, 8/8 pairs lower; render passes 3.83 -> 0. Rounded-corner render surfaces fall from 4 and 8 respectively to none. How to verify: - Open Settings, or set workbench.editor.useModal to all and open a text file. Scroll under a trace of viz and cc and compare with the old shadow overflow and content radius restored. Keep the main editor behind the modal identical. - Check all four corners with Modern UI enabled and disabled, the optional sidebar, navigation controls and resize handles. The part retains its 8px outer radius and 7px inside curve; content adds no second rounded clip. - npm run typecheck-client: passed. - ./scripts/test.sh --run src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts: 124 passing. - node test/unit/browser/index.js --run src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts --browser chromium: 123 passing. Both new regressions fail with the original CSS. - Targeted hygiene and stylelint: passed. - DPR 2 screenshots are stable on repeat. Modern Settings/text differ only on corner arcs (87/83 of 3,082,240 pixels, at most 6/255 per channel); classic differs in 5/6 pixels by at most 1/255. 🤖 Authored with GitHub Copilot on behalf of @alexdima. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the modal-editor clipping changes.
No open issues 🎉
What changed in this PR
This PR removes redundant rounded clipping from modal editors, complementing the main-editor fix in #350107. The modal part remains the single rounded clip, preserving its border and shadow while avoiding unnecessary offscreen render surfaces.
Changes:
- Removes clipping from the shadow wrapper and excludes modal content from floating-panel rounding.
- Adds regression tests for Modern UI enabled and disabled, with and without a sidebar.
- Documents the single-clip behavior and macOS equal-radius requirement.
| File | Description |
|---|---|
src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts |
Tests clip boundaries, corner radii, shadow paint, and unclipped resize sashes. |
src/vs/workbench/contrib/modernUI/README.md |
Documents modal clipping and rendering constraints. |
src/vs/workbench/browser/parts/editor/media/modalEditorPart.css |
Removes the shadow wrapper’s overflow clip while retaining its paint. |
src/vs/workbench/browser/media/floatingPanels.css |
Excludes modal editor content from rounded-corner styling. |
Review effort: Balanced
Alexandru Dima (alexdima)
marked this pull request as ready for review
November 24, 2026 11:36
Alexandru Dima (alexdima)
enabled auto-merge
November 24, 2026 11:36
Lee Murray (mrleemurray)
approved these changes
Nov 24, 2026
Benjamin Christopher Simmonds (benibenj)
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to the main editor's single-clip fix (#350107), independently based on main.
Modal editors nested three rounded clips: the shadow wrapper, the bordered part, and (with Modern UI) its content. Chromium supports one rounded clip per draw quad, so Blink gives the outer clips render surfaces (
property_tree_manager.cc: "Nested rounded corner clips need to force render surfaces for clips other than the leaf ones"). That sends scrolling content through offscreen render passes instead of handing its layers to Core Animation.Only the part now clips the modal surface:
All four part radii remain equal. On macOS, Blink's
ShaderBasedRRectalso requires this: unequal radii cannot use the CALayerOverlay path and force a render surface even without nesting.This fixes the two-clip case with Modern UI disabled too. The header's navigation controls keep their own local styling, and resize sashes remain outside both the part and shadow wrapper. Agents-window frame rules already exclude modal parts; no Agents-specific change is needed.
Measurements
Apple M5 Pro, DPR 2, DOM editor, Electron 43.8.10 / Chromium 150. One inactive, transparent VS Code instance per workload alternated the old CSS and this change in rotating order, eight pairs of 60 scroll frames. Times are CPU time (
tdur) of the GPU process's traced threads, not wall time.The main editor underneath the modal still has the nested clips addressed by #350107. For the isolated modal measurements below, that PR's square-content rule was applied equally to both arms. Extension-activation notification toasts were hidden equally as well; their backdrop filter otherwise adds unrelated passes.
RenderSurfaceReasonCounthas fourrounded cornersurfaces for old Settings and eight for old modal text, and none for either new arm. Renderer-main CPU showed no consistent improvement.Without neutralizing the underlying main editor, the improvement still holds in eight of eight pairs per workload:
The two remaining rounded-corner surfaces in that run belong to the main editor behind the modal and are outside this PR.
Pixels
Old/new/old screenshots in the same instance, for Settings and modal text, with Modern UI on and off. Repeated screenshots of the same arm are identical.
No geometry, shadow, header or sidebar sizing changes. The modal content no longer imposes an additional inset curve.
Corners at 8× zoom, Modern UI on. Columns: old CSS, this PR, changed pixels in magenta. Rows: top left, top right, bottom left, bottom right.
Settings
Text editor in a modal
How to verify
workbench.editor.useModal: "some". Scroll the Settings list and inspect all four modal corners.workbench.editor.useModal: "all"and open a text file after startup. Scroll it, resize and move the modal, and check its header controls.vizandcc: the scrolling modal no longer creates rounded-corner render surfaces. If workbench: don't nest rounded clips around the editor #350107 is not applied, account for the unrelated main editor behind it as described above.Tests
npm run typecheck-client: passed, no compilation errors.pnpm run transpile-client: passed../scripts/test.sh --run src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts: 124 passing.node test/unit/browser/index.js --run src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts --browser chromium: 123 passing.node --experimental-strip-types build/hygiene.ts src/vs/workbench/browser/parts/editor/media/modalEditorPart.css src/vs/workbench/browser/media/floatingPanels.css src/vs/workbench/contrib/modernUI/README.md src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts: passed.node build/stylelint.ts src/vs/workbench/browser/parts/editor/media/modalEditorPart.css src/vs/workbench/browser/media/floatingPanels.css: passed (existing design-token suggestions only).git diff --check: passed.🤖 Authored with GitHub Copilot on behalf of Alexandru Dima (@alexdima).