Expanded diff line anchors are not unique on MR Changes tab

Summary

The MR Changes tab has line anchors for diff lines. Expanding a diff does not produce unique anchors (nor can they be used anyway, see note below).

Steps to reproduce

  • go to a merge request that has diffs that can be expanded
  • observe the first diff's line anchor (which is #007cc976fd94412e5780349bfb81dab72650e1a3_108_108)
  • expand the first file upwards
  • observe the newly added expanded diff line anchors (which looks like #37)

Note: using the full anchor link would suppose that the file be expanded enough again on page (re)load, which is not the case (yet?).

Expected behavior

Line anchor should be unique so as to be useful as a reference to the diff line.

Actual behavior

Line anchor is not unique and thus cannot be used as a reference to the diff line.

Relevant logs and/or screenshots

Screen_Shot_2016-11-14_at_22.13.03

Edited Jun 16, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading