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

File > Shutdown in classic notebook ask if I want to shutdow JupyterLab #7188

Open
Carreau opened this issue Dec 13, 2023 · 9 comments
Open
Labels

Comments

@Carreau
Copy link
Member

Carreau commented Dec 13, 2023

Super tiny issue, not important, but in notebook vs, when in a notebook if I go to "File" -> "Shut Down" is asks "Please confirm you want to shut down JupyterLab."

@Carreau Carreau added bug status:Needs Triage Applied to issues that need triage labels Dec 13, 2023
@jtpio
Copy link
Member

jtpio commented Dec 13, 2023

Thanks @Carreau for reporting.

Is this with Notebook 6.5?

@JasonWeill
Copy link
Collaborator

I see the "shut down JupyterLab" message in Notebook 7.0.6.

image

@JasonWeill JasonWeill removed status:Needs Info status:Needs Triage Applied to issues that need triage labels Dec 30, 2023
@sawickid
Copy link

Hello, I am new to open source contributions, and this will be my first attempt at one for Jupyter Notebook. Would this be a good issue to start with? Additionally, any guidance on how to approach this problem would be very much appreciated.

@Carreau
Copy link
Member Author

Carreau commented Apr 23, 2024

I'm not a JupyterLab dev but I would try to:

  1. clone the repo, and try to install the dev version
  2. find where the error message is defined (using grep for example to find the sentence "Please confirm...")
  3. see if you manage to make a modification (e.g. rename on the given line from "JupyterLab" to something else, and see if that works).
  4. There likely a few other places where "JupyterLab" is hardcoded – finding them and listing them is useful.

Report your findings like:

'It looks like there are 5 places in src/blah/index.ts that needs "JupyterLab" to become a variable. I don't know how to pass the variable with the name into this, but it look like we have access to the "Config" variable, maybe that can hold the name of the current application'.

Then we can iterate on what to do.

@jtpio
Copy link
Member

jtpio commented Apr 23, 2024

Looks like this could be fixed upstream in JupyterLab. The message is currently defined here:

https://github.com/jupyterlab/jupyterlab/blob/8819549495cd11470b4db7464d1d59c53cfce787/packages/mainmenu-extension/src/index.ts#L378

return showDialog({
    title: trans.__('Shutdown confirmation'),
    body: trans.__('Please confirm you want to shut down JupyterLab.'),
    buttons: [
      Dialog.cancelButton(),
      Dialog.warnButton({ label: trans.__('Shut Down') })
    ]
})

So instead of having "JupyterLab" hardcoded, maybe it could use app.name?

@Carreau
Copy link
Member Author

Carreau commented Apr 23, 2024

So instead of having "JupyterLab" hardcoded, maybe it could use app.name?

Quite possible, I saw that a app:JupyterFrontEnd was available, but I was not too familiar with which properties it had.

@jtpio
Copy link
Member

jtpio commented Apr 23, 2024

Notebook defines its name here:

readonly name = 'Jupyter Notebook';

So app.name should indeed pick up the correct app name.

@sawickid would you like to try opening a PR on the JupyterLab repo? https://github.com/jupyterlab/jupyterlab

@sawickid
Copy link

sawickid commented Apr 23, 2024

Absolutely, I'll do that ASAP. Thank you!

@Carreau
Copy link
Member Author

Carreau commented Apr 24, 2024

Sidenote, there are a few other places that could be audited for review as to wheter "JupyterLab" should be hardcoded:

$ rg trans -tts | grep JupyterLab
packages/mainmenu-extension/src/index.ts:    caption: trans.__('Shut down JupyterLab'),
packages/mainmenu-extension/src/index.ts:        body: trans.__('Please confirm you want to shut down JupyterLab.'),
packages/mainmenu-extension/src/index.ts:    caption: trans.__('Log out of JupyterLab'),
packages/extensionmanager/src/model.ts:                ? trans.__('reload JupyterLab')
packages/application-extension/src/index.tsx:            {trans.__('JupyterLab build is suggested:')}
packages/theme-light-extension/src/index.ts:      displayName: trans.__('JupyterLab Light'),
packages/rendermime/src/widgets.ts:      source: trans.__('JavaScript output is disabled in JupyterLab'),
packages/help-extension/src/index.tsx:        text: trans.__('JupyterLab Reference'),
packages/help-extension/src/index.tsx:        text: trans.__('JupyterLab FAQ'),
packages/theme-dark-high-contrast-extension/src/index.ts:      displayName: trans.__('JupyterLab Dark High Contrast'),
packages/theme-dark-extension/src/index.ts:      displayName: trans.__('JupyterLab Dark'),
packages/apputils-extension/src/workspacesplugin.ts:      displayName: trans.__('JupyterLab Workspace File'),
packages/extensionmanager-extension/src/index.ts:      body: trans.__(`Thanks for trying out JupyterLab's extension manager.

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

No branches or pull requests

4 participants