@@ -8,12 +8,13 @@ import { MainContext, MainThreadNotebookShape, NotebookExtensionDescription, IEx
88import { Disposable } from 'vs/base/common/lifecycle' ;
99import { URI , UriComponents } from 'vs/base/common/uri' ;
1010import { INotebookService , IMainNotebookController } from 'vs/workbench/contrib/notebook/browser/notebookService' ;
11- import { INotebookTextModel , INotebookMimeTypeSelector , NOTEBOOK_DISPLAY_ORDER , NotebookCellOutputsSplice , CellKind , NotebookDocumentMetadata , NotebookCellMetadata , ICellEditOperation } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
11+ import { INotebookTextModel , INotebookMimeTypeSelector , NOTEBOOK_DISPLAY_ORDER , NotebookCellOutputsSplice , CellKind , NotebookDocumentMetadata , NotebookCellMetadata , ICellEditOperation , ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
1212import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
1313import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel' ;
1414import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
1515import { INotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookBrowser' ;
1616import { CancellationToken } from 'vs/base/common/cancellation' ;
17+ import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility' ;
1718
1819export class MainThreadNotebookDocument extends Disposable {
1920 private _textModel : NotebookTextModel ;
@@ -63,6 +64,7 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo
6364 @INotebookService private _notebookService : INotebookService ,
6465 @IConfigurationService private readonly configurationService : IConfigurationService ,
6566 @IEditorService private readonly editorService : IEditorService ,
67+ @IAccessibilityService private readonly accessibilityService : IAccessibilityService
6668
6769 ) {
6870 super ( ) ;
@@ -85,22 +87,25 @@ export class MainThreadNotebooks extends Disposable implements MainThreadNoteboo
8587 this . _proxy . $updateActiveEditor ( e . viewType , e . uri ) ;
8688 } ) ) ;
8789
88- let userOrder = this . configurationService . getValue < string [ ] > ( 'notebook.displayOrder' ) ;
89- this . _proxy . $acceptDisplayOrder ( {
90- defaultOrder : NOTEBOOK_DISPLAY_ORDER ,
91- userOrder : userOrder
92- } ) ;
90+ const updateOrder = ( ) => {
91+ let userOrder = this . configurationService . getValue < string [ ] > ( 'notebook.displayOrder' ) ;
92+ this . _proxy . $acceptDisplayOrder ( {
93+ defaultOrder : this . accessibilityService . isScreenReaderOptimized ( ) ? ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER : NOTEBOOK_DISPLAY_ORDER ,
94+ userOrder : userOrder
95+ } ) ;
96+ } ;
9397
94- this . configurationService . onDidChangeConfiguration ( e => {
95- if ( e . affectedKeys . indexOf ( 'notebook.displayOrder' ) >= 0 ) {
96- let userOrder = this . configurationService . getValue < string [ ] > ( 'notebook.displayOrder' ) ;
98+ updateOrder ( ) ;
9799
98- this . _proxy . $acceptDisplayOrder ( {
99- defaultOrder : NOTEBOOK_DISPLAY_ORDER ,
100- userOrder : userOrder
101- } ) ;
100+ this . _register ( this . configurationService . onDidChangeConfiguration ( e => {
101+ if ( e . affectedKeys . indexOf ( 'notebook.displayOrder' ) >= 0 ) {
102+ updateOrder ( ) ;
102103 }
103- } ) ;
104+ } ) ) ;
105+
106+ this . _register ( this . accessibilityService . onDidChangeScreenReaderOptimized ( ( ) => {
107+ updateOrder ( ) ;
108+ } ) ) ;
104109 }
105110
106111 async $registerNotebookRenderer ( extension : NotebookExtensionDescription , type : string , selectors : INotebookMimeTypeSelector , handle : number , preloads : UriComponents [ ] ) : Promise < void > {
0 commit comments