Skip to content

Commit 77e591a

Browse files
authored
Fix JSON setting editor not opening issue (#6778) (#6795)
1 parent cc454bb commit 77e591a

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

app/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,7 @@
273273
],
274274
"@jupyter-notebook/tree-extension": true,
275275
"@jupyterlab/running-extension": true,
276-
"@jupyterlab/settingeditor-extension": [
277-
"@jupyterlab/settingeditor-extension:form-ui"
278-
]
276+
"@jupyterlab/settingeditor-extension": true
279277
},
280278
"/notebooks": {
281279
"@jupyterlab/celltags-extension": true,

packages/tree-extension/src/index.ts

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import { ISettingRegistry } from '@jupyterlab/settingregistry';
2424

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

27-
import { ISettingEditorTracker } from '@jupyterlab/settingeditor';
27+
import {
28+
IJSONSettingEditorTracker,
29+
ISettingEditorTracker,
30+
} from '@jupyterlab/settingeditor';
2831

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

@@ -205,7 +208,11 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
205208
ISettingRegistry,
206209
IToolbarWidgetRegistry,
207210
],
208-
optional: [IRunningSessionManagers, ISettingEditorTracker],
211+
optional: [
212+
IRunningSessionManagers,
213+
ISettingEditorTracker,
214+
IJSONSettingEditorTracker,
215+
],
209216
autoStart: true,
210217
provides: INotebookTree,
211218
activate: (
@@ -215,7 +222,8 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
215222
settingRegistry: ISettingRegistry,
216223
toolbarRegistry: IToolbarWidgetRegistry,
217224
manager: IRunningSessionManagers | null,
218-
settingEditorTracker: ISettingEditorTracker | null
225+
settingEditorTracker: ISettingEditorTracker | null,
226+
jsonSettingEditorTracker: IJSONSettingEditorTracker | null
219227
): INotebookTree => {
220228
const nbTreeWidget = new NotebookTreeWidget();
221229

@@ -301,13 +309,18 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
301309

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

304-
if (settingEditorTracker) {
305-
settingEditorTracker.widgetAdded.connect((_, editor) => {
306-
nbTreeWidget.addWidget(editor);
307-
nbTreeWidget.tabBar.addTab(editor.title);
308-
nbTreeWidget.currentWidget = editor;
309-
});
310-
}
312+
// add a separate tab for each setting editor
313+
[settingEditorTracker, jsonSettingEditorTracker].forEach(
314+
(editorTracker) => {
315+
if (editorTracker) {
316+
editorTracker.widgetAdded.connect((_, editor) => {
317+
nbTreeWidget.addWidget(editor);
318+
nbTreeWidget.tabBar.addTab(editor.title);
319+
nbTreeWidget.currentWidget = editor;
320+
});
321+
}
322+
}
323+
);
311324

312325
return nbTreeWidget;
313326
},

0 commit comments

Comments
 (0)