Skip to content

Commits view: Add a 'Browse files' button pointing to the Tree/Blob view of current path

What does this MR do and why?

Seeks to address #536446 (closed) by adding a "Browse files" button to the Commits view that can be used to quickly jump to the Tree or Blob view for the current path.

For example, in gitlab-org/gitlab/-/commits/master/README.md the button would point to gitlab-org/gitlab/-/blob/master/README.md.

(The proposed label is consistent with the button currently shown in the Commit view.)

Screenshots or screen recordings

Scenario Before After
Directory in default branch Before-commit-main-branch-directory commit-main-branch-directory.png
File in default branch Before-commits-main-branch-file.png commits-main-branch-file.png
File in arbitrary branch Before-commits-custom-branch-file.png commits-custom-branch-file.png

Responsiveness

Widths:

How to set up and validate locally

  1. Set up the GitLab Development Kit (GDK) locally (instructions here).
  2. Check out the changes from this branch into the GDK tree.
  3. Load http://gdk.local:3000/gitlab-org/gitlab-test/.
  4. Click on a file/directory.
    • Optional: switch branches with the ref-picker dropdown.
  5. Click on the History button for the last commit affecting the file/directory.
  6. Click on the new Browse files button. Check that it effectively returns to 4).

Closes #536446 (closed).

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading