Repository navigation
workbench: don't nest rounded clips in the suggest widget - #350119
Merged
Merged
Conversation
Modern UI rounds and clips both the editor suggest widget and its list. Chromium applies one rounded clip per draw quad, so nesting them forces offscreen render surfaces while the selection or suggestions change. Keep the widget's clip and square its list's clip, including with a status bar. The widget's four radii remain equal, so macOS can use Core Animation rather than mask unequal rounded corners through a render surface. This preserves the footer, loading/message state and row boundary radii. The separate details overlay is unchanged. Workbench suggestions keep their list clip so their resize sashes remain reachable. Both Modern UI and the Agents window share the editor fix; classic UI is unchanged. Measured in one inactive instance per run, alternating old and new CSS: - On main's editor card: GPU-process CPU time per arrow key 2.78 -> 1.91 ms, render passes 4.95 -> 3.08; all eight pairs improve. - With #350107 applied equally to both arms: 2.68 -> 1.85 ms, render passes 2.73 -> 0; all eight pairs improve. The paired CPU difference is -0.88 ms. - With that same editor-card fix and a status bar: 2.86 -> 1.86 ms, render passes 2.58 -> 0; all four pairs improve. How to verify: - Open editor suggestions and move the selection, with and without editor.suggest.showStatusBar. Check first/last row highlights and the footer seam, partial scrolling, resize sashes and the details overlay. - Trace viz and cc: with #350107, there are no DirectRenderer::DrawRenderPass events or rounded-corner render surfaces for the selection workload. - At DPR 2, first/last selection screenshots differ only on corner arcs: 54/376704 pixels without a footer (max channel difference 15/255), 46/407808 with a footer and first selected, zero with last selected. Repeated screenshots with unchanged CSS are identical. - ./scripts/test.sh --run src/vs/workbench/contrib/modernUI/test/browser/roundedCorners.test.ts passes (35 tests); the Chromium runner passes (34 tests). - npm run typecheck-client, targeted hygiene and stylelint pass. 🤖 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 suggestion-widget clipping changes.
No open issues 🎉
What changed in this PR
This PR reduces nested rounded clipping in editor suggestions for Modern UI and the Agents window. It keeps the widget’s outer rounded clip while making its list clip square, independently of the editor-card optimization in #350107.
Changes:
- Removes the editor list’s redundant rounded clip, leaving workbench and classic suggestion clipping unchanged.
- Extends corner tests to check clipping, partially scrolled highlights, footer seams, and classic behavior.
- Documents the clipping strategy and its Chromium/macOS rendering rationale.
| File | Description |
|---|---|
src/vs/workbench/contrib/modernUI/test/browser/roundedCorners.test.ts |
Updates assertions for visible clipping, footer seams, and classic behavior. |
src/vs/workbench/contrib/modernUI/README.md |
Explains the distinct editor and workbench clipping strategies. |
src/vs/workbench/contrib/modernUI/browser/media/suggestWidget.css |
Squares the editor list clip while preserving workbench list rounding. |
Review effort: Balanced
Alexandru Dima (alexdima)
marked this pull request as ready for review
November 24, 2026 11:30
Alexandru Dima (alexdima)
enabled auto-merge
November 24, 2026 11:30
Lee Murray (mrleemurray)
approved these changes
Nov 24, 2026
Ladislau Szomoru (lszomoru)
approved these changes
Nov 24, 2026
Alexandru Dima (alexdima)
deleted the
alexd/modern-ui-suggest-one-clip
branch
November 24, 2026 12:00
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.
Modern UI (on by default) rounds and clips both the editor's suggest widget and its list. Chromium applies one rounded clip per draw quad, so Blink gives outer nested rounded clips render surfaces (
property_tree_manager.cc: "Nested rounded corner clips need to force render surfaces for clips other than the leaf ones"). That costs while moving the selection or updating suggestions as the user types.This leaves the editor widget as the rounded clip and gives its list a square clip:
ShaderBasedRRectin the same Blink file refuses unequal radii because Core Animation cannot apply them, and uses a render surface instead.Related: remove the editor card's nested clip (#350107). This PR is independently based on main and does not include that change.
Measurements
Apple M5 Pro, macOS, DPR 2, DOM editor. Each run uses one inactive, transparent VS Code instance and alternates the old/new CSS in rotating order. The workload is the coordinator's word-suggestion list: 15 down-arrow keys followed by 15 up-arrow keys. Times are CPU time (
tdur) of the GPU process's traced threads, not GPU wall time. Notification toasts are hidden equally in both arms: dev-build activation-error toasts otherwise add unrelated backdrop-filter render passes. The machine was busy, so the comparisons are paired.Values and differences are medians, so the difference between medians need not equal the paired median difference. The remaining passes with main's editor-card CSS are from the unchanged editor clips addressed by #350107. Applying its editor-content rule equally to both arms isolates the suggest widget: the renderer reports one
rounded cornerrender surface with the old suggest CSS and none with this PR, with or without the suggest status bar. Renderer-main CPU time showed no consistent improvement.Pixel comparisons capture the actual suggest widget, new/old/new in one instance, after the scrollbar fade finishes:
All changed pixels are confined to the corner arcs. Partial scrolling likewise changes only arc pixels: 74 without a footer, 66 with one (maximum channel difference 48/255). Repeated captures with unchanged CSS have zero differing pixels in all six cases; the content, footer seam and focus indicators are unchanged.
Before / after
What changed: the widget still rounds the corners; its list no longer adds a second rounded clip.
All six cases, captured in one window. Magenta marks the pixels that differ:
The corners zoomed 8×, the only places where pixels change:
How to verify
editor.suggest.showStatusBaron and off, and check the footer seam, focus outline, resize handles, loading/message state and details overlay.vizandccwhile moving the suggest selection. With the editor-card fix from workbench: don't nest rounded clips around the editor #350107 applied, this change produces noDirectRenderer::DrawRenderPassevents and norounded cornerrender surfaces for this workload..part.editor > .content { border-radius: 0 !important; }rule equally to both arms.Tests
The existing corner tests now check the visible clip's shape and overflow, clipped partially scrolled highlights, the absence of a second rounded editor-list clip, footer seams, and unchanged classic clipping. Existing cases also cover both workbenches, logical boundary rows under virtualization/filtering, all four themes' focus indicators, and workbench suggestion resize-sash hit targets.
npm run typecheck-client: passed.pnpm run transpile-client: passed../scripts/test.sh --run src/vs/workbench/contrib/modernUI/test/browser/roundedCorners.test.ts: passed, 35 tests.node test/unit/browser/index.js --run src/vs/workbench/contrib/modernUI/test/browser/roundedCorners.test.ts --browser chromium: passed, 34 tests.node --experimental-strip-types build/hygiene.ts src/vs/workbench/contrib/modernUI/browser/media/suggestWidget.css src/vs/workbench/contrib/modernUI/test/browser/roundedCorners.test.ts src/vs/workbench/contrib/modernUI/README.md: passed.node build/stylelint.ts src/vs/workbench/contrib/modernUI/browser/media/suggestWidget.css: passed.tl;dr
Keep one equal-radius clip on the editor suggest widget, not a second on its list. The isolated suggest workload draws zero render passes and uses about 0.9 ms less GPU-process CPU time per arrow key; the footer, row corners, focus indicators and workbench resize sashes are preserved.
🤖 Authored with GitHub Copilot on behalf of Alexandru Dima (@alexdima).