From c0b328e1b609cc2ee8744f625eeb37fdfe34aa91 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Aug 2026 15:24:48 +0000 Subject: [PATCH] Fix inconsistent Omni input window height growth (#331233) --- .../browser/chatInputWindow/chatInputWindowService.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatInputWindow/chatInputWindowService.ts b/src/vs/workbench/contrib/chat/browser/chatInputWindow/chatInputWindowService.ts index e0749a05ff9..efceae4c8c5 100644 --- a/src/vs/workbench/contrib/chat/browser/chatInputWindow/chatInputWindowService.ts +++ b/src/vs/workbench/contrib/chat/browser/chatInputWindow/chatInputWindowService.ts @@ -642,7 +642,15 @@ export class ChatInputWindowService extends Disposable implements IChatInputWind let pendingBounds: IRectangle | undefined; let applyingBounds = false; const getRowHeight = () => { - let contentHeight = Math.ceil(widget.contentHeight); + // Measure the input's rendered height synchronously rather than + // reading `widget.contentHeight`, which is backed by a + // ResizeObserver and lags a frame behind. `layout()` re-lays the + // editor synchronously, so the observable is stale until the + // observer fires next frame; sizing the window to that stale height + // while the editor grows (e.g. pasting text or cycling input + // history) clips the new lines and makes the window grow + // inconsistently until the observer catches up. + let contentHeight = Math.ceil(widget.input.element.offsetHeight); if (widget.attachmentModel.size > 0) { contentHeight += Math.max(0, CHAT_INPUT_WINDOW_INITIAL_SURFACE_HEIGHT - widget.input.inputRowHeight); }