Skip to content

Support quote reply shortcut ('r') in merge request diff discussions

What does this MR do and why?

This MR adds support for quote reply shortcut (r) to merge request diff discussions on the 'Changes' tab. Right now this shortcut only works on the 'Overview' tab in merge requests. This change makes it work on both pages.

The new logic is possible with the help of Custom Events, which we now trigger on a discussion element and let the component handle that event. This approach has advantages over event bus because it's scoped to a specific discussion so we don't have to pass that context at all.

This MR also fixes a bug when you pressed r and it put the quoted text into the main reply form on the 'Overview' tab because shortcut listener was still working while the tab was invisible. With the new approach we only handle shortcuts for specific tab while it's visible.

Screenshots or screen recordings

Before After
CleanShot_2025-10-23_at_03.56.07 CleanShot_2025-10-23_at_03.54.56

How to set up and validate locally

  1. Visit any merge request
  2. Select 'Changes' tab
  3. Create a discussion on any line
  4. Select the message inside the discussion
  5. Hit r
  6. Observe the reply field to be in focus and the selected message quoted
Edited by Stanislav Lashmanov

Merge request reports

Loading