Adds the AI-DLC documents of the testimonials redesign
Continuous Integration / check (pull_request) Successful in 1m45s
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 8m44s
Continuous Integration / deploy-production (pull_request) Skipped

Requirements, execution plan, functional design, code summaries, build and test results and the audit log; the reverse-engineering notes and the feature registry are updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 01:24:15 +01:00
co-authored by Claude Sonnet 5.5
parent b03b18f58e
commit 7a5e713b69
26 changed files with 1593 additions and 5 deletions
@@ -0,0 +1,76 @@
# Code summary: testimonials (unit 2)
## What changed
| File | Change |
|---|---|
| `web/src/content/types.ts` | `Testimonial` gets the optional `imagePosition` (comment: not trusted, goes through `normalizeImagePosition`, has no say in whether a review is shown) |
| `web/src/content/testimonials.ts` | `imagePosition: '50% 42%'` on the trouwshoot review |
| `web/src/lib/normalizeImagePosition.ts` (new) | `(value: unknown) => string`: `"X% Y%"` or the centre `"50% 50%"`; never throws |
| `web/src/lib/slideCounter.ts` (new) | `(index, count) => string`: `"X / Y"`, safe for odd input |
| `web/src/lib/normalizeImagePosition.test.ts`, `slideCounter.test.ts` (new) | Example tests plus property tests (see below) |
| `web/src/lib/visibleTestimonials.test.ts` | New property: any `imagePosition` (valid, garbled, missing) changes neither which reviews are shown nor their order |
| `web/src/test/arbitraries.ts` | `imagePositionValid`, `imagePositionInvalid`, `imagePositionAny`; `testimonial` and `anyTestimonial` get an optional `imagePosition` |
| `web/src/recipes/carouselControl.ts` | `dot` removed; `arrow` is a 44 px target without border or background, lighter on hover |
| `web/src/components/home/Testimonials/TestimonialSlide.tsx` | Rebuilt: landscape photo over a `paper.deep` card; from `lg` one grid cell with both layers (photo 57%, card 56%, card at least 400 px, 66 px reserved under it when `withControls`); below `lg` stacked in at most 640 px with the card overlapping the photo by 36 px; photo through `DeferredImage` with `objectPosition`; no `FramedImage`, no quotation mark, no dash before the names |
| `web/src/components/home/Testimonials/TestimonialCarousel.tsx` | `spacing: '0px'`, no item padding, no dots, a counter (`aria-hidden`, `testimonials-counter`), the bar at the bottom right from `lg` and centred below the slides under `lg`; arrow keys, the `instant` flag, the live region and the other test ids unchanged |
| `web/src/components/home/Testimonials/Testimonials.tsx` | Placeholder without the padding wrappers; the control spacer only below `lg` (still one `data-requires-js` element) |
| `Testimonials.test.tsx`, `TestimonialSlide.test.tsx` | Updated and extended (no dots, counter, no timer, crop, card, no quotation mark) |
| `aidlc-docs/_shared/reverse-engineering/` (`api-documentation.md`, `architecture.md`, `business-overview.md`) | Testimonial field, the two helpers, the section's behaviour and the heading style |
| Functional design (`domain-entities.md`, `frontend-components.md`) | Aligned with what was built (see deviations) |
`LAYOUT.md` is unchanged on purpose: its home diagram only holds the block name "Testimonials", which stays.
## Deviations from the functional design (small, recorded here)
- **Rounding**: `normalizeImagePosition` rounds to at most two decimals instead of "the shortest form". A value like `0.0000001%` would otherwise print in exponent form, which cannot be read back (it would break idempotence). Design documents are updated.
- **Hover only**: the arrows lighten on hover but not on keyboard focus: opacity would also fade the focus ring. Focus keeps the theme's ring.
- **Photo loads early in the carousel**: `TestimonialSlide` gets a `near` prop that the carousel sets, so the next photo is not still loading while it slides in (the clipped off-screen slides never come into view on their own). The placeholder and the single review keep the lazy behaviour.
- **Control room only with a carousel**: the 66 px under the card is added only when `withControls` is set (carousel and its placeholder), not for a single review.
- **Text padding**: the left padding of the card text is 25% of the slide width (a percentage on a grid item refers to the grid area), as on the canvas; the design text said "of the card" and was corrected.
## Testable properties (PBT-02..08, 10)
| Function | Property | Category |
|---|---|---|
| `normalizeImagePosition` | Always two numbers from 0 to 100 with at most two decimals, for any value | Invariant |
| `normalizeImagePosition` | Normalising twice equals normalising once | Idempotence |
| `normalizeImagePosition` | Any whitespace layout of a valid value gives `"X% Y%"` with the same numbers | Round-trip |
| `normalizeImagePosition` | Every unacceptable value gives exactly `"50% 50%"` | Easy verification |
| `normalizeImagePosition` | Never throws, for `fc.anything()` | Invariant |
| `slideCounter` | Reads `X / Y` with 1 <= X <= Y for any numbers (NaN, infinite, negative, fractional) | Invariant |
| `slideCounter` | Gives back index + 1 and count for a valid position | Round-trip |
| `slideCounter` | Equals the plain template for a valid position | Oracle |
| `visibleTestimonials` | `imagePosition` never changes what is shown or in which order | Invariant |
Example tests pin the key scenarios next to each property (`"50% 42%"`, `"120% 40%"`, `(0, 2)` is `"1 / 2"`, ...). fast-check keeps shrinking on and the seed is printed in every run (`fast-check seed: ...`), CI runs it with `pnpm test`.
## Verification of this unit (Step 13.5)
| Check | Result |
|---|---|
| Type check (`tsc --noEmit`) | passed |
| `pnpm lint` | passed (one unused variable in my own test was fixed) |
| `pnpm format:check` | passed |
| Whole unit-test run with coverage (`pnpm test`) | 134 files, 1414 tests passed; coverage thresholds met (including the 100% for `lib/`) |
Not done here (phase-level Build and Test): prerender build, e2e tests, Lighthouse, a real-browser check of the swipe, the slide, the gap between slides (that the next slide never shows at the edge) and the geometry at 1024, 1440 and phone widths, plus the wrapping of every `SectionHeading` title.
## Extension compliance
| Extension | Rule | Status | Note |
|---|---|---|---|
| Security Baseline | SECURITY-04 | Compliant | Styles are Chakra classes; no inline style attribute; no header change; the crop value is normalised before it reaches a style |
| Security Baseline | SECURITY-05 (in spirit) | Compliant | Content is validated, not trusted (`unknown` in, safe string out) |
| Security Baseline | SECURITY-10 | N/A | No dependency change |
| Security Baseline | SECURITY-15 | Compliant | Both helpers never throw and fall back safely |
| Security Baseline | other rules | N/A | Front-end only; no store, API or identity |
| Property-Based Testing | PBT-02 | Compliant | Round-trips for both helpers |
| Property-Based Testing | PBT-03 | Compliant | Invariants for both helpers and for `visibleTestimonials` |
| Property-Based Testing | PBT-04 | Compliant | Idempotence of `normalizeImagePosition` |
| Property-Based Testing | PBT-05 | Compliant | Oracle for `slideCounter` |
| Property-Based Testing | PBT-06 | N/A | The carousel state belongs to Chakra |
| Property-Based Testing | PBT-07 | Compliant | Shared domain generators in `arbitraries.ts` |
| Property-Based Testing | PBT-08 | Compliant | Shrinking on, seed printed, part of CI |
| Property-Based Testing | PBT-09 | Compliant | `fast-check`, already a dependency |
| Property-Based Testing | PBT-10 | Compliant | Example tests beside every property |
@@ -0,0 +1,84 @@
# Business Logic Model: testimonials (unit 2)
## Navigation flow
All state lives in Chakra's carousel. Buttons, keys and swipes all end in the same place, so the counter and the announcement can not disagree with what is on screen.
```mermaid
graph TD
Button["Previous or next button"]
Key["Arrow key in the control bar"]
Swipe["Swipe or mouse drag on the slides"]
Api["Carousel scrollPrev, scrollNext, snap"]
Motion{"Prefers reduced motion?"}
Instant["Jump to the page"]
Slide["Slide horizontally to the page"]
Page["Carousel page changes"]
Counter["Counter text from slideCounter"]
Announce["Live region text from slideLabel"]
Button --> Api
Key --> Api
Swipe --> Api
Api --> Motion
Motion -->|"yes"| Instant
Motion -->|"no"| Slide
Instant --> Page
Slide --> Page
Page --> Counter
Page --> Announce
classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef logic fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
classDef decision fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000;
classDef result fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
class Button,Key,Swipe input;
class Api,Page logic;
class Motion decision;
class Instant,Slide,Counter,Announce result;
```
Text alternative: buttons, arrow keys and swipes all call the carousel, which jumps or slides to the page depending on the reduced-motion preference; the new page then updates the counter text and the live-region announcement.
Notes:
- The carousel loops: next on the last review goes to the first, previous on the first to the last. With two reviews both buttons give the other review, only the direction of the slide differs.
- Swipes and drags are handled by the carousel (`allowMouseDrag`), which follows the finger and snaps; under reduced motion the snap is instant.
- Nothing runs on a timer.
- The announcement is empty on load and filled only by a change (BR-REV-08).
## Pure helpers
| Function | Signature | Behaviour |
|---|---|---|
| `slideCounter` (new, `web/src/lib/slideCounter.ts`) | `(index: number, count: number) => string` | `"X / Y"`; see domain-entities.md for the total behaviour on odd input |
| `normalizeImagePosition` (new, `web/src/lib/normalizeImagePosition.ts`) | `(value: unknown) => string` | `"X% Y%"` or `"50% 50%"`; see the decision flow in business-rules.md |
| `slideLabel` (unchanged) | `(index, count) => string` | `"Review n van m"` |
| `visibleTestimonials`, `isValidTestimonial` (unchanged) | | BR-REV-01 |
`normalizeImagePosition` takes `unknown` on purpose: the value comes from content that a CMS may deliver later, so it is checked, not trusted (SECURITY-05 in spirit, SECURITY-15 fail safe: never throws).
## Testable properties (PBT-01)
Framework: `fast-check` (already a dependency, with shared arbitraries in `web/src/test`; PBT-09 is met). Properties are in addition to example tests (PBT-10).
| Component | Category | Property |
|---|---|---|
| `slideCounter` | Invariant | For any numbers at all (also negative, fractional, NaN, infinite) the result matches `^\d+ / \d+$` and reads X <= Y with X >= 1 |
| `slideCounter` | Round-trip | For a valid position, parsing the result gives back `index + 1` and `count` |
| `slideCounter` | Oracle | For a valid position it equals the plain template `${index + 1} / ${count}` (the simplest possible reference) |
| `normalizeImagePosition` | Invariant | For any value (strings of every shape, numbers, `undefined`, `null`, objects) the result is two numbers from 0 to 100 with percent signs, separated by one space |
| `normalizeImagePosition` | Idempotence | `normalize(normalize(v)) === normalize(v)` for any value |
| `normalizeImagePosition` | Round-trip | For X and Y in 0..100 with at most two decimals, any layout of whitespace around the parts gives the same result as the plain `"X% Y%"` form, and that result keeps the numbers |
| `normalizeImagePosition` | Easy verification | A value outside the accepted form (generated as out-of-range, one part, no `%`, a sign, an exponent, extra text) always gives exactly `"50% 50%"` |
| `visibleTestimonials` | Invariant (new case) | Giving a review any `imagePosition` (valid, garbled or missing) does not change whether it is shown or in which order |
| `slideLabel`, `visibleTestimonials` (existing) | Invariant, Round-trip | Existing properties keep passing |
| Carousel navigation (next and previous around the loop) | Stateful (PBT-06) | **N/A**: the state belongs to Chakra's carousel, not to this code; a stateful model test would test the library. The loop is pinned by example tests |
| Layout, animation, placeholder | None | **No PBT properties identified**: presentation only; covered by example tests, the prerender and hydration tests, and the manual swipe check |
Generators (PBT-07), added to `web/src/test/arbitraries.ts` and reused by the tests:
- `imagePositionValid`: two numbers from 0 to 100 (whole and with one or two decimals) written with a percent sign and random whitespace between and around.
- `imagePositionAny`: `fc.oneof` of the valid form, out-of-range numbers, strings of other shapes, and non-string values.
- the existing `testimonial` arbitrary gets an optional `imagePosition` (valid, garbled or absent), so existing review properties also run with the new field.
@@ -0,0 +1,91 @@
# Business Rules: testimonials (unit 2)
Rule numbers `BR-REV-nn` are the ones of `homepage-sections/construction/lieve-woorden`; `BR-TR-nn` are new in this feature. Requirement references are to `requirements.md`.
## Rule table
| ID | Rule | Status | Source |
|---|---|---|---|
| BR-REV-01 | Only valid reviews are shown; broken ones are skipped, and of two with the same id the first wins; the order stays | Kept | FR-TR-09 |
| BR-REV-02 | No valid review: the section is left out; one review: shown without controls and without counter | Kept (counter added to the "without controls" part) | FR-TR-09 |
| BR-REV-03 | The carousel is shown from two reviews on, one review per page | Kept | FR-TR-09 |
| BR-REV-04 | Navigation | **Replaced** by BR-TR-01 (no dots) | FR-TR-07 |
| BR-REV-05 | The carousel loops; the buttons are never disabled | Kept | FR-TR-09 |
| BR-REV-06 | A change slides horizontally; instant under `prefers-reduced-motion` | Kept, now also for swipes and keys (all through the carousel's `instant` flag) | FR-TR-08 |
| BR-REV-07 | Every slide has the height of the tallest one | Kept | FR-TR-09 |
| BR-REV-08 | Every manual change is announced once, politely, as "Review n van m"; nothing on load | Kept | FR-TR-09 |
| BR-REV-09 | Slides are named "Review n van m"; buttons "Vorige review" and "Volgende review" | Kept without the dot labels | FR-TR-06 |
| BR-REV-10 | Hidden slides are not readable or focusable | Kept | FR-TR-09 |
| BR-REV-11 | The quote is a `blockquote` with the names as its `figcaption` | Kept, **without** the decorative quotation mark | FR-TR-04 |
| BR-LZY-02 | The prerendered HTML holds the text of every shown review | Kept | FR-TR-13 |
| BR-TR-01 | The review changes only through the previous and next buttons, the left and right arrow keys while focus is in the control bar, a swipe, or a drag with the mouse. No timer, no pause control, no dots | New | FR-TR-07 |
| BR-TR-02 | The counter reads "X / Y" (current of total, from 1). It is visible text that screen readers skip (`aria-hidden`); the live region carries the announcement | New | FR-TR-06, NFR-TR-01 |
| BR-TR-03 | The crop of a photo comes from `normalizeImagePosition(testimonial.imagePosition)`; a missing or invalid value gives the centre | New | FR-TR-11 |
| BR-TR-04 | Layout switches at `lg` (1024 px). From `lg`: the photo (3:2) on the left overlaps the card on the right. Below `lg`: stacked, with the photo (4:3) at most 640 px wide and centred, and the card overlapping its bottom by 36 px | New (question 1 = A) | FR-TR-01, FR-TR-02 |
| BR-TR-05 | The card is at least 400 px high and grows with its text; all slides take the height of the tallest (BR-REV-07). Text is never cut off or shrunk to fit | New (question 2 = A) | FR-TR-01 |
| BR-TR-06 | There is no coloured block behind the photo; the card is the surface behind it | New (question 3 = A) | FR-TR-01 |
| BR-TR-07 | The card is always `paper.deep`; quote text `ink.soft`; shoot type `ink`; names `accent.deeper`; all at least 4.5:1 on the card | New | FR-TR-03, NFR-TR-01 |
| BR-TR-08 | Until the carousel has loaded the placeholder shows the longest review as a slide, and below `lg` also the height of the control bar, so nothing below moves | Changed (no sand-block padding) | FR-TR-13 |
| BR-TR-09 | The heading of the section uses the heading style of unit 1 (`SectionHeading`) | Kept from unit 1 | FR-TR-05 |
## Decision flow: what is rendered
```mermaid
graph TD
Start["Reviews from the content"]
Filter["visibleTestimonials"]
Count{"How many shown?"}
None["Render nothing"]
One["One TestimonialSlide, no controls"]
Many{"Section near the screen?"}
Placeholder["Placeholder: longest slide, others hidden"]
Carousel["Carousel with controls and counter"]
Start --> Filter
Filter --> Count
Count -->|"none"| None
Count -->|"one"| One
Count -->|"two or more"| Many
Many -->|"no, or still loading"| Placeholder
Many -->|"yes, and loaded"| Carousel
classDef step fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef decision fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000;
classDef result fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
class Start,Filter step;
class Count,Many decision;
class None,One,Placeholder,Carousel result;
```
Text alternative: the reviews are filtered; none renders nothing, one renders a single slide without controls, and two or more render the placeholder until the section is near the screen and the carousel has loaded.
## Decision flow: normalising the crop position
```mermaid
graph TD
Raw["Raw imagePosition"]
Present{"Is it a string?"}
Parse{"Two numbers with percent signs, separated by whitespace?"}
Range{"Both from 0 to 100?"}
Format["Write as X% Y% in shortest form"]
Centre["Use 50% 50%"]
Raw --> Present
Present -->|"no"| Centre
Present -->|"yes"| Parse
Parse -->|"no"| Centre
Parse -->|"yes"| Range
Range -->|"no"| Centre
Range -->|"yes"| Format
classDef step fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef decision fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000;
classDef result fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
class Raw step;
class Present,Parse,Range decision;
class Format,Centre result;
```
Text alternative: a raw value that is a string of two percentages from 0 to 100 is written in its shortest form; every other value gives the centre.
@@ -0,0 +1,77 @@
# Domain Entities: testimonials (unit 2)
## Entity relationships
```mermaid
graph TD
Testimonial["Testimonial"]
ContentImage["ContentImage"]
ImagePosition["ImagePosition, normalised"]
ShownList["Shown reviews"]
Counter["Counter text"]
SlideLabel["Slide label"]
CarouselState["Carousel state, owned by Chakra"]
Testimonial -->|"has one"| ContentImage
Testimonial -->|"may carry raw value for"| ImagePosition
Testimonial -->|"filtered into"| ShownList
ShownList -->|"sets the count of"| CarouselState
CarouselState -->|"index and count give"| Counter
CarouselState -->|"index and count give"| SlideLabel
classDef entity fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef value fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000;
classDef external fill:#e9d5ff,stroke:#6b21a8,stroke-width:1px,color:#000;
class Testimonial,ContentImage,ShownList entity;
class ImagePosition,Counter,SlideLabel value;
class CarouselState external;
```
Text alternative: a Testimonial has one ContentImage and may carry a raw crop value that is normalised into an ImagePosition; the valid reviews form the shown list, which sets the count of Chakra's carousel state, and from that state's index and count come the counter text and the slide label (blue = entities, orange = derived values, purple = state owned by the library).
## Testimonial (changed: one optional field)
| Field | Type | Required | Notes |
|---|---|---|---|
| `id` | string | yes | Unique among shown reviews (first wins, BR-REV-01) |
| `shoot` | string | yes | Shoot type shown above the quote |
| `quote` | string | yes | Plain text without quotation marks; the design adds none |
| `author` | string | yes | Names under the quote |
| `image` | `ContentImage` | yes | `src`, `width` > 0, `height` > 0, `alt` |
| `imagePosition` | string | **no (new)** | Raw CSS `object-position` as two percentages, e.g. `"50% 42%"`. Never trusted as given: it is passed through `normalizeImagePosition` before it reaches a style |
**Invariants** (`isValidTestimonial`, unchanged): `id`, `shoot`, `quote`, `author` and `image.src` are not blank; `image.width` and `image.height` are above zero. `imagePosition` is **not** part of validity: a missing, empty or garbled value never hides a review, it only falls back to the centre.
Content values: trouwshoot `"50% 42%"`, newbornshoot not set (centre).
## ImagePosition (derived value)
The normalised crop position, always of the form `"X% Y%"`.
| Property | Rule |
|---|---|
| Accepted input | Two numbers, each followed by `%`, separated by whitespace; optional surrounding whitespace; digits with an optional decimal part; no sign, no exponent |
| Range | Each number from 0 up to and including 100 |
| Output | `"X% Y%"` where X and Y are the numbers rounded to at most two decimals and written without trailing zeros (`"050.0% 42%"` becomes `"50% 42%"`; `"0.0000001%"` becomes `"0%"`, so no exponent form can appear), one space between. The range check is on the number as given (`"100.001%"` is out of range) |
| Fallback | Anything else (missing, empty, one number, no `%`, out of range, negative, extra parts, text): the centre, `"50% 50%"` (owner's answer A, question 4) |
| Idempotence | Normalising a normalised value gives the same value |
## Counter text (derived value)
`"X / Y"` with X the current review (counted from 1) and Y the number of reviews.
| Property | Rule |
|---|---|
| Input | `index` (zero-based) and `count` (number of shown reviews) |
| Valid input | `count` is a whole number of at least 1 and `index` is a whole number from 0 up to `count - 1` |
| Output | `` `${index + 1} / ${count}` `` |
| Invalid input | Never throws and never reads wrong: a count below 1 or not a finite number counts as 1; an index outside the range, or not a finite number, is moved to the nearest end (0 or `count - 1`); fractions are cut off. The result always has 1 <= X <= Y |
## Slide label (unchanged)
`slideLabel(index, count)` gives `"Review n van m"` and names each slide and the announcement (BR-REV-08, BR-REV-09). The old dot labels `"Review n"` are removed together with the dots.
## Carousel state
Owned by Chakra's carousel (`page`, `pageSnapPoints`, loop, scroll position). The unit does not keep its own copy of the current review: the counter and the announcement read the carousel's `page` and the shown count.
@@ -0,0 +1,132 @@
# Frontend Components: testimonials (unit 2)
Visual reference: the design canvas <https://claude.ai/artifact/BEDx5KkBVMKXs6bjzoNoew> (desktop 1440 px, phone 390 px). Decisions of the owner after the canvas: tablet and phone share the stacked layout (question 1 = A), the card grows with its text (question 2 = A), no sand block (question 3 = A).
## Component hierarchy
```mermaid
graph TD
Route["routes/index.tsx"]
T["Testimonials"]
Section["PageSection tone alt"]
Heading["SectionHeading"]
Holder["Box with view observer"]
Placeholder["CarouselPlaceholder"]
Carousel["TestimonialCarousel, lazy"]
Slide["TestimonialSlide"]
Photo["DeferredImage with crop"]
Card["Card: shoot, quote, names"]
Controls["Control bar: prev, counter, next"]
Live["Live region"]
Lib["lib: visibleTestimonials, slideLabel, slideCounter, normalizeImagePosition"]
Recipe["carouselControl recipe"]
Route --> T
T --> Section
Section --> Heading
Section --> Holder
Holder --> Placeholder
Holder --> Carousel
Placeholder --> Slide
Carousel --> Slide
Carousel --> Controls
Carousel --> Live
Slide --> Photo
Slide --> Card
Controls --> Recipe
Lib -.-> T
Lib -.-> Carousel
Lib -.-> Slide
classDef root fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef logic fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
class Route root;
class T,Section,Heading,Holder,Placeholder,Carousel,Slide,Photo,Card,Controls,Live,Recipe ui;
class Lib logic;
```
Text alternative: the home route renders Testimonials in a PageSection with SectionHeading; a view-observing box shows either the placeholder or the lazy carousel, both made of TestimonialSlide (a cropped photo and a card), and the carousel adds the control bar and the live region; pure helpers feed all of them.
## Testimonials (changed a little)
- **Props**: unchanged, `{ content: HomeContent['testimonials']; testimonials: Testimonial[] }`.
- **Behaviour**: unchanged: `visibleTestimonials`; none gives `null`; one gives a single `TestimonialSlide`; two or more give the box with the view observer, the placeholder first and the lazy carousel once near the screen.
- **Section**: `PageSection` with `tone="alt"` (decision FR-TR-10), `data-testid="testimonials"`, centred `SectionHeading` with the unit 1 style.
## TestimonialSlide (rebuilt)
- **Props**: `{ testimonial: Testimonial }`.
- **Wrapper**: `data-testid="testimonial-{id}"`.
### From `lg` (1024 px)
One grid cell holds two stacked layers, so the row is as high as the higher one:
| Part | Placement |
|---|---|
| Photo | Left, 57% of the width, 3:2, starts 40 px below the top of the cell, above the card |
| Card | Right, 56% of the width, at least 400 px high (`minH`), `paper.deep`, with a bottom margin of 66 px that reserves the room for the control bar (22 px gap plus 44 px bar) |
| Card content | Centred in the card; left padding of 25% of the slide width (a percentage padding on a grid item refers to the grid area, as in the canvas; it clears the 13% overlap with the photo) and 44 px on the right |
The cell is therefore as high as the larger of "photo bottom" and "card plus the control room". The two overlap by about 13% of the width, as in the canvas.
### Below `lg`
A wrapper at most 640 px wide, centred. The photo is full width of the wrapper, 4:3; the card follows with a negative top margin of 36 px so it overlaps the bottom of the photo, with 72 px top padding so the text starts below the overlap and 28 px at the sides. Text centred. The control bar is below the card (see Controls).
### Photo
- `DeferredImage` (keeps the lazy loading, the width and height that reserve space, and the `noscript` twin) with `objectFit: cover`, `bg: paper.deep` until it loads, and `objectPosition` from `normalizeImagePosition(testimonial.imagePosition)`.
- No `FramedImage` and no coloured block (BR-TR-06). The source files stay 880 x 1100.
### Card text
| Element | Style |
|---|---|
| Shoot type | Heading font, uppercase, letter-spacing 0.2em, 21 px (19 px below `lg`), colour `ink` |
| Quote | `chakra.blockquote`, body font, weight 300, 17 px (16.5 px below `lg`), line-height 1.75, colour `ink.soft`, balanced wrapping (`text-wrap: pretty`) |
| Names | `chakra.figcaption`, small caps style (`textStyle="eyebrow"`), colour `accent.deeper`; the old "— " prefix is dropped |
`figure` > `blockquote` + `figcaption` stays (BR-REV-11). No decorative quotation mark. Plain elements are used instead of Chakra's `Blockquote` for the same bundle-size reason as before.
## TestimonialCarousel (changed)
- Chakra `useCarousel` with `slideCount`, `loop`, `allowMouseDrag`, `translations.item = slideLabel`, `onPageChange` for the announcement, and `spacing` set to 0 (slides come directly after each other, as on the canvas). The old 4 rem spacing existed so the sand block of one photo never peeked into the next slide; without that block it is not needed. Code Generation checks that the next slide never shows at the edge.
- `Carousel.ItemGroup` keeps `aria-live="off"`; items stretch to equal height (BR-REV-07); no more `ps` and `pb` of 1.5 rem on the items.
- Touch and mouse: the carousel follows the finger and snaps. Under reduced motion the buttons, keys and indicators call the API with `instant`; the swipe snap is made instant by the existing reduced-motion CSS.
- **Control bar** (own markup, as before): previous button, counter, next button.
- From `lg`: placed at the bottom right of the carousel, aligned with the card column (width 56%, left padding 25%, right 44 px), content centred; it sits in the room reserved under the card.
- Below `lg`: below the slides, centred, 28 px under the card.
- Buttons: icon only (the existing Ant Design arrows, offline), no circle and no border, 44 px target, lighter on hover (opacity), the theme focus ring on keyboard focus. Names "Vorige review" and "Volgende review". Arrow keys on the bar work as before.
- Counter: `Text` with the heading font, 16 px, letter-spacing 0.08em, `ink.soft`, `aria-hidden`, content `slideCounter(carousel.page, count)`.
- The dots are removed.
- **Live region**: unchanged: empty on load, `slideLabel(page, count)` after a change.
- **Test ids**: `testimonials-prev`, `testimonials-next`, `testimonials-status`, new `testimonials-counter`; `testimonials-dot-{n}` is removed.
## carouselControl recipe (changed)
The `dot` variant is removed. The `arrow` variant loses its 48 px box with border: it becomes a 44 px square target without border or background, with `opacity` transition (hover lowers the opacity to 0.55, which lightens it; keyboard focus gets the theme's focus ring and is not dimmed, because opacity would also fade the ring). The recipe comment names the buttons under the testimonials only.
## CarouselPlaceholder (changed)
- Shows the longest review as a normal `TestimonialSlide` (no padding wrappers any more), the other reviews visually hidden, `aria-hidden` and `inert` (BR-LZY-02).
- Below `lg` it adds a spacer of the control bar's height plus its margin, with `data-requires-js` as before; from `lg` no spacer is needed, because the bar sits inside the room the slide already reserves.
## Accessibility (NFR-TR-01)
- The region is named by the h2; the carousel keeps its `aria-roledescription` and label; slides are named "Review n van m".
- Contrast on `paper.deep`: names `accent.deeper` (about 6.4:1), quote `ink.soft` (about 6.1:1), shoot type `ink` (higher).
- Targets of at least 44 px; the focus ring comes from the theme.
- Hidden slides stay inert (BR-REV-10); the counter is hidden from assistive technology and never read twice.
- Axe clean for the placeholder, the carousel and the single review.
## Interaction flows
- Visitor presses next, presses the right arrow key in the bar, or swipes left: the carousel moves one review forward, slides (or jumps under reduced motion), the counter changes to "2 / 2", the live region announces "Review 2 van 2".
- On the last review, next goes to the first (loop); on the first, previous goes to the last.
- No form, no API call and no persisted state in this unit.
## Not in this unit
Autoplay and pause (removed), dots (removed), changes outside the Testimonials folder other than the theme-free helpers, content, test helpers and `LAYOUT.md`.