-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(FileStatusList): sort copied before renamed #12246
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
fix(FileStatusList): sort copied before renamed #12246
Conversation
as well as before added/removed as copied may have changes worth reviewing. Order unequal/same/b/a in the same way as they are displayed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have not run.
My first quick thoughts:
Copied is kind of an "added" file.
And it is important to me whether it is an exact copy / rename (100% similarity) or not.
So the sorting of the existing file status [icons] makes good sense to me.
(I need to move the Equal filter toolbar button.)
Would it suffice to move the submodule icons up in order to present them more prominently?
Also Copied can be 100% and Modified can be copied. It is not always obvious what Git presents the changes as.., I interpret above as you support copied before renamed, but also copied/renamed before added/removed? From a review perspective the logical order would be modified, copied, added, renamed, removed, but copied/removed are related as added/removed (latter could be copied that failed to be recognized as such). I would prefer to have submodule changes presented as e.g. modified. Previously, they were embedded (just no special watermarked icon), fine for me. Now it seems like they are last. No major issue, not that many changes. |
It heavily depends on the similarity. Added and removed should be adjacent because the Git's rename/copy detection is too limited. Let's use this PR as it is. Submodules should be sorted in front of FileStatusModified* in a follow-up (moving the status icons did not have an effect). |
Same should be moved last too, also not affected by icon order |
Normally seen as a copy |
This might be caused by asynchronous retrieval of the submodule status. Workaround: Create submodule nodes with a default submodule icon at once, update them asynchronously.
This means changing the icon order cannot affect the sorting of the DiffBranchStatus, which is the primary, independent sort criterion. Sorting the enum values should suffice. Side effects? |
when sorting by file status. Also sort copied/renamed before added/removed as copied may have changes worth reviewing. Sort Same after B/A (so order is Unequal/B/A/Same). Order icons for Unequal/B/A/Same in the same way as they are displayed.
As I changed the order of icons and mentioned it here, I changed it, updated commit message and description. For submodules: I have no good repro now, will open an issue if I recreate the problem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Regarding submodules:
- in a follow-up
- async status seems to not be the root cause
- works much better if all icons are moved, particularly
SubmodulesManage
andFolderSubmodule
- status is
DiffBranchStatus.Unknown
which is sorted behindSameChange
👍 Plan to merge in some days, just finishing up the discussion here.
That is as before, I believe.
I believe it is fine having modified/copied/renamed/added/removed/submodule(s), preferable in Unequal to see conflicts easily (but at least now I find it no major issue to see all submodule changes after same).
That would mean that |
Proposed changes
sort copied before renamed as well as before added/removed as copied may have changes worth reviewing.
Order unequal/same/b/a in the same way as they are displayed.
Note: My primary feature is to see Copied (that may have changes) before Renamed (just moved) to simplify reviewing.
As Copied has "changes" I find it natural to see that after Modified, and Renamed should follow Copied.
But Added/Removed could be moved before Copied/Renamed
Screenshots
Before
After
Test methodology
Manual
Merge strategy
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.