Makes Reveal, deferred images and the first row work from the HTML

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>
This commit is contained in:
2026-10-31 22:57:05 +01:00
co-authored by Claude Opus 5.5
parent 4139c8f732
commit 44125155bc
19 changed files with 422 additions and 70 deletions
@@ -144,7 +144,7 @@ P23 of the design is an example test on one constant, not a property: Step 8 (BR
## Part A: Setup and baseline (batch B0, Haiku, exclusive)
### Step 1: Confirm a green baseline and create the log [ ]
### Step 1: Confirm a green baseline and create the log [x]
- Executor: Haiku.
- Implements: NFR-PR-Q-01 (baseline), setup.
@@ -161,7 +161,7 @@ P23 of the design is an example test on one constant, not a property: Step 8 (BR
The three riskiest mechanisms are built in their real form and proven in a real browser first. If a proof fails, STOP: the design needs a decision before mechanical work starts.
### Step 2: `Reveal` with a layout effect (V-D1) [ ]
### Step 2: `Reveal` with a layout effect (V-D1) [x]
- Executor: Sonnet.
- Implements: BR-RVL-01 to 09, 11, 12; FR-PR-09, FR-PR-10; V-D1.
@@ -175,7 +175,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
- Done when: the probe shows the expected behaviour; `pnpm exec tsc --noEmit`, `pnpm lint` clean; `pnpm exec vitest run src/displayHydration.test.tsx` green. The existing `useReveal.test.tsx` cases listed in § 6 fail as expected (they are rewritten in Step 14); no other test fails.
- Record: verification log V-D1 with the probe output summary. If hydration reports an error, a flash is sampled, or React warns about `useLayoutEffect`, STOP.
### Step 3: `DeferredImage` twin and the head CSS (V-D2, V-D3) [ ]
### Step 3: `DeferredImage` twin and the head CSS (V-D2, V-D3) [x]
- Executor: Sonnet.
- Implements: BR-IMG-01 to 04, 10; BR-NAV-01, 02 (head placement); V-D2, V-D3.
@@ -192,7 +192,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
- Done when: V-D2 and V-D3 are OK; `tsc`, lint clean; `src/components/DeferredImage/DeferredImage.test.tsx` still passes unchanged (client render shows no `noscript` content).
- Record: verification log V-D2, V-D3 with evidence. A hydration error caused by the head `noscript`, a request for a twin with JavaScript on, or the CSS leaving the head: STOP.
### Step 4: First row of the portfolio grid (V-D13) [ ]
### Step 4: First row of the portfolio grid (V-D13) [x]
- Executor: Sonnet.
- Implements: BR-PRE-03, 08, 10, 11, 12; BR-IMG-10; FR-PR-21; V-D13.
@@ -208,7 +208,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
- Done when: V-D13 is OK; `tsc`, lint clean; `pnpm build` green. `PortfolioGrid.test.tsx` is expected to fail on the removed prop only (Step 14).
- Record: verification log V-D13 with evidence (request counts per width, box comparison). A `<picture>` that changes a tile's box, a double request, a request below the media query, or a hydration error: STOP.
### Step 5: Proof report and decision to continue [ ]
### Step 5: Proof report and decision to continue [x]
- Executor: Sonnet.
- Do: write `aidlc-docs/features/prerendering/construction/display-fallbacks/code/proof-report.md` (max one page): per V-D1, V-D2, V-D3, V-D13 the outcome in one or two sentences with evidence; the list of files changed so far; deviations from the design (none expected). Run `pnpm exec tsc --noEmit`, `pnpm lint`, `pnpm build`, `pnpm test` and list which tests fail (expected: the `useReveal.test.tsx` cases and `PortfolioGrid.test.tsx` named in § 6, nothing else).