Use content-visibility on Rapid Diffs files

What does this MR do and why?

This MR adds content-visibility: auto to Rapid Diffs files to speed up page rendering. This change reduces streaming rendering cost by ≈5-10 times.

Related bugfix in Chrome.

Screenshots or screen recordings

Screen_Recording_2025-05-02_at_19.21.47

Before After
image image

How to set up and validate locally

  1. Use Chrome 138.0.7156.0 or newer (a Canary build would work)
  2. Enable rapid_diffs and rapid_diffs_on_mr_show feature flags
  3. Go to merge request with lots of changes (more than 100 files changed or 3000 lines)
  4. Select 'Changes' tab
  5. Add ?rapid_diffs=true to the URL, follow it
  6. Observe a very responsive page during and after the loading
Edited by Stanislav Lashmanov

Merge request reports

Loading