From e6df4b17c42841e16bd9786fb918a5506fddfcaa Mon Sep 17 00:00:00 2001 From: Duc Trung Le Date: Wed, 18 Sep 2024 15:55:06 +0200 Subject: [PATCH] Add missing aria label to the file browser --- packages/docprovider-extension/src/filebrowser.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/docprovider-extension/src/filebrowser.ts b/packages/docprovider-extension/src/filebrowser.ts index 34dbb380..a7777634 100644 --- a/packages/docprovider-extension/src/filebrowser.ts +++ b/packages/docprovider-extension/src/filebrowser.ts @@ -243,7 +243,8 @@ export const defaultFileBrowser: JupyterFrontEndPlugin = { IRouter, JupyterFrontEnd.ITreeResolver, ILabShell, - ISettingRegistry + ISettingRegistry, + ITranslator ], activate: async ( app: JupyterFrontEnd, @@ -251,10 +252,11 @@ export const defaultFileBrowser: JupyterFrontEndPlugin = { fileBrowserFactory: IFileBrowserFactory, router: IRouter | null, tree: JupyterFrontEnd.ITreeResolver | null, - labShell: ILabShell | null + labShell: ILabShell | null, + translator: ITranslator | null ): Promise => { const { commands } = app; - + const trans = (translator ?? nullTranslator).load('jupyterlab'); app.serviceManager.contents.addDrive(drive); // Manually restore and load the default file browser. @@ -263,6 +265,12 @@ export const defaultFileBrowser: JupyterFrontEndPlugin = { restore: false, driveName: drive.name }); + defaultBrowser.node.setAttribute('role', 'region'); + defaultBrowser.node.setAttribute( + 'aria-label', + trans.__('File Browser Section') + ); + void Private.restoreBrowser( defaultBrowser, commands,