j/k keyboard shortcuts for next/previous file in diff don't work in merge requests

Summary

The j / k keyboard shortcuts for navigating between files in a merge request diff ("Next file in diff" / "Previous file in diff") have stopped working reliably over the past few days.

Steps to reproduce

  1. Open a merge request with multiple changed files, on the "Changes" tab.
  2. Click anywhere in the diff area to ensure focus isn't in a text field.
  3. Press j to move to the next file, or k to move to the previous file.

What is the current bug behavior?

Pressing j / k does nothing — the view doesn't scroll to or highlight the next/previous file.

What is the expected correct behavior?

Pressing j / k should navigate to the next/previous file in the diff, per the documented default keybindings (MR_NEXT_FILE_IN_DIFF / MR_PREVIOUS_FILE_IN_DIFF in keybindings.js).

Possible cause

This is likely related to the ongoing Rapid Diffs rollout (epic Enable Rapid Diffs on merge requests by default). There's an active parity-tracking epic for exactly this class of regression: Rapid Diffs: diff keyboard shortcut parity, with related open issues:

  • #602607 – Rapid Diffs: position-aware jump-to-file
  • #618786 (closed) – Rapid Diffs: keyboard shortcuts on the Commit page
  • #614279 – MR thread shortcuts (n/p/r) don't bind on a direct Changes-tab load

None of those is an exact match for j/k failing on the standard MR Changes tab, so filing this separately for visibility.

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖