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
7 changes: 7 additions & 0 deletions packages/application-extension/src/index.ts
Expand Up @@ -200,11 +200,18 @@ const opener: JupyterFrontEndPlugin<void> = {
): void => {
const { commands, docRegistry } = app;

const ignoreTreePattern = new RegExp('/tree/(.*)');
itsmevichu marked this conversation as resolved.
Show resolved Hide resolved
const command = 'router:tree';
commands.addCommand(command, {
execute: (args: any) => {
const parsed = args as IRouter.ILocation;
const matches = parsed.path.match(TREE_PATTERN) ?? [];
const isTreeMatch = parsed.path.match(ignoreTreePattern);

if (isTreeMatch) {
return;
}

const [, , path] = matches;
if (!path) {
return;
Expand Down
5 changes: 4 additions & 1 deletion packages/console-extension/src/index.ts
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion packages/terminal-extension/src/index.ts
Expand Up @@ -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;
Expand Down