Pin file when linking to a file line in an MR
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/347123+, (comment)
When you copy a link to a file line in a merge request and then follow it in a new tab the whole MR Changes page will have to load first before it'll scroll you to the linked line. This is not ideal because there might be lots of changes and lots of files. You'll have to wait for them to load before you could see your linked file and the line.
We could address that by doing the following:
- Change the file line link to
/merge_requests/%id%/diffs/%blob_hash%#line_%line%
. This is required for theblob_hash
to be available on the server side. - When a
blob_hash
is set in the URL fetch this file as soon as possible (for example using startup calls). - Render this file out of order as the first item in the file tree list. Also adjust its position in the file tree. 4. Highlight both of them to indicate that the file is pinned.
- Add a 'Close' or 'Unpin' button to remove the pinned mode from the file.
Screenshot
Concept image
Edited by Stanislav Lashmanov