@@ -26,6 +26,7 @@ import { SIDE_BAR_FOREGROUND } from '../../../common/theme.js';
26
26
import { IViewDescriptorService } from '../../../common/views.js' ;
27
27
import { IChatViewTitleActionContext } from '../common/chatActions.js' ;
28
28
import { ChatAgentLocation , IChatAgentService } from '../common/chatAgents.js' ;
29
+ import { ChatContextKeys } from '../common/chatContextKeys.js' ;
29
30
import { ChatModelInitState , IChatModel } from '../common/chatModel.js' ;
30
31
import { CHAT_PROVIDER_ID } from '../common/chatParticipantContribTypes.js' ;
31
32
import { IChatService } from '../common/chatService.js' ;
@@ -99,6 +100,13 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
99
100
100
101
this . _onDidChangeViewWelcomeState . fire ( ) ;
101
102
} ) ) ;
103
+
104
+ const keysToWatch = new Set ( ChatContextKeys . Setup . signedOut . key ) ;
105
+ this . _register ( this . contextKeyService . onDidChangeContext ( e => {
106
+ if ( e . affectsSome ( keysToWatch ) ) {
107
+ this . _onDidChangeViewWelcomeState . fire ( ) ;
108
+ }
109
+ } ) ) ;
102
110
}
103
111
104
112
override getActionsContext ( ) : IChatViewTitleActionContext | undefined {
@@ -130,10 +138,11 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
130
138
}
131
139
132
140
override shouldShowWelcome ( ) : boolean {
141
+ const signedOut = this . contextKeyService . getContextKeyValue < boolean > ( ChatContextKeys . Setup . signedOut . key ) ;
133
142
const noPersistedSessions = ! this . chatService . hasSessions ( ) ;
134
- const shouldShow = this . didUnregisterProvider || ! this . _widget ?. viewModel && noPersistedSessions || this . defaultParticipantRegistrationFailed ;
135
- this . logService . trace ( `ChatViewPane#shouldShowWelcome(${ this . chatOptions . location } ) = ${ shouldShow } : didUnregister=${ this . didUnregisterProvider } || noViewModel:${ ! this . _widget ?. viewModel } && noPersistedSessions=${ noPersistedSessions } || defaultParticipantRegistrationFailed=${ this . defaultParticipantRegistrationFailed } ` ) ;
136
- return shouldShow ;
143
+ const shouldShow = this . didUnregisterProvider || ! this . _widget ?. viewModel && noPersistedSessions || this . defaultParticipantRegistrationFailed || signedOut ;
144
+ this . logService . trace ( `ChatViewPane#shouldShowWelcome(${ this . chatOptions . location } ) = ${ shouldShow } : didUnregister=${ this . didUnregisterProvider } || noViewModel:${ ! this . _widget ?. viewModel } && noPersistedSessions=${ noPersistedSessions } || defaultParticipantRegistrationFailed=${ this . defaultParticipantRegistrationFailed } || signedOut= ${ signedOut } ` ) ;
145
+ return ! ! shouldShow ;
137
146
}
138
147
139
148
private getSessionId ( ) {
0 commit comments