mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +01:00
sessions: fix welcome page chat input collapsing on first keystroke
The chat input on the Agent Sessions welcome page would collapse from ~44px to ~22px after the first character typed, hiding the text. Root cause: ChatWidget.layout() reserves MIN_LIST_HEIGHT (50px) for the chat list even when the welcome page hides it via CSS. With a layout height of 150px, the remaining budget for the input part was only 100px. Once the input part's non-editor chrome (~128px for toolbars, padding, attachments) was subtracted, _effectiveInputEditorMaxHeight dropped to 0, collapsing the editor. Fix: call setInputPartMaxHeightOverride(272) before layout so the input part has enough budget independent of the artificially small layout height. This mirrors what other compact chat surfaces (e.g. stacked chat view) already do. Fixes #304544 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -65,6 +65,8 @@ const configurationKey = 'workbench.startupEditor';
|
||||
const MAX_SESSIONS = 6;
|
||||
const MAX_REPO_PICKS = 10;
|
||||
const MAX_WALKTHROUGHS = 10;
|
||||
const WELCOME_CHAT_INPUT_LAYOUT_HEIGHT = 150;
|
||||
const WELCOME_CHAT_INPUT_MAX_HEIGHT_OVERRIDE = 272;
|
||||
|
||||
/**
|
||||
* - visibleDurationMs: Do they close it right away or leave it open (#3)
|
||||
@@ -804,9 +806,8 @@ export class AgentSessionsWelcomePage extends EditorPane {
|
||||
}
|
||||
|
||||
const chatWidth = Math.min(800, this.lastDimension.width - 80);
|
||||
// Use a reasonable height for the input part - the CSS will hide the list area
|
||||
const inputHeight = 150;
|
||||
this.chatWidget.layout(inputHeight, chatWidth);
|
||||
this.chatWidget.setInputPartMaxHeightOverride(WELCOME_CHAT_INPUT_MAX_HEIGHT_OVERRIDE);
|
||||
this.chatWidget.layout(WELCOME_CHAT_INPUT_LAYOUT_HEIGHT, chatWidth);
|
||||
}
|
||||
|
||||
private layoutSessionsControl(): void {
|
||||
|
||||
Reference in New Issue
Block a user