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,48 @@
# Build and Test Summary
Run on 2026-11-06 in the worktree `AndreaSlopFotografie-testimonials-redesign` (branch `feature/testimonials-redesign` from master `c8ca5eb`), on the owner's PC.
## Build Status
- **Build tool**: pnpm 12.11, `tsc`, Vite with prerender
- **Build status**: Success (24 s)
- **Build artifacts**: `web/dist/client`; 12 pages prerendered; 16 inline scripts moved into 28 files
## Test Execution Summary
### Unit tests
- **Total**: 1414 in 134 files, 0 failed
- **Coverage**: thresholds met, including 100% for `src/lib`
- **Status**: Pass
### Integration (browser checks on the built site)
- **Heading style on six pages at 390, 768 and 1440 px**: capitals everywhere; no page scrolls sideways (`scrollWidth` equals the width on every page, on the branch and on master); the longest title takes 4 lines at 390 px and 3 lines from 768 px, as estimated (A2)
- **Testimonials geometry** (1440 / 1024 / 768 / 390 px): photo 638 x 426 and card 627 x 400 at 1440 px (overlap as in the canvas); the control bar sits under the card inside the slide; below 1024 px the layout is stacked with the photo at most 640 px wide; card colour `rgb(232, 224, 213)`; crop `50% 42%`; the second slide starts at the group's right edge, no glimpse
- **Behaviour**: next, previous, the loop, ArrowRight in the bar, dragging with the mouse and swiping on a touch device all change the review; after the scroll settles the counter and the announcement follow ("1 / 2" to "2 / 2", "Review 2 van 2"); the second photo is already loaded when it slides in; nothing changes by itself over 7 seconds
- **Status**: Pass
### Performance (Lighthouse)
- **Desktop** (`lighthouserc.desktop.cjs`): all 12 URLs pass
- **Mobile** (`pnpm lighthouse`): all assertions pass except one, **`/` performance 0.83 against a floor of 0.85** (blocking locally only; CI warns)
- **Root cause check**: five runs of `/` on the branch and five on a build of master, same machine, one after the other: branch 0.84 0.85 0.84 0.84 0.84, master 0.84 0.84 0.84 0.85 0.85 (median 0.84 for both); LCP about 4.36 s on both, TBT 60 to 80 ms on both; the LCP element is the hero (`span`), not the testimonials. So the change does not lower the score; the homepage is recorded at exactly 0.85 (`mobileExceptions`, owner decision 2026-11-01, `numberOfRuns: 1`) and fails by chance on this machine today, on master as well
- **Status**: No regression; the single-run local floor of `/` is borderline (known follow-up: responsive photos)
### Additional tests
- **E2E suite** (`pnpm e2e`): 12 files, 268 passed, 205 skipped; the same numbers on master
- **Security**: `pnpm audit:deps` clean (no known vulnerabilities in production packages); `pnpm audit:dev` reports 23 advisories in development tools (2 low, 10 moderate, 11 high), which do not block (NFR-SEC-05) and are unrelated to this change
- **Contract tests**: N/A (no API)
## Extension compliance (Build and Test)
| Extension | Rule | Status | Note |
|---|---|---|---|
| Security Baseline | SECURITY-04, 10, 15 | Compliant | See security-test-instructions.md; other rules N/A |
| Property-Based Testing | PBT-08 | Compliant | Seed printed on every run, shrinking on, part of `pnpm test` in CI |
| Property-Based Testing | PBT-02..07, 09, 10 | Compliant | Unchanged since Code Generation; PBT-06 N/A |
## Overall Status
- **Build**: Success
- **All tests**: Pass, with one local Lighthouse floor (`/` mobile performance) that is borderline and equal on master
- **Ready for Operations**: Not applicable (Operations phase declined at Requirements Analysis)
## Next Steps
Commit, push, open the pull request and handle it (authorised by the owner for this task), then update and clean up the branches.
@@ -0,0 +1,21 @@
# Build Instructions
## Prerequisites
- **Build tool**: pnpm 12.11 (`packageManager` in `web/package.json`), Vite, TypeScript; Node as in the CI image.
- **Dependencies**: the lock file `web/pnpm-lock.yaml`; no dependency was added or changed in this feature. In a new worktree run `pnpm install --frozen-lockfile` first.
- **Environment variables**: none needed locally. `LIGHTHOUSE_PERFORMANCE=warn` is set by CI (see performance-test-instructions.md).
- **System requirements**: Chrome for Lighthouse and the browser checks (`C:\Program Files\Google\Chrome\Application\chrome.exe` on this PC); free port 4173 for `pnpm preview` and Lighthouse.
## Build steps
1. Install dependencies: `cd web && pnpm install --frozen-lockfile`.
2. Build everything: `pnpm build` (runs `tsc`, `vite build` with prerender, and the script that moves inline scripts into files).
3. Verify: the output lists the 12 prerendered pages (`/`, `/404`, `/over-mij`, `/portfolio`, `/contact`, `/privacyverklaring`, `/soorten-fotoshoots` and its five shoot pages) and ends with "Inline scripts verplaatst: 12 pagina's gecontroleerd, 16 scripts verplaatst, 28 bestanden geschreven".
**Build artifacts**: `web/dist/client` (static HTML per page, assets, moved scripts). **Common warnings**: none expected.
## Troubleshooting
- **Type errors in `tsc`**: run `pnpm exec tsc --noEmit` to see them without building; the Chakra types come from `pnpm typegen` (also run by `postinstall`).
- **`vite build` fails during prerender**: a page throws while rendering on the server; run the failing route's test (`pnpm exec vitest run src/<test>`) to find it.
- **Port 4173 in use**: another session may be running Lighthouse; ask before starting `pnpm preview` (see the parallel-sessions agreement).
@@ -0,0 +1,28 @@
# End-to-End Test Instructions
## Automated
```bash
cd web
pnpm build
pnpm e2e # vitest run --config vitest.e2e.config.ts, against the built site
```
- **Expected**: 12 files; 268 passed and 205 skipped (the skips come from the suite itself and are the same on master).
- Nothing in the e2e suite names the old dots; the tests that touch the section look for `testimonial-{id}`, which still exists.
## Manual or scripted browser checks (a real browser, because jsdom has no layout)
Start `pnpm preview` and open `/`, scroll to "Lieve woorden".
| Check | Expected |
|---|---|
| Click next and previous | The slide moves horizontally in about a second; the counter reads "2 / 2" then "1 / 2"; the live region says "Review 2 van 2" |
| Loop | Next on the last review goes to the first; previous on the first goes to the last |
| Arrow keys | With focus on a button in the bar, ArrowRight and ArrowLeft move the review |
| Drag with the mouse, swipe on a phone | The slide follows and snaps; after about a second the counter and the announcement follow. Drag at least about half the width, a short drag snaps back |
| Nothing by itself | After 7 seconds the counter is unchanged |
| Reduced motion | With `prefers-reduced-motion: reduce` the change is immediate |
| The second photo | Loaded before it slides in (the carousel sets `near`) |
Results of the run of 2026-11-06 are in build-and-test-summary.md.
@@ -0,0 +1,30 @@
# Integration Test Instructions
## Purpose
The two units meet in the testimonials section: the new heading style (unit 1) sits above the new slides (unit 2), and the heading style also reaches every other page that uses `SectionHeading`. These scenarios check that they work together on the built site.
## Scenarios
### 1. Heading style on every page that uses `SectionHeading`
- **Setup**: `pnpm build`, then `pnpm preview` (port 4173).
- **Steps**: open `/`, `/over-mij`, `/contact`, `/portfolio`, `/soorten-fotoshoots/newborn` and `/soorten-fotoshoots/gezin` at 390, 768 and 1440 px; read the line count of each uppercase `h2` and the page's `scrollWidth`.
- **Expected**: every title shows in capitals; no page scrolls sideways; the longest title ("Lifestyle fotograaf met een passie voor storytelling") takes 4 lines at 390 px and 3 lines from 768 px.
### 2. Testimonials section on the built, prerendered page
- **Steps**: open `/`, scroll to "Lieve woorden", wait for the carousel; read the geometry of the slide, photo, card and control bar at 1440, 1024, 768 and 390 px.
- **Expected**: from 1024 px the photo overlaps the card and the control bar sits under the card inside the slide's height; below 1024 px the layout is stacked with the photo at most 640 px wide; the card is `rgb(232, 224, 213)`; the second slide starts at the group's right edge (no glimpse); the crop is `50% 42%` on the rings photo.
### 3. Prerender to hydration to carousel
- **Covered by**: the existing prerender, hydration and placeholder tests (`Testimonials in the prerendered HTML`, `displayHydration`, `hydration`) and the e2e suites `rawHtml`, `noJs` and `interaction`.
- **Expected**: the HTML holds every review's text; without JavaScript the longest review and the hidden copies are present; after hydration the carousel replaces the placeholder without a layout jump.
## Run
```bash
cd web
pnpm build && pnpm e2e # scenario 3 and the page-level checks
pnpm preview # then the browser checks of scenarios 1 and 2
```
The browser checks of scenarios 1 and 2 were run with `playwright-core` (already a dev dependency) against Chrome; the scripts are scratch files, not part of the repository.
@@ -0,0 +1,30 @@
# Performance Test Instructions
## Purpose
NFR-TR-02: the Lighthouse targets in `web/lighthouserc.cjs` (mobile) and `lighthouserc.desktop.cjs` do not go down because of this feature. The carousel stays lazy-loaded away from the hero, and the photos are the same files.
## Run
```bash
cd web
pnpm build
pnpm lighthouse # lhci autorun for mobile, then for desktop (&&)
```
- Needs port 4173 free and no heavy work in parallel: it skews the score. In the parallel-sessions agreement, ask the other sessions first.
- **Locally the performance assertion blocks; in CI it only warns** (`LIGHTHOUSE_PERFORMANCE=warn`), because the Raspberry Pi runner scores 30 to 40 points lower. `numberOfRuns` is 1 on purpose, so a page that sits exactly on its floor can fail by chance.
- Accessibility, best practices and SEO must be 1 on every page; those block everywhere.
## A/B check against master (when one page sits on its floor)
```bash
cd web
pnpm exec lhci collect --collect.url=http://localhost:4173/ --collect.numberOfRuns=5
```
Run it once with the branch's `dist` and once with master's `dist` (build master in the main checkout), then compare the scores in `.lighthouseci/lhr-*.json`. Do not run the two at the same time.
## Result of 2026-11-06
See build-and-test-summary.md: the homepage is on its floor of 0.85 and scores 0.84 on both the branch and master on this machine.
@@ -0,0 +1,23 @@
# Security Test Instructions
The change is front-end only: no new inputs, endpoints, storage or dependencies.
## Dependency audit
```bash
cd web
pnpm audit:deps # production packages, blocking: pnpm audit --prod --audit-level high
pnpm audit:dev # development tools, report only
```
- **Expected**: `audit:deps` reports "No known vulnerabilities found". `audit:dev` lists the known advisories in development tools (2026-11-06: 23, none in production); they do not block (NFR-SEC-05) and are not changed by this feature.
## Rules from the Security Baseline extension
| Rule | How it is checked |
|---|---|
| SECURITY-04 (headers and CSP) | No header or CSP change; the new styles are generated CSS classes, no inline `style` attribute; the e2e `serverRules` suite checks the headers; Lighthouse best-practices stays 1 |
| SECURITY-05 (in spirit) | `normalizeImagePosition` takes `unknown` and gives a safe string; its property tests include arbitrary values and `fc.anything()` |
| SECURITY-10 | Lock file unchanged; no dependency added |
| SECURITY-15 | `normalizeImagePosition` and `slideCounter` never throw (property tests) |
| Others | Not applicable: no data store, API, identity, logging or network configuration in this change |
@@ -0,0 +1,28 @@
# Unit Test Execution
## Run the unit tests
```bash
cd web
pnpm test # vitest run --coverage
```
- **Expected**: 134 files and 1414 tests pass; the coverage thresholds hold (including 100% for `src/lib`, which the two new helpers meet).
- **Seed**: fast-check prints `fast-check seed: <n>` at the top of every run. To replay a failure: `FC_SEED=<n> pnpm test` (PBT-08).
- **Reports**: coverage in `web/coverage`.
## Tests of this feature
| Area | Files |
|---|---|
| Section heading | `src/components/SectionHeading/SectionHeading.test.tsx` (uppercase and letter-spacing in CSS only; plain `sectionTitle` headings untouched) |
| Helpers | `src/lib/normalizeImagePosition.test.ts` and `slideCounter.test.ts` (examples plus properties), `visibleTestimonials.test.ts` (new property) |
| Components | `Testimonials.test.tsx` (no dots, counter, no timer, wiring of arrows, keys and reduced motion, prerendered HTML), `TestimonialSlide.test.tsx` (card, crop, no quotation mark) |
Property tests and example tests sit side by side (PBT-10). jsdom has no layout, so swiping, sliding and the geometry are checked in a real browser (see e2e-test-instructions.md).
## If a test fails
1. Read the output; for a property failure the shrunk counterexample and the seed are printed.
2. Replay with `FC_SEED=<n> pnpm exec vitest run <file>`.
3. Fix the code (or, if the property was wrong, the property) and add the shrunk case as a permanent example test.