Skip to content

workbench: don't nest rounded clips in the suggest widget - #350119

Merged
Alexandru Dima (alexdima) merged 1 commit into
mainfrom
alexd/modern-ui-suggest-one-clip
Nov 24, 2026
Merged

Alexandru Dima (alexdima) merged 1 commit into
mainfrom
alexd/modern-ui-suggest-one-clip

Conversation

@alexdima

@alexdima Alexandru Dima (alexdima) commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

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:

  • The widget clips partially scrolled highlights, the status bar and the loading/message state. Its four corner radii stay equal, including with a status bar. This matters on macOS: ShaderBasedRRect in the same Blink file refuses unequal radii because Core Animation cannot apply them, and uses a render surface instead.
  • The first/last logical rows keep their own highlight and focus-outline radii. The footer seam stays at the Control tier. The separate details overlay and the editor's existing resize-sash clipping are unchanged.
  • Workbench suggestions are deliberately unchanged: they have no outer rounded clip and need their list's clip so their resize sashes remain reachable outside the widget.
  • The editor fix also applies in the Agents window, independently of the Modern UI setting. Classic UI is unchanged.

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.

Editor-card CSS Variant Old suggest CSS This PR Paired difference Pairs improving
Main GPU process / arrow key 2.78 ms 1.91 ms -0.92 ms 8/8
Main Render passes / arrow key 4.95 3.08 -1.90 8/8
#350107 in both arms GPU process / arrow key 2.68 ms 1.85 ms -0.88 ms 8/8
#350107 in both arms Render passes / arrow key 2.73 0 -2.73 8/8
#350107 in both arms, suggest status bar visible GPU process / arrow key 2.86 ms 1.86 ms -0.99 ms 4/4
#350107 in both arms, suggest status bar visible Render passes / arrow key 2.58 0 -2.58 4/4

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 corner render 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:

Suggest status bar Selection Different device pixels Maximum channel difference
Hidden First 54 / 376,704 15 / 255
Hidden Last 54 / 376,704 15 / 255
Visible First 46 / 407,808 15 / 255
Visible Last 0 / 407,808 0

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.

0-what-changed

All six cases, captured in one window. Magenta marks the pixels that differ:

1-overview

The corners zoomed 8×, the only places where pixels change:

2-corners-zoomed

How to verify

  • Open editor suggestions with Modern UI enabled. Select the first and last item, filter to one item, then scroll through a partially visible highlighted row. Repeat with editor.suggest.showStatusBar on and off, and check the footer seam, focus outline, resize handles, loading/message state and details overlay.
  • Repeat in an Agents-window editor. Disable Modern UI in the regular workbench and check that classic suggestions still use their original rounded list clip. Workbench suggestion resize sashes must remain reachable outside their widget.
  • Trace viz and cc while moving the suggest selection. With the editor-card fix from workbench: don't nest rounded clips around the editor #350107 applied, this change produces no DirectRenderer::DrawRenderPass events and no rounded corner render surfaces for this workload.
  • Compare old/new in the same window by adding the old CSS below. To isolate this widget from the separate editor-card issue, apply workbench: don't nest rounded clips around the editor #350107's .part.editor > .content { border-radius: 0 !important; } rule equally to both arms.
body :is(.modern-ui, .agent-sessions-workbench) .editor-widget.suggest-widget .monaco-list {
	border-radius: var(--vscode-cornerRadius-large) !important;
}
body :is(.modern-ui, .agent-sessions-workbench) .editor-widget.suggest-widget.with-status-bar .monaco-list {
	border-bottom-left-radius: 0 !important;
	border-bottom-right-radius: 0 !important;
}

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).

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>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 11:10

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.

🟢 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

@alexdima
Alexandru Dima (alexdima) added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 2b32f02 Nov 24, 2026
91 of 95 checks passed
@alexdima
Alexandru Dima (alexdima) deleted the alexd/modern-ui-suggest-one-clip branch November 24, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants