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

UI issue in the "tree view" #7216 #7253

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
8 changes: 8 additions & 0 deletions packages/application-extension/src/index.ts
Original file line number Diff line number Diff line change
@@ -200,16 +200,24 @@ const opener: JupyterFrontEndPlugin<void> = {
): void => {
const { commands, docRegistry } = app;

const ignoredPattern = new RegExp('/tree/(.*)');
const pathSegmentPattern = new RegExp('\\bnotebooks\\b|\\bedit\\b');
const command = 'router:tree';
commands.addCommand(command, {
execute: (args: any) => {
const parsed = args as IRouter.ILocation;
const matches = parsed.path.match(TREE_PATTERN) ?? [];

const [, , path] = matches;
if (!path) {
return;
}

const pathSegments: string[] = parsed.path.split(pathSegmentPattern);
if (pathSegments.length > 1 && pathSegments[0].match(ignoredPattern)) {
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if following a similar logic as in JupyterLab (disposing the command after routing) could help keep things simpler and avoid special cases using patterns?

https://github.com/jupyterlab/jupyterlab/blob/cdca0a20ba84af21922c390c46e086e50120d4cc/packages/application-extension/src/index.tsx#L938-L939

return;
}

app.started.then(async () => {
const file = decodeURIComponent(path);
const urlParams = new URLSearchParams(parsed.search);
5 changes: 4 additions & 1 deletion packages/console-extension/src/index.ts
Original file line number Diff line number Diff line change
@@ -29,13 +29,16 @@ const opener: JupyterFrontEndPlugin<void> = {
activate: (app: JupyterFrontEnd, router: IRouter) => {
const { commands } = app;
const consolePattern = new RegExp('/consoles/(.*)');
const ignoreTreePattern = new RegExp('/(tree|notebooks|edit)/(.*)');

const command = 'router:console';
commands.addCommand(command, {
execute: (args: any) => {
const parsed = args as IRouter.ILocation;
const matches = parsed.path.match(consolePattern);
if (!matches) {
const isTreeMatch = parsed.path.match(ignoreTreePattern);

if (isTreeMatch || !matches) {
return;
}
const [, match] = matches;
5 changes: 4 additions & 1 deletion packages/terminal-extension/src/index.ts
Original file line number Diff line number Diff line change
@@ -33,13 +33,16 @@ const opener: JupyterFrontEndPlugin<void> = {
) => {
const { commands } = app;
const terminalPattern = new RegExp('/terminals/(.*)');
const ignoreTreePattern = new RegExp('/(tree|notebooks|edit)/(.*)');

const command = 'router:terminal';
commands.addCommand(command, {
execute: (args: any) => {
const parsed = args as IRouter.ILocation;
const matches = parsed.path.match(terminalPattern);
if (!matches) {
const isTreeMatch = parsed.path.match(ignoreTreePattern);

if (isTreeMatch || !matches) {
return;
}
const [, name] = matches;

Unchanged files with check annotations Beta

const toolbar = page.getByRole('toolbar');
['Rename', 'Delete', 'Open', 'Download', 'Delete'].forEach(async (text) => {
expect(toolbar.getByText(text)).toBeVisible();

Check failure on line 39 in ui-tests/test/filebrowser.spec.ts

GitHub Actions / ui-tests (firefox)

[firefox] › test/filebrowser.spec.ts:31:7 › File Browser › Select one file

1) [firefox] › test/filebrowser.spec.ts:31:7 › File Browser › Select one file ──────────────────── Error: expect(received).toBeVisible() Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByRole('toolbar').getByText('Open') 37 | 38 | ['Rename', 'Delete', 'Open', 'Download', 'Delete'].forEach(async (text) => { > 39 | expect(toolbar.getByText(text)).toBeVisible(); | ^ 40 | }); 41 | }); 42 | at forEach (/home/runner/work/notebook/notebook/ui-tests/test/filebrowser.spec.ts:39:39) at /home/runner/work/notebook/notebook/ui-tests/test/filebrowser.spec.ts:38:56
});
});
// Copyright (c) Jupyter Development Team.

Check failure on line 1 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Test timeout of 60000ms exceeded.

Check failure on line 1 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Pending operations: - proxy.click at test/mobile.spec.ts:35:12

Check failure on line 1 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Pending operations: - proxy.click at test/mobile.spec.ts:35:12

Check failure on line 1 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Test timeout of 60000ms exceeded.

Check failure on line 1 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Pending operations: - proxy.click at test/mobile.spec.ts:35:12

Check failure on line 1 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Pending operations: - proxy.click at test/mobile.spec.ts:35:12
// Distributed under the terms of the Modified BSD License.
import { expect } from '@playwright/test';
// Create a new notebook
const [notebook] = await Promise.all([
page.waitForEvent('popup'),

Check failure on line 33 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Error: proxy.waitForEvent: Page closed =========================== logs =========================== waiting for event "popup" ============================================================ 31 | // Create a new notebook 32 | const [notebook] = await Promise.all([ > 33 | page.waitForEvent('popup'), | ^ 34 | page.click('text="New"'), 35 | page.click('text="Python 3 (ipykernel)"'), 36 | ]); at /home/runner/work/notebook/notebook/ui-tests/test/mobile.spec.ts:33:12

Check failure on line 33 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: proxy.waitForEvent: Page closed =========================== logs =========================== waiting for event "popup" ============================================================ 31 | // Create a new notebook 32 | const [notebook] = await Promise.all([ > 33 | page.waitForEvent('popup'), | ^ 34 | page.click('text="New"'), 35 | page.click('text="Python 3 (ipykernel)"'), 36 | ]); at /home/runner/work/notebook/notebook/ui-tests/test/mobile.spec.ts:33:12

Check failure on line 33 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Error: proxy.waitForEvent: Page closed =========================== logs =========================== waiting for event "popup" ============================================================ 31 | // Create a new notebook 32 | const [notebook] = await Promise.all([ > 33 | page.waitForEvent('popup'), | ^ 34 | page.click('text="New"'), 35 | page.click('text="Python 3 (ipykernel)"'), 36 | ]); at /home/runner/work/notebook/notebook/ui-tests/test/mobile.spec.ts:33:12

Check failure on line 33 in ui-tests/test/mobile.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: proxy.waitForEvent: Page closed =========================== logs =========================== waiting for event "popup" ============================================================ 31 | // Create a new notebook 32 | const [notebook] = await Promise.all([ > 33 | page.waitForEvent('popup'), | ^ 34 | page.click('text="New"'), 35 | page.click('text="Python 3 (ipykernel)"'), 36 | ]); at /home/runner/work/notebook/notebook/ui-tests/test/mobile.spec.ts:33:12
page.click('text="New"'),
page.click('text="Python 3 (ipykernel)"'),
]);

Check failure on line 1 in ui-tests/test/links.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/links.spec.ts:21:7 › Local Links › Open the current directory

2) [chromium] › test/links.spec.ts:21:7 › Local Links › Open the current directory ─────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in ui-tests/test/links.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/links.spec.ts:21:7 › Local Links › Open the current directory

2) [chromium] › test/links.spec.ts:21:7 › Local Links › Open the current directory ─────────────── Pending operations: - locator.click at test/links.spec.ts:26:50

Check failure on line 25 in ui-tests/test/links.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/links.spec.ts:21:7 › Local Links › Open the current directory

2) [chromium] › test/links.spec.ts:21:7 › Local Links › Open the current directory ─────────────── Error: proxy.waitForEvent: Page closed =========================== logs =========================== waiting for event "popup" ============================================================ 23 | 24 | const [current] = await Promise.all([ > 25 | page.waitForEvent('popup'), | ^ 26 | page.getByText('Current Directory').last().click(), 27 | ]); 28 | at /home/runner/work/notebook/notebook/ui-tests/test/links.spec.ts:25:12
// Copyright (c) Jupyter Development Team.

Check failure on line 1 in ui-tests/test/notebook.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/notebook.spec.ts:32:7 › Notebook › Renaming the notebook should be possible

2) [chromium] › test/notebook.spec.ts:32:7 › Notebook › Renaming the notebook should be possible ─ Error: apiRequestContext.fetch: Request context disposed. =========================== logs =========================== → POST http://localhost:8888/api/sessions?1709926252446 user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/113.0.5672.53 Safari/537.36 accept: */* accept-encoding: gzip,deflate,br accept-language: en-US content-type: text/plain;charset=UTF-8 cookie: username-localhost-8888="2|1:0|10:1709926250|23:username-localhost-8888|204:eyJ1c2VybmFtZSI6ICJmZTg0NjZmYWY2MTg0MDA2YjFlZDA4YWQ1MjRlYTYwNiIsICJuYW1lIjogIkFub255bW91cyBQcmF4aWRpa2UiLCAiZGlzcGxheV9uYW1lIjogIkFub255bW91cyBQcmF4aWRpa2UiLCAiaW5pdGlhbHMiOiAiQVAiLCAiY29sb3IiOiBudWxsfQ==|fa03e06820db1c286f15818ab2dc054095a345afb4201cf50bac700ce27a16b9"; _xsrf=2|4b8d27b5|8fa478b5a7c9b2a108a4f8a8b9c87d86|1709926250 origin: http://localhost:8888 referer: http://localhost:8888/notebooks/test-notebook-Notebook-Title-should-be-rendered-chromium/example.ipynb x-xsrftoken: 2|4b8d27b5|8fa478b5a7c9b2a108a4f8a8b9c87d86|1709926250 sec-ch-ua: "HeadlessChrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24" sec-ch-ua-mobile: ?0 sec-ch-ua-platform: "Linux" content-length: 173 ============================================================ at /home/runner/work/notebook/notebook/ui-tests/node_modules/@jupyterlab/galata/src/galata.ts:918:49

Check failure on line 1 in ui-tests/test/notebook.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/notebook.spec.ts:32:7 › Notebook › Renaming the notebook should be possible

2) [chromium] › test/notebook.spec.ts:32:7 › Notebook › Renaming the notebook should be possible ─ Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.
// Distributed under the terms of the Modified BSD License.
import path from 'path';
await Promise.all([
await page.click('text="Rename"'),
// wait until the URL is updated
await page.waitForNavigation(),

Check failure on line 52 in ui-tests/test/notebook.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/notebook.spec.ts:32:7 › Notebook › Renaming the notebook should be possible

2) [chromium] › test/notebook.spec.ts:32:7 › Notebook › Renaming the notebook should be possible ─ Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: proxy.waitForNavigation: Navigation failed because page was closed! =========================== logs =========================== waiting for navigation until "load" ============================================================ 50 | await page.click('text="Rename"'), 51 | // wait until the URL is updated > 52 | await page.waitForNavigation(), | ^ 53 | ]); 54 | 55 | // Check the URL contains the new name at /home/runner/work/notebook/notebook/ui-tests/test/notebook.spec.ts:52:18
]);
// Check the URL contains the new name
import { expect } from '@playwright/test';

Check failure on line 1 in ui-tests/test/smoke.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/smoke.spec.ts:10:7 › Smoke › Tour

3) [chromium] › test/smoke.spec.ts:10:7 › Smoke › Tour ─────────────────────────────────────────── Test timeout of 60000ms exceeded.
import { test } from './fixtures';