Riksdagsmonitor Intelligence Platform โ€” API Documentation - v1.0.47
    Preparing search index...

    Variable HOMEPAGE_ROOT_MARGINConst

    HOMEPAGE_ROOT_MARGIN: "300px" = '300px'

    Narrow IntersectionObserver rootMargin to use on pages that are NOT a single-dashboard "deep link" (/dashboards/<slug>.html, /politician-dashboard*.html). Multi-section pages such as index*.html have several below-the-fold sections โ€” #coalition-status typically sits 600โ€“1400 px below the fold โ€” and the 2000 px DEFAULT_ROOT_MARGIN would pre-fetch them eagerly, defeating the entire point of lazy loading.

    The previous behaviour caused the homepage to download view_riksdagen_politician_experience_summary_sample.csv (โ‰ˆ 5.8 MiB) and view_riksdagen_politician_sample.csv (โ‰ˆ 542 KiB) on initial render via coalition-loader, driving Lighthouse Performance to 4 (LCP 5.3 s, TBT 5,330 ms). A 300 px margin still pre-fetches a touch before the section scrolls into view (smooth UX) without forcing the download on page load.

    Tests assert this exact value to lock the contract.