-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Create a workspaces GUI #6944
Comments
Hi @RafalSkolasinski. We want a workspaces GUI of some sort in JupyterLab. And your suggestion of just a list to begin with is similar to conversations we've had about where to start. I'd be happy to mentor anyone who wants to work on this feature. I've labeled the issue as |
I'm keen to chip in. Where do we start? |
@ibdafna Great! I would start by making a feature branch in your fork and creating a CC: @tgeorgeux @ellisonbg if you know (or are) someone who would like to work on the user experience of this UI, let's connect them with Itay. For now, I think a list of sessions is the right place to start. |
@ibdafna Did you get started on this ? I was wondering if I could pick it up. |
Is anyone working on this right now? |
Firstly - apologies for not noticing the comments earlier. I started working on this, progress not as quick as I would have wanted. @Madhu94 happy for any help on this! Give me a couple of weeks and I'll post a WIP PR. |
Also interested in chipping in on this or at least watching eagerly from the sidelines! |
@ibdafna Sorry, I missed the replies to my question. Still interested in picking this up if you haven't or helping to push this along if you have. |
As an update, in case anyone's interested, I've also started working on a workspaces extension in userland. I'm facing minor blocks(like #7785). I'll update once I'm done. |
@Madhu94, awesome! I'm glad you are taking this up! |
quoting myself from #7876 "interface to manage workspaces":
|
@allefeld I would say a good way to start is to just add a command to the command palette and probably a menu item but not to tie it to a specific URL yet. URLs are a place in a user interface we should be very conservative about because they are one of the last things that change and they can be very long-lasting. Since this is a user interface for managing workspaces, simply launching it the way we'd launch any other extension (i.e. from the command palette or menu or launcher) seems like the right way to invoke it. I'm not 100% opposed to the URL being used this way, but it's not where I would begin. |
@afshin, I thought it would be the logical way to do it, but I understand. |
FYI, I'm starting to work on a potential experience and UI for this. I'll post mockups as I make progress. Between the helpful comment from @allefeld and JupyterLab docs, I think I have a good idea of what functionality and use cases are needed, but more input in that area is always useful since I've rarely used workspaces myself. |
I’ve been making my way through each of the interactions needed for this feature and it’s turning into a lot to post together, so I’m going to break it up. This comment will be about the potential placement of a workspace UI in either the sidebar or the launcher. Since it was recommended in the sidebar on this thread, I’ll start there. I don’t think workspace management makes sense in the command palette since the command palette schema is more of a collection of actions and things you can do while workspaces are really just the set up of a Lab experience. I put it in the Open Tabs section for now because workspaces will change what tabs are open, but I am worried it might be easily missed here. I think the best option for placement of a workspace management UI is actually in the launcher. Since workspaces change the URL, open files, and arrangement of tabs, the launcher seems like the place I’d expect such a large visual change to happen. As it is currently, I think the launcher needs some work (which I’m working on in the background based on multiple issues), but this design would match with current launcher expectations. Right now I’m tentatively using this modified version of Material Design’s dashboard icon to represent workspaces. I’ve given it only a little thought, so if anyone has feedback on it feel free to share. If anyone wants to use it, let me know and I'll get you an SVG since GitHub doesn't support them in comments. |
Hi @isabela-pf, thanks for digging in to this! I have two concerns:
|
@isabela-pf I understand your reasoning, but I'm not sure I agree. Everything else in the launcher adds something to the current workspace, so having items there change the entire workspace would be surprising. I'm not sure what I would recommend instead, but one option would be a modal dialogue. A large box that covers most but not all of the viewport, and with the current workspace in the background dimmed or blurred. What would creating / selecting a workspace do? Replace the one in the current tab, or create a new tab? |
To be more precise, everything in the launcher replaces that same launcher tab with exactly one activity.
I agree. |
Thanks for the great feedback! I’ll have to think more about where a workspace UI fits. For now I have mockups of some of the other interactions that are not influenced by that UI placement choices. I think these interactions make sense as dialogs regardless of UI placement, though that could change in the right context. To create a new workspace, it seems to me like all that is needed is the workspace name. This dialog makes it so that setting up a workspace stays quick, but is more explicit about workspaces generating URLs. I still have filler brackets in this mockup because I haven’t looked into what invalid characters there might be for a workspace name. Creating a new workspace this way would create a workspace based on what the user has open, just as workspaces do now. This error in the existing dialog design can also be used for other workspace naming errors (like in renaming a workspace). One of the key things I think this UI will need is a context menu with these items ordered first to last:, rename workspace, clone workspace, export workspace, reset workspace, and delete workspace. I haven’t made the rename workspace flow yet because I had some questions about how that would work. I’ve grouped all these questions in the comment below. Cloning a workspace should look a lot like creating a new workspace because a cloned workspace is still a new workspace. The only changes here are in the text. Cloned workspaces have default suggested name of [existingworkspace]clone (numbered as necessary), but leave the text highlighted so it can easily be named before it is actually cloned. Deleting a workspace seems like it might have an extra confirmation so that users don’t do it by accident. I have a confirm deletion dialog here, but I want to know the frequency of deletion and/or how irritating it is to delete a workspace by accident to make that choice. This is the same for resetting workspaces. Let me know if this was helpful for starting to get a feel for how these features might need to interact with a user. |
I found myself having a couple of questions I haven’t been able to find answers to myself, so I’m listing them here.
|
Here are the operations we support from the browser client:
There are also options from the command line: $ jupyter lab workspace --help
Import or export a JupyterLab workspace
There are two sub-commands for export or import of workspaces. This app
should not otherwise do any work.
Subcommands
-----------
Subcommands are launched as `jupyter cmd [args]`. For information on using
subcommand 'cmd', do: `jupyter cmd -h`.
export
import
...
$ jupyter lab paths
Application directory: /Users/stslve/miniconda/share/jupyter/lab
User Settings directory: /Users/stslve/.jupyter/lab/user-settings
Workspaces directory: /Users/stslve/.jupyter/lab/workspaces
|
While this feature is not implemented, the code below will create a clickable list of existing workspaces reverse-sorted by modification time. A notebook in the default workspace with this code (optionally with the extension epi2me-labs/jupyterlab-autorun-cells) works as a makeshift GUI for workspaces. from pathlib import Path
from datetime import datetime
from IPython.display import display, Markdown
workspaces = []
for f in (Path.home() / '.jupyter/lab/workspaces').glob("*.jupyterlab-workspace"):
*handle, _ = f.stem.split("-")
workspaces.append((datetime.fromtimestamp(f.stat().st_mtime), "-".join(handle)))
workspaces.sort(reverse=True)
display(Markdown("\n".join([f"- [{wk}](/lab/workspaces/{wk}) ({date.isoformat(' ', timespec='minutes')})" for date, wk in workspaces]))) |
Did this issue go dormant or has it been moved elsewhere? I found myself pulled in by workspaces because of the save option, but now I'm at a loss of what to do after a system reboot on recovering it. Trying different lab/workspaces/ urls did not work. Just said couldn't open the file. now I'm running into weird issues with jupyterlab losing connection and the only way to fix it seems to be deleting workspaces. https://stackoverflow.com/questions/70361265/server-connection-error-with-conda-and-jupyter-lab |
I wonder if something that the earlier discussion has overlooked would be the presentation of the workspaces themselves. I've just checked and this is the list of workspace identifiers I have: [
"auto-0",
"auto-1",
"auto-2",
"auto-3",
"auto-4",
"auto-5",
"auto-6",
"auto-7",
"auto-8",
"auto-9",
"auto-A",
"auto-a",
"auto-b",
"auto-B",
// [...]
"auto-W",
"auto-w",
"auto-x",
"auto-X",
"auto-y",
"auto-Y",
"auto-z",
"auto-Z",
"bar",
"default",
"/lab",
"/lab/workspaces/auto-0",
"/lab/workspaces/auto-1",
"/lab/workspaces/auto-2",
// [..]
"/lab/workspaces/auto-x",
"/lab/workspaces/auto-y",
"/lab/workspaces/auto-Y",
"/lab/workspaces/auto-z",
"/lab/workspaces/auto-Z"
] Even if I had a switcher widget, I would not know to which workspace I want to switch. However, there is a lot of useful metadata that we cold use for descriptors, e.g.
Here is the contents of an example workspace that we can easily access: {
"data": {
"layout-restorer:data": {
"main": {
"dock": {
"type": "tab-area",
"currentIndex": 0,
"widgets": [
"notebook:Untitled56.ipynb"
]
},
"current": "notebook:Untitled56.ipynb"
},
"down": {
"size": 0,
"widgets": []
},
"left": {
"collapsed": false,
"visible": true,
"current": "filebrowser",
"widgets": [
"filebrowser",
"running-sessions",
"extensionmanager.main-view"
],
"widgetStates": {
"jp-running-sessions": {
"sizes": [
0.25,
0.25,
0.25,
0.25
],
"expansionStates": [
false,
false,
false,
false
]
},
"extensionmanager.main-view": {
"sizes": [
0.3333333333333333,
0.3333333333333333,
0.3333333333333333
],
"expansionStates": [
false,
false,
false
]
}
}
},
"right": {
"collapsed": true,
"visible": true,
"widgets": [
"jp-property-inspector",
"@jupyterlab/toc:plugin",
"debugger-sidebar"
],
"widgetStates": {
"jp-debugger-sidebar": {
"sizes": [
0.2,
0.2,
0.2,
0.2,
0.2
],
"expansionStates": [
false,
false,
false,
false,
false
]
}
}
},
"relativeSizes": [
0.07538946314456518,
0.9246105368554348,
0
],
"top": {
"simpleVisibility": true
}
},
"notebook:Untitled56.ipynb": {
"data": {
"path": "Untitled56.ipynb",
"factory": "Notebook"
}
}
},
"metadata": {
"id": "auto-0",
"last_modified": "2023-12-01T10:11:25.037295+00:00",
"created": "2023-12-01T10:11:25.037295+00:00"
}
} |
I’m adding to this issue again because @krassowski may be working on this soon. I come bearing a new set of proposals is meant to build on the discussion above (from years ago, I know, such is open source time) and recommend UI for workspaces that requires minimal new design. As always, feedback is welcome. I’ve included all the workspace commands I’m aware of from the docs because I find it’s usually easier to plan for taking up the most space and remove items if we don’t find them necessary. If you think some of these commands should not be in the UI as a first pass (or at all) that’s also good to know. These proposals will hold up even if commands are removed from the list shown in the mockups. I’ve divided proposals by the area of JupyterLab they’d show up in. Menu itemsWe could add workspace commands under the File Menu since they do contribute to the set of files open in a JupyterLab. or Pros
Cons
Running side barEarly on in this issue I proposed an option that put workspaces alongside kernels in the left sidebar. This is updated from that previous proposal. They are still in their own section, but the options available are pared down and the new styling is shown. Pros
Cons
Command paletteNo matter what direction we go with, I believe adding workspace commands into JupyterLab’s UI should also show those commands in the command palette. However, it could be an option to only show workspace commands in the command palette and nowhere else. Pros
Cons
Other notesDeletion and resetting (or overwriting) other files in JupyterLab leads to a dialog to check that the high-consequence action is intended. For workspace files, I think we should consider doing the same. However, even though a workspace file is being deleted, I would consider the stakes to be lower for the kind of information a workspace file saves. I could be convinced that a deletion confirmation dialog is not necessary if someone has good reasoning against it. |
Thank you @isabela-pf! I'm thinking that maybe Workspaces submenu could fit better under the "View" or "Tabs" menu with the rationale being that for user changing/closing/resetting a workspace changes the arrangement/layout/open tabs. What do you think? |
I think that the link expired, do you still have the SVG asset somewhere? No worried if not, I can recreate it otherwise. |
Looking forward to this feature, so I searched for the icon. |
I'm finding "click on workspace in sidebar to open" to be somewhat odd experience in practice:
For (a) I wonder if we should have a custom confirmation dialog when opening a workspace from a sidebar which would always show up. It could have more useful options like "[Cancel] [Save All and Continue]" For (b) I would consider if we should modify the layout after loading to open the workspaces sidebar if the workspace was opened from the sidebar. |
Another question: what should we do with the existing "Save Workspace" and "Save Current Workspace As..." menu entries/commands? These act pretty similar to "Export" command (they write to disk rather than to API) but have slightly different semantic than "Export". I think we can tuck them into the "Workspaces" submenu just above import/export. |
It is technically possible to remove the Of note a workspace which is deleted, including the |
Thanks for collecting all these questions, @krassowski! Please let me know if I miss something in trying to answer them. I do know I owe you more answers to other comments on here, but I didn't want the fact that I didn't have them all answered to block the ones I did. So I will return for the rest! Thank you for your patience.
|
Responding to the next questions!
I think this feedback makes sense. I will say I do not think we need to be able to manage workspaces through both the menu and sidebar as long as all the controls are available. If it makes more sense to work with the menus only, that is perfectly fine from my point of view. You provide some good ideas to workaround it, but ultimately if we can make it simpler by having less UI I’d support that.
I think this works. Putting all workspace things together makes sense to me. I am trying to think if there’s a way to combine the commands, but you make a good point they do not do quite the same thing.
Since it regenerates, I think it runs the risk of being confusing to delete it but never have it disappear from the list. This makes me think it shouldn’t be deletable, only resettable. |
I like the idea of deleting the |
Jupyterlab's documentation only explain how to manage workspaces via URLs and CLI.
Are there any plans to provide some GUI for those? At least create new one and list / choose / delete existing ones?
The text was updated successfully, but these errors were encountered: