Switch chat view immediately when clicking cloud session (#290191)

Just detect this loading state with no model and don't show the sessions control in that scenario
Fix #289904
This commit is contained in:
Rob Lourens
2026-01-24 16:21:03 -08:00
committed by GitHub
parent 79c1f6ad28
commit d1b96c2426
2 changed files with 7 additions and 9 deletions

View File

@@ -784,14 +784,12 @@ export class ChatWidget extends Disposable implements IChatWidget {
* Updates the DOM visibility of welcome view and chat list immediately
*/
private updateChatViewVisibility(): void {
if (!this.viewModel) {
return;
if (this.viewModel) {
const numItems = this.viewModel.getItems().length;
dom.setVisibility(numItems === 0, this.welcomeMessageContainer);
dom.setVisibility(numItems !== 0, this.listContainer);
}
const numItems = this.viewModel.getItems().length;
dom.setVisibility(numItems === 0, this.welcomeMessageContainer);
dom.setVisibility(numItems !== 0, this.listContainer);
this._onDidChangeEmptyState.fire();
}

View File

@@ -461,9 +461,9 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
// Sessions control: stacked
if (this.sessionsViewerOrientation === AgentSessionsViewerOrientation.Stacked) {
newSessionsContainerVisible =
!!this.chatEntitlementService.sentiment.installed && // chat is installed (otherwise make room for terms and welcome)
(!this._widget || this._widget?.isEmpty()) && // chat widget empty
!this.welcomeController?.isShowingWelcome.get(); // welcome not showing
!!this.chatEntitlementService.sentiment.installed && // chat is installed (otherwise make room for terms and welcome)
(!this._widget || (this._widget.isEmpty() && !!this._widget.viewModel)) && // chat widget empty (but not when model is loading)
!this.welcomeController?.isShowingWelcome.get(); // welcome not showing
}
// Sessions control: sidebar