Fix inline chat widget collapsing when removing attachments (#227167)

Fix microsoft/vscode-copilot#7661
pull/207670/merge
Rob Lourens 2024-08-29 15:20:47 -07:00 committed by GitHub
parent 777c2ac861
commit 231deb14cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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();