Fix inconsistent Omni input window height growth (#331233)

This commit is contained in:
Copilot
2026-08-18 15:24:48 +00:00
committed by GitHub
parent b50a541238
commit c0b328e1b6
@@ -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);
}