SSWConsulting / SSWConsulting/SSW.Website
🐛 Fix homepage footer layout shift (CLS ~0.6)
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 14
- Forks
- 10
- Avg merge
- 13h 51m
- Merged PRs (30d)
- 38
Description
Parent: #4889 · Priority 1 — biggest single scoring loss (CLS score 0.12).
Problem
A real mobile trace attributes ~100% of CLS to one shift:
score 0.578 → body > div.flex > footer.no-print
It only reproduces under real throttling — with simulated throttling Lighthouse reports CLS 0. So it's timing-dependent: something arrives late and pushes the footer, rather than a static layout bug. Lighthouse lists no root-cause sub-items, so the two candidates below are ranked suspects, not confirmed.
Candidate 1 — live-stream banner renders nothing on the server
app/live-steam-banner/live-stream.tsx:24-32
const LiveStreamClient = dynamic(..., { loading: () => <></>, ssr: false });
Confirmed: 0 occurrences of the banner in the server HTML. It sits at the very top of the page, so when it mounts post-hydration it pushes the entire document — footer included — down. Only renders when there is an upcoming User Group event, which would also explain why the shift is intermittent.
Candidate 2 — sticky-footer shell pins the footer inside the first viewport
app/components/page-layout.tsx
<div className="flex min-h-screen flex-col">
<main className="z-0 grow bg-white">{children}</main>
<Footer />
While main is still short, grow places the footer inside the first viewport (so it counts toward CLS), and it then drops below the fold as content fills in. The reported selector div.flex > footer is exactly this wrapper. Removing h-screen did not fix this — grow alone still pins the footer to the fold when main is short.
Suggested approach
- Reproduce with real throttling and confirm which candidate fires (test with and without an upcoming User Group event).
- For candidate 1: reserve the banner's height server-side, or render a correctly-sized placeholder instead of
<></>. - For candidate 2: ensure
mainreserves at least a viewport so the footer never starts above the fold.
Done when
CLS on PageSpeed Insights (mobile) is < 0.1.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the mobile trace with real throttling, testing with and without an upcoming User Group event. Inspect app/live-steam-banner/live-stream.tsx:24-32 and app/components/page-layout.tsx to identify which candidate causes the shift. The work is done when mobile PageSpeed Insights reports CLS below 0.1.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs
- Domain
- frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100