Agent sessions: make room for chat input when space is limited (fix #281053) (#283263)

* Agent sessions: make room for chat input when space is limited (fix #281053)

* cleanup

* fix

* cleanup
This commit is contained in:
Benjamin Pasero
2025-12-13 08:32:29 +01:00
committed by GitHub
parent b3113d01e4
commit 732e7801d3
@@ -473,6 +473,8 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
//#region Chat Control
private static readonly MIN_CHAT_WIDGET_HEIGHT = 120;
private _widget!: ChatWidget;
get widget(): ChatWidget { return this._widget; }
@@ -779,9 +781,15 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
}
// Ensure visibility is in sync before we layout
this.updateSessionsControlVisibility();
const { visible: sessionsContainerVisible } = this.updateSessionsControlVisibility();
if (!sessionsContainerVisible) {
return { heightReduction: 0, widthReduction: 0 };
}
const availableSessionsHeight = height - this.sessionsTitleContainer.offsetHeight - this.sessionsLinkContainer.offsetHeight;
let availableSessionsHeight = height - this.sessionsTitleContainer.offsetHeight - this.sessionsLinkContainer.offsetHeight;
if (this.sessionsViewerOrientation === AgentSessionsViewerOrientation.Stacked) {
availableSessionsHeight -= ChatViewPane.MIN_CHAT_WIDGET_HEIGHT; // always reserve some space for chat input
}
// Show as sidebar
if (this.sessionsViewerOrientation === AgentSessionsViewerOrientation.SideBySide) {