File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ namespace CommandIDs {
3939 export const openSwitchDrive = 'drives:open-switch-drive-dialog' ;
4040 export const copyToAnotherBucket = 'drives:copy-to-another-bucket' ;
4141 export const toggleBucketSwitching = 'drives:toggle-bucket-switching-ui' ;
42+ export const toggleBrowser = 'filebrowser:toggle-main' ;
4243}
4344
4445const FILE_BROWSER_FACTORY = 'DriveBrowser' ;
@@ -159,6 +160,28 @@ const defaultFileBrowser: JupyterFrontEndPlugin<IDefaultFileBrowser> = {
159160 return bucketSwitching ;
160161 }
161162
163+ // Set attributes when adding the browser to the UI
164+ defaultBrowser . node . setAttribute ( 'role' , 'region' ) ;
165+ defaultBrowser . node . setAttribute ( 'aria-label' , 'Drive Browser Section' ) ;
166+ defaultBrowser . title . icon = DriveIcon ;
167+
168+ // Show the current file browser shortcut in its title.
169+ const updateBrowserTitle = ( ) => {
170+ const binding = app . commands . keyBindings . find (
171+ b => b . command === CommandIDs . toggleBrowser
172+ ) ;
173+ if ( binding ) {
174+ const ks = binding . keys . map ( CommandRegistry . formatKeystroke ) . join ( ', ' ) ;
175+ defaultBrowser . title . caption = 'Drive Browser (' + ks + ')' ;
176+ } else {
177+ defaultBrowser . title . caption = 'Drive Browser' ;
178+ }
179+ } ;
180+ updateBrowserTitle ( ) ;
181+ app . commands . keyBindingChanged . connect ( ( ) => {
182+ updateBrowserTitle ( ) ;
183+ } ) ;
184+
162185 // Wait for the application to be restored and for the
163186 // settings and persistent state database to be loaded
164187 app . restored
You can’t perform that action at this time.
0 commit comments