Skip to content

Commit 12119f9

Browse files
committed
Fix what looks like a rebase issue
1 parent d583453 commit 12119f9

File tree

3 files changed

+8
-44
lines changed

3 files changed

+8
-44
lines changed

packages/application-extension/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"@jupyterlab/translation": "^4.0.0-alpha.14",
5656
"@lumino/coreutils": "^2.0.0-alpha.6",
5757
"@lumino/disposable": "^2.0.0-alpha.6",
58-
"@lumino/messaging": "^2.0.0-alpha.6",
5958
"@lumino/widgets": "^2.0.0-alpha.6"
6059
},
6160
"devDependencies": {

packages/application-extension/src/index.ts

+7-42
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,10 @@ import {
5050
IDisposable
5151
} from '@lumino/disposable';
5252

53-
import { MessageLoop } from '@lumino/messaging';
54-
5553
import { Menu, Widget } from '@lumino/widgets';
5654

5755
import { SideBarPalette } from './sidebarpalette';
5856

59-
/**
60-
* The default notebook factory.
61-
*/
62-
const NOTEBOOK_FACTORY = 'Notebook';
63-
64-
/**
65-
* The editor factory.
66-
*/
67-
const EDITOR_FACTORY = 'Editor';
68-
6957
/**
7058
* A regular expression to match path to notebooks and documents
7159
*/
@@ -178,12 +166,10 @@ const opener: JupyterFrontEndPlugin<void> = {
178166
id: '@jupyter-notebook/application-extension:opener',
179167
autoStart: true,
180168
requires: [IRouter, IDocumentManager],
181-
optional: [ISettingRegistry],
182169
activate: (
183170
app: JupyterFrontEnd,
184171
router: IRouter,
185-
docManager: IDocumentManager,
186-
settingRegistry: ISettingRegistry | null
172+
docManager: IDocumentManager
187173
): void => {
188174
const { commands } = app;
189175

@@ -198,34 +184,13 @@ const opener: JupyterFrontEndPlugin<void> = {
198184
}
199185

200186
const file = decodeURIComponent(path);
201-
const ext = PathExt.extname(file);
202-
203-
// TODO: fix upstream?
204-
await settingRegistry?.load('@jupyterlab/notebook-extension:panel');
205-
206-
await new Promise(async (resolve, reject) => {
207-
// TODO: get factory from file type instead?
208-
if (ext === '.ipynb') {
209-
docManager.open(file, NOTEBOOK_FACTORY, undefined, {
210-
ref: '_noref'
211-
});
212-
} else {
213-
docManager.open(file, EDITOR_FACTORY, undefined, {
214-
ref: '_noref'
215-
});
216-
}
217-
resolve(void 0);
187+
const urlParams = new URLSearchParams(parsed.search);
188+
const factory = urlParams.get('factory') ?? 'default';
189+
app.started.then(async () => {
190+
docManager.open(file, factory, undefined, {
191+
ref: '_noref'
192+
});
218193
});
219-
220-
// force triggering a resize event to try fixing toolbar rendering issues:
221-
// https://github.com/jupyter/notebook/issues/6553
222-
const currentWidget = app.shell.currentWidget;
223-
if (currentWidget) {
224-
MessageLoop.sendMessage(
225-
currentWidget,
226-
Widget.ResizeMessage.UnknownSize
227-
);
228-
}
229194
}
230195
});
231196

ui-tests/test/menus.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const MENU_PATHS = [
2525
test.use({ autoGoto: false });
2626

2727
test.describe('Notebook Menus', () => {
28-
test.beforeAll(async ({ page, tmpPath }) => {
28+
test.beforeEach(async ({ page, tmpPath }) => {
2929
await page.contents.uploadFile(
3030
path.resolve(__dirname, `./notebooks/${NOTEBOOK}`),
3131
`${tmpPath}/${NOTEBOOK}`

0 commit comments

Comments
 (0)