add a setting for only using a single tab for diffs
Description
Currently every diff is opened in a new jupyter tab. I propose a setting that would enable behavior similar to github desktop where there is only one tab for diffs, and opening a new diff would change what diff is displayed but not create a new tab.

Contrast with the tab explosion when viewing the same commits in jupyterlab-git:

Often this multitab behavior is pretty nice, but I'd like to be able to toggle it on and off.
That is a nice idea. But a better approach instead of all or none would be to set a maximum number of diff tab to be kept opened using a queue. If the setting is 0, then the behavior would be the actual. And if it is one, it will be the one you propose. And if it is something else, it would probably make more sense like looking at all changes in a commit (especially as diffing big file can be quite slow) but keeping the number of opened tabs acceptable.
VSCode shows each file diff as a separate tab as well (on double-click)

I like this idea as a setting for the opinionated user, but it's important to not over-index on GitHub Desktop or a particular Git GUI.
In VSCode when you click on a file it shows the diff in a separate diff tab. If you click on another file it shows the diff in the same diff tab. A new diff tab is only opened if you double-click on a file (or if no diff tab is already open).
I would love for jupyterlab-git to replicate this UX as I think it's pretty perfect:
https://github.com/jupyterlab/jupyterlab-git/issues/252#issuecomment-509865304
@dhirschfeld As you said in the other issue, what you're describing is part of a more complex feature in vscode called preview mode. Implementation of our own preview mode would probably best be first tackled in core before we implement our own flavor of it here in the git extension.
Some thoughts:
- the "open in preview tab" behavior could be implemented as new flavor of the
filebrowser:opencmd from @jupyterlab/filebrowser-extension. Say,filebrowser:open-preview - we could then reuse
filebrowser:open-previewin the git extension's file listing widgets - this way, it would be easy to implement a single user setting that could turn on/off the "open in preview tab" behavior everywhere
Agreed with what @telamonian said above.
In the VSCode file browser, a single-click opens a file in the so-called "preview mode" tab, leading to a nice consistency between the regular file browser and the Git one.
Since a single-click doesn't do the same in the JupyterLab file browser, I'd also vote that this is first handled in core and then we can aim to have consistency between the the regular and the Git file browser.
I agree too with @telamonian.
the "open in preview tab" behavior could be implemented as new flavor of the filebrowser:open cmd from @jupyterlab/filebrowser-extension. Say, filebrowser:open-preview
It will actually be more work than that as some widgets are inserted from as deep as LabShell (https://github.com/jupyterlab/jupyterlab-git/blob/8d56986409461cd9968d7208da4946fca8c70392/src/components/diff/DiffWidget.tsx#L57) for non-trivial content like diff. It may even make sense to add that ability directly in the lumino DockPanel.
So quite some work to achieve it... Therefore I would accept a simpler approach within the extension from now.