Comment permalinks have poor interaction with collapsed files
Summary
When opening a permalink to a comment on an auto-collapsed file in a merge request, the comment will not be visible. This makes it difficult to send someone an email or Slack DM about a particular comment for out-of-band discussion.
Steps to reproduce
- Create a merge request with a sufficiently large file change that the file is collapsed by default
- Expand the collapsed file and add a comment to it
- Get the permalink to the comment
- Open the link in a new browser tab
What is the current bug behavior?
Merge request page opens but comment is not visible
What is the expected correct behavior?
Merge request page opens, normally-collapsed file is expanded, and viewport scrolls to comment (more consistent with behavior for comments on non-collapsed files)
Output of checks
This bug happens on GitLab.com