Expand lines/files in a MR when linking to collapsed lines/files
Summary
It is possible to comment on an unchanged line in a merge request (https://gitlab.com/gitlab-org/gitlab-ce/issues/13950) but if you link to the line and don't comment on it, the diff doesn't expand to the linked line nor jump to the file on the diff.
Since GitLab makes it possible to generate the link, the link should jump to the correct location.
This is also seems to be the case when linking to lines in auto-collapsed files.
Steps to reproduce
- Go to an existing merge request
- In the diff tab, expand unchanged lines, and then click on one of the lines to select it and copy the URL
- Open the URL in a new tab
Example Project
What is the current bug behavior?
Link anchor doesn't scroll the user to the correct line in the correct file.
What is the expected correct behavior?
Link should cause the diff to be expanded to the correct line, and the user to be jumped to that location.
Relevant logs and/or screenshots
n/a
Output of checks
This bug happens on GitLab.com
Possible fixes
If an unchanged line is linked to we should automatically expand the entire file as requested in https://gitlab.com/gitlab-org/gitlab-ce/issues/19054