From b03299b291361529d821d7d9fd4a5ec3d99e19fa Mon Sep 17 00:00:00 2001 From: Duc Trung Le Date: Wed, 18 Sep 2024 17:04:52 +0200 Subject: [PATCH] Add missing aria label to the file browser (#355) --- 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,