@@ -83,7 +83,7 @@ export interface IInlineChatWidgetConstructionOptions {
83
83
/**
84
84
* The men that rendered in the lower right corner, use for feedback
85
85
*/
86
- feedbackMenuId : MenuId ;
86
+ feedbackMenuId ? : MenuId ;
87
87
88
88
/**
89
89
* @deprecated
@@ -157,19 +157,6 @@ export class InlineChatWidget {
157
157
@ITextModelService protected readonly _textModelResolverService : ITextModelService ,
158
158
@IChatService private readonly _chatService : IChatService ,
159
159
) {
160
- // Share hover delegates between toolbars to support instant hover between both
161
- // TODO@jrieken move into chat widget
162
- // const hoverDelegate = this._store.add(createInstantHoverDelegate());
163
-
164
- this . _store . add ( this . _configurationService . onDidChangeConfiguration ( e => {
165
- if ( e . affectsConfiguration ( AccessibilityVerbositySettingId . InlineChat ) ) {
166
- this . _updateAriaLabel ( ) ;
167
- // TODO@jrieken FIX THIS
168
- // this._chatWidget.ariaLabel = this._accessibleViewService.getOpenAriaHint(AccessibilityVerbositySettingId.InlineChat);
169
- this . _elements . followUps . ariaLabel = this . _accessibleViewService . getOpenAriaHint ( AccessibilityVerbositySettingId . InlineChat ) ;
170
- }
171
- } ) ) ;
172
-
173
160
// toolbars
174
161
this . _progressBar = new ProgressBar ( this . _elements . progress ) ;
175
162
this . _store . add ( this . _progressBar ) ;
@@ -290,14 +277,22 @@ export class InlineChatWidget {
290
277
}
291
278
} ;
292
279
293
- const feedbackToolbar = this . _instantiationService . createInstance ( MenuWorkbenchToolBar , this . _elements . feedbackToolbar , options . feedbackMenuId , { ...workbenchToolbarOptions , hiddenItemStrategy : HiddenItemStrategy . Ignore } ) ;
294
- this . _store . add ( feedbackToolbar . onDidChangeMenuItems ( ( ) => this . _onDidChangeHeight . fire ( ) ) ) ;
295
- this . _store . add ( feedbackToolbar ) ;
280
+ if ( options . feedbackMenuId ) {
281
+ const feedbackToolbar = this . _instantiationService . createInstance ( MenuWorkbenchToolBar , this . _elements . feedbackToolbar , options . feedbackMenuId , { ...workbenchToolbarOptions , hiddenItemStrategy : HiddenItemStrategy . Ignore } ) ;
282
+ this . _store . add ( feedbackToolbar . onDidChangeMenuItems ( ( ) => this . _onDidChangeHeight . fire ( ) ) ) ;
283
+ this . _store . add ( feedbackToolbar ) ;
284
+ }
296
285
286
+ this . _store . add ( this . _configurationService . onDidChangeConfiguration ( e => {
287
+ if ( e . affectsConfiguration ( AccessibilityVerbositySettingId . InlineChat ) ) {
288
+ this . _updateAriaLabel ( ) ;
289
+ }
290
+ } ) ) ;
297
291
292
+ this . _elements . root . tabIndex = 0 ;
298
293
this . _elements . followUps . tabIndex = 0 ;
299
- this . _elements . followUps . ariaLabel = this . _accessibleViewService . getOpenAriaHint ( AccessibilityVerbositySettingId . InlineChat ) ;
300
294
this . _elements . statusLabel . tabIndex = 0 ;
295
+ this . _updateAriaLabel ( ) ;
301
296
302
297
// this._elements.status
303
298
this . _store . add ( setupCustomHover ( getDefaultHoverDelegate ( 'element' ) , this . _elements . statusLabel , ( ) => {
@@ -319,15 +314,19 @@ export class InlineChatWidget {
319
314
}
320
315
321
316
private _updateAriaLabel ( ) : void {
322
- if ( ! this . _accessibilityService . isScreenReaderOptimized ( ) ) {
323
- return ;
324
- }
325
- let label = defaultAriaLabel ;
326
- if ( this . _configurationService . getValue < boolean > ( AccessibilityVerbositySettingId . InlineChat ) ) {
327
- const kbLabel = this . _keybindingService . lookupKeybinding ( AccessibilityCommandId . OpenAccessibilityHelp ) ?. getLabel ( ) ;
328
- label = kbLabel ? localize ( 'inlineChat.accessibilityHelp' , "Inline Chat Input, Use {0} for Inline Chat Accessibility Help." , kbLabel ) : localize ( 'inlineChat.accessibilityHelpNoKb' , "Inline Chat Input, Run the Inline Chat Accessibility Help command for more information." ) ;
317
+
318
+ this . _elements . root . ariaLabel = this . _accessibleViewService . getOpenAriaHint ( AccessibilityVerbositySettingId . InlineChat ) ;
319
+
320
+ if ( this . _accessibilityService . isScreenReaderOptimized ( ) ) {
321
+ let label = defaultAriaLabel ;
322
+ if ( this . _configurationService . getValue < boolean > ( AccessibilityVerbositySettingId . InlineChat ) ) {
323
+ const kbLabel = this . _keybindingService . lookupKeybinding ( AccessibilityCommandId . OpenAccessibilityHelp ) ?. getLabel ( ) ;
324
+ label = kbLabel
325
+ ? localize ( 'inlineChat.accessibilityHelp' , "Inline Chat Input, Use {0} for Inline Chat Accessibility Help." , kbLabel )
326
+ : localize ( 'inlineChat.accessibilityHelpNoKb' , "Inline Chat Input, Run the Inline Chat Accessibility Help command for more information." ) ;
327
+ }
328
+ this . _chatWidget . inputEditor . updateOptions ( { ariaLabel : label } ) ;
329
329
}
330
- this . _chatWidget . inputEditor . updateOptions ( { ariaLabel : label } ) ;
331
330
}
332
331
333
332
dispose ( ) : void {
@@ -526,7 +525,9 @@ export class InlineChatWidget {
526
525
}
527
526
} ;
528
527
}
529
-
528
+ /**
529
+ * @deprecated use `setChatModel` instead
530
+ */
530
531
updateFollowUps ( items : IInlineChatFollowup [ ] , onFollowup : ( followup : IInlineChatFollowup ) => void ) : void ;
531
532
updateFollowUps ( items : undefined ) : void ;
532
533
updateFollowUps ( items : IInlineChatFollowup [ ] | undefined , onFollowup ?: ( ( followup : IInlineChatFollowup ) => void ) ) {
@@ -540,10 +541,11 @@ export class InlineChatWidget {
540
541
this . _onDidChangeHeight . fire ( ) ;
541
542
}
542
543
543
-
544
+ /**
545
+ * @deprecated use `setChatModel` instead
546
+ */
544
547
updateSlashCommands ( commands : IInlineChatSlashCommand [ ] ) {
545
- // this._inputWidget.updateSlashCommands(commands);
546
- // TODO@jrieken
548
+
547
549
}
548
550
549
551
updateInfo ( message : string ) : void {
0 commit comments