Skip to content

Commit df4a6bf

Browse files
authored
Add the Settings Editor to the landing page (#6316)
* Add the Settings Editor to the landing page * Fix tab panel tabs * Do not include JSON editor for now * Hide Settings Editor command from the menu * Update yarn.lock * Fix integrity * Fix yarn.lock and resolutions * Update yarn.lock * Allow adding and closing the settings editor * Do not include JSON editor for now * Update snapshots * More snapshot updates * More snapshot update * Fix resolutions
1 parent a0b3a80 commit df4a6bf

File tree

12 files changed

+470
-306
lines changed

12 files changed

+470
-306
lines changed

Diff for: app/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ async function main() {
148148
require('@jupyterlab/theme-light-extension'),
149149
require('@jupyterlab/theme-dark-extension'),
150150
require('@jupyterlab/translation-extension'),
151+
require('@jupyterlab/ui-components-extension'),
151152
// Add the "Hub Control Panel" menu option when running in JupyterHub
152153
require('@jupyterlab/collaboration-extension'),
153154
require('@jupyterlab/hub-extension')
@@ -170,7 +171,11 @@ async function main() {
170171
].includes(id)
171172
),
172173
require('@jupyter-notebook/tree-extension'),
173-
require('@jupyterlab/running-extension')
174+
require('@jupyterlab/running-extension'),
175+
require('@jupyterlab/settingeditor-extension').default.filter(
176+
({ id }) =>
177+
['@jupyterlab/settingeditor-extension:form-ui'].includes(id)
178+
)
174179
]);
175180
break;
176181
}

Diff for: app/package.json

+6
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
"@jupyterlab/rendermime-interfaces": "~3.8.0-alpha.17",
7575
"@jupyterlab/running-extension": "~4.0.0-alpha.17",
7676
"@jupyterlab/services": "~7.0.0-alpha.17",
77+
"@jupyterlab/settingeditor": "~4.0.0-alpha.17",
78+
"@jupyterlab/settingeditor-extension": "~4.0.0-alpha.17",
7779
"@jupyterlab/settingregistry": "~4.0.0-alpha.17",
7880
"@jupyterlab/shortcuts-extension": "~4.0.0-alpha.17",
7981
"@jupyterlab/statedb": "~4.0.0-alpha.17",
@@ -148,6 +150,8 @@
148150
"@jupyterlab/pdf-extension": "^4.0.0-alpha.17",
149151
"@jupyterlab/rendermime-extension": "^4.0.0-alpha.17",
150152
"@jupyterlab/running-extension": "^4.0.0-alpha.17",
153+
"@jupyterlab/settingeditor": "^4.0.0-alpha.17",
154+
"@jupyterlab/settingeditor-extension": "^4.0.0-alpha.17",
151155
"@jupyterlab/shortcuts-extension": "^4.0.0-alpha.17",
152156
"@jupyterlab/terminal-extension": "^4.0.0-alpha.17",
153157
"@jupyterlab/theme-dark-extension": "^4.0.0-alpha.17",
@@ -209,6 +213,7 @@
209213
"@jupyterlab/pdf-extension",
210214
"@jupyterlab/rendermime-extension",
211215
"@jupyterlab/running-extension",
216+
"@jupyterlab/settingeditor-extension",
212217
"@jupyterlab/shortcuts-extension",
213218
"@jupyterlab/terminal-extension",
214219
"@jupyterlab/theme-dark-extension",
@@ -245,6 +250,7 @@
245250
"@jupyterlab/rendermime",
246251
"@jupyterlab/rendermime-interfaces",
247252
"@jupyterlab/services",
253+
"@jupyterlab/settingeditor",
248254
"@jupyterlab/settingregistry",
249255
"@jupyterlab/statedb",
250256
"@jupyterlab/statusbar",

Diff for: packages/tree-extension/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"@jupyterlab/filebrowser": "^4.0.0-alpha.17",
4949
"@jupyterlab/mainmenu": "^4.0.0-alpha.17",
5050
"@jupyterlab/services": "^7.0.0-alpha.17",
51+
"@jupyterlab/settingeditor": "^4.0.0-alpha.17",
5152
"@jupyterlab/settingregistry": "^4.0.0-alpha.17",
5253
"@jupyterlab/statedb": "^4.0.0-alpha.17",
5354
"@jupyterlab/translation": "^4.0.0-alpha.17",

Diff for: packages/tree-extension/src/index.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { ISettingRegistry } from '@jupyterlab/settingregistry';
2222

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

25+
import { ISettingEditorTracker } from '@jupyterlab/settingeditor';
26+
2527
import { ITranslator } from '@jupyterlab/translation';
2628

2729
import {
@@ -135,7 +137,7 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
135137
ISettingRegistry,
136138
IToolbarWidgetRegistry
137139
],
138-
optional: [IRunningSessionManagers],
140+
optional: [IRunningSessionManagers, ISettingEditorTracker],
139141
autoStart: true,
140142
provides: INotebookTree,
141143
activate: (
@@ -144,7 +146,8 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
144146
translator: ITranslator,
145147
settingRegistry: ISettingRegistry,
146148
toolbarRegistry: IToolbarWidgetRegistry,
147-
manager: IRunningSessionManagers | null
149+
manager: IRunningSessionManagers | null,
150+
settingEditorTracker: ISettingEditorTracker | null
148151
): INotebookTree => {
149152
const nbTreeWidget = new NotebookTreeWidget();
150153

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

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

212+
if (settingEditorTracker) {
213+
settingEditorTracker.widgetAdded.connect((_, editor) => {
214+
nbTreeWidget.addWidget(editor);
215+
nbTreeWidget.tabBar.addTab(editor.title);
216+
nbTreeWidget.currentWidget = editor;
217+
});
218+
}
219+
209220
return nbTreeWidget;
210221
}
211222
};

Diff for: packages/tree/style/base.css

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
.jp-TreePanel .lm-TabBar-tab {
2121
color: var(--jp-ui-font-color0);
2222
font-size: var(--jp-ui-font-size1);
23-
padding-top: 6px;
2423
height: 100%;
2524
}
2625

@@ -45,3 +44,7 @@
4544
button[data-command='filebrowser:refresh'] .jp-ToolbarButtonComponent-label {
4645
display: none;
4746
}
47+
48+
.jp-TreePanel .lm-TabBar-tabIcon svg {
49+
vertical-align: sub;
50+
}
16 Bytes
Loading
-32 Bytes
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)