Skip to content

Adjust scroll to collapsed file

What does this MR do and why?

Resolves Collapsing file in diffs tab causes unexpected ... (#360204 - closed).

Discussions on previous implementation for context.

This MR ensures that:

  1. You're scrolled to a diff file only when diff file header is stuck (you've scrolled past the beginning of the file)
  2. Scroll to a diff file is instant

Screenshots or screen recordings

Before After
Screen_Recording_2023-12-06_at_18.11.08 Screen_Recording_2023-12-06_at_18.09.54

How to set up and validate locally

  1. Open any MR with at least 2 files that in total consume more than 1 screen height
  2. Try to collapse the first file
  3. No scrolling should happen
  4. Expand the file
  5. Scroll a bit past the first file so the file header becomes stuck
  6. Collapse the first file
  7. You should be scrolled to the first file header

Merge request reports

Loading