Finalises the second unit's design with the owner's decisions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -263,3 +263,27 @@
|
||||
**Context**: Functional Design unit 2. Findings: the LCP on / stays at 4280 ms because of the bytes requested early, mainly the 224 KB hero photo, which this unit cannot change.
|
||||
|
||||
---
|
||||
|
||||
## Functional Design - Unit 2 Answers
|
||||
|
||||
**Timestamp**: 2026-10-31T23:40:00Z
|
||||
|
||||
**User Input**: "Kan je de vragen hier sturen" (answers through the chat dialog: first question "Zelfde regel"; second question "Eerste rij meteen laden")
|
||||
|
||||
**AI Response**: "Recorded Q1 A and Q2 B in display-fallbacks-fd-questions.md. Asked the design sub-agent to finalise O1 to O5 in the design."
|
||||
|
||||
**Context**: Functional Design unit 2.
|
||||
|
||||
---
|
||||
|
||||
## Functional Design - Unit 2 Approval Prompt
|
||||
|
||||
**Timestamp**: 2026-10-31T23:55:00Z
|
||||
|
||||
**User Input**: "(none: updated design reviewed by the main session)"
|
||||
|
||||
**AI Response**: "Design finalised with O1 to O5. /portfolio: eager first row by column count with media-bound preloads, compared by measurement with the deferred variant (BR-DMS-05). Asked for approval."
|
||||
|
||||
**Context**: Functional Design unit 2. Awaiting approval.
|
||||
|
||||
---
|
||||
|
||||
+12
-8
@@ -57,7 +57,7 @@ Measured in Chrome at 412 x 823 on the built page, 2 s after load: the grid wrap
|
||||
|
||||
### 1.5 Client navigation
|
||||
|
||||
Option specified (provisional, O1): the same rule as on a first load; no `useHydrated` branch.
|
||||
Option decided (O1): the same rule as on a first load; no `useHydrated` branch.
|
||||
|
||||
- Why: FR-PR-09's reason is that visible content must never wait for an animation. One rule on both paths has no divergence to test, and the hydration rule (BR-HYD-01) is untouched.
|
||||
- What changes: today a page reached by client navigation fades in its first screen; after this unit its first screen is visible at once and only content below the fold fades on scroll.
|
||||
@@ -106,7 +106,8 @@ Text alternative: DeferredImage renders its deferred image and a noscript twin;
|
||||
|---|---|---|
|
||||
| `Hero` slide 1 | `src` present, `fetchPriority="high"` | Shown. Slides 2 and up are JavaScript only (BR-IMG-07). |
|
||||
| `IntroGallery` (4, `near` from its own observer) | No `src` | Twin shown. The phone row is a CSS scroll-snap list and keeps working. |
|
||||
| `PortfolioGrid` (`eagerCount={0}`, so all deferred) | No `src` | Twins shown, all load at once. Tiles link to the large photo. |
|
||||
| `PortfolioGrid` tile 1, and tiles 2 and 3 through `<source media>` (first row, BR-PRE-08) | Tile 1 has `src`; tiles 2 and 3 have a `<source>` and no `src` | Tile 1 shown; tiles 2 and 3 shown through the twin (and the source, which loads the same URL). Tiles link to the large photo. |
|
||||
| `PortfolioGrid` tiles 4 and up (deferred) | No `src` | Twins shown, all load at once. |
|
||||
| `InstagramGrid` | No `src` | Twins shown; tiles link to Instagram. |
|
||||
| `PhotoMosaic`, `PhotoDuo` | No `src` | Twins shown. |
|
||||
| `FramedImage` without `priority` (shoot pages, testimonials, `MediaText`) | No `src` | Twin shown. |
|
||||
@@ -196,7 +197,7 @@ Chrome 2026-10-31, `PerformanceObserver` `largest-contentful-paint`, last entry
|
||||
|---|---|---|---|---|
|
||||
| `/` | h1 text | h1 text | h1 text | Hero photo (React), logos |
|
||||
| `/over-mij` | `andrea-portret` | same | same | `andrea-portret` (React) |
|
||||
| `/portfolio` | `f41a1916` (first tile) | `f41a1922` | `f41a7883` | None |
|
||||
| `/portfolio` | `f41a1916` (first tile) | `f41a1922` | `f41a7883` | Today none. After this unit: tile 1 (React), tiles 2 and 3 with `media` 48em and 64em (BR-PRE-08 to 11) |
|
||||
| `/soorten-fotoshoots` | `newborn` | same | same | `newborn` (React) |
|
||||
| `newborn`, `zwangerschap`, `gezin`, `loveshoot`, `portret` | own photo | same | same | Own photo (React) |
|
||||
| `/contact` | intro text | intro text | `contact` (aside photo) | None for the aside; the 72 px portrait is preloaded at every width |
|
||||
@@ -206,7 +207,7 @@ The Lighthouse reports name the same elements (mobile: `/` the h1 span; over-mij
|
||||
|
||||
### 5.2 Decision flow
|
||||
|
||||
See flowchart 1.3 in the business rules. Result: nothing to add for seven of the eleven pages (React already preloads), one explicit link for `/contact` from `lg`, nothing for `/portfolio` (deferred by decision, different tile per width), nothing for `/privacyverklaring`. Two preloads are avoided by making their images lazy (the light logo off `/`, the contact portrait), because they are `display: none` where they are not used.
|
||||
See flowchart 1.3 in the business rules. Result: nothing to add for seven of the eleven pages (React already preloads), one explicit link for `/contact` from `lg`, for `/portfolio` the first row of the grid: tile 1 by React, tiles 2 and 3 by two links bound to 48em and 64em (the largest paint is a different tile per width, always one of these), nothing for `/privacyverklaring`. Two preloads are avoided by making their images lazy (the light logo off `/`, the contact portrait), because they are `display: none` where they are not used.
|
||||
|
||||
## 6. Largest paint: what the reports show
|
||||
|
||||
@@ -238,7 +239,7 @@ B shows what this unit achieves: it removes cause 1 (77 to 226 ms better than A,
|
||||
|
||||
### 6.3 `/portfolio` 3007 to 3607 ms with `Reveal` visible
|
||||
|
||||
In A the grid is hidden (BR-RVL-13 defect, section 1.4), so the largest paint is the intro paragraph at 55 ms, and the photos requested later (two requests at 194 ms, `DeferredImage` after the `load` event) are never candidates. In B the grid is visible, the first photo is the largest paint, and its real LCP is 197 ms. The simulator now includes everything requested up to 197 ms, among it those two photos (54 KB and 144 KB): +600 ms for +198 KB (3.0 ms per KB). The element changed from text to a photo; nothing got slower for the visitor, but the lab number did. This unit's design makes the grid visible (BR-RVL-03), so `/portfolio` is expected near B (score 0.90 against 0.94 in A). See O2.
|
||||
In A the grid is hidden (BR-RVL-13 defect, section 1.4), so the largest paint is the intro paragraph at 55 ms, and the photos requested later (two requests at 194 ms, `DeferredImage` after the `load` event) are never candidates. In B the grid is visible, the first photo is the largest paint, and its real LCP is 197 ms. The simulator now includes everything requested up to 197 ms, among it those two photos (54 KB and 144 KB): +600 ms for +198 KB (3.0 ms per KB). The element changed from text to a photo; nothing got slower for the visitor, but the lab number did. This unit's design makes the grid visible (BR-RVL-03), so `/portfolio` is expected near B (score 0.90 against 0.94 in A) or, with the eager first row, somewhere else that is not measured yet. B had the photos deferred; the eager row requests tile 1 (54 KB at 412 px) with the scripts instead of at 194 ms, which could move the simulated LCP either way. The owner chose the eager first row (O2); BR-DMS-05 measures it against the deferred variant and reports to the owner if it is below 0.9 or below the deferred variant.
|
||||
|
||||
### 6.4 `/` stays at 4280 ms in both
|
||||
|
||||
@@ -280,6 +281,8 @@ Properties extend the numbering of unit 1 (P1 to P17). fast-check runs in Vitest
|
||||
| P19 | `startsHidden` | Metamorphic (monotonic) | If an element with top `t` is hidden then every element with top `t' >= t` (same viewport) is hidden; shifting top and viewport height by the same amount does not change the result. |
|
||||
| P20 | `nextRevealPhase(phase, event)` | Invariant (state machine) | For any phase and any sequence of events the phase never returns from `revealed` to `hidden` or `settled`, and never goes from `settled` to `revealed` (BR-RVL-09). |
|
||||
| P21 | `nextRevealPhase` | Idempotence | Applying the same event twice gives the same result as once (StrictMode runs effects twice). |
|
||||
| P24 | `firstRow(index, columns)` | Invariant | For any column map with increasing breakpoints and column counts and any tile index: the result is `'always'` exactly when `index` is smaller than the base column count, `null` exactly when it is not smaller than the largest column count, and otherwise `{ media }` of the first breakpoint whose column count exceeds `index`. |
|
||||
| P25 | `firstRow` and `firstRowPreloads` | Metamorphic (monotonic) | If a tile is eager at some width it is eager at every wider width (the set of eager tiles only grows with the column count); and the number of tiles eager at a width equals the column count at that width. `firstRowPreloads(items)` has one link per tile with a `media`, none for `'always'` or `null` tiles, `href` equal to the tile thumb's `src`, and never more links than `max columns - base columns` (no duplicates). |
|
||||
| P22 | `preloadImage(image, options)` | Invariant | For any image and options, `href` equals `image.src`, `rel` is `preload`, `as` is `image`, `fetchPriority` is `high`, `media` is present exactly when given and equals it, and no other key exists. |
|
||||
|
||||
The check that the CSS constant has no `</`, `url(` or `@import` and balanced braces (BR-NAV-02) is an example test on one constant, not a property.
|
||||
@@ -292,7 +295,8 @@ Components with no properties:
|
||||
| `DeferredImage` | No PBT properties identified: fixed markup from one image; example tests with `renderToString` and `hydrate()`. |
|
||||
| `NoScriptStyles`, `NoScriptNav` | No PBT properties identified: constant markup; example tests and the browser tests of BR-DTS-03. |
|
||||
| `NavigationBar`, `MobileNav`, `MobileNavGroup`, `NavSubmenu`, `Hero*`, `FilterBar`, `Footer`, `FooterColumn`, `Testimonials` | No PBT properties identified: attribute additions on components with small fixed inputs. |
|
||||
| Route `head()` of `/contact` | No PBT properties identified: it calls `preloadImage` (P22) with fixed content. |
|
||||
| Route `head()` of `/contact` and `/portfolio` | No PBT properties identified: they call `preloadImage` and `firstRowPreloads` (P22, P24, P25) with fixed content. |
|
||||
| `PortfolioGrid` | No PBT properties identified: markup from a list; the choice per tile is `firstRow` (P24, P25); example tests with `renderToString` and `hydrate()`. |
|
||||
|
||||
## 8. Requirement coverage
|
||||
|
||||
@@ -303,9 +307,9 @@ Components with no properties:
|
||||
| FR-PR-11 | BR-IMG-01 to 10; BR-RVL-01; section 2 |
|
||||
| FR-PR-12 | BR-NAV-01 to 12; section 3 |
|
||||
| FR-PR-13 | BR-NJS-01 to 11; BR-IMG-07, 08; section 4 |
|
||||
| FR-PR-21 | BR-PRE-01 to 09; section 5 |
|
||||
| FR-PR-21 | BR-PRE-01 to 12; section 5 |
|
||||
| FR-PR-22 | BR-NJS-02 (placeholders hidden, address stays absent) |
|
||||
| NFR-PR-P-01, P-03 | BR-DMS-01 to 04; section 6 |
|
||||
| NFR-PR-P-01, P-03 | BR-DMS-01 to 05; section 6 |
|
||||
| NFR-PR-Q-01, Q-03 | BR-DTS-01 to 04 |
|
||||
| NFR-PR-SEC-01 | BR-NAV-02 |
|
||||
|
||||
|
||||
+36
-25
@@ -4,7 +4,7 @@ Rule ids are scoped to this feature and this unit. "Source" points at a requirem
|
||||
|
||||
Groups: BR-RVL reveal, BR-IMG images, BR-NAV menu without JavaScript, BR-NJS other fallbacks, BR-PRE first-photo preload, BR-DMS measurement, BR-DTS tests.
|
||||
|
||||
**Provisional** marks a choice that belongs to the owner. The recommendation is written down; the alternatives are in section 5.
|
||||
The choices that belonged to the owner (O1 to O5) were decided on 2026-10-31 and are recorded as final in section 5. Nothing in this unit is provisional.
|
||||
|
||||
All statements marked "verified" were checked on 2026-10-31 against `web/src`, the built `web/dist/client` and a real Chrome (Playwright, local preview server) without changing any code.
|
||||
|
||||
@@ -60,17 +60,18 @@ graph TD
|
||||
Plain -->|"no, inside picture"| Explicit["Route head adds preloadImage with media"]
|
||||
Photo --> Hidden{"Hidden at some breakpoint"}
|
||||
Hidden -->|"yes"| Lazy["Image is lazy: no fetch, no preload there"]
|
||||
Photo --> Deferred{"Deliberately deferred"}
|
||||
Deferred -->|"yes"| None["No preload, see BR-PRE-08"]
|
||||
Photo --> Row{"Portfolio tile"}
|
||||
Row -->|"first row at this width"| Eager["Eager: source with media plus media preload"]
|
||||
Row -->|"later rows"| Deferred["Deferred: no preload, loads when near"]
|
||||
classDef step fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||
classDef choice fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
||||
classDef result fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
class Photo step;
|
||||
class Plain,Hidden,Deferred choice;
|
||||
class React,Explicit,Lazy,None result;
|
||||
class Plain,Hidden,Row choice;
|
||||
class React,Explicit,Lazy,Eager,Deferred result;
|
||||
```
|
||||
|
||||
Text alternative: a plain high-priority photo is preloaded by React itself, a photo in a picture element needs an explicit media-bound link, hidden photos are lazy and deferred photos get no preload.
|
||||
Text alternative: a plain high-priority photo is preloaded by React, a photo in a picture needs a media-bound link, hidden photos are lazy, and portfolio tiles of the first row are eager.
|
||||
|
||||
## 2. Rules
|
||||
|
||||
@@ -87,7 +88,7 @@ Text alternative: a plain high-priority photo is preloaded by React itself, a ph
|
||||
| BR-RVL-07 | With `prefers-reduced-motion: reduce` nothing is hidden and no observer is created. The layout effect reads `window.matchMedia('(prefers-reduced-motion: reduce)').matches` itself: Chakra's `useMediaQuery` still holds its server-safe `false` while the layout effect runs (BR-HYD-07), and a late `true` would first hide and then animate. `useReveal` no longer calls `useMediaQuery`. In addition `Reveal` carries `_motionReduce` `{ opacity: 1, transform: 'none', transition: 'none' }`, so a preference that changes while elements are hidden shows them at once. | FR-PR-10 |
|
||||
| BR-RVL-08 | Without `IntersectionObserver` (old browsers, jsdom) the element stays settled and visible. | FR-PR-09; BR-HYD-05 |
|
||||
| BR-RVL-09 | The transitions are one-way: settled stays settled, hidden becomes revealed, revealed stays revealed. An element never goes back to hidden, also not when it scrolls out of view. The observer is disconnected on unmount. | FR-PR-09 |
|
||||
| BR-RVL-10 | **Provisional.** A `Reveal` that mounts after hydration (client navigation, the lazy testimonial and contact content) follows the same rules; there is no `useHydrated` branch. Content in view when the new page mounts appears at once, content below the viewport fades in on scroll. Reason: FR-PR-09 asks that content in view never waits for an animation, and the same rule on both paths is simpler to test and cannot diverge from the first load. Consequence: the entrance fade of the first screen on client navigation, which exists today, is dropped. Edge: the router scrolls to the top after the new page mounts, so on a navigation from a scrolled page, elements that end up below the fold after that scroll may already be settled and not fade. | FR-PR-09 |
|
||||
| BR-RVL-10 | **Decided (O1).** A `Reveal` that mounts after hydration (client navigation, the lazy testimonial and contact content) follows the same rules; there is no `useHydrated` branch. Content in view when the new page mounts appears at once, content below the viewport fades in on scroll. Reason: FR-PR-09 asks that content in view never waits for an animation, and the same rule on both paths is simpler to test and cannot diverge from the first load. Consequence: the entrance fade of the first screen on client navigation, which exists today, is dropped. Edge: the router scrolls to the top after the new page mounts, so on a navigation from a scrolled page, elements that end up below the fold after that scroll may already be settled and not fade. | FR-PR-09 |
|
||||
| BR-RVL-11 | `Reveal` keeps its props (`BoxProps` plus `delay`) and all 21 call sites stay as they are (list in [frontend-components.md § 4](frontend-components.md)). `useReveal<T>()` returns `{ ref, visible, animated }`: `visible` is `false` only while hidden; `animated` is `true` only once revealed. `data-reveal` keeps the values `visible` and `hidden` that tests select on. | FR-PR-09 |
|
||||
| BR-RVL-12 | The decision is pure logic in `src/lib/revealPhase.ts`: `startsHidden(top, viewportHeight)` and `nextRevealPhase(phase, event)`. The hook only reads the DOM and calls them. `src/lib` has a 100 % coverage threshold. | NFR-PR-Q-01, Q-02 |
|
||||
| BR-RVL-13 | The existing trigger cannot reveal an element taller than `(innerHeight - 60) / 0.12` (6358 px at 823 px, 4833 px at 640 px, 4233 px at 568 px): the 12 % threshold is then never reached. Observed 2026-10-31: on `/portfolio` at 412 x 823 the grid wrapper (4537 px high, top at 377 px) stayed `hidden` for good until scrolled, although it was in view; the grid showed as an empty area under the filters. BR-RVL-03 removes this for elements that start in view. For an element that starts below the fold the limit stays. Code generation checks the tallest `Reveal` on every page at 320, 360 and 412 px wide (V-D6). | FR-PR-09 |
|
||||
@@ -120,7 +121,7 @@ Text alternative: a plain high-priority photo is preloaded by React itself, a ph
|
||||
| BR-NAV-06 | The shoot submenu is expanded without JavaScript: `#mobile-nav [id^="mobile-group-"] { grid-template-rows: 1fr; visibility: visible; transition: none }` always, not only on `:target` (selector weight 1,1,0 beats Emotion's single class). The chevron button of the group carries `data-requires-js` and is hidden. | FR-PR-12 |
|
||||
| BR-NAV-07 | Close link: `<a class="ns-menu-close" href="#site-header">` with the existing text "Menu sluiten", as the first child of the panel's content, so it is the first Tab stop after opening. `#site-header` is the fixed `header`, which gets an `id` for this. A fragment navigation to a fixed element does not scroll: verified in Chrome with the page at `scrollY` 300, opening via `#mobile-nav` and closing via `#site-header` both left it at 300 (Firefox and Safari: V-D4). Rejected: `href="#"` (scrolls to the top of the page) and `href="#main"` (scrolls to the content). | FR-PR-12 |
|
||||
| BR-NAV-08 | Focus order without JavaScript: skip link, logo, open link; closed, the panel is `visibility: hidden`, so none of its links is focusable. After activating the open link the browser's sequential focus starting point is `#mobile-nav`, so the next Tab goes to the close link, then Home, Over mij, Portfolio, Soorten fotoshoots, Newborn, Zwangerschap, Gezin, Loveshoot, Portretten, Contact (verified, in that order). Both links get a visible focus ring (`:focus-visible` outline in the CSS). | FR-PR-12; WCAG 2.4.3, 2.4.7 |
|
||||
| BR-NAV-09 | Desktop (from `lg`): all top-level links are in the header and work. The panel with the five shoot links is `visibility: hidden`, so by keyboard those links are unreachable, and the chevron button does nothing. **Provisional:** `[data-submenu]:focus-within > [data-submenu-panel] { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: none }` opens it while focus is on the "Soorten fotoshoots" link or inside the panel, and the chevron is hidden (`data-requires-js`). `transition: none` is needed: the panel's `visibility` transition starts hidden, and a Tab pressed in the same frame skipped the panel (observed); with a 150 ms pause, Tab reached Newborn to Gezin in order. Mouse users click "Soorten fotoshoots", which opens the overview where each shoot has its "Lees meer" link; hover opening is not offered (the 0.75rem gap between link and panel would close it). | FR-PR-12; BR-NAV-21, 27 (earlier feature: no hover opening) |
|
||||
| BR-NAV-09 | Desktop (from `lg`): all top-level links are in the header and work. The panel with the five shoot links is `visibility: hidden`, so by keyboard those links are unreachable, and the chevron button does nothing. **Decided (O3):** `[data-submenu]:focus-within > [data-submenu-panel] { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: none }` opens it while focus is on the "Soorten fotoshoots" link or inside the panel, and the chevron is hidden (`data-requires-js`). `transition: none` is needed: the panel's `visibility` transition starts hidden, and a Tab pressed in the same frame skipped the panel (observed); with a 150 ms pause, Tab reached Newborn to Gezin in order. Mouse users click "Soorten fotoshoots", which opens the overview where each shoot has its "Lees meer" link; hover opening is not offered (the 0.75rem gap between link and panel would close it). | FR-PR-12; BR-NAV-21, 27 (earlier feature: no hover opening) |
|
||||
| BR-NAV-10 | The JavaScript menu stays as it is. The additions are `id="site-header"`, `data-requires-js` on the hamburger and the two chevron buttons, `data-submenu` on the submenu wrapper and `data-submenu-panel` on its panel, and the close link. With JavaScript these attributes do nothing (`noscript` content is not rendered). `useReducer`, ARIA and focus handling are not touched. | FR-PR-12; D9 |
|
||||
| BR-NAV-11 | Opening and closing add history entries (`#mobile-nav`, `#site-header`). Back from a page reached through the menu can return to the home page with the menu open. Accepted. | FR-PR-12 |
|
||||
| BR-NAV-12 | A visitor with JavaScript switched on whose script fails to load gets no `noscript` content, so the hamburger stays inert. That case is not covered by FR-PR-12 ("without JavaScript") and not by this design; the desktop links still work. | FR-PR-12 |
|
||||
@@ -132,7 +133,7 @@ Text alternative: a plain high-priority photo is preloaded by React itself, a ph
|
||||
| BR-NJS-01 | One marker, `data-requires-js`, means "no function without JavaScript". The no-JavaScript CSS hides it: `[data-requires-js] { display: none !important }`. `!important` is needed because style props set `display` on several of these elements, and Emotion's rules are unlayered single-class rules that come later in the document than the `head` CSS. Marked: the hamburger button, the two chevron buttons, `HeroArrows` buttons, `HeroPauseButton`, the hero progress bar, the `FilterBar` root, the testimonial controls spacer, the footer Contact column. | FR-PR-13 |
|
||||
| BR-NJS-02 | `[data-email-pending] { display: none !important }`: the e-mail placeholders (footer, contact card, gate sentence and gate button) stay in the HTML for layout during hydration, and are removed from layout without JavaScript, where the address never comes (FR-PR-22). The footer Contact column gets `data-requires-js` as well, so its title "Contact" does not stand alone (BR-MAIL-09). `FooterColumn` takes an optional prop to put the marker on its root. | FR-PR-22; BR-MAIL-09 |
|
||||
| BR-NJS-03 | Hero: slide 1 with its photo, h1, call to action and social links. The arrows, the pause button and the progress bar are hidden. The progress bar would otherwise run once and stop. The section keeps `aria-roledescription="carousel"`; a screen reader without JavaScript hears a carousel with one slide. Accepted. | FR-PR-13 |
|
||||
| BR-NJS-04 | Testimonials: the placeholder shows the longest review (not necessarily the first) and keeps the other copies visually hidden, `aria-hidden` and `inert`, as unit 1 decided (BR-LZY-02) and as the browser test V9 asserts. The empty 48 px spacer for the carousel controls is hidden. **Provisional:** a visitor without JavaScript reads one review, not all. | FR-PR-13; BR-LZY-02 |
|
||||
| BR-NJS-04 | Testimonials: the placeholder shows the longest review (not necessarily the first) and keeps the other copies visually hidden, `aria-hidden` and `inert`, as unit 1 decided (BR-LZY-02) and as the browser test V9 asserts. The empty 48 px spacer for the carousel controls is hidden. **Decided (O5):** a visitor without JavaScript reads one review, not all. | FR-PR-13; BR-LZY-02 |
|
||||
| BR-NJS-05 | Contact form: on `/contact` the form is a hidden streamed segment (`<div hidden id="S:0">`) that stays hidden without JavaScript, and the gate shows its notice over a blank, blurred area. On `/` the notice sits over the placeholder box. The notice text "Het contactformulier komt binnenkort." is readable; the address and the mail button do not exist without JavaScript (FR-PR-22). The form is disabled today (`contactForm.enabled` is `false`), so nothing usable is lost. When it is enabled, a visitor without JavaScript gets an empty area and no way to send a message; that must be designed then. | FR-PR-13, FR-PR-22; BR-LZY-01 |
|
||||
| BR-NJS-06 | Portfolio: the filter buttons are hidden and all photos show, also for `/portfolio?shoot=...` (the search only applies after hydration, BR-HYD-10). Tiles are links to the large photos. | FR-PR-13 |
|
||||
| BR-NJS-07 | The "Boek" links of the price cards go to `/?pakket=...`. Without JavaScript the page loads at the top and the package is not applied. Accepted. | FR-PR-06, FR-PR-13 |
|
||||
@@ -148,12 +149,15 @@ Text alternative: a plain high-priority photo is preloaded by React itself, a ph
|
||||
| BR-PRE-01 | Fact, verified in `dist/client`: React 19.3 already writes `<link rel="preload" as="image">` into the `<head>` for every `<img>` with a string `src` that is not `loading="lazy"`, not `fetchPriority="low"`, not a `data:` URL, and not inside `<picture>` or `<noscript>`. Photos with `fetchPriority="high"` get `fetchPriority="high"` on the link. So `/` (hero 8), `/over-mij`, `/soorten-fotoshoots` and the five shoot pages already preload their first photo, with the hashed URL, from the same `src` the `<img>` uses (so the browser can never fetch it twice). The declaration of "this is the first photo" is `priority` on `FramedImage` / `fetchPriority="high"` on the `<img>`, which unit 1 left in place. | FR-PR-21; D8 |
|
||||
| BR-PRE-02 | Explicit links are only for images React cannot hoist. That is `/contact` from `lg`: the photo is a `<source media="(min-width: 64em)" srcSet>` in a `<picture>` and the `<img>` has a `data:` placeholder, so nothing is preloaded today and it is the largest paint at 1350 x 940. The contact route's `head()` adds `preloadImage(image, { media: ASIDE_MEDIA })`: `rel="preload"`, `as="image"`, `href` the hashed URL, `fetchPriority="high"`, `media="(min-width: 64em)"`. Below `lg` the media query keeps it from downloading. | FR-PR-21 |
|
||||
| BR-PRE-03 | `preloadImage(image: ContentImage, options?: { media?: string }): HeadLink` is added to `seo.ts` (component-methods.md named it `preloadImage(src)`). It returns a plain object with `rel`, `as`, `href` (= `image.src`), `fetchPriority` and, only when given, `media`. `seo.ts` has a 100 % coverage threshold: examples and property P22 cover it. `pageHead` is not changed: passing every page's first photo to it would write the same preload twice (BR-PRE-04). The application design said pages pass their first photo to `pageHead`; the investigation shows React already does it. | FR-PR-21; D8 |
|
||||
| BR-PRE-04 | A photo is declared once. A build test over all 12 HTML files asserts: every `preload as="image"` `href` occurs once; every page that has a `priority` photo has its preload; `/contact` has the `media` link and no other link for that file. This also catches a React upgrade that changes the hoisting. | FR-PR-21; NFR-PR-Q-01 |
|
||||
| BR-PRE-05 | Nothing is preloaded that is not shown. Measured on `dist/client`: every page preloads both logos, `/contact` preloads the 72 px portrait (5 KB) that is `display: none` from `lg`. Fixes, both by `loading="lazy"` (a lazy image is neither fetched while `display: none` nor hoisted by React): the contact page's narrow portrait; the light logo on every page except `/` (on those pages the header is never transparent, so the light logo is never shown). `NavigationBar` knows `isHome` from the pathname in its first render, which is the same on the server and in the browser (the prerendered 404 has `/404`, never `/`). On `/` both logos stay eager, because both are shown in some state (dark below `lg` and after scrolling 150 px, light over the hero from `lg`). The light logo is 25 KB, about 140 ms of simulated LCP at the Lighthouse throttle on ten pages (estimate from the 5.4 ms per KB slope in the business logic model, to be measured). Verified in Chrome on the built `/over-mij`: with `loading="lazy"` on the light logo and its preload link removed, only the dark logo is requested. **Provisional.** | FR-PR-21; NFR-PR-P-01 |
|
||||
| BR-PRE-06 | Largest paint per page and screen size, measured in Chrome 2026-10-31 at 412 x 823, 768 x 1024 and 1350 x 940 (unthrottled, Reveal forced visible to simulate this unit) and checked against the Lighthouse reports: `/`: the h1 text at every size (the hero photo is never reported, probably because it covers the whole viewport; not confirmed); `/over-mij`, `/soorten-fotoshoots` and the five shoot pages: their `priority` photo at every size; `/contact`: the intro text below `lg`, the aside photo from `lg`; `/portfolio`: a grid photo at every size once the grid is visible (a different tile per width); `/privacyverklaring` and the 404 page: text or the footer logo. Table with names: [domain-entities.md § 6](domain-entities.md). | FR-PR-21 |
|
||||
| BR-PRE-04 | A photo is declared once. A build test over all 12 HTML files asserts: every `preload as="image"` `href` occurs once; every page that has a `priority` photo has its preload; `/contact` has the `media` link and no other link for that file; `/portfolio` has React's link for tile 1 and exactly two `media` links (48em and 64em) for tiles 2 and 3. This also catches a React upgrade that changes the hoisting. | FR-PR-21; NFR-PR-Q-01 |
|
||||
| BR-PRE-05 | Nothing is preloaded that is not shown. Measured on `dist/client`: every page preloads both logos, `/contact` preloads the 72 px portrait (5 KB) that is `display: none` from `lg`. Fixes, both by `loading="lazy"` (a lazy image is neither fetched while `display: none` nor hoisted by React): the contact page's narrow portrait; the light logo on every page except `/` (on those pages the header is never transparent, so the light logo is never shown). `NavigationBar` knows `isHome` from the pathname in its first render, which is the same on the server and in the browser (the prerendered 404 has `/404`, never `/`). On `/` both logos stay eager, because both are shown in some state (dark below `lg` and after scrolling 150 px, light over the hero from `lg`). The light logo is 25 KB, about 140 ms of simulated LCP at the Lighthouse throttle on ten pages (estimate from the 5.4 ms per KB slope in the business logic model, to be measured). Verified in Chrome on the built `/over-mij`: with `loading="lazy"` on the light logo and its preload link removed, only the dark logo is requested. **Decided (O4);** the effect on score and LCP is measured (BR-DMS-03, V-D7). | FR-PR-21; NFR-PR-P-01 |
|
||||
| BR-PRE-06 | Largest paint per page and screen size, measured in Chrome 2026-10-31 at 412 x 823, 768 x 1024 and 1350 x 940 (unthrottled, Reveal forced visible to simulate this unit) and checked against the Lighthouse reports: `/`: the h1 text at every size (the hero photo is never reported, probably because it covers the whole viewport; not confirmed); `/over-mij`, `/soorten-fotoshoots` and the five shoot pages: their `priority` photo at every size; `/contact`: the intro text below `lg`, the aside photo from `lg`; `/portfolio`: a grid photo at every size once the grid is visible (a different tile per width, always one of the first-row tiles); `/privacyverklaring` and the 404 page: text or the footer logo. Table with names: [domain-entities.md § 6](domain-entities.md). | FR-PR-21 |
|
||||
| BR-PRE-07 | The hero photo on `/` keeps its React-written preload with `fetchPriority="high"` although the largest paint there is text: it is the first thing a visitor sees. No explicit link is added. | FR-PR-21 |
|
||||
| BR-PRE-08 | **Provisional, and a deviation from FR-PR-21:** `/portfolio` gets no preload. Its largest paint after this unit is a grid photo (`DeferredImage`, loaded after the `load` event), a different tile at each width. `PortfolioGallery` keeps `eagerCount={0}` (decision 2026-10-27: eager photos measured 0.80 against 0.91 on mobile, because they slowed fonts and the intro text). A preload would repeat that and could not name one photo. The comment in `PortfolioGallery` ("the grid fades in, so its photos are never the largest paint") stops being true for a grid in view and is rewritten. Measuring "first row eager plus preload" is V-D5. | FR-PR-21; decision 2026-10-27 |
|
||||
| BR-PRE-09 | A route never preloads an image that is lazy or deferred, and never more than one explicit link per page. No `imagesrcset` or `imagesizes` is used (responsive photos are out of scope). | FR-PR-21 |
|
||||
| BR-PRE-08 | **The first row of the portfolio grid is eager and preloaded** (O2, final; FR-PR-21 has no exception for `/portfolio`). "First row" is a number of tiles that depends on the column count, which is CSS only (`base` 1 column, `md` from 48em 2 columns, `lg` from 64em 3 columns, the values `PortfolioGrid` uses for `gridTemplateColumns`; the build does not know the width). The grid places tiles row by row in reading order of the unfiltered list, so tile 1 is in the first row at every width, tile 2 from `md`, tile 3 from `lg` (probe: at 320 to 640 px only tile 1 starts in the first screen, at 768 to 1023 px tiles 1 and 2 form the first row, from 1024 px tiles 1 to 3). Tiles 4 and up stay deferred (`DeferredImage`, loaded after the `load` event when near); on a screen taller than one row, such as 768 x 1024 where tiles 3 and 4 start inside the screen, they are not eager either: "first row" is a column count, not a screen height. The rule is pure logic in `src/lib/firstRow.ts`: `firstRow(index, columns)` returns `'always'`, `{ media }` (the `min-width` query of the first breakpoint whose column count exceeds the index) or `null`. `PortfolioGrid`'s `eagerCount` prop (default 3) is replaced by `eagerFirstRow` (default `true`), and `PortfolioGallery` stops passing 0. History: the shared `PortfolioGrid` has had `eagerCount` (default 3, "the first row on desktop") since commit 18bf031; `PortfolioGallery` set it to 0 in 9efa7fc (2026-10-27) after measuring 0.80 eager against 0.91 deferred on mobile, when the grid faded in and its photos could never be the largest paint. That reason no longer holds for a grid in view (BR-RVL-03), the owner chose FR-PR-21 literally, and BR-DMS-05 re-checks the old result. The comment in `PortfolioGallery` ("No photo loads before the page has: the grid fades in, so its photos are never the largest paint, ... decision 2026-10-27") is replaced by: the first row loads eagerly, with preloads, because it is in view and is the largest paint; later rows wait for the page and for proximity; the 2026-10-27 measurement is repeated in BR-DMS-05. | FR-PR-21; decision 2026-10-27 (superseded) |
|
||||
| BR-PRE-09 | A route never preloads an image that is lazy or deferred. Explicit links exist only for photos in a `<picture>` and always carry `media`: one on `/contact`, two on `/portfolio`. No `imagesrcset` or `imagesizes` is used (responsive photos are out of scope). | FR-PR-21 |
|
||||
| BR-PRE-10 | Markup per tile. Tile 1 (`'always'`): the existing eager `Image` with `src`, `fetchPriority="high"`, `decoding="async"`; React hoists its preload (BR-PRE-01) without `media`, which is right because it is eager at every width. Tiles 2 and 3 (`{ media }`): a `<picture>` (`display: contents`) with `<source media={media} srcSet={thumb.src}>` and the `DeferredImage` as its `<img>`, with `loading="eager"` and `fetchPriority="high"` overriding its defaults. Below the media query nothing loads and the `DeferredImage` behaves as for any later tile; from it the `<source>` loads the photo at once, and the `src` the effect sets later is the same URL (the source wins, no second request). Verified in Chrome with an `<img>` without `src` in a `<picture>` plus a media-bound preload: one request at 768 and 1100 px, none at 412 px. Every other tile is the `DeferredImage` of unit 1. Tiles 2 and 3 keep their noscript twin through `DeferredImage` (BR-IMG-01). | FR-PR-21; D8 |
|
||||
| BR-PRE-11 | Preload links for the first row. React hoists tile 1 only. Tiles 2 and 3 sit in a `<picture>`, which React does not hoist, so the `/portfolio` route's `head()` adds `preloadImage(thumb, { media })` for them, built by `firstRowPreloads(items)` in `src/lib/firstRow.ts` from the same unfiltered list the HTML renders. Each photo is named once: tile 1 by React, tiles 2 and 3 by a link bound to the same query as their `<source>` and the same hashed URL. A browser therefore fetches each photo once (no double fetch) and never fetches one the width does not show (no useless preload): a phone gets one preload, 768 to 1023 px two, from 1024 px three. | FR-PR-21; BR-PRE-04 |
|
||||
| BR-PRE-12 | Interaction with the filter and the lightbox. (a) `?shoot=` applies after hydration (BR-HYD-10, BR-HYD-12): the HTML, the first render and the preloads use the unfiltered list. A visitor arriving on `/portfolio?shoot=gezin` therefore fetches up to three first-row photos the filter may then remove; accepted, because the HTML shows all photos until hydration anyway. When the filter applies, the rule works by index in the filtered list, so the new first row is eager too (its tiles remount through `key={item.id}`) and is in view; the structure is equal on the server and in the first browser render, so no hydration rule changes. (b) The lightbox preloads the large photos (`full.src`, `new Image()` for the neighbours of the open photo) only while it is open, and its chunk loads on the first hover, focus or click on a tile. The tiles use `thumb.src`, a different file, so the two never fetch the same URL and the eager row does not start the lightbox. | FR-PR-06, FR-PR-21 |
|
||||
|
||||
### BR-DMS: Measurement and the largest-paint mechanism
|
||||
|
||||
@@ -161,8 +165,9 @@ Text alternative: a plain high-priority photo is preloaded by React itself, a ph
|
||||
|---|---|---|
|
||||
| BR-DMS-01 | Explanation, with evidence in [business-logic-model.md § 6](business-logic-model.md): the mobile Lighthouse LCP is a throttled simulation whose result follows the bytes requested before the real (unthrottled) LCP moment, at about 5.4 ms per KB; and in the "after" run the shoot pages' LCP waits for hydration because `Reveal` hides the photo. This unit removes the second cause. It does not change the bytes. | NFR-PR-P-03 |
|
||||
| BR-DMS-02 | After code generation the gate measurement is repeated with the unit 1 method (`lhci collect`, 3 runs per URL, mobile and desktop, median, same machine) against `measurement-gate.md`. At least one run per URL keeps its trace (Lighthouse gather mode) so the claim in BR-DMS-01 can be checked against the trace and not only inferred. | NFR-PR-P-03 |
|
||||
| BR-DMS-03 | Expected result, from the "Reveal visible" run (B) and the changes above: score and LCP better than A on `/over-mij`, `/soorten-fotoshoots`, the five shoot pages (by 77 to 226 ms), `/contact`; `/portfolio` on mobile worse than A (3007 to about 3600 ms, score 0.94 to about 0.90) because a photo becomes the largest paint; `/` unchanged at about 4280 ms. B is only an indication (BR-MEA-05); the real figures come from the measurement. | NFR-PR-P-01 |
|
||||
| BR-DMS-03 | Expected result, from the "Reveal visible" run (B) and the changes above: score and LCP better than A on `/over-mij`, `/soorten-fotoshoots`, the five shoot pages (by 77 to 226 ms), `/contact`; `/portfolio` on mobile no better than A (3007 ms, 0.94) because a photo becomes the largest paint: B gave about 3600 ms and 0.90 with the photos deferred; the eager row is unmeasured and may be better or worse (BR-DMS-05); `/` unchanged at about 4280 ms. B is only an indication (BR-MEA-05); the real figures come from the measurement. | NFR-PR-P-01 |
|
||||
| BR-DMS-04 | Not solved by this unit and reported as such: `/` stays at about 0.85 (the 224 KB hero photo is requested before the text paint); zwangerschap, gezin, loveshoot and portret stay below 0.9 on mobile in B (0.88 to 0.89), and zwangerschap (+6), portret (+9), gezin (+80) and loveshoot (+139 ms) stay above master. The levers are bytes (photo size, 48 KB of 500 x 500 logos shown at 46 px, script size), which belong to the responsive-photos feature, unit 3 or the owner's per-page decision (NFR-PR-P-01). | NFR-PR-P-01 |
|
||||
| BR-DMS-05 | Explicit comparison for `/portfolio`, because the 2026-10-27 decision measured eager photos at 0.80 against 0.91. After code generation, on the same machine, with the same method as BR-DMS-02 (`lhci collect`, 3 runs each, median, mobile and desktop), measure two builds: **E** (the chosen design: grid visible, first row eager with preloads, BR-PRE-08 to 12) and **D** (grid visible, `eagerFirstRow={false}`, no preload: the deferred variant, which is B plus nothing else). The variant switch is a local, uncommitted change for the measurement, restored and checksum-verified afterwards, as in unit 1. Both builds are measured at the same time of day; the runs, scores, FCP, LCP, LCP element, TBT and CLS are written to `measurement-display.md` next to the gate measurement. **Decision rule:** if E scores below 0.9 or below D on mobile (the target of NFR-PR-P-01), the result goes to the owner with both tables before anything else is built on it; the design is not switched to D, and the lighthouse target is not changed, without that decision. Desktop must stay at 0.9 or better. | NFR-PR-P-01, P-03; decision 2026-10-27 |
|
||||
|
||||
### BR-DTS: Tests
|
||||
|
||||
@@ -170,15 +175,16 @@ Text alternative: a plain high-priority photo is preloaded by React itself, a ph
|
||||
|---|---|---|
|
||||
| BR-DTS-01 | `useReveal.test.tsx` changes where behaviour changed: jsdom has no layout (`getBoundingClientRect` returns zeros, so every element counts as in view), so tests that need a below-the-fold element stub `getBoundingClientRect` to return `top` larger than `innerHeight`. The cases "server render is visible", "in view at hydration stays visible, no observer", "below the fold is hidden and then visible after the observer fires", "reduced motion hides nothing and creates no observer", "no IntersectionObserver stays visible", "disconnects on unmount" replace the old ones. `Reveal.test.tsx` stays. No other test selects on hidden content (`grep` of `src`, 2026-10-31). | BR-TST-02 |
|
||||
| BR-DTS-02 | New example tests: `DeferredImage` through `renderToString` (twin once, `data-deferred` on the first image, no `<link rel="preload">` for the twin) and through `hydrate()` (no hydration error); `NoScriptNav` and `NoScriptStyles` through `renderToString`; `preloadImage`; the CSS-content test of BR-NAV-02; a check that every id the CSS names exists in the components (`mobile-nav`, `site-header`, `mobile-group-`, `data-submenu`). | NFR-PR-Q-01 |
|
||||
| BR-DTS-03 | Browser tests (`e2e/`, JavaScript off, 11 pages and the 404 page at 390 and 1280 px): no visible `button`; no visible `img` without a loaded photo (`complete` and `naturalWidth` > 0), none with `display` other than `none` among `img[data-deferred]`; every `img` has its alt text in the accessibility tree once; at 390 px the open link opens the menu, all links are focusable in the order of BR-NAV-08, the close link closes it, `scrollY` is unchanged; at 1280 px the submenu links are reached by Tab. With JavaScript, at 390 and 1280 px: the opacity of every `Reveal` that is in view at load is 1 on every animation frame from the first paint to hydration and after; below-the-fold ones are 0 and then fade in on scroll; no request for a deferred photo before it is near; every `preload as="image"` URL is used by a visible `img` at that width and requested exactly once; at 1280 px `/contact` requests the aside photo once and at 390 px not at all. | NFR-PR-Q-03; FR-PR-09, 11, 12, 21 |
|
||||
| BR-DTS-03 | Browser tests (`e2e/`, JavaScript off, 11 pages and the 404 page at 390 and 1280 px): no visible `button`; no visible `img` without a loaded photo (`complete` and `naturalWidth` > 0), none with `display` other than `none` among `img[data-deferred]`; every `img` has its alt text in the accessibility tree once; at 390 px the open link opens the menu, all links are focusable in the order of BR-NAV-08, the close link closes it, `scrollY` is unchanged; at 1280 px the submenu links are reached by Tab. With JavaScript, at 390 and 1280 px: the opacity of every `Reveal` that is in view at load is 1 on every animation frame from the first paint to hydration and after; below-the-fold ones are 0 and then fade in on scroll; no request for a deferred photo before it is near; every `preload as="image"` URL is used by a visible `img` at that width and requested exactly once; on `/portfolio` at 390, 768 and 1350 px exactly 1, 2 and 3 grid photos are requested before the `load` event and no other grid photo; at 1280 px `/contact` requests the aside photo once and at 390 px not at all. | NFR-PR-Q-03; FR-PR-09, 11, 12, 21 |
|
||||
| BR-DTS-04 | The unit-1 browser tests keep passing: V9 (one review, the rest 1 px, `aria-hidden`, `inert`), V15 (the h1 and `main` stay in place between JavaScript off and on), BR-HYD-20 (no console error on any page). The raw-HTML tests that count `img` or links parse with `DOMParser`, which treats `noscript` as markup, so they must not count the twins or the menu links twice (V-D8). | BR-TST-05, 06 |
|
||||
| BR-DTS-05 | Unit tests for the first row: `firstRow` and `firstRowPreloads` (properties P24 and P25 and examples at each column count); `PortfolioGrid` through `renderToString` (tile 1 plain `img` with `src`, tiles 2 and 3 in `<picture>` with `source media`, tile 4 up without `src`) and through `hydrate()` (no hydration error); the existing `PortfolioGrid.test` that passes `eagerCount={3}` changes to the new prop. | NFR-PR-Q-01; FR-PR-21 |
|
||||
|
||||
## 3. What this unit leaves for unit 3
|
||||
|
||||
| Belongs to | Left as it is |
|
||||
|---|---|
|
||||
| Servers and upload | Nothing changes: the new CSS and links are inside the HTML files. |
|
||||
| Lighthouse targets | `lighthouserc.cjs` exceptions are decided after BR-DMS-02; `/portfolio` may need an owner decision (section 5, O2). |
|
||||
| Lighthouse targets | `lighthouserc.cjs` exceptions are decided after BR-DMS-02; `/portfolio` goes to the owner if BR-DMS-05 says so. |
|
||||
| Responsive photos | Out of scope. The logos and photos stay as they are. |
|
||||
|
||||
## 4. To verify in code generation
|
||||
@@ -191,7 +197,7 @@ Neither the code nor the probes of this design settle these.
|
||||
| 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). | BR-IMG-03 |
|
||||
| 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. | BR-NAV-01 |
|
||||
| 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. | BR-NAV-07 |
|
||||
| V-D5 | Measure `/portfolio` with the first row eager and preloaded against deferred (mobile and desktop) before any change to `eagerCount`. | BR-PRE-08 |
|
||||
| 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. | BR-PRE-08, BR-DMS-05 |
|
||||
| V-D6 | Height of every `Reveal` at 320, 360, 412, 768, 1350 px wide against the limit of BR-RVL-13. | BR-RVL-13 |
|
||||
| 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. | BR-PRE-05 |
|
||||
| V-D8 | The raw-HTML e2e tests that count `img` or links (`rawHtml.e2e.ts`) with `noscript` content present. | BR-DTS-04 |
|
||||
@@ -199,13 +205,18 @@ Neither the code nor the probes of this design settle these.
|
||||
| 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. | BR-PRE-06 |
|
||||
| V-D11 | The first React 19 upgrade: the hoisting facts of BR-PRE-01 (tested by BR-PRE-04). | BR-PRE-01 |
|
||||
| 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). | BR-NJS-01 to 06 |
|
||||
| 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). | BR-PRE-10 |
|
||||
| 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. | BR-PRE-06, BR-PRE-08 |
|
||||
| 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. | BR-PRE-12 |
|
||||
|
||||
## 5. Decisions for the owner (all provisional)
|
||||
## 5. Decisions of the owner (final)
|
||||
|
||||
| # | Decision | Recommendation (written down) | Alternatives |
|
||||
Decided by the owner and the coordinator on 2026-10-31. Nothing here is provisional.
|
||||
|
||||
| # | Decision | Final choice | Rules |
|
||||
|---|---|---|---|
|
||||
| O1 | First screen on client navigation (BR-RVL-10) | Same rule as the first load: in view appears at once, below the fold fades in on scroll | Keep today's entrance fade for the first screen on client navigation (needs a `useHydrated` branch and a second path to test) |
|
||||
| O2 | `/portfolio`: grid in view is visible, no preload, deferred photos stay (BR-RVL-03, BR-PRE-08) | Follow FR-PR-09 literally; expect mobile 0.94 to about 0.90 in the lab, real visitors see the photos earlier | (a) Keep the grid hidden until 12 % visible, i.e. leave the mobile portfolio grid empty under the filters at load as today (keeps 3007 ms, contradicts "content in view stays visible"); (b) first row eager plus preload (FR-PR-21 literal, measure first, V-D5) |
|
||||
| O3 | Desktop shoot submenu without JavaScript (BR-NAV-09) | Open on keyboard focus (`:focus-within`) | Leave unreachable (the overview page lists all five); or also open on hover with a bridge for the gap |
|
||||
| O4 | `loading="lazy"` on the light logo (not on `/`) and the contact portrait (BR-PRE-05) | Do it, about 140 ms of lab LCP on ten pages | Leave as is and resize the two 500 x 500 PNG logos (48 KB shown at 46 px) in the responsive-photos feature, which saves more |
|
||||
| O5 | Testimonials without JavaScript (BR-NJS-04) | One review (longest), as unit 1 | Show all reviews stacked: needs the hidden copies to lose `aria-hidden`, and V9 changes |
|
||||
| O1 | First screen on client navigation | Same rule as the first load: content in view appears at once, content below the fold fades in on scroll. The entrance fade of the first screen on client navigation is dropped. | BR-RVL-10 |
|
||||
| O2 | `/portfolio` | The grid in view is visible, and its first row (1 tile below `md`, 2 from `md`, 3 from `lg`) loads eagerly with a preload, following FR-PR-21 literally. Later rows stay deferred. Measured against the deferred variant, and reported to the owner if it scores below 0.9 or below the deferred variant. | BR-RVL-03, BR-PRE-08 to 12, BR-DMS-05 |
|
||||
| O3 | Desktop shoot submenu without JavaScript | Opens on keyboard focus (`:focus-within`, `transition: none`). Mouse visitors without JavaScript reach the shoot pages through the overview page. | BR-NAV-09 |
|
||||
| O4 | Lazy light logo (not on `/`) and lazy contact portrait | Done; the effect on score and LCP is measured. | BR-PRE-05, V-D7 |
|
||||
| O5 | Testimonials without JavaScript | One review, the longest, as in unit 1. | BR-NJS-04 |
|
||||
|
||||
+23
-3
@@ -15,6 +15,7 @@ graph TD
|
||||
Css["NoScriptStyleSheet in the head"]
|
||||
Frag["FragmentTarget: mobile-nav, site-header"]
|
||||
Link["PreloadLink: rel preload, as image"]
|
||||
Row["FirstRow: always, from md, from lg, or none"]
|
||||
Prof["PageImageProfile: largest paint per page and width"]
|
||||
Rect -->|"decides first phase of"| Phase
|
||||
Phase -->|"styles"| Elem
|
||||
@@ -24,15 +25,16 @@ graph TD
|
||||
Frag -->|"is shown by"| Css
|
||||
Img -->|"yields, only for picture"| Link
|
||||
Prof -->|"says which page needs a"| Link
|
||||
Row -->|"decides eager tiles and their"| Link
|
||||
classDef value fill:#fbd38d,stroke:#92400e,stroke-width:1px,color:#000;
|
||||
classDef entity fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||
classDef build fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
class Rect,Phase,Img value;
|
||||
class Elem,Pair,Link,Prof entity;
|
||||
class Elem,Pair,Link,Prof,Row entity;
|
||||
class Mark,Css,Frag build;
|
||||
```
|
||||
|
||||
Text alternative: a measured rectangle sets the reveal phase, a content image yields the deferred pair or a preload link, and the no-JavaScript stylesheet acts on markers and fragment targets.
|
||||
Text alternative: a measured rectangle sets the reveal phase, an image yields the deferred pair or a preload link, the first-row rule picks eager tiles, and the stylesheet acts on markers and targets.
|
||||
|
||||
## 2. Reveal phase
|
||||
|
||||
@@ -82,6 +84,8 @@ Classes written by hand in the CSS (no Emotion): `ns-menu-open`, `ns-menu-close`
|
||||
| `fetchPriority` | `'high'` | constant |
|
||||
| `media` | string, optional | Only for a photo shown from one breakpoint (`ASIDE_MEDIA`, `(min-width: 64em)`) |
|
||||
|
||||
On `/portfolio` two links with `media` `(min-width: 48em)` (tile 2) and `(min-width: 64em)` (tile 3).
|
||||
|
||||
Written by React (not by this entity): one link per non-lazy `img` with `src`, inside the head (BR-PRE-01).
|
||||
|
||||
## 6. PageImageProfile (largest paint, preload source)
|
||||
@@ -92,7 +96,7 @@ Sizes are transfer sizes from the Lighthouse reports. "React" means the hoisted
|
||||
|---|---|---|---|---|
|
||||
| `/` | h1 text | h1 text | Hero `hero-8` 224 | React, `fetchPriority="high"` (BR-PRE-07) |
|
||||
| `/over-mij` | `andrea-portret` | same | 84 | React |
|
||||
| `/portfolio` | grid tile 1 (`f41a1916`) at 412; tile 2 (`f41a1922`) at 768 | tile (`f41a7883`) | 54 to 144 each | None (BR-PRE-08) |
|
||||
| `/portfolio` | grid tile 1 (`f41a1916`) at 412; tile 2 (`f41a1922`) at 768 | tile (`f41a7883`) | 54 to 144 each | Tile 1 React; tiles 2 and 3 `media` links 48em and 64em (BR-PRE-08 to 11) |
|
||||
| `/soorten-fotoshoots` | `newborn` | same | 74 | React |
|
||||
| `/soorten-fotoshoots/newborn` | `newborn` | same | 74 | React |
|
||||
| `/soorten-fotoshoots/zwangerschap` | `zwangerschap` | same | 103 | React |
|
||||
@@ -104,3 +108,19 @@ Sizes are transfer sizes from the Lighthouse reports. "React" means the hoisted
|
||||
| 404 page | footer logo | footer logo | none | None |
|
||||
|
||||
Logos, preloaded by React on every page today: `logo-dark` 23 KB and `logo-light` 25 KB, 500 x 500 px, shown at 46 px. The light logo is used only on `/` from `lg` (BR-PRE-05). The 72 px contact portrait is 5 KB.
|
||||
|
||||
## 7. FirstRow
|
||||
|
||||
`FirstRow` is the answer of `firstRow(index, columns)` for one tile of the portfolio grid (BR-PRE-08).
|
||||
|
||||
| Input | Type | Value for the grid |
|
||||
|---|---|---|
|
||||
| `index` | number, 0 based | Position in the unfiltered list, reading order |
|
||||
| `columns` | map of breakpoint media to column count | `base`: 1, `(min-width: 48em)`: 2, `(min-width: 64em)`: 3. One constant that `PortfolioGrid` also uses for `gridTemplateColumns` |
|
||||
|
||||
| Tile | `FirstRow` | Markup | Preload |
|
||||
|---|---|---|---|
|
||||
| 1 (index 0) | `'always'` | `Image` with `src`, `fetchPriority="high"` | React |
|
||||
| 2 (index 1) | `{ media: '(min-width: 48em)' }` | `picture` with `source`, `DeferredImage` img, `loading="eager"` | `preloadImage` with `media` |
|
||||
| 3 (index 2) | `{ media: '(min-width: 64em)' }` | same | `preloadImage` with `media` |
|
||||
| 4 and up | `null` | `DeferredImage` | None |
|
||||
|
||||
+16
-8
@@ -21,15 +21,18 @@ graph TD
|
||||
Def --> Twin["noscript twin image"]
|
||||
Pages --> Hero["Hero, FilterBar, Testimonials, Footer"]
|
||||
Seo["seo.ts preloadImage"] --> Contact["routes/contact head"]
|
||||
Row["lib/firstRow"] --> Grid["PortfolioGrid"]
|
||||
Row --> Port["routes/portfolio head"]
|
||||
Seo --> Port
|
||||
classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||
classDef app fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
classDef newc fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
||||
class Root,Head,Body shell;
|
||||
class Nav,Mob,Sub,Pages,Rev,Def,Hero,Contact app;
|
||||
class Open,Close,Hook,Pure,Twin,Seo newc;
|
||||
class Nav,Mob,Sub,Pages,Rev,Def,Hero,Contact,Grid,Port app;
|
||||
class Open,Close,Hook,Pure,Twin,Seo,Row newc;
|
||||
```
|
||||
|
||||
Text alternative: the shell holds the noscript CSS, navigation the noscript menu links, Reveal a hook over a pure module, DeferredImage a twin, and the contact head uses preloadImage (yellow new, green changed).
|
||||
Text alternative: the shell holds the noscript CSS, navigation the noscript menu links, Reveal a hook over a pure module, DeferredImage a twin, and the contact and portfolio heads use preloadImage (yellow new, green changed).
|
||||
|
||||
## 2. Components
|
||||
|
||||
@@ -42,6 +45,7 @@ Text alternative: the shell holds the noscript CSS, navigation the noscript menu
|
||||
| `src/lib/revealPhase.ts` | `type RevealPhase = 'settled' \| 'hidden' \| 'revealed'`; `startsHidden(top: number, viewportHeight: number): boolean` (`top >= viewportHeight`); `nextRevealPhase(phase, event: 'belowViewport' \| 'inView' \| 'intersected'): RevealPhase` (BR-RVL-09, 12). Pure, no DOM. |
|
||||
| `src/components/NoScript/noScriptCss.ts` | `NO_SCRIPT_CSS: string`, the whole sheet of BR-NAV, BR-NJS and BR-IMG-02, 04. No `</`, `url(` or `@import` (BR-NAV-02). The ids and attributes it names are exported as constants next to it (`MOBILE_NAV_ID`, `HEADER_ID`) and used by the components, so a rename breaks a test and not the fallback. |
|
||||
| `src/components/NoScript/NoScriptStyles.tsx` | `NoScriptStyles()` renders `<noscript><style>{NO_SCRIPT_CSS}</style></noscript>`. Rendered by the root shell after `HeadContent`. Renders the same on both sides; the browser ignores the children (BR-IMG-03). |
|
||||
| `src/lib/firstRow.ts` | `GRID_COLUMNS` (base 1, 48em 2, 64em 3; also used by `PortfolioGrid`'s `gridTemplateColumns`), `firstRow(index, columns = GRID_COLUMNS): 'always' \| { media: string } \| null`, `firstRowPreloads(items, columns = GRID_COLUMNS): HeadLink[]` (BR-PRE-08, 11). Pure; `src/lib` has a 100 % coverage threshold. |
|
||||
| `src/components/NavigationBar/NoScriptNav.tsx` | `NoScriptMenuOpen()`: `<noscript><a className="ns-menu-open" href="#mobile-nav" aria-label="Menu openen">` three `<span aria-hidden>`. `NoScriptMenuClose()`: `<noscript><a className="ns-menu-close" href="#site-header">Menu sluiten</a></noscript>`. One module, two exports; this replaces the single `NoScriptNav` of components.md because the CSS moved to the head (BR-NAV-01). |
|
||||
|
||||
### Changed
|
||||
@@ -63,11 +67,13 @@ Text alternative: the shell holds the noscript CSS, navigation the noscript menu
|
||||
| `ContactDetails` | The narrow-variant portrait gets `loading="lazy"` (BR-PRE-05). |
|
||||
| `routes/contact.tsx` | `head()` returns `links: [...pageHead('/contact').links, preloadImage(image, { media: ASIDE_MEDIA })]`; `ASIDE_MEDIA` is imported from `ContactAside`. |
|
||||
| `seo.ts` | Adds `preloadImage(image, options?)` and the `HeadLink` type (BR-PRE-03). `pageHead` unchanged. |
|
||||
| `PortfolioGallery` | Comment on `eagerCount={0}` rewritten (BR-PRE-08); behaviour unchanged. |
|
||||
| `PortfolioGrid` | The `eagerCount` prop (default 3) becomes `eagerFirstRow` (default `true`). Tile by `firstRow(index, GRID_COLUMNS)`: tile 1 the eager `Image`; tiles with a `media` a `<picture>` (`display: contents`) with `<source media srcSet>` and `DeferredImage` (`loading="eager"`, `fetchPriority="high"`); others `DeferredImage`. Index-based, so the first render equals the HTML (BR-HYD-12). `gridTemplateColumns` reads `GRID_COLUMNS`. |
|
||||
| `PortfolioGallery` | Stops passing `eagerCount={0}`; the comment is replaced (BR-PRE-08). |
|
||||
| `routes/portfolio.tsx` | `head()` adds `links: [...pageHead('/portfolio').links, ...firstRowPreloads(items)]` with `items` the unfiltered list the page renders (BR-PRE-11). |
|
||||
|
||||
### Unchanged (verified)
|
||||
|
||||
`ContactAside` (picture and `source` already work without JavaScript), `FramedImage`, `MediaText`, `IntroGallery`, `PhotoDuo`, `PhotoMosaic`, `PortfolioGrid`, `InstagramGrid`, `Pricing` (they only render `DeferredImage` or `Image`), `useInView` (still used by `DeferredImage`, `IntroGallery`, `Testimonials`, `ContactPanel`), `usePageLoaded`, `BackToTop`, `Lightbox`, `ContactFormGate`, `ContactPanel`, `NotFound`.
|
||||
`ContactAside` (picture and `source` already work without JavaScript), `FramedImage`, `MediaText`, `IntroGallery`, `PhotoDuo`, `PhotoMosaic`, `InstagramGrid`, `Pricing` (they only render `DeferredImage` or `Image`), `useInView` (still used by `DeferredImage`, `IntroGallery`, `Testimonials`, `ContactPanel`), `usePageLoaded`, `BackToTop`, `Lightbox`, `ContactFormGate`, `ContactPanel`, `NotFound`.
|
||||
|
||||
## 3. First-render contract
|
||||
|
||||
@@ -75,6 +81,7 @@ Text alternative: the shell holds the noscript CSS, navigation the noscript menu
|
||||
|---|---|---|
|
||||
| `Reveal` | Settled, visible | Hidden below the viewport (layout effect), revealed on scroll |
|
||||
| `DeferredImage` | Image without `src`, `data-deferred`, plus noscript twin (not rendered in the browser) | `src` set after load and in view, as unit 1 |
|
||||
| `PortfolioGrid` | Tile by index: eager `Image`, `<picture>` tiles, deferred tiles (unfiltered list) | Filter applies, same rule on the filtered list |
|
||||
| `NoScriptStyles`, `NoScriptMenuOpen`, `NoScriptMenuClose` | `noscript` with children | Browser ignores the children |
|
||||
| `NavigationBar` light logo | `loading="lazy"` unless `pathname` is `/` (same on both sides) | Unchanged |
|
||||
| Hero, FilterBar, chevrons, hamburger | As unit 1, plus the marker attribute | Unchanged |
|
||||
@@ -109,16 +116,17 @@ Props unchanged; nothing to edit. Verified by `grep` of `<Reveal` in `src` (21 n
|
||||
| `DeferredImage` | `renderToString` markup; `hydrate()` clean; existing tests unchanged (client render shows no `noscript` content) |
|
||||
| `NoScriptStyles`, `NoScriptNav` | `renderToString`; CSS constant checks; id constants exist in `NavigationBar` and `MobileNav` |
|
||||
| `seo.ts` | `preloadImage` with and without `media` (P22) |
|
||||
| Prerender | BR-PRE-04 over the 12 HTML files |
|
||||
| `firstRow`, `PortfolioGrid` | P24, P25; `renderToString` and `hydrate()` of the grid; `PortfolioGrid.test` moves from `eagerCount={3}` to the new prop (BR-DTS-05) |
|
||||
| Prerender | BR-PRE-04 over the 12 HTML files, including the two `media` links of `/portfolio` |
|
||||
| Browser (`e2e/`) | BR-DTS-03, BR-DTS-04 |
|
||||
|
||||
## 6. Testable properties
|
||||
|
||||
Component-level properties: none, see "No PBT properties identified" in [business-logic-model.md § 7](business-logic-model.md). The pure functions `startsHidden`, `nextRevealPhase` and `preloadImage` have properties P18 to P22 there.
|
||||
Component-level properties: none, see "No PBT properties identified" in [business-logic-model.md § 7](business-logic-model.md). The pure functions `startsHidden`, `nextRevealPhase`, `preloadImage`, `firstRow` and `firstRowPreloads` have properties P18 to P25 there.
|
||||
|
||||
| Component | Result |
|
||||
|---|---|
|
||||
| All components in section 2 | No PBT properties identified: markup and wiring with fixed small inputs; example tests, axe and the browser tests cover them. The only decisions with a large input space were moved into `lib/revealPhase.ts` and `seo.ts`. |
|
||||
| All components in section 2 | No PBT properties identified: markup and wiring with fixed small inputs; example tests, axe and the browser tests cover them. The only decisions with a large input space were moved into `lib/revealPhase.ts`, `lib/firstRow.ts` and `seo.ts`. |
|
||||
|
||||
## 7. Accessibility notes
|
||||
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ De nieuwe regel voor de fade-in: wat bij het laden in beeld is, staat er meteen;
|
||||
- B) De fade-in van het eerste scherm behouden bij navigeren binnen de site. Het effect blijft zoals nu, maar dit is een tweede codepad, en de grootste foto verschijnt op die pagina's later.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]:
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 2
|
||||
|
||||
@@ -23,4 +23,4 @@ Hoe gaan we hiermee om?
|
||||
- C) De grid blijft verborgen tot er genoeg van in beeld is, zoals nu. De score blijft 0,94, maar de telefoonbezoeker houdt de lege plek.
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]:
|
||||
[Answer]: B
|
||||
|
||||
+2
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Feature: prerendering. Unit: 2 "display-fallbacks" (fade-in, no JavaScript, first photo; see [execution-plan.md](../../inception/plans/execution-plan.md) § Units of Work). Builds on unit 1 ([start-migration functional design](../start-migration/functional-design/) and [code summary](../start-migration/code/code-summary.md)). Artifacts: [functional-design/](../display-fallbacks/functional-design/).
|
||||
|
||||
No questions were needed. The choices that belong to the owner are written down as provisional in `business-rules.md` section 5 (O1 to O5) and in the report to the orchestrator.
|
||||
No questions were needed. The choices that belonged to the owner (O1 to O5) were decided on 2026-10-31 and are final in `business-rules.md` section 5; step 15 applies them.
|
||||
|
||||
## Steps
|
||||
|
||||
@@ -20,3 +20,4 @@ No questions were needed. The choices that belong to the owner are written down
|
||||
- [x] Step 12: `frontend-components.md` (hierarchy, new and changed components, first-render contract, call sites, tests, accessibility)
|
||||
- [x] Step 13: Check diagrams against the Mermaid standards and the content validation rules
|
||||
- [x] Step 14: Report to the orchestrator
|
||||
- [x] Step 15: Apply the owner decisions O1 to O5: remove "provisional", specify the portfolio first row (columns, tiles, preloads, filter, lightbox), rewrite BR-PRE-08, add the portfolio measurement (BR-DMS-05), update properties, verification points and components
|
||||
|
||||
Reference in New Issue
Block a user