From 1b22d602fec7a7151e72eb1664a84530737db54e Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 27 Sep 2024 14:08:28 -0700 Subject: [PATCH] Avoid setting a negative padding on the chat welcome view container (#229996) The layout here is a bit weird to avoid shifting when followups appear. If the followups wrap, then the layout is messed up because negative padding is not allowed. I might try to simplify this for next month. Fix microsoft/vscode-copilot#8749 --- src/vs/workbench/contrib/chat/browser/chatWidget.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatWidget.ts b/src/vs/workbench/contrib/chat/browser/chatWidget.ts index 3c3a79cf03fb5..612ae173d9974 100644 --- a/src/vs/workbench/contrib/chat/browser/chatWidget.ts +++ b/src/vs/workbench/contrib/chat/browser/chatWidget.ts @@ -963,7 +963,7 @@ export class ChatWidget extends Disposable implements IChatWidget { this.tree.getHTMLElement().style.height = `${listHeight}px`; // Push the welcome message down so it doesn't change position when followups appear - const followupsOffset = 100 - this.inputPart.followupsHeight; + const followupsOffset = Math.max(100 - this.inputPart.followupsHeight, 0); this.welcomeMessageContainer.style.height = `${listHeight - followupsOffset}px`; this.welcomeMessageContainer.style.paddingBottom = `${followupsOffset}px`; this.renderer.layout(width);