From 231deb14cd5a978343f722e9ac5207b0ae0dd607 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 29 Aug 2024 15:20:47 -0700 Subject: [PATCH] Fix inline chat widget collapsing when removing attachments (#227167) Fix microsoft/vscode-copilot#7661 --- src/vs/workbench/contrib/chat/browser/chatInputPart.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatInputPart.ts b/src/vs/workbench/contrib/chat/browser/chatInputPart.ts index 8f910bc2e76..52d7d73bd97 100644 --- a/src/vs/workbench/contrib/chat/browser/chatInputPart.ts +++ b/src/vs/workbench/contrib/chat/browser/chatInputPart.ts @@ -516,7 +516,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge onDidChangeCursorPosition(); } - private initAttachedContext(container: HTMLElement) { + private initAttachedContext(container: HTMLElement, isLayout = false) { const oldHeight = container.offsetHeight; dom.clearNode(container); this.attachedContextDisposables.clear(); @@ -578,7 +578,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge this.attachedContextDisposables.add(disp); }); - if (oldHeight !== container.offsetHeight) { + if (oldHeight !== container.offsetHeight && !isLayout) { this._onDidChangeHeight.fire(); } } @@ -609,7 +609,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge private previousInputEditorDimension: IDimension | undefined; private _layout(height: number, width: number, allowRecurse = true): void { - this.initAttachedContext(this.attachedContextContainer); + this.initAttachedContext(this.attachedContextContainer, true); const data = this.getLayoutData();