Skip to content

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:

  1. 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.
  2. 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

  1. Open any large MR.
  2. Go to Changes page.
  3. Switch to 'Show one file at a time' mode.
  4. Start navigating through files using file browser on the left.
  5. 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.

Merge request reports