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:
- You're scrolled to a diff file only when diff file header is stuck (you've scrolled past the beginning of the file)
- 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
- Open any MR with at least 2 files that in total consume more than 1 screen height
- Try to collapse the first file
- No scrolling should happen
- Expand the file
- Scroll a bit past the first file so the file header becomes stuck
- Collapse the first file
- You should be scrolled to the first file header