Merge request file order inconsistent with sidebar listview
Summary
In the diff, the files are ordered such that the least nested files will be shown first, followed by files in folder. In contrast, the navigation sidebar orders the nested folder first, then the files in the top folder.
Steps to reproduce
Make a merge request with example files as below, observe.
What is the current bug behavior?
In a merge request with 2 files: src/file.h file2.h
the sidebar will order them as src
- file.h file2.h
while in the diff the order will be
file2.h src/file.h
This is somewhat confusing when tracking changes in multiple files or trying to get an overview over larger merge requests. It becomes particularly bad with many changes and very nested structures
What is the expected correct behavior?
The order should be consistent
Proposal
The file browser in tree view has the most intuitive and consistent behavior. We should change the order of the file browser list view and the file diffs to match the file browser tree view. Example:
/1-folder/nested/
A-file.ext
M-file.ext
Z-file.ext
/1-folder/
A-file.ext
M-file.ext
Z-file.ext
/2-folder/
A-file.ext
M-file.ext
Z-file.ext
/
A-file.ext
M-file.ext
Z-file.ext
Feature Flag
This feature is behind a feature flag called sort_diffs
. Will be rolled out in #293819 (closed).