Files
AndreaSlopFotografie/aidlc-docs/features/prerendering/construction/display-fallbacks/functional-design/business-rules.md
T
SluijsensandClaude Opus 5.5 b5fd83256d Loads the light logo after the page load
Lazy loading saved its bytes during page load, but left the logo empty for a
moment when navigating to the homepage on a wide screen. Also adds the second
unit's code summary and the shared docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 01:56:13 +01:00

43 KiB

Business Rules - Unit 2: Display fallbacks

Rule ids are scoped to this feature and this unit. "Source" points at a requirement (FR/NFR), a design decision (D1 to D13 in application-design.md) or a unit 1 rule (business-rules.md). Flows and evidence: business-logic-model.md. Components: frontend-components.md. Data: domain-entities.md.

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.

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.

1. Decision flowcharts

1.1 What Reveal does after hydration

graph TD
    Start["Reveal mounted in the browser"] --> Support{"IntersectionObserver available and no reduced motion"}
    Support -->|"no"| Settled["Settled: visible, nothing to animate"]
    Support -->|"yes"| Measure["Layout effect: read top edge of the element"]
    Measure --> Below{"Top edge at or below the viewport bottom"}
    Below -->|"no"| Settled
    Below -->|"yes"| Hidden["Hidden: opacity 0, no transition"]
    Hidden --> Seen{"12 percent visible above the 60 px line"}
    Seen -->|"yes, once"| Revealed["Revealed: fades in with the delay"]
    classDef state fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
    classDef step fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
    classDef choice fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
    class Settled,Hidden,Revealed state;
    class Start,Measure step;
    class Support,Below,Seen choice;

Text alternative: after hydration an element that is wholly below the viewport is hidden without a transition and fades in once on scroll; every other element stays visible.

1.2 Which markup a deferred photo gets

graph TD
    Img["DeferredImage renders"] --> Pair["Image without src plus a noscript twin with src"]
    Pair --> Js{"JavaScript on"}
    Js -->|"yes"| Today["Twin is plain text to the parser: no request, no preload"]
    Today --> Load["After load and in view the effect sets src"]
    Js -->|"no"| Hide["CSS hides the empty image, the twin shows the photo"]
    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 Img,Pair step;
    class Js choice;
    class Today,Load,Hide result;

Text alternative: a deferred photo is rendered as an empty image plus a noscript twin; with JavaScript the twin is ignored, without it the CSS hides the empty image and shows the twin.

1.3 How a page gets its first-photo preload

graph TD
    Photo["First photo of a page"] --> Plain{"A plain img with src and high priority"}
    Plain -->|"yes"| React["React hoists a preload link into the head"]
    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 --> 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,Row choice;
    class React,Explicit,Lazy,Eager,Deferred result;

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

BR-RVL: Reveal and useReveal

Id Rule Source
BR-RVL-01 The first render of Reveal, on the server and in the browser, is visible: data-reveal="visible", opacity 1, no transform, no transition. The prerendered HTML therefore shows all Reveal content, with and without JavaScript. FR-PR-09, FR-PR-11; D7; BR-HYD-01
BR-RVL-02 After hydration each Reveal decides in a useLayoutEffect whether to hide itself. The effect reads element.getBoundingClientRect().top and window.innerHeight and hides the element only when top >= innerHeight. A layout effect runs after the DOM commit and before the next paint, so hiding a below-the-fold element is never painted as a flash. All Reveals of a commit read before any of them writes (state is set after the effects), so the reads cost one layout. React 19 does not warn for useLayoutEffect during prerendering (no such message in react-dom-server.*.development.js). FR-PR-09; D6, D7
BR-RVL-03 "In view at load" means: not wholly below the bottom edge of the viewport. This includes an element that is partly visible, one taller than the screen, and one above the viewport (scroll restoration, #anchor jump). The 60 px trigger margin is not part of this test: an element whose top sits in that band was painted from the HTML, and hiding it would make it disappear. FR-PR-09
BR-RVL-04 The hidden state is opacity 0 and translateY(24px) with transition: none. The change from settled to hidden therefore never animates. FR-PR-09
BR-RVL-05 The reveal trigger is unchanged: one IntersectionObserver, threshold 0.12, rootMargin 0px 0px -60px 0px, disconnected after the first intersection. When it fires, the element becomes revealed: opacity 1, no transform, transitionProperty opacity, transform, duration token reveal (0.8 s), smooth, transitionDelay ${delay}s. FR-PR-09 ("as it does now")
BR-RVL-06 delay only matters for an element that was hidden and is revealed. Elements in view at load show at once, so a staggered row (Pricing cards, PhotoMosaic tiles) that is in view at load appears together. Rows revealed on scroll keep their stagger. FR-PR-09
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 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). 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
BR-RVL-14 Anchors and scroll restoration are decided at hydration time, as today. /?pakket=...#contact and /#prijzen jump before hydration (the element exists in the HTML), so the target is in view and settled. Smooth scrolling to #contact after hydration passes hidden sections; they fade as they intersect, as now. A scroll position restored after hydration reveals content by scrolling, as now. FR-PR-07, FR-PR-09

BR-IMG: Images and DeferredImage

Id Rule Source
BR-IMG-01 DeferredImage renders two siblings: the deferred <img> exactly as today, and <noscript> with a twin <img>. The twin has src (image.src), alt, width and height from the image, decoding="async", no loading attribute, and the same style props as the first image, so it has the same class and the same box. It leaves out id, data-testid and ref. The props of DeferredImage do not change. FR-PR-11; D8
BR-IMG-02 The deferred <img> carries data-deferred. The no-JavaScript CSS hides img[data-deferred]:not([src]) with display: none !important. Without it Chrome draws the empty image as a sized box with a broken-image icon and the alt text inside it (verified on /soorten-fotoshoots without JavaScript: complete is true, naturalWidth 0, the box keeps its size). Hidden with display: none, the empty image is not announced either, so a screen reader without JavaScript meets the photo once, in the twin. FR-PR-11
BR-IMG-03 With JavaScript nothing changes. The HTML parser reads noscript content as text when scripting is on, so the twin is not fetched. React renders no noscript children in the browser (shouldSetTextContent is true for noscript in react-dom-client) and ignores them when hydrating, so there is no mismatch. Prerendering skips the preload for an img inside noscript (tagScope & 1 in react-dom-server), so no <link rel="preload"> is added. Code generation proves "no extra request" with a request log (V-D2). FR-PR-11; D6, D8
BR-IMG-04 The no-JavaScript CSS gives noscript display: contents, so the wrapper element takes no part in flex, grid or positioning of the twin (absolute photos in PhotoMosaic, MediaText and the Pricing decorations keep their containing block either way). FR-PR-11
BR-IMG-05 Without JavaScript browsers do not honour loading="lazy" (Chrome disables it when scripting is off), so every twin on a page loads at once; on /portfolio that is all photos of the grid. The twin carries no loading attribute for that reason. Accepted: the visitors are rare and the alternative (load nothing) leaves empty frames. FR-PR-11
BR-IMG-06 Photos that are already in the HTML with a src need nothing: Image with priority in FramedImage, the hero's first slide, ContactAside (<source srcSet> in <picture> works without JavaScript), the ContactDetails portrait, the logos. Inventory of every image path: business-logic-model.md § 2.3. FR-PR-11
BR-IMG-07 Hero slides other than the first need JavaScript to appear and stay out of the HTML (the first render loads only the active slide). Without JavaScript the visitor sees slide 1, its text and the call to action. FR-PR-13
BR-IMG-08 The Lightbox needs JavaScript. Every tile of PortfolioGrid is a plain link to the large photo (href is item.full.src), so without JavaScript a tile opens the photo file itself. FR-PR-13
BR-IMG-09 The testimonial placeholder's visually hidden review copies contain deferred photos too, so their twins also load without JavaScript although nobody sees them. Accepted (review photos only); see BR-NJS-05. FR-PR-11
BR-IMG-10 The twin never changes what a page looks like with JavaScript, so hydration needs no new rule: the first render still has no src on either side (BR-HYD-01 and unit 1 section 3). FR-PR-05

BR-NAV: The menu without JavaScript

Id Rule Source
BR-NAV-01 The CSS for all no-JavaScript fallbacks (menu, deferred photos, hidden controls) lives in one <noscript><style> in the <head>, rendered by the root shell after HeadContent. That position is valid HTML: style is only allowed in noscript inside head, not in body. The two menu links are <noscript> elements in the body. This replaces the application design's single NoScriptNav that held the CSS as well. FR-PR-12; D9
BR-NAV-02 The CSS is allowed by style-src 'self' 'unsafe-inline' (unchanged, securityHeaders.ts). The script step leaves it alone: inlineScripts.ts treats noscript as a raw-text element and only looks for <script>; the CSS contains none. The CSS has no </, no url( and no @import (a test checks this), so it cannot end the noscript early or fetch anything. It holds no e-mail address, so the address scan stays clean. NFR-PR-SEC-01; BR-SCR-02, BR-MAIL-10
BR-NAV-03 Open link: <a class="ns-menu-open" href="#mobile-nav" aria-label="Menu openen"> with three bars, inside the header's right-hand div before the hamburger. It is 44 x 44 px like the button. It is hidden from 64rem up (lg), where the header shows the links. aria-label reuses the existing string. FR-PR-12
BR-NAV-04 The hamburger button gets data-requires-js and is hidden without JavaScript (BR-NJS-01). FR-PR-12, FR-PR-13
BR-NAV-05 #mobile-nav:target { clip-path: inset(0); visibility: visible }. No !important: an id selector outranks the single-class selectors Emotion generates, also those inside media queries (verified: with the rule the computed values were inset(0px) and visible). display is not touched, so the panel stays none from lg up even when the address ends in #mobile-nav. The existing clip-path and visibility transition animates the opening, and _motionReduce on the panel still switches it off. FR-PR-12
BR-NAV-06 The shoot submenu is expanded without JavaScript: #mobile-nav [id^="mobile-group-"] { grid-template-rows: 1fr; transition: none } always (selector weight 1,1,0 beats Emotion's single class), and #mobile-nav:target [id^="mobile-group-"] { visibility: visible } only while the panel is open: a visible child of a hidden parent is focusable, so an unconditional visibility: visible would leave the shoot links in the Tab order of the closed panel (BR-NAV-08; found in the browser test, decided 2026-10-31). 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. 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

BR-NJS: Other fallbacks without JavaScript

Id Rule Source
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. 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
BR-NJS-08 BackToTop is already inert and visibility: hidden until a scroll listener shows it, so it needs no marker. The 404 page already shows one button, "Terug naar home", a link. FR-PR-13
BR-NJS-09 Specificity policy for the CSS: id selectors and attribute selectors with a pseudo-class beat Emotion's single-class rules by weight; a bare attribute selector has equal weight and loses to the later Emotion rule, so it needs !important (BR-NJS-01) or an id. FR-PR-12, FR-PR-13
BR-NJS-10 No Dutch copy is written or changed. The only visible texts the unit uses are existing strings: "Menu openen", "Menu sluiten". FR-PR-12
BR-NJS-11 What a visitor without JavaScript sees, per page, is in business-logic-model.md § 4. Remaining imperfections: BR-IMG-05, BR-NAV-11, BR-NAV-12, BR-NJS-03, BR-NJS-04, BR-NJS-05, BR-NJS-07, and the missing e-mail address (FR-PR-22). FR-PR-11, FR-PR-13

BR-PRE: First-photo preload

Id Rule Source
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; /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. Amended after the measurement (V-D7): the light logo is lazy only until the page has loaded (loading is lazy while !isHome && !pageLoaded, usePageLoaded; the first render still equals the HTML). A lazy display: none image is not fetched until it is shown, so it flashed on a client navigation to /; after load it is fetched, so it is ready. A navigation before load may still flash briefly (accepted). 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. 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 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

Id Rule Source
BR-DMS-01 Explanation, with evidence in business-logic-model.md § 6: 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 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

Id Rule Source
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; 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 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

Neither the code nor the probes of this design settle these.

# Point Where it matters
V-D1 useLayoutEffect in Reveal during renderToString, hydrateRoot and StrictMode (double effect): no warning, no mismatch, the hide step runs once visibly. BR-RVL-02
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 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
V-D9 The visible focus ring of the two menu links in Chakra's reset (a bare a outside Chakra components). BR-NAV-08
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 of the owner (final)

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 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