@@ -15,14 +15,14 @@ import { IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarService, ShowToolti
15
15
import { ChatContextKeys } from '../common/chatContextKeys.js' ;
16
16
import { quotaToButtonMessage , OPEN_CHAT_QUOTA_EXCEEDED_DIALOG , CHAT_SETUP_ACTION_LABEL , TOGGLE_CHAT_ACTION_ID , CHAT_OPEN_ACTION_ID } from './actions/chatActions.js' ;
17
17
import { $ , addDisposableListener , append , clearNode , EventHelper , EventLike , EventType } from '../../../../base/browser/dom.js' ;
18
- import { ChatEntitlement , IChatEntitlementService } from '../common/chatEntitlementService.js' ;
18
+ import { ChatEntitlement , ChatEntitlementService , IChatEntitlementService } from '../common/chatEntitlementService.js' ;
19
19
import { CancellationToken } from '../../../../base/common/cancellation.js' ;
20
20
import { KeybindingLabel } from '../../../../base/browser/ui/keybindingLabel/keybindingLabel.js' ;
21
21
import { defaultCheckboxStyles , defaultKeybindingLabelStyles } from '../../../../platform/theme/browser/defaultStyles.js' ;
22
22
import { Checkbox } from '../../../../base/browser/ui/toggle/toggle.js' ;
23
23
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js' ;
24
24
import { Command } from '../../../../editor/common/languages.js' ;
25
- import { ICommandService } from '../../../../platform/commands/common/commands.js' ;
25
+ import { CommandsRegistry , ICommandService } from '../../../../platform/commands/common/commands.js' ;
26
26
import { Lazy } from '../../../../base/common/lazy.js' ;
27
27
import { contrastBorder , inputValidationErrorBorder , inputValidationInfoBorder , inputValidationWarningBorder , registerColor , transparent } from '../../../../platform/theme/common/colorRegistry.js' ;
28
28
import { IHoverService } from '../../../../platform/hover/browser/hover.js' ;
@@ -98,13 +98,15 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
98
98
99
99
private static readonly SETTING = 'chat.experimental.statusIndicator.enabled' ;
100
100
101
+ private static readonly SIGN_IN_COMMAND_ID = 'workbench.action.chat.signIn' ;
102
+
101
103
private entry : IStatusbarEntryAccessor | undefined = undefined ;
102
104
103
105
private dashboard = new Lazy < ChatStatusDashboard > ( ( ) => this . instantiationService . createInstance ( ChatStatusDashboard ) ) ;
104
106
105
107
constructor (
106
108
@IStatusbarService private readonly statusbarService : IStatusbarService ,
107
- @IChatEntitlementService private readonly chatEntitlementService : IChatEntitlementService ,
109
+ @IChatEntitlementService private readonly chatEntitlementService : ChatEntitlementService ,
108
110
@IContextKeyService private readonly contextKeyService : IContextKeyService ,
109
111
@IConfigurationService private readonly configurationService : IConfigurationService ,
110
112
@IProductService private readonly productService : IProductService ,
@@ -114,6 +116,7 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
114
116
115
117
this . create ( ) ;
116
118
this . registerListeners ( ) ;
119
+ this . registerCommands ( ) ;
117
120
}
118
121
119
122
private async create ( ) : Promise < void > {
@@ -148,6 +151,12 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
148
151
this . _register ( this . chatEntitlementService . onDidChangeEntitlement ( ( ) => this . entry ?. update ( this . getEntryProps ( ) ) ) ) ;
149
152
}
150
153
154
+ private registerCommands ( ) : void {
155
+ CommandsRegistry . registerCommand ( ChatStatusBarEntry . SIGN_IN_COMMAND_ID , ( ) => {
156
+ this . chatEntitlementService . requests ?. value . signIn ( ) ;
157
+ } ) ;
158
+ }
159
+
151
160
private getEntryProps ( ) : IStatusbarEntry {
152
161
let text = '$(copilot)' ;
153
162
let ariaLabel = localize ( 'chatStatus' , "Copilot Status" ) ;
@@ -185,10 +194,13 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
185
194
186
195
// Signed out
187
196
else if ( this . chatEntitlementService . entitlement === ChatEntitlement . Unknown ) {
188
- text = '$(copilot-not-connected)' ;
197
+ text = '$(copilot-not-connected) Sign In to Use Copilot ' ;
189
198
ariaLabel = localize ( 'signInToUseCopilot' , "Sign in to Use Copilot..." ) ;
190
- tooltip = localize ( 'signInToUseCopilot' , "Sign in to Use Copilot..." ) ;
191
- command = TOGGLE_CHAT_ACTION_ID ;
199
+ tooltip = {
200
+ element : token => this . dashboard . value . show ( token )
201
+ } ;
202
+ command = ChatStatusBarEntry . SIGN_IN_COMMAND_ID ;
203
+ kind = 'prominent' ;
192
204
}
193
205
194
206
// Any other User
0 commit comments