Skip to content

Commit 209376d

Browse files
authored
agent sessions - more tweaks to prevent excessive layout (#288381)
1 parent 10771d9 commit 209376d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,14 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
647647
}));
648648

649649
// When showing sessions stacked, adjust the height of the sessions list to make room for chat input
650+
let lastChatInputHeight: number | undefined;
650651
this._register(chatWidget.input.onDidChangeHeight(() => {
651652
if (this.sessionsViewerVisible && this.sessionsViewerOrientation === AgentSessionsViewerOrientation.Stacked) {
652-
this.relayout();
653+
const chatInputHeight = this._widget?.input?.contentHeight;
654+
if (chatInputHeight && chatInputHeight !== lastChatInputHeight) { // ensure we only layout on actual height changes
655+
lastChatInputHeight = chatInputHeight;
656+
this.relayout();
657+
}
653658
}
654659
}));
655660
}

0 commit comments

Comments
 (0)