Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the tab renderer to allow adding closable tab #6477

Merged
merged 2 commits into from
Jul 20, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions packages/tree-extension/src/index.ts
Original file line number Diff line number Diff line change
@@ -3,19 +3,19 @@

import {
JupyterFrontEnd,
JupyterFrontEndPlugin
JupyterFrontEndPlugin,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were these prettier changes added automatically on commit?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally the local dev install should pull the right version of prettier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I couldn't commit because of prettier check, so I ran jlpm prettier and add the changes.
But the command did have change a lot of files, with the same kind of modification.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to do a clean local install in a new environment to make sure the right dependencies are pulled?

Copy link
Collaborator Author

@brichet brichet Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jtpio, I had some weird files in node-modules/.bin.
jlpm clean did the trick.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

} from '@jupyterlab/application';

import {
IToolbarWidgetRegistry,
createToolbarFactory,
setToolbar
setToolbar,
} from '@jupyterlab/apputils';

import {
IFileBrowserFactory,
FileBrowser,
Uploader
Uploader,
} from '@jupyterlab/filebrowser';

import { ISettingRegistry } from '@jupyterlab/settingregistry';
@@ -27,7 +27,8 @@ import { ITranslator } from '@jupyterlab/translation';
import {
caretDownIcon,
folderIcon,
runningIcon
runningIcon,
TabBarSvg,
} from '@jupyterlab/ui-components';

import { Menu, MenuBar, TabPanel } from '@lumino/widgets';
@@ -70,10 +71,10 @@ const createNew: JupyterFrontEndPlugin<void> = {
'terminal:create-new',
'console:create',
'filebrowser:create-new-file',
'filebrowser:create-new-directory'
'filebrowser:create-new-directory',
];

newCommands.forEach(command => {
newCommands.forEach((command) => {
newMenu.addItem({ command });
});

@@ -89,7 +90,7 @@ const createNew: JupyterFrontEndPlugin<void> = {
}
);
}
}
},
};

/**
@@ -101,7 +102,7 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
IFileBrowserFactory,
ITranslator,
ISettingRegistry,
IToolbarWidgetRegistry
IToolbarWidgetRegistry,
],
optional: [IRunningSessionManagers],
autoStart: true,
@@ -113,7 +114,11 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
toolbarRegistry: IToolbarWidgetRegistry,
manager: IRunningSessionManagers | null
): void => {
const tabPanel = new TabPanel({ tabPlacement: 'top', tabsMovable: true });
const tabPanel = new TabPanel({
tabPlacement: 'top',
tabsMovable: true,
renderer: TabBarSvg.defaultRenderer,
});
tabPanel.addClass('jp-TreePanel');

const trans = translator.load('notebook');
@@ -135,7 +140,7 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
new Uploader({
model: browser.model,
translator,
label: trans.__('Upload')
label: trans.__('Upload'),
})
);

@@ -173,7 +178,7 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
});

app.shell.add(tabPanel, 'main', { rank: 100 });
}
},
};

/**