@@ -94,6 +94,25 @@ const ASK_FOR_PUBLIC_CODE_MATCHES = false; // TODO@bpasero revisit this
94
94
const TRIGGER_SETUP_COMMAND_ID = 'workbench.action.chat.triggerSetup' ;
95
95
const TRIGGER_SETUP_COMMAND_LABEL = localize2 ( 'triggerChatSetup' , "Use AI Features with Copilot for Free..." ) ;
96
96
97
+ export const SetupWelcomeViewKeys = new Set ( [ ChatContextKeys . Setup . triggered . key , ChatContextKeys . Setup . installed . key , ChatContextKeys . Setup . signedOut . key , ChatContextKeys . Setup . canSignUp . key ] ) ;
98
+ export const SetupWelcomeViewCondition = ContextKeyExpr . and (
99
+ ContextKeyExpr . has ( 'config.chat.experimental.offerSetup' ) ,
100
+ ContextKeyExpr . or (
101
+ ContextKeyExpr . and (
102
+ ChatContextKeys . Setup . triggered ,
103
+ ChatContextKeys . Setup . installed . negate ( )
104
+ ) ,
105
+ ContextKeyExpr . and (
106
+ ChatContextKeys . Setup . canSignUp ,
107
+ ChatContextKeys . Setup . installed
108
+ ) ,
109
+ ContextKeyExpr . and (
110
+ ChatContextKeys . Setup . signedOut ,
111
+ ChatContextKeys . Setup . installed
112
+ )
113
+ )
114
+ ) ! ;
115
+
97
116
export class ChatSetupContribution extends Disposable implements IWorkbenchContribution {
98
117
99
118
static readonly ID = 'workbench.chat.setup' ;
@@ -119,23 +138,7 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr
119
138
private registerChatWelcome ( ) : void {
120
139
Registry . as < IChatViewsWelcomeContributionRegistry > ( ChatViewsWelcomeExtensions . ChatViewsWelcomeRegistry ) . register ( {
121
140
title : localize ( 'welcomeChat' , "Welcome to Copilot" ) ,
122
- when : ContextKeyExpr . and (
123
- ContextKeyExpr . has ( 'config.chat.experimental.offerSetup' ) ,
124
- ContextKeyExpr . or (
125
- ContextKeyExpr . and (
126
- ChatContextKeys . Setup . triggered ,
127
- ChatContextKeys . Setup . installed . negate ( )
128
- ) ,
129
- ContextKeyExpr . and (
130
- ChatContextKeys . Setup . canSignUp ,
131
- ChatContextKeys . Setup . installed
132
- ) ,
133
- ContextKeyExpr . and (
134
- ChatContextKeys . Setup . signedOut ,
135
- ChatContextKeys . Setup . installed
136
- )
137
- )
138
- ) ! ,
141
+ when : SetupWelcomeViewCondition ,
139
142
icon : Codicon . copilotLarge ,
140
143
content : disposables => disposables . add ( this . instantiationService . createInstance ( ChatSetupWelcomeContent , this . controller . value , this . context ) ) . element ,
141
144
} ) ;
0 commit comments