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

Add the Settings Editor to the landing page #6316

Merged
merged 14 commits into from
Jan 13, 2023
7 changes: 6 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ async function main() {
require('@jupyterlab/theme-light-extension'),
require('@jupyterlab/theme-dark-extension'),
require('@jupyterlab/translation-extension'),
require('@jupyterlab/ui-components-extension'),
// Add the "Hub Control Panel" menu option when running in JupyterHub
require('@jupyterlab/collaboration-extension'),
require('@jupyterlab/hub-extension')
Expand All @@ -170,7 +171,11 @@ async function main() {
].includes(id)
),
require('@jupyter-notebook/tree-extension'),
require('@jupyterlab/running-extension')
require('@jupyterlab/running-extension'),
require('@jupyterlab/settingeditor-extension').default.filter(
({ id }) =>
['@jupyterlab/settingeditor-extension:form-ui'].includes(id)
)
]);
break;
}
Expand Down
6 changes: 6 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"@jupyterlab/rendermime-interfaces": "~3.8.0-alpha.17",
"@jupyterlab/running-extension": "~4.0.0-alpha.17",
"@jupyterlab/services": "~7.0.0-alpha.17",
"@jupyterlab/settingeditor": "~4.0.0-alpha.17",
"@jupyterlab/settingeditor-extension": "~4.0.0-alpha.17",
"@jupyterlab/settingregistry": "~4.0.0-alpha.17",
"@jupyterlab/shortcuts-extension": "~4.0.0-alpha.17",
"@jupyterlab/statedb": "~4.0.0-alpha.17",
Expand Down Expand Up @@ -148,6 +150,8 @@
"@jupyterlab/pdf-extension": "^4.0.0-alpha.17",
"@jupyterlab/rendermime-extension": "^4.0.0-alpha.17",
"@jupyterlab/running-extension": "^4.0.0-alpha.17",
"@jupyterlab/settingeditor": "^4.0.0-alpha.17",
"@jupyterlab/settingeditor-extension": "^4.0.0-alpha.17",
"@jupyterlab/shortcuts-extension": "^4.0.0-alpha.17",
"@jupyterlab/terminal-extension": "^4.0.0-alpha.17",
"@jupyterlab/theme-dark-extension": "^4.0.0-alpha.17",
Expand Down Expand Up @@ -209,6 +213,7 @@
"@jupyterlab/pdf-extension",
"@jupyterlab/rendermime-extension",
"@jupyterlab/running-extension",
"@jupyterlab/settingeditor-extension",
"@jupyterlab/shortcuts-extension",
"@jupyterlab/terminal-extension",
"@jupyterlab/theme-dark-extension",
Expand Down Expand Up @@ -245,6 +250,7 @@
"@jupyterlab/rendermime",
"@jupyterlab/rendermime-interfaces",
"@jupyterlab/services",
"@jupyterlab/settingeditor",
"@jupyterlab/settingregistry",
"@jupyterlab/statedb",
"@jupyterlab/statusbar",
Expand Down
1 change: 1 addition & 0 deletions packages/tree-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"@jupyterlab/filebrowser": "^4.0.0-alpha.17",
"@jupyterlab/mainmenu": "^4.0.0-alpha.17",
"@jupyterlab/services": "^7.0.0-alpha.17",
"@jupyterlab/settingeditor": "^4.0.0-alpha.17",
"@jupyterlab/settingregistry": "^4.0.0-alpha.17",
"@jupyterlab/statedb": "^4.0.0-alpha.17",
"@jupyterlab/translation": "^4.0.0-alpha.17",
Expand Down
15 changes: 13 additions & 2 deletions packages/tree-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import { ISettingRegistry } from '@jupyterlab/settingregistry';

import { IRunningSessionManagers, RunningSessions } from '@jupyterlab/running';

import { ISettingEditorTracker } from '@jupyterlab/settingeditor';

import { ITranslator } from '@jupyterlab/translation';

import {
Expand Down Expand Up @@ -135,7 +137,7 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
ISettingRegistry,
IToolbarWidgetRegistry
],
optional: [IRunningSessionManagers],
optional: [IRunningSessionManagers, ISettingEditorTracker],
autoStart: true,
provides: INotebookTree,
activate: (
Expand All @@ -144,7 +146,8 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
translator: ITranslator,
settingRegistry: ISettingRegistry,
toolbarRegistry: IToolbarWidgetRegistry,
manager: IRunningSessionManagers | null
manager: IRunningSessionManagers | null,
settingEditorTracker: ISettingEditorTracker | null
): INotebookTree => {
const nbTreeWidget = new NotebookTreeWidget();

Expand Down Expand Up @@ -206,6 +209,14 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {

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

if (settingEditorTracker) {
settingEditorTracker.widgetAdded.connect((_, editor) => {
nbTreeWidget.addWidget(editor);
nbTreeWidget.tabBar.addTab(editor.title);
nbTreeWidget.currentWidget = editor;
});
}

return nbTreeWidget;
}
};
Expand Down
5 changes: 4 additions & 1 deletion packages/tree/style/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
.jp-TreePanel .lm-TabBar-tab {
color: var(--jp-ui-font-color0);
font-size: var(--jp-ui-font-size1);
padding-top: 6px;
height: 100%;
}

Expand All @@ -45,3 +44,7 @@
button[data-command='filebrowser:refresh'] .jp-ToolbarButtonComponent-label {
display: none;
}

.jp-TreePanel .lm-TabBar-tabIcon svg {
vertical-align: sub;
}
Binary file modified ui-tests/test/mobile.spec.ts-snapshots/tree-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/test/mobile.spec.ts-snapshots/tree-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading