@@ -25,6 +25,8 @@ import { IHostService } from 'vs/workbench/services/host/browser/host';
25
25
import { IntervalCounter } from 'vs/base/common/async' ;
26
26
import { assertIsDefined } from 'vs/base/common/types' ;
27
27
import { NotificationsToastsVisibleContext } from 'vs/workbench/common/contextkeys' ;
28
+ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
29
+ import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
28
30
29
31
interface INotificationToast {
30
32
readonly item : INotificationViewItem ;
@@ -83,7 +85,9 @@ export class NotificationsToasts extends Themable implements INotificationsToast
83
85
@IEditorGroupsService private readonly editorGroupService : IEditorGroupsService ,
84
86
@IContextKeyService private readonly contextKeyService : IContextKeyService ,
85
87
@ILifecycleService private readonly lifecycleService : ILifecycleService ,
86
- @IHostService private readonly hostService : IHostService
88
+ @IHostService private readonly hostService : IHostService ,
89
+ @IKeybindingService private readonly _keybindingService : IKeybindingService ,
90
+ @IConfigurationService private readonly _configurationService : IConfigurationService
87
91
) {
88
92
super ( themeService ) ;
89
93
@@ -187,11 +191,24 @@ export class NotificationsToasts extends Themable implements INotificationsToast
187
191
const notificationList = this . instantiationService . createInstance ( NotificationsList , notificationToast , {
188
192
verticalScrollMode : ScrollbarVisibility . Hidden ,
189
193
widgetAriaLabel : ( ( ) => {
190
- if ( ! item . source ) {
191
- return localize ( 'notificationAriaLabel' , "{0}, notification" , item . message . raw ) ;
194
+ let accessibleViewHint : string | undefined ;
195
+ const keybinding = this . _keybindingService . lookupKeybinding ( 'editor.action.accessibleView' ) ?. getAriaLabel ( ) ;
196
+ if ( this . _configurationService . getValue ( 'accessibility.verbosity.notification' ) ) {
197
+ accessibleViewHint = keybinding ? localize ( 'chatAccessibleViewHint' , "Inspect the response in the accessible view with {0}" , keybinding ) : localize ( 'chatAccessibleViewHintNoKb' , "Inspect the response in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding" ) ;
192
198
}
193
199
194
- return localize ( 'notificationWithSourceAriaLabel' , "{0}, source: {1}, notification" , item . message . raw , item . source ) ;
200
+ if ( ! item . source ) {
201
+ if ( accessibleViewHint ) {
202
+ return localize ( 'notificationAriaLabelViewHint' , "{0}, notification {1}" , item . message . raw , accessibleViewHint ) ;
203
+ } else {
204
+ return localize ( 'notificationAriaLabel' , "{0}, notification" , item . message . raw ) ;
205
+ }
206
+ }
207
+ if ( accessibleViewHint ) {
208
+ return localize ( 'notificationWithSourceAriaLabelViewHint' , "{0}, source: {1}, notification {2}" , item . message . raw , item . source , accessibleViewHint ) ;
209
+ } else {
210
+ return localize ( 'notificationWithSourceAriaLabel' , "{0}, source: {1}, notification" , item . message . raw , item . source ) ;
211
+ }
195
212
} ) ( )
196
213
} ) ;
197
214
itemDisposables . add ( notificationList ) ;
0 commit comments