perf(frontend): content-visibility on andebol.net FPA agenda cards (BIT-28144)
Tests / writer-pipeline tests (push) Successful in 1m14s
Tests / bridge tests (push) Successful in 1m18s
Tests / frontend lib tests (push) Successful in 3m8s
Tests / writer-pipeline tests (pull_request) Successful in 3m23s
Tests / bridge tests (pull_request) Successful in 3m21s
Tests / frontend lib tests (pull_request) Successful in 1m16s

andebol.net home fails LCP (~8s) and Lighthouse Performance (~26) while
newsproject.bitreport.pt (same bridge/cache stack) passes. Root cause:
FpaAgendaSection is andebol.net-only (fpa_agenda_enabled + institutional
theme, homepage only) and renders up to 48 game cards with heavy per-card
CSS (gradients, color-mix, shadows). Measured andebol.net home DOM at
~2230 elements vs ~468 on newsproject.bitreport.pt, and Style & Layout
main-thread cost consistently ~3x higher, matching the diagnostics in
docs/PERFORMANCE_BASELINE.md (no render-blocking scripts, cost
concentrated in style/layout).

Apply content-visibility: auto + contain-intrinsic-size to
.fpa-agenda__card so the browser skips style/layout/paint for
off-screen cards (most of the 48 sit below the fold).
This commit is contained in:
José Alves committed 2026-08-04 21:16:06 +01:00
1 parent d3055a1957
commit 3ee362fe69
1 file changed
+8
@@ -352,6 +352,14 @@ const date_groups = [...by_date.entries()];
}
}
.fpa-agenda__card {
/* Up to 48 cards can render on this list (FPA_AGENDA_MAX); most sit below the
fold. content-visibility skips style/layout/paint for off-screen cards,
which is where the bulk of this section's main-thread cost comes from. */
content-visibility: auto;
contain-intrinsic-size: 0 260px;
}
.fpa-agenda__match {
display: flex;
flex-direction: column;