vscode-git-graph icon indicating copy to clipboard operation
vscode-git-graph copied to clipboard

`Open New Tab Editor Group: Beside` should be relative to graph, not relative to active

Open mikestopcontinues opened this issue 4 years ago • 3 comments

Describe the improvement that you'd like I really like Open New Tab Editor Group: Beside, as it allows me to flip through different diffs by clicking through the file list. However, if I click into any of those diffs, clicking on the file list opens a third editor group (or fourth or fifth). That makes for a huge mess.

Instead of opening a diffs beside the active pane, it should open diffs beside the graph pane.

mikestopcontinues avatar Jan 04 '22 19:01 mikestopcontinues

In recent versions Git Graph began to opene diffs in random editors. In earlier versions it reused the same editor which made it really practical to look through commits.

I would consider the new behavior a bug as I don't think it was intentional: GitGraphRandomEditors

Wosi avatar Jan 30 '22 13:01 Wosi

I believe this response answers the original improvement request by @mikestopcontinues, and the new comment from @Wosi. (the screen recording made the behaviour much clearer to me)

Visual Studio Code manages every aspect of the editor lifecycle & layout. When any extension calls the Visual Studio Code API to open a diff / file editor, the extension can optionally specify a ViewColumn that the editor should be opened in. The behaviour of the Beside ViewColumn (and all other values) are completely controlled by Visual Studio Code - no extension has the luxury of changing them. There is also no other alternative Visual Studio Code API options available to achieve a similar effect.

The Git Graph extension setting git-graph.openNewTabEditorGroup allows the user's preferred ViewColumn to be passed directly through to Visual Studio Code when the diff / file editor is being opened. The extension doesn't have any control over what Visual Studio Code chooses to do with the specified ViewColumn.

The expected (and historical) Visual Studio Code behaviour is that: When the user clicks on a file, that interaction has already made the Git Graph View the active editor. Therefore, the Beside option would behave as expected, opening or re-using the editor to the right of the Git Graph View. Furthermore, "relative to graph" and "relative to active" are therefore equivalent (as the graph is the active editor).

I think that alongside recent Visual Studio Code Webview code changes, an intermittent race condition was introduced such that the Webview is sometimes delayed in becoming active until after the user click event has been handled (after the diff / file editor has already been requested to be opened). This would affect any extension that uses a Visual Studio Code Webview - not just Git Graph.

Please raise this as a bug with Visual Studio Code, so Microsoft can investigate & hopefully resolve it (call it "Webview Activation Timing - Open Editor Beside Webview"). When providing the details, outline the behaviour in general (or quote parts of this comment), and use your screen recording & Git Graph as an example illustrating the issue. It's important to do this, so this issue is triaged appropriately (as it affects any extension that leverages this capability, not just Git Graph).

mhutchie avatar Jan 31 '22 09:01 mhutchie

Thanks, @mhutchie. I let them know. :)

mikestopcontinues avatar Jan 31 '22 14:01 mikestopcontinues