Link to file in Changes tab of MR no longer works for all files after incremental rendering improvement
Summary
(Summarize the bug encountered concisely) When following the link with a fragment hash to a file rendered incrementally in the Changes tab, the browser no longer scrolls down to the file.
This seems a side-effect of the improvement of having incremental rendering.
Steps to reproduce
(How one can reproduce the issue - this is very important)
Expected behaviour: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6818/diffs#fd8fac4b03918e6fd91fbe012942377a2684b549
- Open an MR with more than 200 lines added
- Open the Changes tab
- Wait for it to load.
- Scroll to a file after 200 lines mark. (at least 200 lines have been outputted)
- Click the file name, to scroll to it.
- Copy the URL in the browser address bar
- Open it in a new tab.
- Wait for everything to load.
- Browser didn't scroll to where it supposed to.
What is the current bug behavior?
The browser scrolls to the file before the content above it is finished loading.
Results in the browser being in a place where it shouldn't.
Also: when you click the file name, the file header is being covered by the elements that are positioned fixed; could be related-or not.
What is the expected correct behavior?
The browser scrolls to the file and stays in the correct place, showing the file requested by the URL.
Relevant logs and/or screenshots
Kapture_2018-08-15_at_18.20.00
Expected
Kapture_2018-08-15_at_18.23.00
Possible fixes
Defer jumping to after the files have been fully loaded or Jump once when the page loads and then jump again when the files are fully loaded.