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:
@@ -0,0 +1,176 @@
|
||||
# Execution Plan
|
||||
|
||||
## Detailed Analysis Summary
|
||||
|
||||
### Transformation Scope
|
||||
- **Transformation Type**: Single component area in one package (`web/`), plus one shared component that fans out to several pages
|
||||
- **Primary Changes**: a new look and new behaviour for the "Lieve woorden" section (card over a landscape photo, counter instead of dots, no autoplay, horizontal slide), a new heading style in `SectionHeading`, and an optional `imagePosition` field in the content model
|
||||
- **Related Components**: `Testimonials`, `TestimonialSlide`, `TestimonialCarousel`, `carouselControl` recipe, `SectionHeading` and its eight callers (`AboutBlock`, `ContactSection`, `IntroGallery`, `Pricing`, `Testimonials`, `InstagramGrid`, `AboutIntro`, `ShootPage`), `theme.ts` (text styles), `content/types.ts`, `content/testimonials.ts`, two new helpers in `web/src/lib`, `LAYOUT.md`
|
||||
|
||||
### Change Impact Assessment
|
||||
- **User-facing changes**: Yes. The testimonials look and behave differently; every `SectionHeading` on the site gets uppercase, letter-spaced titles
|
||||
- **Structural changes**: No. Same components, same route, same lazy-loading pattern
|
||||
- **Data model changes**: Yes, small: one optional field `imagePosition` on `Testimonial`
|
||||
- **API changes**: No
|
||||
- **NFR impact**: Yes, checks only: accessibility (contrast, axe), no hydration mismatch, Lighthouse targets must hold, titles must not break on phones
|
||||
|
||||
### Component Relationships
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Theme["theme.ts text styles"]
|
||||
SH["SectionHeading"]
|
||||
Callers["Seven other callers: home sections, about intro, shoot page"]
|
||||
Test["Testimonials, slide and carousel"]
|
||||
Content["Testimonial content and type"]
|
||||
Helpers["lib helpers: slideCounter, normalizeImagePosition"]
|
||||
Recipe["carouselControl recipe"]
|
||||
Theme --> SH
|
||||
SH --> Callers
|
||||
SH --> Test
|
||||
Content --> Test
|
||||
Helpers --> Test
|
||||
Recipe --> Test
|
||||
classDef style1 fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||
classDef comp fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
classDef data fill:#fbd38d,stroke:#92400e,stroke-width:1px,color:#000;
|
||||
class Theme,Recipe style1;
|
||||
class SH,Callers,Test comp;
|
||||
class Content,Helpers data;
|
||||
```
|
||||
|
||||
Text alternative: the theme text styles feed SectionHeading, which is used by its callers and by Testimonials; Testimonials also uses the content, two new helpers and the carousel control recipe.
|
||||
|
||||
| Component | Change type | Reason | Priority |
|
||||
|---|---|---|---|
|
||||
| `theme.ts` (new heading text style) | Minor | FR-TR-05 | Critical |
|
||||
| `SectionHeading` and its eight callers | Minor | New style on every page that uses it; callers themselves do not change | Critical |
|
||||
| `Testimonials`, `TestimonialSlide`, `TestimonialCarousel` | Major | New layout, controls, animation, placeholder | Critical |
|
||||
| `carouselControl` recipe | Minor | Dots removed, arrows without circle | Important |
|
||||
| `content/types.ts`, `content/testimonials.ts` | Minor | `imagePosition` | Important |
|
||||
| `lib/slideCounter`, `lib/normalizeImagePosition` (new) | Minor | FR-TR-12, property tests | Important |
|
||||
| `LAYOUT.md`, RE lines | Minor | FR-TR-14 | Optional |
|
||||
|
||||
### Risk Assessment
|
||||
- **Risk Level**: Medium. The carousel is the heaviest code on the page and sits behind a lazy-load placeholder whose height must match; the heading change reaches several pages and may wrap titles on phones
|
||||
- **Rollback Complexity**: Easy. One branch, no deployment or data change
|
||||
- **Testing Complexity**: Moderate. The existing tests (including prerender, hydration and axe tests) must be adjusted; swiping can not be tested in jsdom, so it needs a manual check in a real browser
|
||||
|
||||
## Workflow Visualization
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start(["User Request"])
|
||||
|
||||
subgraph INCEPTION["🔵 INCEPTION PHASE"]
|
||||
WD["Workspace Detection<br/><b>COMPLETED</b>"]
|
||||
RE["Reverse Engineering<br/><b>SKIP</b>"]
|
||||
RA["Requirements Analysis<br/><b>COMPLETED</b>"]
|
||||
US["User Stories<br/><b>SKIP</b>"]
|
||||
WP["Workflow Planning<br/><b>IN PROGRESS</b>"]
|
||||
AD["Application Design<br/><b>SKIP</b>"]
|
||||
UG["Units Generation<br/><b>SKIP</b>"]
|
||||
end
|
||||
|
||||
subgraph CONSTRUCTION["🟢 CONSTRUCTION PHASE"]
|
||||
FD1["Functional Design, unit 1<br/><b>SKIP</b>"]
|
||||
CG1["Code Generation, unit 1<br/>section heading<br/><b>EXECUTE</b>"]
|
||||
FD2["Functional Design, unit 2<br/><b>EXECUTE</b>"]
|
||||
CG2["Code Generation, unit 2<br/>testimonials<br/><b>EXECUTE</b>"]
|
||||
NFR["NFR Requirements, NFR Design,<br/>Infrastructure Design<br/><b>SKIP</b>"]
|
||||
BT["Build and Test<br/><b>EXECUTE</b>"]
|
||||
end
|
||||
|
||||
Start --> WD
|
||||
WD --> RA
|
||||
RA --> WP
|
||||
WP --> CG1
|
||||
CG1 --> FD2
|
||||
FD2 --> CG2
|
||||
CG2 --> BT
|
||||
BT --> End(["Complete"])
|
||||
|
||||
style WD fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style RA fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style WP fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style CG1 fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style CG2 fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style BT fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||
style FD2 fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||
style RE fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||
style US fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||
style AD fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||
style UG fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||
style FD1 fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||
style NFR fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||
style INCEPTION fill:#BBDEFB,stroke:#1565C0,stroke-width:3px,color:#000
|
||||
style CONSTRUCTION fill:#C8E6C9,stroke:#2E7D32,stroke-width:3px,color:#000
|
||||
style Start fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
|
||||
style End fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
|
||||
|
||||
linkStyle default stroke:#333,stroke-width:2px
|
||||
```
|
||||
|
||||
Text alternative: after Workflow Planning, unit 1 (section heading) goes straight to Code Generation; unit 2 (testimonials) has Functional Design and then Code Generation; Build and Test closes the feature. Reverse Engineering, User Stories, Application Design, Units Generation, the NFR stages and Infrastructure Design are skipped; there is no Operations phase.
|
||||
|
||||
## Units
|
||||
|
||||
The two units are fixed here, so Units Generation is skipped. They do not depend on each other for logic, only for looks, so unit 1 goes first (small, and the testimonials heading then already has its final style).
|
||||
|
||||
| Unit | Content | Requirements |
|
||||
|---|---|---|
|
||||
| 1. section-heading | New text style in `theme.ts`, used by `SectionHeading`; check the eight callers and every page that shows a `SectionHeading` (titles that wrap on a phone, tests and snapshots that name the old style) | FR-TR-05, A1, A2 |
|
||||
| 2. testimonials | `imagePosition` in the content model, helpers `slideCounter` and `normalizeImagePosition` with property tests, new `TestimonialSlide` and `Testimonials` layout, controls and counter in `TestimonialCarousel` and the recipe, slide animation, placeholder height, tests, `LAYOUT.md` and RE lines | FR-TR-01..04, 06..14, NFR-TR-01..06 |
|
||||
|
||||
## Phases to Execute
|
||||
|
||||
### 🔵 INCEPTION PHASE
|
||||
- [x] Workspace Detection (COMPLETED)
|
||||
- [x] Reverse Engineering (SKIPPED)
|
||||
- **Rationale**: shared artifacts exist; team agreement is no full refresh per feature. Only the lines about the testimonials and the heading are updated (FR-TR-14)
|
||||
- [x] Requirements Analysis (COMPLETED)
|
||||
- [x] User Stories (SKIPPED)
|
||||
- **Rationale**: one type of visitor and concrete requirements from a reviewed design
|
||||
- [x] Workflow Planning (IN PROGRESS)
|
||||
- [ ] Application Design - SKIP
|
||||
- **Rationale**: no new components or services; the two helpers are fully specified in FR-TR-12 and the layout decisions belong in Functional Design of unit 2
|
||||
- [ ] Units Generation - SKIP
|
||||
- **Rationale**: the two units are fixed in this plan
|
||||
|
||||
### 🟢 CONSTRUCTION PHASE
|
||||
- [ ] Functional Design, unit 1 - SKIP
|
||||
- **Rationale**: a style change with no logic; PBT-01 is N/A
|
||||
- [ ] Functional Design, unit 2 - EXECUTE
|
||||
- **Rationale**: layout geometry and overlap, how Chakra's carousel carries the slide animation, the placeholder height, the helpers and the testable properties (PBT-01)
|
||||
- [ ] NFR Requirements - SKIP
|
||||
- **Rationale**: the NFRs are in requirements.md; the PBT framework (`fast-check`) is already selected (PBT-09)
|
||||
- [ ] NFR Design - SKIP
|
||||
- **Rationale**: no new NFR patterns
|
||||
- [ ] Infrastructure Design - SKIP
|
||||
- **Rationale**: no infrastructure change
|
||||
- [ ] Code Generation, unit 1 - EXECUTE (ALWAYS)
|
||||
- [ ] Code Generation, unit 2 - EXECUTE (ALWAYS)
|
||||
- [ ] Build and Test - EXECUTE (ALWAYS)
|
||||
- **Rationale**: `pnpm check` (lint, types, tests, build, Lighthouse), a manual swipe check on a phone or in device mode, and a check of every page that shows a `SectionHeading`
|
||||
|
||||
### 🟡 OPERATIONS PHASE
|
||||
- [ ] Deployment Setup, Monitoring Setup, Production Readiness Validation - SKIP
|
||||
- **Rationale**: Operations Configuration = No (decided at Requirements Analysis)
|
||||
|
||||
## Package Change Sequence
|
||||
|
||||
Single package (`web/`). Order: unit 1 (heading), then unit 2 (testimonials), each with its own build and tests; Build and Test covers both together.
|
||||
|
||||
## Estimated Timeline
|
||||
- **Total Phases**: 5 stages still to run (Functional Design for unit 2, two Code Generation stages, Build and Test, plus this plan)
|
||||
- **Estimated Duration**: about the size of the shoot-type pages feature; the carousel and the placeholder are the long part
|
||||
|
||||
## Success Criteria
|
||||
- **Primary Goal**: the testimonials match the approved canvas on desktop and phone, with no autoplay and no dots
|
||||
- **Key Deliverables**: new `Testimonials` section, `SectionHeading` style, `imagePosition` field, two helpers with property tests, updated tests and `LAYOUT.md`
|
||||
- **Quality Gates**:
|
||||
- `pnpm check` green, Lighthouse targets not lowered
|
||||
- No axe violations; contrast at least 4.5:1
|
||||
- Hydrated page equals prerendered HTML
|
||||
- Security Baseline and PBT compliance summaries at each applicable stage
|
||||
- Manual swipe check and a look at every page with a `SectionHeading`
|
||||
+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