-
Notifications
You must be signed in to change notification settings - Fork 93
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
[ENH] - Add user-friendly button to get back to JHub "home" #2182
Comments
Or we have a Home button/icon in the menu bar. |
cc: @krassowski since he might know more about JupyterLab customizability. |
Yes, this can be accomplished by dropping a JSON configuration file into a stardardised location (if you want users to be able to modify the menus), or by adding it from an extension (if you believe this is an important item and want to prevent user from accidentally removing it when fiddling with the settings). Happy to help here.
We could create a tiny extension that would do that, possibly styling it more in-line with other Jlab components; there is for example some space in the top bar (next to menu) where some control functions could be easily exposed. A separate header is also an option but it has UX and maintenance tread-offs. |
So our bigger issue is that JHub and JLab have two independent menu structures. Right now I think a link/icon back to 'Home' and another one for 'Environment Management' would be the simplest to do without solving the larger issue. This is an important functionality and does not need to be user editable. |
@krassowski: is the first option referring to https://jupyterlab.readthedocs.io/en/stable/extension/extension_points.html#main-menu? |
In principle yes, this is documenting the JSON format I was referring, but rather than defining a new menu you possibly could just change the label of the existing one; or disable the old entry one and add a new one. In that case you could use |
I was able to create a new menu item and add an item to go to the control panel using the following JSON: {
"menus": [
{
"id": "jp-mainmenu-home",
"disabled": false,
"label": "Home",
"rank": 0,
"items": [
{
"command": "hub:control-panel",
"rank": 2
}
]
}
]
} However, I have two concerns:
|
That would not be a top-level menu itm but a button, right? The menu by definition should open a list of items and having a non-standard addition which behaves differently would go against the good UX practice and accessibility (https://www.w3.org/WAI/tutorials/menus/application-menus/); there is a lot of behaviour baked into the menu, for example when you open one and move mouse to the next one it activates; it would not be clear what should happen then if top-level items were allowed to be standalone buttons, nor . That said, adding a button to the top bar can be done with a very simple extension; I would however suggest to style it slightly differently from the top-level application menu items. For that matter you could even replace the Jupyter Logo in the top left corner with a home button/icon.
Yes, I would recommend adding a simple extension implementing the command. You could re-purpose {
"menus": [
{
"id": "jp-mainmenu-home",
"disabled": false,
"label": "Home",
"rank": 0,
"items": [
{
"command": "help:open",
"args": {
"url": "https://google.com",
"text": "Open Jupyter.org"
},
"rank": 2
}
]
}
]
} We could separate This seems to suggest that you want to change |
@krassowski thank you for all your help; it has been really useful. As you might have noticed, I don't have any experience customizing Jupyterlab. What I'm trying to achieve here is to create two UI elements (initially I thought Menu Items but your button suggestion sounds compelling) for the user to go to two URLs:
For element 1, I can already leverage the For element 2, the URL should be opened in another browser tab not a Jupyterlab tab; so while your suggestion of repurposing I was trying to implement both UI elements using the |
Or should we do a new menu item with
|
I just found out that you can pass a @dharhas and @kcpevey what are your feelings about having two Menu Items with one subitem each that open the Hub Control Panel and conda-store? It would look something like this: I personally believe that having two new Menu Items with just one subitem each is far from ideal and that a better alternative would be to have them as buttons. However, I think that would mean that we cannot use the |
This is easily achievable and we could add more subitems in the future if we have the need for it. Do you think this would make it more intuitive for users? |
Agreed. For now we avoid a custom extension. Let's make a menu item called "Nebari" and we put several links in there. Ideally it should be the links we see in Hub/JHub-Apps services except Jupyter and VSCode
For some deployments this might include MLFlow and other things. jhub-apps gets this list dynamically I think. @aktech or @jbouder can you clarify where jhub-apps gets its services list from. |
Open question should we put the menu item before |
@dharhas those values are currently provided to the UI by the jhub_apps endpoint. I believe they're provided through a config on the backend. |
For me it would make more sense to have it as the last item (i.e., rightmost) of the Menu but I can be talked into putting it first. |
I agree. Putting it before File doesn't feel right :) |
@marcelovilla for this release lets hardcode the list I mentioned earlier. We will worry about a dynamic list for the next release. |
Feature description
Its non-intuitive to go:
File -> Hub Control Panel
to get back to the landing page which hasStart/Stop Server
and the header for Envrionment Management, User management, Grafana, etc.As we are adding jhub apps as an optional landing page, we need to a way to make it more intuitive for folks to get back to this "home" page.
Is there a way to add items to the File menus in JLab? So we could add more intuitive names (e.g. Home takes you back to the landing page).
Or would there be a way to add the current JHub header to the JLab interface?
Value and/or benefit
More intuitive interface for end users
Anything else?
No response
The text was updated successfully, but these errors were encountered: