Use IntersectionObserver in trackViews()
Created by: lguychard
Use IntersectionObserver
in trackViews()
so that views are only emitted when they're contained (even partially) within the viewport, or within 4000px of the viewport's top/bottom edges. The 4000px heuristic avoids the UI jitter of code view toolbar buttons being added as you scroll.
This change allows us to remove the 50 code view limit that was put in place so as to not freeze the page on large PRs.