Add merge request buttons to refactored commits page

What does this MR do and why?

This MR adds the MR buttons to the refactored commit list:

  • "Create merge request" button when viewing a non-default branch with no open MR (if the user has permission)
  • "View open merge request" button when an open MR already exists from that branch to the default branch

This button is in the overflow menu on mobile.

References

Resolves #598206

Screenshots or screen recordings

Light mode Dark mode Mobile
View open MR

CleanShot 2026-09-09 at 16.43.40.png

CleanShot 2026-09-09 at 16.44.27.png

CleanShot 2026-09-09 at 16.43.49.png

Create MR

CleanShot 2026-09-09 at 16.43.31.png

CleanShot 2026-09-09 at 16.44.18.png

CleanShot 2026-09-09 at 16.43.59.png

How to set up and validate locally

  1. Enable the project_commits_refactor feature flag in the Rails console: Feature.enable(:project_commits_refactor)
  2. Visit a project's commits page on a non-default branch as a developer
  3. Verify the "Create merge request" button appears in the page header
  4. Create an MR from that branch and revisit the commits page
  5. Verify the "Create merge request" button changes to "View open merge request"
  6. Visit the default branch, a tag, or a commit SHA ref
  7. Verify no merge request button appears on any of these ref types
  8. Use the ref selector dropdown to switch between branches
  9. Verify the button updates correctly without a page reload
Edited by Chaoyue Zhao

Merge request reports

Loading
Loading