Code Insights: Render insight that are rendered in visible viewport area
Created by: vovakulikov
Background
Prior to this PR, we render all insights on the page that were ever visible. So for example, if we have 100 insights on the page and only 10 of them are visible, during user scrolling we will render more and more elements on the page (10, 12, 15, 20 ....) at the end we will render all insights.
In this PR we use intersection observer information to track insight cards that are visible so we always will have approximately the same number of rendered insight cards on the page.
Test plan
- Make sure that we don't skip any insight rendering on the page
- Make sure that we don't have unnecessary requests in the network tab during page scrolling
App preview:
Check out the client app preview documentation to learn more.