microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.3k stars 29.31k forks source link

Order of Compare Selected files by mouse #226883

Open lijh8 opened 2 months ago

lijh8 commented 2 months ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

When we select two files in these three places and issue Compare Selected command to compare them, which file appears on the left of the diff window, is it random?

  1. Folders in explorer window: The first selected files appears on the left in diff window. No matter on which file of the two the Compare Selected command is executed. This has been the way for a long time.

  2. Open Editors in explorer window: The file appears on the left in diff window is the file on which the Compare Selected command is executed.

  3. tabs: same as item 2 Open Editors.

lramos15 commented 2 months ago

Sorry I'm not understanding the issue. Could you try rephrasing it a bit so that I may reproduce?

Namarot commented 2 months ago

@lramos15 I was going to open a closely related issue, but I will elaborate further here, let me know if I should open a new issue instead.

The behavior @lijh8 describes in step 1 has now been reversed in Version 1.93.0, see: #225441 However the behavior of "Compare Selected" is still inconsistent between "Folders" and "Open Editors".

Steps to Reproduce:

Actual Behavior:

Expected Behavior: Right Click -> Compare Selected should have the same behavior in "Folders" and "Open Editors" views.

Edit: I should add that I prefer the way it works in the "Folders" view, with the file you select first being shown on the left as the "original", but the inconsistency constantly throws me off and makes me triple check every time I'm comparing files.

runxel commented 1 week ago

Yes, I second that the whole UX around the Compare feature is utterly borked, see like #232841. Not only that it seems totally random for the user with what they will end up with, it is also highly problematic and will lead to data loss inevitably. (I just experienced that) Furthermore this issue is accelerated by the fact that it is IMPOSSIBLE to deduce what file is actually on the right or the left! Hey folks, please! We need some kind of differentation here!: Image

The breadcrumbs on the left NEVER changes. But what does it mean? Just put two breadcrumbs in there for left and right and it will much clearer.

Also regarding the standard order: If the user chooses two files for compare, the one on the right should always automatically be the older one (because it works from left to right, and I most possibly want newer stuff to come in the older file; like standard git workflow. Or make a switch for that, so people can choose).