Merge Request file browser tree view excessively truncates long paths
Summary
The Merge Request -> Changes -> File Browser when set to Tree View appears to truncate long paths excessively with .../ instead of only truncating paths in the middle.
Steps to reproduce
-
Create a merge request consisting of changes on items at the deepest level of a long directory tree (~104 characters in this example).
-
When viewing these changes in the file browser set to
Tree View, large sections of the directory path are truncated with.../, instead of only truncating the middle as is done inList View. Additionally, hovering the mouse cursor over the path truncated as.../does not reveal the path that was truncated, however it seems that hovering slightly above this does so, but it's not obvious at first.
-
Example 1 - jamesreed/treeviewtruncateissue!3 (diffs)
-
Here we can see an example of where a large section of the path is truncated in
Tree View.
-
Here we can see an example of how only the middle of the long path is truncated in
List View.
-
Here we can see an example of the cursor hover point that shows the full directory path. It's somewhere in-between the changed file and the highest folder shown. Hovering over the truncated path simply shows the
.../style truncation, and doesn't expand to a full path.
-
-
If changes are introduced on files higher up in the tree, the truncation behavior in
Tree Viewwill change, however it still looks like too much of the path is truncated.-
Example 2 - jamesreed/treeviewtruncateissue!3 (diffs)
-
Example 3 - jamesreed/treeviewtruncateissue!3 (diffs)
-
Example Project
Example project merge requests:
- Example 1 - jamesreed/treeviewtruncateissue!3 (diffs)**
- Example 2 - jamesreed/treeviewtruncateissue!3 (diffs)**
- Example 3 - jamesreed/treeviewtruncateissue!3 (diffs)**
What is the current bug behavior?
Large sections of long folder paths are truncated entirely in the file browser Tree View.
What is the expected correct behavior?
Long folder paths in the file browser Tree View should truncate only in the middle. Viewing the full path in the Tree View should be possible in an obvious manner.
Caveat: It's possible that this behavior is intended depending on the circumstances, however my interpretation of how this should work is largely influenced by previous discussions on this that took place in:
-
Merge Request sidebar adapts to long file paths
- Specifically:
When hovering folders and files, the full path/name is displayed.
- Specifically:
Note that you can still see the full path of changed items in the actual diff view to the right of the file browser, so it's still possible to read the paths this way.




