Fix inconsistent scroll to file in 'Show one file at a time' mode
What does this MR do and why?
Fixes Scroll to file is inconsistent in a single file... (#426250 - closed).
This MR fixes inconsistent scroll to file in 'Show one file at a time' mode. It does so by:
- Setting a consistent min height of the page so there's always enough space at the bottom even when the file height is small or if it's loading.
- Skipping calculation of the file header height if the URL fragment does not contain
#note
in it. This height is only needed when navigating to a discussion.
Screenshots or screen recordings
Before | After |
---|---|
Screen_Recording_2023-11-17_at_03.51.07 | Screen_Recording_2023-11-17_at_03.49.07 |
How to set up and validate locally
- Open any large MR.
- Go to Changes page.
- Switch to 'Show one file at a time' mode.
- Start navigating through files using file browser on the left.
- The scroll position should be kept consistent.
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.