Reveal content is visible in the HTML and only content below the viewport hides after hydration. Deferred photos get a noscript twin, and the first row of the portfolio loads eagerly per column count. Some old tests still expect the former behaviour; they are rewritten next, so this commit's test run is not fully green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.6 KiB
Proof report: display fallbacks, early proofs
Details and evidence per point: verification-log.md.
Outcomes
- V-D1 OK.
Revealwith a layout effect hydrates cleanly under StrictMode (unit test) and in Chrome: elements in view stay at opacity 1 in every frame, elements below the fold go to 0 after hydration without an intermediate value, reduced motion hides nothing. The/portfoliogrid on a phone is now visible. - V-D2 OK. With JavaScript on the noscript twin is never requested: requested URLs equal the displayed photos, each once; Emotion writes the shared class once.
- V-D3 OK for head and twin. The
noscriptwith the CSS stays in the head, the browser holds the same number ofnoscriptelements as the HTML, no hydration error. Header and panel are settled with the menu links. Without JavaScript every shown image has loaded and every empty deferred image isdisplay: none. - V-D13 OK. The
<picture>tiles keep their box to the pixel at six widths, hover zoom and focus ring work, 1, 2 and 3 grid photos load beforeloadat phone, tablet and desktop, each photo once, no hydration error. Router link types acceptmediaandfetchPriority.
Files changed so far
New: web/src/lib/revealPhase.ts, web/src/lib/firstRow.ts, web/src/components/NoScript/noScriptCss.ts, web/src/components/NoScript/NoScriptStyles.tsx, web/src/displayHydration.test.tsx.
Changed: web/src/hooks/useReveal.ts, web/src/components/Reveal/Reveal.tsx, web/src/components/DeferredImage/DeferredImage.tsx, web/src/routes/__root.tsx, web/src/seo.ts, web/src/components/PortfolioGrid/PortfolioGrid.tsx, web/src/components/portfolio/PortfolioGallery/PortfolioGallery.tsx, web/src/routes/portfolio.tsx, web/src/components/PortfolioGrid/PortfolioGrid.test.tsx (one line, see below).
Deviations from the design
PortfolioGrid.test.tsx:eagerCount={3}becameeagerFirstRow, only sotscandpnpm buildcompile (the build runstscover the tests). Its assertions are untouched and still pass; Step 14 rewrites the test.firstRow.tsimportspreloadImagefrom../seo.ts(relative with.ts, like the other files insrc/lib) instead of@/seo.PortfolioGridkeeps its literalgridTemplateColumns(as the step says);GRID_COLUMNSis a parallel constant with the same values.
Checks
tsc --noEmit, pnpm lint, pnpm format:check (src), pnpm build green. pnpm test: 124 files, 1180 tests, 5 failures, all in tests named in the plan: four useReveal.test.tsx cases and PortfolioGallery.test.tsx ("none eager").