Implement global search in the file tree browser
What does this MR do and why?
This replaces the local filter functionality in the repository file tree browser with an integration to GitLab's global search. Instead of filtering files within the tree view, users can now trigger the global search modal directly from the file tree browser.
References
Screenshots or screen recordings
How to set up and validate locally
-
Navigate to a repository's file tree browser:
- Go to any project on your local GitLab instance
- Visit the repository files page (e.g.,
https://gitlab.com/your-project/-/tree/main)
-
Test the search button:
- Click the "Search files (*.vue, *.rb...)" button in the file tree browser
- Verify that the global search modal opens
- Confirm that the search input is pre-populated with
~character
-
Test the keyboard shortcut:
- Press the
fkey while viewing the repository - Verify that the global search modal opens (instead of focusing a filter input)
- Confirm the search input contains
~
- Press the
-
Test the toggle shortcut:
- Press
Shift+fto toggle the file tree browser visibility - Verify this still works as expected
- Press
-
Verify the search functionality:
- In the opened global search modal, type a file name
- Confirm that file search works correctly across the repository
Note: The ~ character in the search input triggers GitLab's file search mode in the global search, allowing users to search for files by name or pattern across the entire repository.
Related to #543753 (closed)
Edited by Jacques Erasmus
