Scroll to line in Diffs app despite virtual scrolling or collapse state
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
- Create a very large MR (I used 100 files each with 250 lines of changes)
- Scroll until the MR shows a file that is not loaded
- Load the file and leave a comment on it
- (Optionally) Mark the file as
Viewed
- Navigate to the Overview tab and perform a hard refresh
- Scroll to your comment on the Overview tab, and click the file name associated with it
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Thomas Randolph