Skip to content

Scroll to line in Diffs app despite virtual scrolling or collapse state

Thomas Randolph requested to merge tor/defect/scroll-to-collapsed-line into master

What does this MR do and why?

For #345527 (closed)

Solution

Load a collapsed file if that file's hash shows in the URL when the app loads.

Complexities

  • We have to add a mechanism to force a file to display without clearing other collapse values
  • We need the full diff file in order to load the collapsed diff, which means we have to wait for all batches to finish before we can load the one we need

Screenshots or screen recordings

There is no scroll behavior from before, as scrolling to a line does not work.

After
RecApp-2023-09-19-01_14_16

How to set up and validate locally

  1. Create a very large MR (I used 100 files each with 250 lines of changes)
  2. Scroll until the MR shows a file that is not loaded
  3. Load the file and leave a comment on it
  4. (Optionally) Mark the file as Viewed
  5. Navigate to the Overview tab and perform a hard refresh
  6. Scroll to your comment on the Overview tab, and click the file name associated with it
  7. Wait until the diffs have finished loading and the page scrolls to your comment, loading the otherwise-unloaded file

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Randolph

Merge request reports