Skip to content

Show target branch on MR dashboard when MR targets the non-default branch

What does this MR do and why?

Shows the MR's target branch on the MR homepage if the target branch is not the project's default branch.

This matches the behavior of the classic MR search list.

For #561771 (closed)

Screenshots or screen recordings

Before After
Default branch target (no change) image image
Non-default branch target image image

How to set up and validate locally

  1. Create an MR that targets any branch other than the default branch as configured in the project settings.
    • Make sure you assign yourself so that the MR is in your MR dashboard
  2. Navigate to /dashboard/merge_requests
  3. Note the target branch at the end of the title metadata in the dashboard MR display (this could be right of the milestone, or right of the diff stats)

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.

Follow-up

In the linked issue, the ask was to have the target branch wrap below when the view is too small. That's what this MR does by default.

In a later discussion, there's the idea of truncating the target branch and having a tooltip: #561771 (comment 2702448686)

This MR includes the tooltip. However, the truncation should be done in a follow-up (if at all):

  1. This view does not scale down to mobile at all. All of the content significantly overflows the viewport and requires horizontal scrolling. Forcing this one section to truncate at a certain width will require a substantial amount of custom code to override the default reflow that's happening now.
  2. Because none of the view is being condensed to fit on mobile, truncating the target branch may actually be worse than "fitting in" with the rest of the content, which all just reflows and wraps until a certain size (larger than mobile!) and then stops shrinking entirely.
Edited by Thomas Randolph

Merge request reports

Loading