Adds the fallbacks for visitors without JavaScript
The mobile menu works through CSS, and controls that need JavaScript are hidden without it. The contact photo gets its own preload, and the tests cover the new Reveal behaviour, the first row and the noscript markup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ 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 open until the menu step |
|
||||
| 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-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 |
|
||||
|
||||
+10
-9
@@ -218,7 +218,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
|
||||
## Part C: No-JavaScript menu and CSS (batch B2, Sonnet; parallel with B3 and B4)
|
||||
|
||||
### Step 6: The complete no-JavaScript CSS [ ]
|
||||
### Step 6: The complete no-JavaScript CSS [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-NAV-03 to 06, 08, 09; BR-NJS-01, 02, 09; BR-IMG-02, 04.
|
||||
@@ -232,7 +232,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
Use the Chakra CSS variables the site already uses where a token is needed (`var(--slp-...)`), no hard-coded colours except `currentColor`. Build the ids in the selectors from the exported constants.
|
||||
- Done when: `tsc`, lint clean; the CSS has no `</`, `url(` or `@import`, balanced braces (Step 8 tests it).
|
||||
|
||||
### Step 7: The two menu links and the attributes [ ]
|
||||
### Step 7: The two menu links and the attributes [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-NAV-03, 04, 06, 07, 09, 10; BR-PRE-05 (light logo); V-D3 (header and panel).
|
||||
@@ -244,7 +244,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
4. `MobileNavGroup.tsx`: `data-requires-js` on the chevron button. `NavSubmenu.tsx`: `data-submenu` on the wrapper `Box` (the one with the `ref` and `onBlur`), `data-submenu-panel` on the panel `Box`, `data-requires-js` on the chevron button.
|
||||
- Done when: `tsc`, lint clean; the existing tests of the folder (`NavigationBar.test`, `MobileNav.test`, `NavSubmenu.test`, `NavLink.test`, `activeOptions.test`, `src/navSubmenu.test.tsx`) pass unchanged (client render shows no `noscript` content); `renderToString` of the navigation contains both links.
|
||||
|
||||
### Step 8: Tests for the menu and the CSS [ ]
|
||||
### Step 8: Tests for the menu and the CSS [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-DTS-02; BR-NAV-02; NFR-PR-SEC-01, S-01; PBT: "No PBT properties identified" (constant markup).
|
||||
@@ -256,7 +256,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
|
||||
## Part D: Markers and preload hygiene (batch B3, Sonnet; parallel with B2 and B4)
|
||||
|
||||
### Step 9: `data-requires-js` and the footer column [ ]
|
||||
### Step 9: `data-requires-js` and the footer column [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-NJS-01 to 04, 06; BR-NJS-02 (footer); FR-PR-13, FR-PR-22.
|
||||
@@ -264,7 +264,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
- Do: `data-requires-js` on each arrow `ArrowButton`, on the pause button, on the hero progress bar `Box`, on the `FilterBar` root `div`, on the 48 px controls spacer `Box` in `CarouselPlaceholder`. `FooterColumn` takes an optional `requiresJs?: boolean` prop that sets `data-requires-js` on its root `Box`; the Contact column in `Footer.tsx` passes `requiresJs`. The `data-email-pending` placeholders already exist (unit 1); do not change them. Nothing else changes: the review copies stay hidden, `aria-hidden` and `inert` (BR-NJS-04).
|
||||
- Done when: `tsc`, lint clean; the existing tests of these folders pass unchanged.
|
||||
|
||||
### Step 10: Preload hygiene for the contact page [ ]
|
||||
### Step 10: Preload hygiene for the contact page [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-PRE-02, 05; V-D11.
|
||||
@@ -272,7 +272,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
- Do: `loading="lazy"` on the portrait `Image` of `ContactDetails` (it is `display: none` from `lg`; a lazy image is neither fetched while hidden nor hoisted by React). `routes/contact.tsx`: import `ASIDE_MEDIA` from `../components/contact/ContactAside/ContactAside` and `preloadImage` from `../seo`; `head()` returns `links: [...base.links, preloadImage(contactContent.image, { media: ASIDE_MEDIA })]` with `base = pageHead('/contact')`, keeping the existing `scripts`.
|
||||
- Done when: `tsc`, lint clean; `ContactDetails.test.tsx` and the contact route tests pass unchanged; `pnpm exec vitest run src/seo.test.ts` still green.
|
||||
|
||||
### Step 11: Tests for markers and preload hygiene [ ]
|
||||
### Step 11: Tests for markers and preload hygiene [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-DTS-02; PBT: "No PBT properties identified" (attribute additions).
|
||||
@@ -284,7 +284,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
|
||||
## Part E: Reveal, image and first-row tests (batch B4, Sonnet; parallel with B2 and B3)
|
||||
|
||||
### Step 12: Generators [ ]
|
||||
### Step 12: Generators [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: PBT-07; BR-DTS-05.
|
||||
@@ -292,7 +292,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
- Do: `revealArbitraries.ts`: `viewportHeight` (finite positive floats, integers and a few phone and desktop heights mixed), `elementTop` (finite floats and integers, negative, zero, equal to the viewport height, far below), `revealPhase`, `revealEvent` (`belowViewport`, `inView`, `intersected`), `revealEvents` (arrays up to 20). `firstRowArbitraries.ts`: `columnMap` (1 to 4 breakpoints, strictly increasing column counts starting at the base, media strings of the form `(min-width: Nem)` with strictly increasing N), `tileIndex` (0 to 12), and a `galleryItemsWithThumbs` built from `galleryItems` in `arbitraries.ts`. Do not add anything to `arbitraries.ts`.
|
||||
- Done when: `tsc` clean; the files are used by Step 13 (check with `grep`).
|
||||
|
||||
### Step 13: Properties P18 to P25 [ ]
|
||||
### Step 13: Properties P18 to P25 [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-RVL-12; BR-PRE-03, 08, 11; BR-DTS-05; PBT-01 to 10.
|
||||
@@ -308,7 +308,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
- Example tests for every branch of `revealPhase.ts`, `firstRow.ts` (the real `GRID_COLUMNS`: tile 1 always, tile 2 `48em`, tile 3 `64em`, tile 4 null) and `preloadImage` with and without `media`, so `src/lib/**` and `src/seo.ts` stay at 100 %.
|
||||
- Done when: `pnpm exec vitest run src/lib/revealPhase.test.ts src/lib/firstRow.test.ts src/seo.test.ts` green; a coverage run of those files shows 100 % for `revealPhase.ts`, `firstRow.ts` and the new `seo.ts` code.
|
||||
|
||||
### Step 14: Component, hydration and prerender tests [ ]
|
||||
### Step 14: Component, hydration and prerender tests [x]
|
||||
|
||||
- Executor: Sonnet.
|
||||
- Implements: BR-DTS-01, 02, 05; BR-RVL-01 to 09; BR-IMG-01, 03, 10; BR-PRE-08, 10; V-D1, V-D13 (test); PBT: "No PBT properties identified" for components (decisions are in P18 to P25).
|
||||
@@ -323,6 +323,7 @@ The three riskiest mechanisms are built in their real form and proven in a real
|
||||
- `displayPrerender.test.tsx` (`// @vitest-environment node`, in the style of `src/prerender.test.tsx`): for every `sitePages` path, the prerendered HTML contains one noscript twin per `data-deferred` image and no `data-reveal="hidden"`.
|
||||
- Done when: **CP2** (after B2 and B3 are also done): `pnpm test` green with coverage thresholds, `pnpm lint`, `pnpm format:check`, `pnpm exec tsc --noEmit`, `pnpm build` green.
|
||||
- Record: list every existing test changed, with the reason.
|
||||
- Record (B4): changed existing tests, all named in section 6. `useReveal.test.tsx`: the six cases rewritten (server render visible; stubbed rectangle for the hidden, observing and disconnecting cases; reduced motion creates no observer; hydration case follows the new layout effect). `PortfolioGrid.test.tsx`: `eagerCount={3}` test replaced by the first-row test (`eagerFirstRow`), plus server-markup, hydration and column tests. `PortfolioGallery.test.tsx`: only the loop that expected no eager photo ("none eager") now expects tile 1 plain and high priority, tiles 2 and 3 eager, the rest lazy.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user