Spaces:
Running
Running
Commit History
13 days ago
-
perf(cls,lcp,fonts): zero-CLS landing — root-cure the 0.4 layout shift + self-hosted preloaded fonts
ahmdelbaz28-uxRoot causes found (Playwright layout-shift observer + timeline tracing): 1. Home was a lazy route: the shell (navbar+footer) committed first with the footer inside the first viewport; when the Home chunk arrived ~400ms later the full page pushed it ~9,000px down — ONE 0.4 shift on every landing visit (identical on prod origin and local). Home now ships in the main bundle; first commit IS the real page. All other routes stay lazy. 2. Google-hosted fonts swapped in ~700ms after paint and re-flowed every Arabic text block. All 20 woff2 subsets (Cairo+Inter, arabic/latin/ latin-ext) are now self-hosted (public/fonts/ + generated src/fonts.css with unicode-range), preloaded above the fold — they arrive before first paint (paint is JS-gated), so no swap, no reflow, and one less third-party dependency. scripts/selfhost_fonts.mjs regenerates them. 3. Module scripts do not wait for stylesheets: main.tsx now awaits the entry stylesheet before createRoot (hard 4s fai…3b2ad6e