Add expand/collapse chevron to FTB directories
Description
Adds a chevron button next to directories in the file tree browser that allows expanding/collapsing directories without navigating to them.
This implementation resolves the issue where users had to click through each parent directory to navigate nested directories. Now users can expand/collapse directories directly using the chevron toggle button.
Related Issue
Issue #577191 (closed)
Screenshots
| Before | After |
|---|---|
![]() |
![]() |
How to test locally
- Enable the
repository_file_tree_browserfeature flag:Feature.enable(:repository_file_tree_browser) - Navigate to any repository on your local GitLab instance
- Open the file tree browser in the repository view
- Verify that a chevron button appears next to each directory
- Click the chevron button to expand/collapse directories without navigating into them
- Confirm that:
- The chevron icon changes direction (right → down) when expanding
- Directory contents load when expanding
- Clicking the chevron doesn't navigate to the directory
- The aria-label correctly indicates "Expand directory" or "Collapse directory"
Edited by Jacques Erasmus


