Project-switching extension?

Is there a mechanism or extension that lets a user ‘switch projects’ – automatically closing all the tabs open for a given “project” (i.e. git repo) and open the tabs that were open on another git repository?

This kind of project-oriented (git-repo-oriented) design is deeply architect-ed into other popular editors such as RStudio IDE or Codespaces/VSCode. As an instructor, I find it very valuable as a mechanism for helping users keep a clear association between a set of files and a ‘project’. Without this, students and users who are still getting used to git and project-oriented workflow often struggle to maintain a strong mental model of which files are associated with which projects, and switching between projects means manually closing a lot of tabs a re-opening (and usually re-arranging) new ones. Maybe there is already a mechanism or extension for this in JupyterLab?

For comparison, see https://support.posit.co/hc/en-us/articles/200526207-Using-RStudio-Projects or Switch Between Projects Like a Pro: Quick Guide on VS Code’s Project Manager Extension | by Menghong Chhay | Medium

2 Likes

If all the projects are within the directory that you start JupyterLab from (say you start jupyter lab in C:/Projects and you have C:/Projects/A and C:/Projects/B), you may be interested in the workspaces feature. So far there was no UI for this but this PR: Implement Workspaces GUI by krassowski · Pull Request #15946 · jupyterlab/jupyterlab · GitHub is implementing it and will be available in JupyterLab 4.2 (an alpha will be available today if all goes well):

workspaces

If you want to start JupyterLab directly in project directories, then JupyterLab Desktop isolates workspaces between sessions and offers a session selection screen on startup (see the “Recent sessions”):

4 Likes

Ooh, this is just what I was looking for. Very exciting!

2 Likes