Fix encoding for file tree browser paths with special characters

What does this MR do and why?

Ensure file and directory paths containing spaces and special characters are properly encoded when generating router paths

References

Screenshots or screen recordings

Before After
Screenshot_2025-11-21_at_14.37.58 Screenshot_2025-11-21_at_14.40.16

2025-11-21_14.38.51

How to set up and validate locally

  1. Create a new branch with special characters in the name (e.g., !@#$%/)(&())
  2. In this branch, create a directory with special characters (e.g., @#$%^&*rthsi^%)
  3. Inside that directory, create files with special characters in their names (e.g., test_*^%.js).
  4. Navigate to Repository > Files in the GitLab UI
  5. Browse to the directory with special characters
  6. Click on files with special characters in the file tree browser (left sidebar)
  7. Expected: Files should load correctly

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #581015 (closed)

Edited by Jacques Erasmus

Merge request reports

Loading