Skip to content

chat: don't give the chat input's text a layer of its own - #350123

Closed
Alexandru Dima (alexdima) wants to merge 6 commits into
mainfrom
alexd/chat-input-one-clip
Closed

Alexandru Dima (alexdima) wants to merge 6 commits into
mainfrom
alexd/chat-input-one-clip

Conversation

@alexdima

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

Copy link
Copy Markdown
Member

Warning

Status: not ready. The screenshot check found that in the Agents window's new-chat widget (the three sessions/chat/newWidget/newChatWidget/ConnectorRecommendations fixtures), the input's typed text loses LCD (subpixel) anti-aliasing with this change on Linux, and so on Windows. There, Blink composites the input's caret, so the text that's no longer in Monaco's own opaque layer lands in an Overlap layer without an opaque background (contents-not-opaque). The measurements and pixel comparisons below hold for the workbench's chat view and the other fixtures.

In short: the chat input's editor no longer puts its text into a composited layer of its own. That layer sat under two rounded clips, the input box's and the side bar card's, so Chromium wrapped it in render surfaces on every keystroke. Without it, typing costs the GPU process about 0.2 ms less per keystroke, and the input looks the same: at most 1/255 different on macOS, and the five chat-input component fixtures render identically. The change is one editor option; no CSS changes.

This is the chat-input counterpart of "workbench: don't nest rounded clips around the editor" (#350107).

Why

With Modern UI, the chat view's input box (.chat-input-container) rounds and clips its contents with an 8 px radius and overflow: hidden, inside the rounded side bar card. Monaco promotes an editor's text (.lines-content, and its margin) to a composited layer with transform: translate3d(0, 0, 0) unless disableLayerHinting is set. Chromium applies one rounded clip per draw quad, so for a composited layer under nested rounded clips, 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"). Those are redrawn while typing.

This change sets disableLayerHinting on the chat input's editor. Its text is then drawn into the layer below, which on main already holds the rest of the input (its toolbars, attachments and background). That layer is opaque, so Chromium keeps LCD (subpixel) text there. A comment on the option says why.

Scrolling a long input now repaints the input's viewport instead of moving a layer. The input is a few lines high, so that's cheap.

What this replaces

The first versions of this PR clipped the input box with a square clip-path: inset(0) instead of overflow: hidden. On macOS that looked the same, but the component-fixture screenshots in CI showed three regressions on Linux, which would also affect Windows:

  • With no attachment, the editor reaches the box's inner top-right corner. overflow: hidden rounded it there; the square clip didn't, so the corner turned square.
  • In the Agents window's phone layout, the editor is a few pixels wider than the inside of the box. overflow: hidden clipped it inside the border; clip-path clips at the border's outer edge, so the editor covered the border.
  • The clip-path changed how Chromium splits the page into composited layers. The text in the box and the toolbar below it moved into layers without an opaque background, so cc refused LCD text there (contents-not-opaque, background-color-not-opaque) and drew it grayscale. macOS never uses LCD text, which is why my macOS pixel comparisons missed this.

I confirmed the last one by dumping the layer tree and cc's per-layer LCD decision (Chromium's --enable-lcd-text makes macOS compute it too), both in the workbench and in the CI fixtures. The chat.css and test changes are reverted; against main, this PR now changes only chatInputPart.ts.

Measurements

On an Apple M5 Pro at device pixel ratio 2, with the chat view open (AI features enabled, signed out, no chat provider) and notification toasts hidden. The machine was busy (load average about 11). One VS Code instance alternated this build and main's behavior (Monaco's layer hint put back on the input's text and margin with !important CSS) in rotating order, 4 pairs each. Times are the CPU time of the GPU process's traced threads. Typing is 20 characters and 20 backspaces in the chat input. Values are medians; "Pairs" counts the pairs where this PR is lower.

The signed-out build docks a "Choose how you want to use Copilot" prompt above the input, which squares the box's top corners, so I measured with it hidden (as signed-in users see the input) and docked. "With #350107" applies that PR's editor-card rule in both arms; it has since been merged.

Per keystroke Main This PR Pairs
GPU process, prompt hidden 1.36 ms 1.15 ms 4/4
GPU process, prompt hidden, with #350107 1.31 ms 1.14 ms 4/4
GPU process, prompt docked 1.38 ms 1.17 ms 4/4
GPU process, prompt docked, with #350107 1.36 ms 1.18 ms 4/4
Render passes drawn, prompt hidden 1.18 1.25 2/4 (no difference)
Render passes drawn, prompt docked 2.96 1.57 4/4
Render passes drawn, prompt docked, with #350107 1.60 0.75 4/4
rounded corner render surfaces, prompt hidden 4 3
rounded corner render surfaces, prompt hidden, with #350107 2 1

With the prompt hidden, each surface holds a single quad, which viz draws straight into its parent, so the number of render passes drawn doesn't change; the GPU process time does. With the prompt docked, the box's corners differ (0, 0, 8 and 8 px), and on macOS Blink applies such a clip through a surface even when it isn't nested, so those surfaces are drawn offscreen.

The surface left in the chat input is Blink's caret layer for Monaco's hidden edit context (.native-edit-context). Making its caret transparent doesn't remove it.

While a response streams (the comet spinning), the GPU process time per frame doesn't change (1.07 ms against 1.07 ms, 2 of 4 pairs), and render passes drawn per frame go from 5.92 to 5.59 (4 of 4).

Pixels

Whole-window screenshots in one instance: this PR, main's behavior, then this PR again. They cover the input empty and with text, with and without an attachment above the editor, with the sign-in prompt docked, and with the comet paused at 300, 900 and 1500 ms.

  • Everything differs by at most 1/255: text that moved into another layer, and in one case the editor's top-right corner (8 pixels), whose rounded clip is now applied while painting instead of by the compositor.
  • Repeat captures are identical.

The five chat-input component fixtures that CI flagged for the earlier version (chat/input/chatInput/CompactWithProviderIcon, CopilotHarnessCompactPickers, chat/widget/chatWidget/PendingMessages/Queued, sessions/chat/newWidget/newChatWidget/NewSessionAttachedContext, sessions/chat/view/chatView/PhoneChatComposerSettingsDisabled, Light) render pixel-identically to main locally, and every text run in them stays in the opaque root layer, where cc allows LCD text, as on main.

How to verify

  • The diff is one editor option and its comment in chatInputPart.ts.
  • In a Code OSS build, open the chat view, type in the input and check in DevTools' Layers panel that the input's .lines-content has no layer of its own.
  • Trace the viz and cc categories while typing: RenderSurfaceReasonCount reports one rounded corner surface fewer than on main.
  • To compare with main in one window, put the layer hint back in a style element:
    body .monaco-workbench .part.auxiliarybar .interactive-input-part .monaco-editor .lines-content, body .monaco-workbench .part.auxiliarybar .interactive-input-part .monaco-editor .margin { transform: translate3d(0px, 0px, 0px) !important; }
  • The "Screenshots & Tests" check passes with the committed blocks-ci hashes.

Tests

No unit test builds the real chat input editor (the existing ones stub it), and a test that the option is set would only restate the code. The component fixtures render the real input, so the screenshot check covers what this changes.

  • npm run typecheck-client: passed.
  • ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputPart.test.ts: 67 passing.
  • node test/unit/browser/index.js --run src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputPart.test.ts --browser chromium: 66 passing.
  • node --experimental-strip-types build/hygiene.ts on chatInputPart.ts: passed.

tl;dr

The chat input's editor stops promoting its text to a composited layer, so Chromium no longer wraps it in render surfaces for the nested rounded clips. Typing costs the GPU process about 0.2 ms less per keystroke (4 of 4 pairs in every configuration), and with the signed-out prompt docked about half the render passes. Nothing visible changes. The earlier square clip-path is gone: it squared a corner, covered a border and turned text grayscale on Windows and Linux.

🤖 Authored with GitHub Copilot on behalf of Alexandru Dima (@alexdima).

The chat input box rounds and clips its contents (8 px radius, overflow:
hidden). With Modern UI the box sits inside the rounded auxiliary bar card,
and the comet ring that spins while a response streams adds a third rounded
clip (overflow: clip with border-radius: inherit). Chromium applies one
rounded clip per draw quad, so Blink gives the outer rounded clips render
surfaces. Every keystroke in the chat input then drew offscreen render
passes, even when nothing streams, and every comet frame drew two extra
passes.

The box now clips with a square clip-path: inset(0). Its own border-radius
still rounds its border and background. The ring keeps its rounded shape
from its mask and uses layout containment instead of a rounded clip to keep
the oversized gradient out of ancestor scroll areas. A new square-clipped
child, .chat-input-working-border-clip, carries the rotating gradient. That
child needs layout containment too: without it, Blink re-runs layerization
on every frame of the spin, about 0.6 ms of renderer main-thread time.

How to verify:
- Trace the viz and cc categories while typing in the chat input. With
  this change, RenderSurfaceReasonCount drops from 5 to 2 "rounded corner"
  surfaces, and
  DirectRenderer::DrawRenderPass drops from about 2.6 to 1.3 per keystroke.
- Add .working to the input container and trace again: passes per frame
  drop from about 5 to 3, and PaintArtifactCompositor::Update doesn't run
  per frame.
- Check that the input box's corners and the comet look unchanged.

🤖 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:42
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 7f668a49 Current: 3adaa12b

Changed (25)

sessions/chat/newWidget/newChatWidget/ScheduledDraft/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ScheduledDraftNarrow/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsDisabled/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsTipsDisabled/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendations/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsNarrow/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsOneDismissed/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsTwoDismissed/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsBackground/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsWithNotices/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsShort/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsPhone/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsPhoneWithNotices/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionComparisonSetup/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/PromptOptionsSelected/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/PromptOptionsEditedDisabled/Light
Before After
before after
sessions/mobile/welcome/mobileNewChatWidget/CloudWelcome/Light
Before After
before after
sessions/mobile/welcome/mobileNewChatWidget/CloudRepository/Light
Before After
before after
sessions/mobile/welcome/mobileNewChatWidget/ComputerRepository/Light
Before After
before after
sessions/mobile/welcome/mobileNewChatWidget/KeyboardHeight/Light
Before After
before after
sessions/mobile/welcome/mobileNewChatWidget/Landscape/Light
Before After
before after
sessions/mobile/welcome/mobileNewChatWidget/WelcomePhrase/Light
Before After
before after
chat/input/chatInput/SessionSandboxEnabled/Light
Before After
before after
chat/input/chatInput/SessionSandboxDisabled/Light
Before After
before after
chat/input/chatInput/SessionSandboxOverflow/Light
Before After
before after

9 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.


blocks-ci screenshots changed

Replace the contents of test/componentFixtures/blocks-ci-screenshots.md with:

Updated blocks-ci-screenshots.md
<!-- auto-generated by CI — do not edit manually -->

#### agentSessionsViewer/SessionWithPeerChat/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/458a8a8bdc42227541085b7b89ba8e59307f161986a7d9e0de4c572f860c4b03)

#### baseUI/KeyboardFocusedToggle/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/dfbb0ce3586e7a15bdb7354ff70df81563ed19b5b857c71d7a02e11ef7ad13fd)

#### chat/aiCustomizations/aiCustomizationManagementEditor/PluginMarketplaces/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/625949c7000f4c1d67c061ff464254ac460451d377b4f205dadf93a26efc17b4)

#### chat/chatCustomizationsHover/Default/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/ee82e7855b504c48ca9487cc06428fa0144b134c8a21f96f25ba1c0c34da7382)

#### chat/chatCustomizationsHover/MigrationsAndMcpAuthentication/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/5e63fb51d5307fd8614817015b731adcd7f18acdaf7230aab5bde94359172c7c)

#### chat/chatPetAccessoryRig/chatPetAccessoryRig/AllAccessoriesFacing/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/53dc97e97d4f9e8d02d144012794cce528d3d25d659149df8c854f7c42e54d74)

#### chat/chatPetAccessoryRig/chatPetAccessoryRig/AllRuntimeStates/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/52a7631f8a6714054e07db345ae85b18029e958476e99d6b79d0741d07784bee)

#### chat/chatPetAccessoryRig/chatPetAccessoryRig/CoveredAntennaeComparison/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/8ce92ebc6cc359112d5e8e356f3556ca99906901736105c3b3af5d1840348b0c)

#### chat/chatPetAccessoryRig/chatPetAccessoryRig/CriticalPoses/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/850e813a535b920e614f45c370874ea13e39b095d9930d51863afdb5c03abacd)

#### chat/chatPetAccessoryRig/chatPetAccessoryRig/LiveEyeLayering/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/28743055f10abdf3c0a7809b2b3e830b7a04dc65157febf48215eecdf8b03772)

#### chat/chatQuestionCarousel/MarkdownLinks/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/227e33a8342c7a55ee09346380f5a2a399dfcb967edea911f553906a8bfcfb4f)

#### chat/input/chatInput/CompactWithProviderIcon/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/e80dcc1ac1442c0175ec9764f2d6500210ccfb755b44019eb15d8c42ba198c60)

#### chat/input/chatInput/CopilotHarnessCompactPickers/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/e67ff22f55b85ba448486d56e6e7e01e060fa8f7503c72638ef1b999015d829f)

#### chat/petAchievements/standaloneModal/chatPetAchievementsEditor/MixedSelected/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/6eae698ca25739514cb95bb71c4f6973e938a83a5f4e3dee7153c4c3a646c54b)

#### chat/widget/chatWidget/PendingMessages/Queued/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/ff9db5b64a40589538b988686ab9906714458bd2d756c851d43e14b18ef2b6b7)

#### chat/widget/chatWidget/PendingMessages/Steering/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/53bbe944ed13535f12436eb40541f0b504cb7cd8b8d2c700dac052897b94f560)

#### chat/widget/chatWidget/PendingMessages/SystemNotification/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/c6f2e9991e233ed38ca6c5223819db5cda923130b45eafd3ae07b1fbd8285c07)

#### comments/commentTree/CommentTreeMetadataZoomed/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/a81446b88a24acb43f7713d0d84c921bb9d79d4c06448e77b4baae5c1f5c9026)

#### editor/codeEditor/CodeEditor/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/10e1881a8125f12fa8a45164f5bda6b55319bd0dad93e465246b407bed6bc3e1)

#### editor/fullwidthCharacterWidth/FullwidthCharacterWidthClassification/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/55d5ee041108b8fd525642374564c62fb96f0c5a098412876615262a87e5f5c6)

#### editor/fullwidthCharacterWidth/FullwidthCharacterWidthCode/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/b84c6f6f05420ba33e71cec227c976481b166a2967e9f295b9723c0a32228969)

#### editor/fullwidthCharacterWidth/FullwidthCharacterWidthFont/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/0028778f2f2a0859c2def1a544d03b53b791b7510a8264c2af47e4e0024f4ee5)

#### editor/fullwidthCharacterWidth/FullwidthCharacterWidthProportionalFont/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/467e6c59b70fbd0153e463f8a5bbdb778f9b96aa27117fa8c276e126004fe2ac)

#### editor/fullwidthCharacterWidth/FullwidthCharacterWidthSelection/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/d2f28d080bfa99f2f93566c860e11ca891eb8e38ef27a4b20286b7227d235d89)

#### editor/fullwidthCharacterWidth/FullwidthCharacterWidthTwoCells/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/07cc96d028f69fd9609b88fa23b1c087cde223393dd0fd9ad6341e480068db95)

#### editor/injectedTextDecorations/ColorDecorators/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/ca4563d37cccd40a5f49e1d6075dde7bbf085b718ca52a3e22d91e5d951242d2)

#### editor/injectedTextDecorations/InlayHints/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/76ab9ccd41b2b1a400c2feece58e56e8f49cad84023ed07708305e2ed75db8f5)

#### editor/injectedTextDecorations/InlineProgress/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/4aaae3363f8f4637ecde8de278eefc8a04f04a70f0ba6567309d9e8c76e8a260)

#### editor/injectedTextDecorations/SelectedColorDecorator/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/ba9f3a1f916231953b82851a61bafbe0e2738056cac9d9a5be47da573d8ea5da)

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/a50c6b1aa065a2b53a2e70cc226298c36bd04617f3163ffe11892fba9b141cf1)

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/8d8b39f9a3dd85453ad1594df888c7ac1908d5c7ed80a5b15238d818a89aeb1b)

#### editor/wordWrapIndicator/WordWrapIndicator/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/9b7191f3dc7cede99687efc61bc2e50324e23b2bd0781ab62aed5bb6c113e77e)

#### editor/wordWrapIndicator/WordWrapIndicatorDisabled/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/bfd14bc97613141a7bb9914a204d04b4d2e4f1cd3cedfd806201827fdfa6b05c)

#### editor/wordWrapIndicator/WordWrapIndicatorFixedColumnBeyondViewport/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/44a44a161770ed83c0d9e6214175f1153fe44938942ed85c722fc2d1858cac07)

#### editor/wordWrapIndicator/WordWrapIndicatorVariableLineHeight/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/f6a34b4ac5a13300f402a922b935765ec0a55b712b2bc6951da7be8fa1c1eb7c)

#### editor/wordWrapIndicator/WordWrapIndicatorViewportWrapping/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/2945563f28440c62c812e2c80ac40620807822ec8b691bac9b79a85610b4fc50)

#### sessions/accountMenu/petAchievementBadges/chatPetAchievementBadges/AllBadges/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/a92e0c554f09d1e7d3b864d0b1cd5c70c057b2acbe4fb67daadeba0cb8351eb8)

#### sessions/chat/newWidget/newChatWidget/ConnectorRecommendations/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/da7be85bdd2e040fece79ef51577550cc7375006106d8032ddd3bc42aa9d650e)

#### sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsPhoneWithNotices/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/3d7fd07d6ae8f335e087e4b1e738c238eab2dd13b18f909bf614b0c2b31b407c)

#### sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsWithNotices/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/40b510ea8c76cca3b1c106fa61488e3e37c0271c432f4e82f0447a1628d3237a)

#### sessions/chat/newWidget/newChatWidget/MigrationsBackground/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/0b9b27b94a368a4b1e396c5a305957b08d8eb3d329f42d36d24107ceb4cb1618)

#### sessions/chat/newWidget/newChatWidget/NewSessionAttachedContext/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/4b333c740dcc6cd7d8e4737c4c255c2577195e0d12cd0885a57bb98d719d9136)

#### sessions/chat/newWidget/newChatWidget/NewSessionAutoModel/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/980c37050bfba3092c5e025cbf3e08b788c30ce0d9b1173280b24438f3be2c4a)

#### sessions/chat/newWidget/newChatWidget/NewSessionChatBackground/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/e508b07c99c748e30e6d48b16b34896a68b8c502dfe90f26d69211384ae9fe37)

#### sessions/chat/newWidget/newChatWidget/NewSessionCompactAutoModel/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/64d6561ed3f2c4f3b3666427cb5e7d8cc89394acac0b675b083dc3eb444e9214)

#### sessions/chat/newWidget/newChatWidget/NewSessionComposerBackground/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/b4af21dee1393dbc449dbfc7bf408effc2de617f8ae3e26055fa4ddceddbf879)

#### sessions/chat/newWidget/newChatWidget/NewSessionGitHubContextPicker/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/979b51c07c24c148e1b78bc51d2574f08901005624981f0d635a7ffacbb978c6)

#### sessions/chat/newWidget/newChatWidget/NewSessionPhoneAttachedContext/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/e3c3c57ad2ad2f0736184dd29f51aaf3e201eee901c5110d4274ceeb9139a9f9)

#### sessions/chat/newWidget/newChatWidget/NewSessionPhoneWelcomePhrase/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/e7ca7d680fbb425fc35ed0cd9ad2fdd04bdae4b8249138a75563c4534e6c0885)

#### sessions/chat/newWidget/newChatWidget/NewSessionPhoneWorkspacePicker/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/44758abae0cd500125f5ab0306b3aeda4c5c45fb1c00cd68cd97312f7afffdb1)

#### sessions/chat/newWidget/newChatWidget/NewSessionRemoteWorkspace/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/0350eb5f1761b116d9602b93e346b67bd79cf7e21e8bfe9bef281d34b61eff43)

#### sessions/chat/newWidget/newChatWidget/NewSessionWorkspacePicker/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/ba881377ede57e4ac579fc6fd07dcaec60673d003cc8625d3b71905dfba51410)

#### sessions/chat/view/chatView/AssistantResponseBackground/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/c349a47de36c0bbb9c1f6d72f57330f2ee27d86a78aaae8af922a278141c05a2)

#### sessions/chat/view/chatView/AssistantResponsePlain/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/5bce2190ee4ba08bb2cd4e62ec96dbfe778002b698986fbb121e713c30e90273)

#### sessions/chat/view/chatView/CheckpointControlsBackground/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/95ae0ffb148ca4ae1312c8bb8bbfafa358a28b81e1b00b823f192178d44b30e8)

#### sessions/chat/view/chatView/PhoneChatComposerExperimentalComposer/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/f06a4a418e19ada0e6bf0d2bacd4479d3b1eadbec325a1d8add1f45d12670cda)

#### sessions/chat/view/chatView/PhoneChatComposerSettingsDisabled/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/f06a4a418e19ada0e6bf0d2bacd4479d3b1eadbec325a1d8add1f45d12670cda)

#### sessions/chat/view/chatView/PhoneChatComposerUnifiedWorkspacePicker/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/f06a4a418e19ada0e6bf0d2bacd4479d3b1eadbec325a1d8add1f45d12670cda)

#### sessions/chat/view/chatView/RequestAttachmentBackground/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/f42a0f833c857ea204c962b46aee410bd8466c054dc4c0b4b66450fd44150b24)

#### sessions/sessionsList/SessionsList_ArchivedNestedChat/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/0124a039cae015adf9ee22df80b288e32480a6388dd4c76defc5e8035d5fae01)

#### sessions/sessionsList/SessionsList_CompactArchivedNestedChat/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/544e3c4179be8e33bae9d98145b4dbf5ae0d02b9371a8b18257ffb360d5adb86)

#### sessions/sessionsList/SessionsList_CompactChatRename/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/133b77cee2dd44df7906261b12cbf019eb0a4dbc2dc9d88a865d04687cdbbf8f)

#### sessions/sessionsList/SessionsList_CompactNeedsInput/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/e973a7bb1098848aeb7083b06dd580e2553b9e3dee82384e9201a7ea62b8d32a)

#### sessions/sessionsList/SessionsList_CompactNestedChatActions/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/e01b4e9ec7662e0577b1e91633aa1b07e28d7080788d0d56320fc00ad99ee207)

#### sessions/sessionsList/SessionsList_CompactNestedChatApprovals/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/6bb9a9018f47a11b949c63e7f6ecd4e558b8b8c169ed5687bfc37be3cde682f9)

#### sessions/sessionsList/SessionsList_CompactNestedChatPrimaryAction/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/5370914cc0cae9d6dd4677c1610936afde3783bd3b86d05d8890b3a83fe77a83)

#### sessions/sessionsList/SessionsList_CompactNestedChats/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/68781756d8b7462b1fb647314167fd5653f9176a6799e83a8154220fdb9ae1ea)

#### sessions/sessionsList/SessionsList_CompactSessionRename/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/55159b1e807948be4ca3754b80df31b39731aaf283837016e3b0c6a8966e333b)

#### sessions/sessionsList/SessionsList_CompactUnreadStatusIcons/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/d9a2ae34e8d118e1006023600907f022d1ef272062c9df74206c5810b11f4152)

#### sessions/sessionsList/SessionsList_LightweightNewButton/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/27750194694cd6b4941e11c7752732c04f934269141b93ad9bbd6131217ace45)

#### sessions/sessionsList/SessionsList_LightweightNewButtonWithKeybindingBackground/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/54f5cf2d72ea720ff9c6f07388c686f91f7541abff62ef516b321588260da824)

#### sessions/sessionsList/SessionsList_NarrowHoverToolbar/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/d6897983c4807abb9809df9367403a85717d2dcb3e94c1b642aa986a69e1a766)

#### sessions/sessionsList/SessionsList_NestedChatHierarchyGuides/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/565498cbf2358805e3708b02a426469f95ab9470b02b4828a8ccc18005374355)

#### sessions/sessionsList/SessionsList_PeerChatInProgress/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/c9ccc9b3da21ae2e34c0c8f633094430b303b9f610b9c536fe16b9986ba113fc)

#### sessions/sessionsList/SessionsList_SelectedKeyboardFocus/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/3997a21231c509e1b9ab842d9790f51f6a900e35328a6160d309e8f4663a1a15)

#### sessions/sessionsList/SessionsList_UnreadStatusIcons/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/b1104e1b89ed6f878a0cae871020eb2668c0e6a41b26b0fbb2f5d9995e180b70)

#### workbench/activityBarMenu/CompactActivityBarMenu_CompactDensity/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/6dc0ca91d25531aeea79c4b9d145c1fafd7b705047d0805fc69192d1b372e650)

#### workbench/activityBarMenu/CompactActivityBarMenu_DefaultDensity/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/2786fba1b7f0b41a26e238ea678ef381bd004d977f16abcb600239e142d1488e)

#### workbench/statusBar/statusBar/CompactDensity/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/18f5015021b71f373ce4bf58af10aabd6cf855e6b7f6f629f0c55b07fc5ad1a3)

#### workbench/statusBar/statusBar/DefaultDensity/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/efe99c6ca61388dc0c84b3de79ffcc182cd513da5b32960134d3764b935c0603)
Patch
--- test/componentFixtures/blocks-ci-screenshots.md	2026-11-24 22:22:47.645526845 +0000
+++ /tmp/blocks-ci-updated.md	2026-11-24 22:25:17.338930498 +0000
@@ -112,13 +112,13 @@
 ![screenshot](https://hediet-screenshots.azurewebsites.net/images/a92e0c554f09d1e7d3b864d0b1cd5c70c057b2acbe4fb67daadeba0cb8351eb8)
 
 #### sessions/chat/newWidget/newChatWidget/ConnectorRecommendations/Light
-![screenshot](https://hediet-screenshots.azurewebsites.net/images/ef94a66301e2c5fe36af02f1bb420dd3e70e0aae4506094a30e081fa94315295)
+![screenshot](https://hediet-screenshots.azurewebsites.net/images/da7be85bdd2e040fece79ef51577550cc7375006106d8032ddd3bc42aa9d650e)
 
 #### sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsPhoneWithNotices/Light
-![screenshot](https://hediet-screenshots.azurewebsites.net/images/6a2bb056cb1fc7631ad0aaaf30776fad4b2570fc10ae1241051dc9632f71dd41)
+![screenshot](https://hediet-screenshots.azurewebsites.net/images/3d7fd07d6ae8f335e087e4b1e738c238eab2dd13b18f909bf614b0c2b31b407c)
 
 #### sessions/chat/newWidget/newChatWidget/ConnectorRecommendationsWithNotices/Light
-![screenshot](https://hediet-screenshots.azurewebsites.net/images/74eb3714cb2b5bf5f790a5e3d27b8d822c37d825b8aec00f6330a2b27855f993)
+![screenshot](https://hediet-screenshots.azurewebsites.net/images/40b510ea8c76cca3b1c106fa61488e3e37c0271c432f4e82f0447a1628d3237a)
 
 #### sessions/chat/newWidget/newChatWidget/MigrationsBackground/Light
 ![screenshot](https://hediet-screenshots.azurewebsites.net/images/0b9b27b94a368a4b1e396c5a305957b08d8eb3d329f42d36d24107ceb4cb1618)

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 were identified for the chat input clipping changes.

No open issues 🎉

What changed in this PR

Extends the editor clipping optimization from #350107 to the workbench chat input, reducing unnecessary Chromium render passes while preserving rounded borders and the streaming animation.

Changes:

  • Replaces the input’s rounded overflow clip with a square clip, disabled while streaming.
  • Moves animated gradients into square-clipped child elements with layout containment.
  • Updates tests to verify gradient geometry, scroll overflow, and the absence of nested rounded clips.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​input/​chatInputPart.test.ts Updates animation and overflow tests for the new clipping structure.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​media/​chat.css Reworks input and animation clipping to reduce rendering overhead.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatInputPart.ts Adds clip children to the decorative border and glow elements.

Review effort: Balanced

The previous commit also restructured the comet ring that spins while a
response streams: layout containment instead of its rounded overflow: clip,
and a new square-clipped child for the rotating gradient. The ring's mask is
square, so its rounded clip is what rounds the comet's arc at the corners;
the square clip changed those corners by up to 22/255. Rounding the new
child's clip instead brings back every render pass the restructuring saved.
So the ring can't drop its nested rounded clip without changing how the
comet looks, and this commit puts it back exactly as in main.

What remains is the input box's square clip-path: inset(0) instead of its
rounded overflow: hidden. That is the clip that costs render passes on every
keystroke, while nothing streams. The ring's clip only costs them while the
ring is shown. The comments say why neither clip may become (or stay)
rounded without a reason.

How to verify:
- Trace the viz and cc categories while typing in the chat input. Compared
  with main, RenderSurfaceReasonCount drops from 5 to 2 "rounded corner"
  surfaces and DirectRenderer::DrawRenderPass from about 2.8 to 1.1 per
  keystroke. The remaining 2 surfaces come from the editor card (#350107);
  with both changes, typing draws no render passes.
- Add .working to the input container and trace again: passes per frame
  stay at about 5, as in main.
- Compare screenshots of the input box's corners and of the comet with
  main: they differ by at most 1/255.

🤖 Authored with GitHub Copilot on behalf of @alexdima.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The comment on the input box's square clip said that a rounded
`overflow: hidden` makes every keystroke draw offscreen render passes.
Measured again with the signed-out "Choose how you want to use Copilot"
prompt hidden, as most users see the input, that's not what happens: the
rounded clip still adds two render surfaces around the input's text, but
viz draws each of them, a single quad, straight into its parent. The
drawn render passes per keystroke don't change (1.68 against 1.58, 2 of 4
pairs); the GPU process time does (1.37 ms against 1.21 ms, 4 of 4 pairs).
Offscreen passes only add up while that prompt is docked above the input
and squares the box's top corners (2.98 against 1.46 passes per
keystroke, 4 of 4 pairs), which is where the earlier numbers came from.

The comment now says the clip adds render surfaces and costs GPU time on
every keystroke. No behavior changes.

How to verify:
- Read the comment above `.interactive-input-part:not(.compact)
  .chat-input-container` in chat.css; only its last sentence changed.
- Trace `viz` and `cc` while typing in the chat input, with main's rule
  added back (`overflow: hidden !important; clip-path: none !important` on
  `.chat-input-container:not(.working)`) and without:
  `RenderSurfaceReasonCount` reports 5 against 3 `rounded corner`
  surfaces, and `DirectRenderer::DrawRenderPass` runs about as often.

🤖 Authored with GitHub Copilot on behalf of @alexdima.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replaces the square `clip-path` on the chat input box (the previous
commits on this branch) with a change that keeps main's CSS. The square
clip-path changed what the input looks like on Windows and Linux, which
the component-fixture screenshots in CI caught:
- With no attachment, the input editor reaches the box's inner top-right
  corner. `overflow: hidden` rounded it there; the square clip doesn't,
  so the corner turned square.
- In the Agents window's phone layout, the editor is a few pixels wider
  than the inside of the box. `overflow: hidden` clipped it inside the
  border; clip-path clips at the border's outer edge, so the editor
  covered the border.
- The clip-path changed how Chromium splits the page into composited
  layers: the text in the box and the toolbar below it moved into layers
  without an opaque background, so cc refused LCD text there
  (`contents-not-opaque`, `background-color-not-opaque`) and drew it
  grayscale. macOS never uses LCD text, so it didn't show there.

chat.css and its test are back to main's. Instead, the input editor
sets `disableLayerHinting`. Monaco otherwise promotes the editor's text
(`.lines-content`, and its margin) to a composited layer with
`translate3d(0, 0, 0)`. That layer sits under two rounded clips, the
input box's and the side bar card's, and Chromium applies one rounded
clip per draw quad, so Blink gave the outer clips render surfaces around
it on every keystroke. Without the hint, the text is drawn into the
layer below, which on main already holds the rest of the input and is
opaque, so LCD text is kept everywhere.

Measured on macOS (M5 Pro, DPR 2), one VS Code window alternating this
build and main's layer hint restored with CSS, 4 pairs, per keystroke:
- typing: GPU process 1.36 -> 1.15 ms (4 of 4 pairs), `rounded corner`
  render surfaces 4 -> 3, render passes drawn unchanged;
- with the "workbench: don't nest rounded clips around the editor"
  change (#350107) in both: 1.31 -> 1.14 ms (4 of 4), surfaces 2 -> 1;
- with the signed-out sign-in prompt docked above the input: 1.38 ->
  1.17 ms and 2.96 -> 1.57 render passes (4 of 4 each);
- while a response streams, per comet frame: no GPU difference, 5.92 ->
  5.59 render passes (4 of 4).
The surface left is Blink's caret layer for the hidden edit context.

Pixels on macOS: at most 1/255 anywhere, with and without an attachment
and with the comet paused at three times; the five chat-input component
fixtures render identically. Scrolling a long input now repaints the
input's viewport instead of moving a layer; it's a few lines high.

How to verify:
- `git diff 679e1ca -- src/vs/workbench/contrib/chat` shows only the
  new option and its comment in chatInputPart.ts.
- In a Code OSS build, open the chat view, type in the input and check
  in DevTools' Layers panel that the input's `.lines-content` has no
  layer of its own.
- Trace `viz` and `cc` while typing: `RenderSurfaceReasonCount` reports
  one `rounded corner` surface fewer than on main.
- The "Screenshots & Tests" check passes with the committed blocks-ci
  hashes.

🤖 Authored with GitHub Copilot on behalf of @alexdima.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Brings in the update from main that was merged into this branch on
GitHub (dd01b74), which includes "workbench: don't nest rounded
clips around the editor" (#350107), so that the change that turns off
Monaco's layer hint on the chat input (57b491e) can be pushed on
top of it.

How to verify:
- `git diff origin/main...HEAD -- src/vs/workbench/contrib/chat` shows
  only the `disableLayerHinting` option and its comment in
  chatInputPart.ts.

🤖 Authored with GitHub Copilot on behalf of @alexdima.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@alexdima Alexandru Dima (alexdima) changed the title chat: don't nest rounded clips in the chat input chat: don't give the chat input's text a layer of its own Nov 24, 2026
@alexdima

Copy link
Copy Markdown
Member Author

Abandoning because this breaks LCD antialising

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.

2 participants