Adds browser tests for the page without JavaScript

The tests cover every page without JavaScript, the menu by keyboard and pointer,
the fade-in at load and on scroll, and image requests per width. They found that
the closed menu's shoot links could take focus, which is fixed here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 23:50:17 +01:00
co-authored by Claude Opus 5.5
parent 01fcfeefea
commit 2754890370
13 changed files with 1229 additions and 23 deletions
@@ -6,16 +6,22 @@ Status values: `open` (not yet settled), `OK`, `BLOCKED`, `DEVIATION`.
|---|---|---|---|---|---|
| V-D1 | `useLayoutEffect` in `Reveal` during `renderToString`, `hydrateRoot` and StrictMode (double effect): no warning, no mismatch, the hide step runs once visibly. | 2 | No warning, no mismatch, hide step visible once. | Unit test src/displayHydration.test.tsx (hydrate() under StrictMode, rectangles stubbed): no recoverable error, in-view Reveal stays visible, below-the-fold becomes hidden after hydration and visible after the fake observer fires; no console warning in the run. Browser probe on the built site (rAF sampling of getComputedStyle opacity from the first frame, 2.5 s; /over-mij, /soorten-fotoshoots, /portfolio at 412x823; /, /over-mij at 1350x940; / at 412x823): elements in view at the first sample (2, 2, 1, 0, 2, 0 of 5, 11, 3, 14, 5, 14) were 1 in every frame; elements below the fold (3, 9, 2, 14, 3, 14) ended hidden with opacity values only 0 or 1, never an intermediate value; no console error or warning. /soorten-fotoshoots: first frame with a 0 is frame 16 of 456 (the hide happens after hydration, no transition). reducedMotion reduce (/ and /over-mij at 412x823, /soorten-fotoshoots): every sample 1, nothing hidden. /portfolio grid wrapper at 412x823 now stays visible (the BR-RVL-13 defect). | OK |
| V-D2 | With JavaScript on, the twin image is never requested (request log on `/soorten-fotoshoots` and `/portfolio` before any scroll), and the preload scanner does not read inside `noscript`. Also that Emotion writes the shared class once (one `<style>` for the two images). | 3 | Twin never requested with JavaScript on; one Emotion class. | Built dist, Chrome, 1350x940, JavaScript on. /soorten-fotoshoots: 12 image requests in total, 12 distinct URLs, none twice; 4 before load + 500 ms (both logos, newborn, newborn-detail: photos in or near view); set of requested URLs equals the set of currentSrc of the displayed img elements. /portfolio: 18 requests, 18 distinct, none twice, 8 before load + 500 ms (logos and 6 photos near the viewport), requested set equals the displayed set. No console message. Raw HTML: no preload link for a twin. Emotion: one style block data-emotion="css qvpj2z" (soorten) and one for css-1qa5q9y (portfolio tile class), shared by the deferred image and its twin. | OK |
| V-D3 | `<noscript>` inside `<head>` and inside the header and the panel hydrate without a mismatch in `hydrateRoot(document)` (the shell hydrates `<html>`), and the head hoisting of `HeadContent` keeps the CSS in the head. | 3 (head, twin), 7 (header and panel) | Head and twin part OK; header and panel part is settled in the menu step. | Raw dist/client/soorten-fotoshoots.html and portfolio.html: the noscript with the style sits inside head (after HeadContent); document.head.querySelector("noscript") exists in the browser with the CSS as text; document.querySelectorAll("noscript").length equals the raw HTML count (10 on /soorten-fotoshoots, 17 on /portfolio). No hydration error or console message in the browser. JavaScript off: every displayed img has complete and naturalWidth > 0 (12 of 22 and 18 of 35 images displayed, matching the request counts), every img[data-deferred] is display none and has no src, noscript is display: contents; screenshots of both pages looked at, no broken-image box. | OK (head, twin); header and panel: hydratePage of NavigationBar with the noscript links hydrates with no recoverable error (NoScriptNav.test.tsx); browser check on a current build is left to Step 21 |
| V-D4 | Fragment navigation to a fixed element does not scroll in Firefox and Safari, and Chrome on Android (only desktop Chrome was probed). If one scrolls, the fixed `header` target moves to a zero-size fixed element. | 18 (Chrome part) | | | open |
| V-D3 | `<noscript>` inside `<head>` and inside the header and the panel hydrate without a mismatch in `hydrateRoot(document)` (the shell hydrates `<html>`), and the head hoisting of `HeadContent` keeps the CSS in the head. | 3 (head, twin), 7 (header and panel) | Settled OK: head, twin, header and panel hydrate cleanly with both noscript menu links in a fresh build. | Fresh pnpm build (CP2), pnpm e2e: hydration.e2e.ts, smoke and interaction pass on all 11 pages, /404, /404.html, /onbekend and /soorten-fotoshoots/onbekend at 390 and 1280 px: no console error or warning, no CSP violation, no React #418. Raw HTML: one noscript with one style in head on every page (displayHtml.e2e.ts); header and mobile panel carry nav-noscript-open and nav-noscript-close; document noscript count equals the HTML count. | OK |
| V-D4 | Fragment navigation to a fixed element does not scroll in Firefox and Safari, and Chrome on Android (only desktop Chrome was probed). If one scrolls, the fixed `header` target moves to a zero-size fixed element. | 17 | Chrome part OK; Firefox, Safari and Chrome on Android need a person. | e2e/noJsMenu.e2e.ts: opening via #mobile-nav and closing via #site-header leave scrollY at 300 on /over-mij and / at 390 x 800. | open (Chrome OK, other browsers need a person) |
| V-D5 | The comparison of BR-DMS-05 (E against D on mobile, three runs each, same machine) and its report to the owner when E is below 0.9 or below D. | 26 | | | open |
| V-D6 | Height of every `Reveal` at 320, 360, 412, 768, 1350 px wide against the limit of BR-RVL-13. | 18 | | | open |
| V-D6 | Height of every `Reveal` at 320, 360, 412, 768, 1350 px wide against the limit of BR-RVL-13. | 18 | Every hidden Reveal stays far below the limit (320: 4233 px, 360: 4833, 412: 6358, 768: 8033, 1350: 7333). | e2e/reveal.e2e.ts, hidden Reveals after hydration plus 2 s, tallest per page (px) at 320/360/412/768/1350: / 649/649/649/998/585; /over-mij 465/443/512/230/408; /portfolio 481/541/619/511/223; /soorten-fotoshoots 551/479/391/470/470; newborn 784/712/712/600/624; zwangerschap 784/712/712/600/600; gezin 784/712/712/600/600; loveshoot 736/688/688/568/336; portret 736/688/688/568/336; /contact 670/0/0/0/0; /privacyverklaring 0. | OK |
| V-D7 | After the gate measurement: whether `loading="lazy"` on the light logo and the contact portrait changes score and LCP as estimated; that the logo does not flash on `/` or on a client navigation from `/` to another page and back. | 24, 25 | | | open |
| V-D8 | The raw-HTML e2e tests that count `img` or links (`rawHtml.e2e.ts`) with `noscript` content present. | 20 | | | open |
| V-D9 | The visible focus ring of the two menu links in Chakra's reset (a bare `a` outside Chakra components). | 17 | | | open |
| V-D8 | The raw-HTML e2e tests that count `img` or links (`rawHtml.e2e.ts`) with `noscript` content present. | 20 | The unit-1 raw-HTML tests pass unchanged with noscript content present. | rawHtml.e2e.ts uses toContain on nav targets and removes noscript before reading text; it counts no img and no links, so no change was needed. Only the comment in the interaction.e2e.ts V15 block was updated. | OK |
| V-D9 | The visible focus ring of the two menu links in Chakra's reset (a bare `a` outside Chakra components). | 17 | The focused open and close links have a visible focus ring. | e2e/noJsMenu.e2e.ts: computed outline width of nav-noscript-open and nav-noscript-close, reached with Tab, is at least 2 px. | OK |
| V-D10 | Whether Chrome really excludes the viewport-filling hero photo from LCP (so text is the candidate on `/`), by a trace. Only explains `/`; changes no rule. | 25 (only if a trace exists) | | | open |
| V-D11 | The first React 19 upgrade: the hoisting facts of BR-PRE-01 (tested by BR-PRE-04). | 15 | | | open |
| V-D12 | Visual check without JavaScript on every page at 390 and 1280 px (screenshots through `E2E_SCREENSHOT_DIR`, looked at, not compared): header, hero, nav, footer, empty areas left by hidden controls (`mb` of the filter bar, the gate's margin). | 16 | | | open |
| V-D13 | `<picture>` with `display: contents` around the grid tile `DeferredImage`: the tile keeps its size, the hover zoom, the focus ring and the reading order; the `<source>` photo is requested once when `src` is set later; hydration is clean for tiles 2 and 3 (`<picture>` and `noscript` children). | 4 (proof), 14 (test), 19 (e2e) | Tile keeps size, zoom and focus; one request per photo; clean hydration in the browser. | Boxes of all portfolio tiles before and after at 320x568, 412x823, 768x1024, 1023x768, 1024x768, 1350x940: identical to 0.01 px (baseline taken from the dist built after Steps 2 and 3, which change no box). Photo requests before the load event: 1 at 320, 390, 412 px; 2 at 768 and 1023; 3 at 1024 and 1350; each URL once, none for tiles 4 and up. After a scroll to the bottom each of the 10 grid photos was requested exactly once at every width. Distinct x positions in the first row: 1, 1, 1, 2, 2, 3, 3 at 320, 390, 412, 768, 1023, 1024, 1350 = column count. Hover and keyboard focus (Tab): tile image transform matrix(1.05 ...), zIndex 1, outline solid 2px on tile 2 at 768 and tiles 2 and 3 at 1350. dist/client/portfolio.html head: React preload for tile 1 (f41a1916, no media), f41a1922 with media (min-width: 48em), f41a7883 with media (min-width: 64em), no other photo preload. No hydration error or console message at any width (production build). | OK |
| V-D11 | The first React 19 upgrade: the hoisting facts of BR-PRE-01 (tested by BR-PRE-04). | 15 | React hoisting facts hold in the current build. | e2e/displayHtml.e2e.ts, 70 tests over 11 pages and /404.html: every preload as=image href once per file; every priority photo has its preload with fetchpriority high from the img src; /contact has one media link (min-width: 64em) for the aside photo and no other photo link; /portfolio has React link for tile 1 plus exactly two media links (48em, 64em) for two other photos; light logo preload only on /; no preload for a lazy photo unless a non-lazy img uses the same file (the dark logo in header and footer) and none for a twin except the two media links of /portfolio; data-reveal="hidden" nowhere. | OK |
| V-D12 | Visual check without JavaScript on every page at 390 and 1280 px (screenshots through `E2E_SCREENSHOT_DIR`, looked at, not compared): header, hero, nav, footer, empty areas left by hidden controls (`mb` of the filter bar, the gate's margin). | 16 | Looked at 24 screenshots (11 pages and the 404 page at 390 and 1280 px, JavaScript off). No broken-image box, no empty frame, no hidden control left behind; /over-mij has no empty area under the h1 (V15 resolved). Remaining empty-looking areas are design-accepted (see Findings). | e2e/noJs.e2e.ts passes 24 of 24: no visible button, every data-reveal opacity 1, every displayed img complete with naturalWidth > 0, every img[data-deferred] display none, displayed named imgs equal getByRole("img"), no email-pending or requires-js visible, no mailto link, footer has no Contact heading and no empty column; / has no hero controls and shows slide 1, one review; /portfolio has no filter bar and every tile href ends in an image file. Findings below. | OK |
| V-D13 | `<picture>` with `display: contents` around the grid tile `DeferredImage`: the tile keeps its size, the hover zoom, the focus ring and the reading order; the `<source>` photo is requested once when `src` is set later; hydration is clean for tiles 2 and 3 (`<picture>` and `noscript` children). | 4 (proof), 14 (test), 19 (e2e) | Tile keeps size, zoom and focus; one request per photo; clean hydration in the browser (Step 4); e2e confirms request counts per width. | Step 4 evidence unchanged. e2e/images.e2e.ts at 390/768/1350: distinct x of the first row 1/2/3 equals the number of grid photos requested before load; every grid photo requested exactly once after a full scroll; no console message. Tile sizes against Step 4 were not compared again (Step 4 recorded identical boxes, not their values). | OK |
| V-D14 | Which tiles Chrome reports as the largest paint at 412, 768 and 1350 px after the change (the probe saw `f41a1916` at 412, `f41a1922` at 768 and `f41a7883` at 1350 without the eager row), and that these are first-row tiles. | 25 | | | open |
| V-D15 | `/portfolio?shoot=gezin`: the preloads of unfiltered tiles 2 and 3 and the remounted first row of the filtered list do not fetch the same photo twice. | 19 | | | open |
| V-D15 | `/portfolio?shoot=gezin`: the preloads of unfiltered tiles 2 and 3 and the remounted first row of the filtered list do not fetch the same photo twice. | 19 | No image URL is requested twice on /portfolio?shoot=gezin. | e2e/images.e2e.ts: at 1350 x 940, after the filter applied (fewer tiles than before hydration) and a scroll through the page, every image URL was requested exactly once. | OK |
## Findings (Step 16 screenshots, Step 17 run)
- V-D12 remaining blank areas, all by design: on `/` and `/contact` the contact gate shows its notice ("Het contactformulier komt binnenkort.") centred over a blank area of about 300 px (phone) to 400 px (desktop) height, with extra white space above the Instagram heading on `/` (BR-NJS-05, accepted). On `/portfolio` at 1280 px the left column ends after tile 4 and leaves a gap under it (masonry columns, same with JavaScript). The home header at 1280 px sits over the hero photo with a faint logo (design). Full-page screenshots draw photos below the fold as empty beige frames unless decoded first; the test decodes images before the shot.
- **RESOLVED (Step 17, BR-NAV-06 against BR-NAV-08; was BLOCKED).** Ratified by the coordinator: BR-NAV-08 takes precedence. `noScriptCss.ts` now keeps `grid-template-rows:1fr;transition:none` always and moves `visibility:visible` to `#mobile-nav:target [id^="mobile-group-"]`; BR-NAV-06, `noScriptCss.test.tsx` and plan section 6 updated; the e2e check passes 8 of 8 runs. With the menu closed and JavaScript off, Tab from the open link reaches Newborn, Zwangerschap, Gezin, Loveshoot (links of the shoot group) inside `#mobile-nav`, although the panel is `visibility: hidden`. Mechanism, measured in Chrome on the built `/over-mij` at 390 px: panel `visibility: hidden`, but the group rule `#mobile-nav [id^="mobile-group-"]{grid-template-rows:1fr;visibility:visible;transition:none}` (BR-NAV-06: "always, not only on `:target`") sets `visibility: visible` on the group; a child with `visibility: visible` inside a hidden parent is visible and focusable (group visibility visible, link visible, rows 228px). BR-NAV-08 says that with the panel closed none of its links is focusable. A fix would scope the visibility part to `#mobile-nav:target [id^="mobile-group-"]` (grid-template-rows and transition can stay unconditional), but BR-NAV-06 names "always" and `noScriptCss.test.tsx` asserts the exact string; neither is changeable under the plan's rules. Evidence: `e2e/noJsMenu.e2e.ts` "toont de open-link in plaats van het hamburgermenu en houdt het paneel dicht" fails at the assertion that focus never lands in `#mobile-nav` (the rest of Step 17 passes).
- Step 17 test timing (not a product defect): the hash changes at once but the `:target` style applies one frame later, so a Tab pressed in the same instant misses the panel (seen as focus on nothing in 2 of 3 runs). A human cannot press Tab within a frame; the tests wait for the panel to be visible before the first Tab, and the Tab sequence inside the panel is still read with no pause. Playwright's `click()` on the close link also fails persistently when started during the 0.4 s opening transition; the test waits for `clip-path: inset(0px)` first.