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

Options in Tab Context Menu for Files are confusing #10035

Open
ianhi opened this issue Apr 2, 2021 · 1 comment
Open

Options in Tab Context Menu for Files are confusing #10035

ianhi opened this issue Apr 2, 2021 · 1 comment

Comments

@ianhi
Copy link
Contributor

ianhi commented Apr 2, 2021

Description

I find several of the items on the context menu that shows up when you click on a tab to be unclear.

For a text file the rename and delete seem to be rendered incorrectly and/or missing the word file:
image
when in contrast a Python file the word file is always shown:
image

It is also not obvious to me what the Editor option should be expected to do. It seems to me that I've already opened an editor. Though I would not have expected it to open a jupyter console for txt or md files which is what it seems to do.

Reproduce

  1. Open a new .txt or .md file in jlab
  2. Right click on it's tab
  3. see screenshots above.

Expected behavior

  1. The text options would have the word File included.
  2. The rename file is not always followed by an ellipsis
  3. The Editor option is renamed

Context

  • Operating System and version: Ubuntu
  • Browser and version: Firefox 80
  • JupyterLab version: 3.0.7
@jasongrout
Copy link
Contributor

jasongrout commented Apr 5, 2021

Looking into this, particularly the "Editor" option:

  1. By shift-right clicking on the "Editor" menu item, I inspect the DOM and see that the li element for the context menu item comes from the filemenu:create-console command.
  2. Searching jlab for "filemenu:createConsole" leads to this command definition:
    commands.addCommand(CommandIDs.createConsole, {
    label: () => {
    const localizedLabel = Private.delegateLabel(
    app,
    menu.consoleCreators,
    'createConsoleLabel'
    );
    return localizedLabel
    ? localizedLabel
    : trans.__('New Console for Activity');
    },
    isEnabled: Private.delegateEnabled(
    app,
    menu.consoleCreators,
    'createConsole'
    ),
    execute: Private.delegateExecute(app, menu.consoleCreators, 'createConsole')
    });
  3. I recompiled jlab to include debugging info so I could set a breakpoint there in the code to see what was happening with delegateLabel: jupyter lab build --dev-build
  4. Set a debug breakpoint at that point in the code, and step inside the label function
  5. Find out it leads to
    createConsoleLabel: (n: number) => trans.__('Create Console for Editor'),
    which seems to have already been changed a while ago in master to fix this issue in Fix label for "Create Console for Editor" #9794

Do you want to try tracking down the other issues you mention similarly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants