@@ -90,6 +90,8 @@ import { INotebookLoggingService } from 'vs/workbench/contrib/notebook/common/no
90
90
import { Schemas } from 'vs/base/common/network' ;
91
91
import { DropIntoEditorController } from 'vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController' ;
92
92
import { CopyPasteController } from 'vs/editor/contrib/dropOrPasteInto/browser/copyPasteController' ;
93
+ import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution' ;
94
+ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
93
95
94
96
const $ = DOM . $ ;
95
97
@@ -284,6 +286,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
284
286
@INotebookExecutionStateService notebookExecutionStateService : INotebookExecutionStateService ,
285
287
@IEditorProgressService private editorProgressService : IEditorProgressService ,
286
288
@INotebookLoggingService readonly logService : INotebookLoggingService ,
289
+ @IKeybindingService readonly keybindingService : IKeybindingService
287
290
) {
288
291
super ( ) ;
289
292
@@ -851,6 +854,17 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
851
854
this . _listDelegate = this . instantiationService . createInstance ( NotebookCellListDelegate ) ;
852
855
this . _register ( this . _listDelegate ) ;
853
856
857
+ const createNotebookAriaLabel = ( ) => {
858
+ const keybinding = this . keybindingService . lookupKeybinding ( 'editor.action.accessibilityHelp' ) ?. getLabel ( ) ;
859
+
860
+ if ( this . configurationService . getValue ( AccessibilityVerbositySettingId . Notebook ) ) {
861
+ return keybinding
862
+ ? nls . localize ( 'notebookTreeAriaLabelHelp' , "Notebook\nUse {0} for accessibility help" , keybinding )
863
+ : nls . localize ( 'notebookTreeAriaLabelHelpNoKb' , "Notebook\nRun the Open Accessibility Help command for more information" , keybinding ) ;
864
+ }
865
+ return nls . localize ( 'notebookTreeAriaLabel' , "Notebook" ) ;
866
+ } ;
867
+
854
868
this . _list = this . instantiationService . createInstance (
855
869
NotebookCellList ,
856
870
'NotebookCellList' ,
@@ -904,9 +918,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
904
918
905
919
return '' ;
906
920
} ,
907
- getWidgetAriaLabel ( ) {
908
- return nls . localize ( 'notebookTreeAriaLabel' , "Notebook" ) ;
909
- }
921
+ getWidgetAriaLabel : createNotebookAriaLabel
910
922
} ,
911
923
} ,
912
924
) ;
@@ -987,6 +999,12 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
987
999
} ) ) ;
988
1000
989
1001
this . _registerNotebookActionsToolbar ( ) ;
1002
+
1003
+ this . _register ( this . configurationService . onDidChangeConfiguration ( e => {
1004
+ if ( e . affectsConfiguration ( AccessibilityVerbositySettingId . Notebook ) ) {
1005
+ this . _list . ariaLabel = createNotebookAriaLabel ( ) ;
1006
+ }
1007
+ } ) ) ;
990
1008
}
991
1009
992
1010
private showListContextMenu ( e : IListContextMenuEvent < CellViewModel > ) {
0 commit comments