Skip to content

Linked file feature (previously: Pinned file)

Enabled globally in %17.4

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/347123+, (comment)

Leave your feedback here.

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:

  1. Change the file line link to /merge_requests/%id%/diffs/%blob_hash%#line_%line%. This is required for the blob_hash to be available on the server side.
  2. When a blob_hash is set in the URL fetch this file as soon as possible (for example using startup calls).
  3. 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.
  4. Add a 'Close' or 'Unpin' button to remove the pinned mode from the file.

Screenshot

image

Outdated image

Concept image

Concept image

Edited by Stanislav Lashmanov