Fix commit list browse files button to link to repository tree

What does this MR do and why?

The folder-open button in the refactored commit list (project_commits_refactor feature flag) was using commit.webUrl, which resolves to the commit detail page — the same destination as clicking the commit title. The previous implementation used project_tree_path(project, commit), which opens the repository file browser at that specific commit SHA.

This fix restores the correct behaviour by injecting projectRootPath (already provided by the app) into both the desktop action buttons and the mobile overflow menu components, and computing the tree path using joinPaths.

References

Screenshots or screen recordings

Before After
folder-open links to commit detail page (same as title) folder-open links to repository tree at commit SHA

How to set up and validate locally

  1. Enable the feature flag: Feature.enable(:project_commits_refactor)
  2. Visit any project's commit list, e.g. http://gdk.test:3000/gitlab-org/gitlab/-/commits/master
  3. Hover over the folder-open button on any commit row — confirm the URL shown is /-/tree/<sha> (not /-/commit/<sha>)
  4. Click the button — confirm it opens the repository file browser at that commit SHA
  5. On a narrow viewport, open the ⋮ overflow menu and verify "Browse files at this commit" also links to the tree

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.

Edited by Chaoyue Zhao

Merge request reports

Loading
Loading