Adds the AI-DLC documents of the testimonials redesign
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:
+76
@@ -0,0 +1,76 @@
|
||||
# Vragen bij de requirements: testimonials-redesign
|
||||
|
||||
Vul achter elke `[Answer]:` de letter van je keuze in. Past geen enkele optie, kies dan de laatste (Anders) en licht je keuze toe. Bij elke vraag staat welke optie ik aanbeveel en waarom.
|
||||
|
||||
**Vaste uitgangspunten uit het ontwerp, hierover hoef je niets te beslissen:**
|
||||
|
||||
- Foto links (landschap, 3:2) overlapt een kaart rechts; de tekst in de kaart is gecentreerd (shoot-naam in hoofdletters, citaat, naam).
|
||||
- De kaart is altijd `paper.deep` (`#e8e0d5`); alleen de achtergrond van het blok eromheen wisselt (paper / paper.alt).
|
||||
- Controls: pijlen zonder cirkel en een teller "X / Y". De bolletjes, het balkje, de pauzeknop en autoplay vervallen.
|
||||
- De review wisselt alleen met de pijlen, de pijltjestoetsen of swipen (en slepen met de muis). Een wissel is een horizontale slide; bij `prefers-reduced-motion` direct, zonder animatie.
|
||||
- Wat uit de homepage-sections-spec blijft gelden: de loop (BR-REV-05), gelijke hoogte (BR-REV-07), één nette aankondiging "Review n van m" (BR-REV-08), verborgen slides niet focusbaar (BR-REV-10), en de volledige tekst van elke review in de prerendered HTML (BR-LZY-02).
|
||||
- Vervalt of verandert: BR-REV-04 (de bolletjes), BR-REV-09 (de labels "Review n" van de bolletjes) en de tests en testids van de bolletjes.
|
||||
|
||||
## Vraag 1
|
||||
|
||||
De kop "LIEVE WOORDEN" staat in het ontwerp in gespatieerde hoofdletters (30 px, letter-spacing 0,22em, gecentreerd, zonder hairline). `SectionHeading` is nu gedeeld door alle homepage-secties. Waar moet de nieuwe kop gelden?
|
||||
|
||||
- A) Alleen bij de testimonials, via een variant of prop op `SectionHeading`; de andere secties blijven zoals ze zijn (aanbevolen: het ontwerp is alleen voor deze sectie bekeken, en de andere koppen zijn niet getoetst)
|
||||
- B) Bij alle homepage-secties: dan krijgt de hele homepage dezelfde kop (een grotere wijziging die ik apart zou moeten ontwerpen)
|
||||
- C) De bestaande kop blijft; alleen de rest van de sectie verandert
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: B, daarna in de chat verfijnd met een vervolgvraag (`SectionHeading` staat ook in over-mij en de shoot-pagina's): overal waar `SectionHeading` staat.
|
||||
|
||||
## Vraag 2
|
||||
|
||||
De achtergrond van het blok wisselt "om en om" met de blokken op de pagina. Nu staat de sectie vast op `tone="alt"` in `Testimonials.tsx`. Hoe bepalen we de tone?
|
||||
|
||||
- A) Vast op `alt`, zoals nu; verandert de volgorde van de blokken, dan pas je de tone aan in één regel (aanbevolen: eenvoudig, en de tone is al een prop van `PageSection`)
|
||||
- B) Een prop `tone` op `Testimonials`, die de homepage-route doorgeeft op basis van de plek van het blok, zodat het patroon vanzelf klopt als de volgorde verandert
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 3
|
||||
|
||||
De foto's in `testimonials.ts` zijn staand (880 × 1100, 4:5). Het ontwerp toont ze liggend (3:2), dus er wordt flink bijgesneden: bij de trouwring blijft de hand zichtbaar met de focus op 42% van de hoogte, bij de newborn-foto op het midden. Hoe regelen we welk deel zichtbaar blijft?
|
||||
|
||||
- A) Een optioneel veld `imagePosition` (bijvoorbeeld `'50% 42%'`) per review in het contentmodel, dat de bijsnijdpositie bepaalt; zonder veld is het midden (aanbevolen: past bij de CMS die later komt, en de eigenaar kan het per foto bijstellen)
|
||||
- B) Altijd het midden, zonder extra veld (eenvoudiger, maar de ring-foto verliest dan een deel van de hand)
|
||||
- C) Liggende foto's aanleveren, zodat er niet bijgesneden hoeft te worden (nu geen nieuwe foto's beschikbaar: dat zou een vervolgtaak worden)
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 4: Beveiligingsextensies
|
||||
|
||||
Moeten de beveiligingsregels als harde vereisten worden afgedwongen voor deze feature? (Bij de vorige features stond dit aan.)
|
||||
|
||||
- A) Ja: dwing alle BEVEILIGINGSREGELS af als blokkerende vereisten (aanbevolen voor productietoepassingen)
|
||||
- B) Nee: sla alle BEVEILIGINGSREGELS over
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 5: Property-Based Testing
|
||||
|
||||
Moeten de property-based testing (PBT) regels worden afgedwongen? De feature is vooral UI, maar er zijn pure functies die erbij horen (`visibleTestimonials`, `slideLabel`, en straks de teller "X / Y"). Bij de vorige features stond dit aan.
|
||||
|
||||
- A) Ja: dwing alle PBT-regels af als blokkerende vereisten (aanbevolen voor projecten met bedrijfslogica of datatransformaties; hier vooral voor de pure helpers)
|
||||
- B) Gedeeltelijk: dwing PBT-regels alleen af voor pure functies en serialisatie round-trips (past bij een feature die vooral UI is)
|
||||
- C) Nee: sla alle PBT-regels over
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 6: Operations-fase
|
||||
|
||||
Moet deze feature na de Construction-fase door de Operations-fase (deployment en monitoring opzetten)? Bij de vorige features was het antwoord nee, omdat de pipeline en de testomgeving al bestaan.
|
||||
|
||||
- A) Ja: voer de Operations-fase uit na Construction (deployment + monitoring)
|
||||
- B) Nee: stop na Build and Test (deployment en monitoring vallen buiten deze feature) (aanbevolen: er verandert niets aan de pipeline of de hosting)
|
||||
- C) Nog niet zeker: vraag het opnieuw na de Construction-fase
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: B
|
||||
@@ -0,0 +1,97 @@
|
||||
# Requirements: testimonials-redesign
|
||||
|
||||
## Intent analysis
|
||||
|
||||
| Item | Value |
|
||||
|---|---|
|
||||
| User request | Make the "Lieve woorden" testimonials more elegant and closer to the style of the live site, keep the controls, no autoplay. Built on a design canvas (desktop and mobile) that the owner reviewed in several rounds. |
|
||||
| Request type | Enhancement (new look and new behaviour of an existing component) |
|
||||
| Scope | Multiple components: the Testimonials section, the shared `SectionHeading`, the content model and the theme |
|
||||
| Complexity | Moderate: the carousel logic and a lazy-load placeholder exist and must keep working; the heading change reaches every page that uses `SectionHeading` |
|
||||
| Depth | Standard |
|
||||
| Design source | Design canvas <https://claude.ai/artifact/BEDx5KkBVMKXs6bjzoNoew> (private). It is the visual reference; the numbers below are taken from it. |
|
||||
| Questions | `requirement-verification-questions.md` (6 questions, all answered) |
|
||||
|
||||
## Decisions from the questions
|
||||
|
||||
| Q | Decision |
|
||||
|---|---|
|
||||
| 1 | The new heading style applies everywhere `SectionHeading` is used (homepage sections, over-mij intro, shoot pages, Instagram section): 8 usages in 8 components |
|
||||
| 2 | The Testimonials section stays on `tone="alt"`; the card colour is constant |
|
||||
| 3 | Optional `imagePosition` field per review sets the crop of the landscape photo |
|
||||
| 4 | Security Baseline extension: enforced |
|
||||
| 5 | Property-Based Testing extension: enforced (full) |
|
||||
| 6 | No Operations phase |
|
||||
|
||||
## Functional requirements
|
||||
|
||||
Replaces and extends the homepage-sections spec for the testimonials (BR-REV-01..11). Rules that are not mentioned stay as they are.
|
||||
|
||||
| ID | Requirement |
|
||||
|---|---|
|
||||
| FR-TR-01 | **Desktop layout (from `lg`)**: a landscape photo (3:2) on the left, about 57% of the content width, overlaps a card on the right (about 56% of the width, 400 px high). The photo starts 40 px below the top of the card. The card runs to the right edge of the content area. |
|
||||
| FR-TR-02 | **Phone and tablet layout (below `lg`)**: heading, then the photo at full width (4:3), then the card overlapping the bottom of the photo by 36 px, with the controls centred below it. |
|
||||
| FR-TR-03 | **Card**: always `paper.deep` (`#e8e0d5`), on both `paper` and `paper.alt` sections. The text in it is centred: shoot type, quote, names. |
|
||||
| FR-TR-04 | **Typography**: shoot type in the heading font, uppercase, letter-spacing 0.2em, 21 px (19 px on phones); quote in the body font, weight 300, 17 px (16.5 px on phones), line-height 1.75, colour `ink.soft`; names uppercase, small, letter-spaced, colour `accent.deeper`. The large decorative quotation mark is removed (BR-REV-11 changes: the quote stays a `blockquote` with the names as its `figcaption`, without a decorative mark). |
|
||||
| FR-TR-05 | **Section heading**: a new text style used by `SectionHeading`: heading font, uppercase, letter-spacing 0.22em, 30 px from `md` and 26 px below (as on the canvas), centred. The hairline of the canvas is not part of it. The eyebrow and lead of `SectionHeading` keep their style. The accessible text of the heading does not change (the case is only CSS). |
|
||||
| FR-TR-06 | **Controls**: previous and next as icon-only buttons without a circle or border, each with a 44 px target, with the visible counter "X / Y" between them (X is the current review, Y the number of reviews, both counted from 1). Hover lightens the icon. The buttons keep their names "Vorige review" and "Volgende review". The arrow keys still work while focus is in the control bar (BR-REV-04). |
|
||||
| FR-TR-07 | **Navigation**: only the buttons, the arrow keys, swiping and dragging with the mouse change the review. No autoplay, no pause control and no dots. BR-REV-04 and BR-REV-09 (the dots and their labels) no longer apply. |
|
||||
| FR-TR-08 | **Animation**: a change slides the whole slide (card, photo and text) horizontally; a swipe follows the finger. Under `prefers-reduced-motion` the change is immediate (BR-REV-06 stays). |
|
||||
| FR-TR-09 | **Kept**: the loop at both ends (BR-REV-05), equal height of all slides (BR-REV-07), one polite announcement "Review n van m" for each manual change and nothing on load (BR-REV-08), hidden slides not focusable or readable (BR-REV-10), a single review without controls, and the section left out when no review is valid (BR-REV-01/02). |
|
||||
| FR-TR-10 | **Section tone**: `Testimonials` stays on `tone="alt"`. Only the block background alternates; the card does not change with it. |
|
||||
| FR-TR-11 | **Crop**: `Testimonial` gets an optional `imagePosition` (a CSS `object-position` of two percentages, e.g. `"50% 42%"`). Missing or invalid values fall back to the centre (`"50% 50%"`). The content sets `"50% 42%"` for the trouwshoot photo and the centre for the newborn photo. A review without the field stays valid (`isValidTestimonial` does not change). |
|
||||
| FR-TR-12 | **Counter and position helpers**: two small pure functions in `web/src/lib`: one returns the text "X / Y" for an index and a count, one normalises an `imagePosition` value to a safe `"N% N%"` string. |
|
||||
| FR-TR-13 | **Lazy-load placeholder**: until the carousel has loaded (and in the prerendered HTML) the placeholder shows the longest review laid out exactly like a slide plus the height of the controls, so nothing below moves when the carousel takes its place. The other reviews stay in the page, visually hidden, aria-hidden and inert (BR-LZY-02). |
|
||||
| FR-TR-14 | **Documentation**: `LAYOUT.md` (the Testimonials block) is updated following `.ai/layout-conventions.md`, and the lines of the reverse-engineering artifacts about the testimonials and the heading are updated. |
|
||||
|
||||
## Non-functional requirements
|
||||
|
||||
| ID | Requirement |
|
||||
|---|---|
|
||||
| NFR-TR-01 | **Accessibility**: no axe violations in the prerendered HTML and in the hydrated page. Text contrast at least 4.5:1: names `accent.deeper` on `paper.deep`, quote `ink.soft` on `paper.deep`. Targets at least 44 px. The counter is not read out twice (it is visible text; the live region carries the announcement). |
|
||||
| NFR-TR-02 | **Performance**: the carousel code stays lazy-loaded, away from the hero. The Lighthouse targets in `web/lighthouserc.cjs` (for example `/` at 0.85) do not go down. Photos are not made larger: the existing 880 x 1100 files are used. |
|
||||
| NFR-TR-03 | **Motion**: no animation under `prefers-reduced-motion`; no motion that starts by itself (no autoplay). |
|
||||
| NFR-TR-04 | **Compatibility**: the hydrated page must match the prerendered HTML (no hydration mismatch) and must work without a visible jump in the placeholder swap. |
|
||||
| NFR-TR-05 | **Dependencies**: no new runtime dependencies. |
|
||||
| NFR-TR-06 | **Quality**: `pnpm check` (lint, types, tests, build, Lighthouse) is green. Tests: the tests and test ids of the dots are replaced; new example tests for the counter, the crop position and the controls; property tests for the pure helpers (see below). |
|
||||
|
||||
## Extension rules: applicability
|
||||
|
||||
**Security Baseline (enforced).** The change is front-end only: no new inputs, endpoints, storage or dependencies.
|
||||
|
||||
| Rule | Status | Note |
|
||||
|---|---|---|
|
||||
| SECURITY-01, 02, 03, 05, 06, 07, 08, 11, 12, 14 | N/A | No data store, network intermediary, API, identity or authentication in this change |
|
||||
| SECURITY-04 | Compliant (to verify) | Headers and CSP are untouched; the new styles must not need `unsafe-inline`; `imagePosition` is normalised before it reaches a style (FR-TR-12) |
|
||||
| SECURITY-09 | N/A | No deployment change |
|
||||
| SECURITY-10 | Compliant (to verify) | No new dependencies; the lock file stays committed |
|
||||
| SECURITY-13 | N/A | No external scripts or deserialisation |
|
||||
| SECURITY-15 | Compliant (to verify) | Invalid `imagePosition` and invalid reviews fail safe (fallback or skipped), never thrown |
|
||||
|
||||
**Property-Based Testing (enforced, full).** Framework: `fast-check` (already a dependency, with shared arbitraries in `web/src/test`). Candidate properties, to be detailed in Functional Design (PBT-01):
|
||||
|
||||
| Function | Category | Property |
|
||||
|---|---|---|
|
||||
| `slideCounter(index, count)` | Invariant | Always reads "X / Y" with 1 <= X <= Y |
|
||||
| `normalizeImagePosition(value)` | Invariant, idempotence | The result is always two percentages between 0 and 100; normalising twice gives the same result as once; any invalid input gives the centre |
|
||||
| `visibleTestimonials` (unchanged) | Invariant | Existing properties keep passing |
|
||||
| `slideLabel` (unchanged) | Invariant | Existing properties keep passing |
|
||||
|
||||
Example tests keep pinning the key scenarios (PBT-10): "1 / 2", "2 / 2", the ring photo at `50% 42%`.
|
||||
|
||||
## Assumptions to check at review
|
||||
|
||||
| ID | Assumption |
|
||||
|---|---|
|
||||
| A1 | `SectionHeading` has 8 usages; five more h2 elements use the `sectionTitle` text style directly (`CallToAction`, `PackageBlock`, `ShootBlock`, `ShootPage` x2, `StoryBlocks`). The new heading style is a separate text style used by `SectionHeading` only, so these five keep the current style. If you want them to match, say so and the style is applied there too. |
|
||||
| A2 | Uppercase and letter-spacing are applied in CSS, so long titles may wrap. The longest is "Lifestyle fotograaf met een passie voor storytelling" (52 characters, `AboutBlock`, maximum width 620 px): estimated at about three lines on desktop and four on a phone. This is checked during Build and Test on every page that uses `SectionHeading`; no text is shortened in unit 1. |
|
||||
| A3 | The pixel values from the canvas become relative units in the theme (the card's 56% and the photo's 57% of the content width). The overlap and offsets stay as in the canvas. |
|
||||
| A4 | Chakra's carousel stays the base (paging, snapping, looping, swiping, hidden slides); only the slide content, the controls and the animation change. |
|
||||
|
||||
## Out of scope
|
||||
|
||||
- Autoplay, a pause control and the dots (removed on purpose).
|
||||
- New or landscape photos, and any change to the review texts.
|
||||
- The CMS that will deliver the reviews later (the new field is optional so it fits).
|
||||
- Other text styles that are not `SectionHeading` (see A1).
|
||||
- Deployment and monitoring (no Operations phase).
|
||||
Reference in New Issue
Block a user