Skip to content

Fixed anchoring diff lines in collapsed diffs

What does this MR do?

This MR adds the ability to forceLoad a collapsed diff from instantiation, on top of this, if it is force loaded, we can pass a callback function to be invoked when the content is loaded.

Now when a MR is loaded, we check for a diff line anchor that is currently within a collapsed diff, we re-instantiate the singleFileDiff with the forceLoad option. We also pass a callback function that in responsible for highlighting and scrolling to the specified anchor.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

We currently cannot anchor link to collapsed diff lines as the do not auto-expand.

Screenshots (if relevant)

https://youtu.be/fZVLlP6kchw

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #21633 (closed)

Merge request reports