Merge pull request #6377 from jtpio/checkboxes

Show file checkboxes by default in the file browser
This commit is contained in:
Jeremy Tuloup 2022-04-26 18:47:00 +02:00 committed by GitHub
commit 722f1d7e6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 2 deletions

View File

@ -32,8 +32,16 @@ import {
import { Menu, MenuBar, TabPanel } from '@lumino/widgets';
/**
* The file browser factory.
*/
const FILE_BROWSER_FACTORY = 'FileBrowser';
/**
* The file browser plugin id.
*/
const FILE_BROWSER_PLUGIN_ID = '@jupyterlab/filebrowser-extension:browser';
/**
* Plugin to add extra commands to the file browser to create
* new notebooks, files, consoles and terminals
@ -101,7 +109,7 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
app: JupyterFrontEnd,
factory: IFileBrowserFactory,
translator: ITranslator,
settings: ISettingRegistry,
settingRegistry: ISettingRegistry,
toolbarRegistry: IToolbarWidgetRegistry,
manager: IRunningSessionManagers | null
): void => {
@ -135,7 +143,7 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
browser,
createToolbarFactory(
toolbarRegistry,
settings,
settingRegistry,
FILE_BROWSER_FACTORY,
browserWidget.id,
translator
@ -151,6 +159,19 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
tabPanel.tabBar.addTab(running.title);
}
// show checkboxes by default if there is no user setting override
const settings = settingRegistry.load(FILE_BROWSER_PLUGIN_ID);
Promise.all([settings, app.restored])
.then(([settings]) => {
if (settings.user.showFileCheckboxes !== undefined) {
return;
}
void settings.set('showFileCheckboxes', true);
})
.catch((reason: Error) => {
console.error(reason.message);
});
app.shell.add(tabPanel, 'main', { rank: 100 });
}
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB