Skip to content

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
Screenshot_2025-10-27_at_13.07.15 Screenshot_2025-10-27_at_13.09.23

2025-10-27_11.04.40

How to test locally

  1. Enable the repository_file_tree_browser feature flag:
    Feature.enable(:repository_file_tree_browser)
  2. Navigate to any repository on your local GitLab instance
  3. Open the file tree browser in the repository view
  4. Verify that a chevron button appears next to each directory
  5. Click the chevron button to expand/collapse directories without navigating into them
  6. 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

Merge request reports

Loading