Skip to content

Fix viewed files to automatically expand

What does this MR do and why?

This MR stops viewed files in merge request from automatically expanding when scrolling through them.

Existing implementation relies on 'view effects', which are triggered when the component mounts. It's at this step when we decide whether to collapse a file.

Previously we relied on the idState, which is an alternative to data for items inside the virtual scroller. Since we have no guarantees regarding idState it can be unstable or inconsistent, which causes the aforementioned bug.

Instead, we will use the file object itself to store that safe because it's guaranteed to be stable inside Pinia store.

Screenshots or screen recordings

Before After
CleanShot_2025-11-05_at_18.07.56_2x CleanShot_2025-11-05_at_18.04.56_2x

How to set up and validate locally

  1. Open merge request with at least 100 files changed
  2. Mark all of them viewed
  3. Reload the page
  4. Scroll through the page
  5. Observe all files to stay collapsed

Merge request reports

Loading