notebook
notebook copied to clipboard
`File > Shutdown` in classic notebook ask if I want to shutdow JupyterLab
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."
Thanks @Carreau for reporting.
Is this with Notebook 6.5?
I see the "shut down JupyterLab" message in Notebook 7.0.6.
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.
I'm not a JupyterLab dev but I would try to:
- clone the repo, and try to install the dev version
- find where the error message is defined (using grep for example to find the sentence "Please confirm...")
- 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).
- 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.
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?
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.
Notebook defines its name here:
https://github.com/jupyter/notebook/blob/f6a56f5608ccbf88fef165a6295c6475ff218f7b/packages/application/src/app.ts#L63
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
Absolutely, I'll do that ASAP. Thank you!
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.