Adds the inception docs and design for the homepage sections

Refreshes the shared reverse engineering docs, adds the requirements,
application design and units for the homepage-sections feature, and
updates the static design: live prices and form fields, the new
Lieve woorden block and the coming-soon gate over the contact form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 23:46:30 +02:00
co-authored by Claude Opus 5.5
parent 38c5c3e262
commit c81dcd3979
33 changed files with 2354 additions and 275 deletions
@@ -0,0 +1,77 @@
# Code Generation Plan — Unit 1: Lifestyle fotografie
**This plan is the single source of truth for Code Generation of unit 1.**
## Unit context
- **Requirements**: FR-HP-02 (section), FR-HP-11 (scroll reveal, introduced), FR-HP-12 (content + images), NFR-HP-01/02/03/05/06
- **Design**: [unit-of-work.md](../../inception/application-design/unit-of-work.md) unit 1; [components.md](../../inception/application-design/components.md); [component-methods.md](../../inception/application-design/component-methods.md)
- **Design reference**: `design/andreaslop-static/index.html` (`.section`, `.section__head--center`, `.lead`, `.intro-gallery`) and `assets/css/style.css` §4, §11, §19
- **Depends on**: nothing (first unit); introduces the shared blocks every later unit uses
- **Functional Design**: skipped (presentational). **PBT-01**: no business logic, data transformation or algorithm in this unit → no property-based tests; this is recorded as N/A, not skipped silently. Example-based tests cover the components and hook (PBT-10).
- **Workspace**: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie`, code in `web/`
## Conventions for this unit
- Code comments in English; visitor-facing text (headings, alt texts) in Dutch. **Test names in English** too, since they are code, not visitor-facing (existing tests stay Dutch).
- `data-testid` on the section and its gallery (`intro-gallery`, `intro-gallery-photo-{n}`).
- Styling via theme tokens/text styles and Chakra primitives; no CSS files, no hard-coded colours.
## Steps
### Branch and baseline
- [ ] **Step 1** — Create branch `feature/homepage-sections` from `master`. First commit: the inception artifacts so far (`aidlc-docs/…/homepage-sections/`, refreshed `aidlc-docs/_shared/reverse-engineering/`, `active-features.md`) and the static design update (`design/andreaslop-static/`, `LAYOUT.md`, `.ai/layout-conventions.md`). Not pushed.
### Images
- [ ] **Step 2** — Resize the four live gallery photos (`design/andreaslop-static/assets/img/intro-1…4.jpg`, 1067×1600) to **800×1200**, JPEG quality ~80, into `web/src/assets/home/intro-1.jpg … intro-4.jpg`. Tool: a one-off PowerShell script using .NET `System.Drawing` (already on Windows; not added to the project). The script and its parameters are recorded in the code summary so later units reuse them. Target ≤ ~150 KB per photo.
### Theme (shared)
- [ ] **Step 3** — `web/src/theme.ts`: add tokens from the design that later units also need:
- spacing `sectionY` (`clamp(4.5rem, 9vw, 8.5rem)`), `sectionYTight` (60% of it), `gridGap` (`clamp(1rem, 2.2vw, 2rem)`), `sectionHeadGap` (`clamp(2.5rem, 5vw, 4.5rem)`)
- size `contentNarrow` (`820px`)
- text styles `sectionTitle` (Marcellus; 1.85 / 2.125 / 2.5rem, line-height 1.15) and `lead` (1.25rem, weight 300, line-height 1.6)
- duration `reveal` (`0.8s`)
- then run `pnpm typegen`
### Content
- [ ] **Step 4** — `web/src/content/types.ts`: add `ContentImage` and `HomeContent` with the `intro` part only (`{ title, lead, photos: ContentImage[] }`); later units extend `HomeContent`.
- [ ] **Step 5** — Create `web/src/content/homeContent.ts`: title "Lifestyle fotografie", lead "Jouw favoriete momenten, vastgelegd op een natuurlijke en ongedwongen manier.", four photos with width/height 800×1200 and alt texts:
1. "Babyhandje in de hand van de moeder, op een gebreid dekentje"
2. "Moeder drukt haar pasgeboren baby in een gebreid truitje tegen zich aan"
3. "Zwangere vrouw op blote voeten in het zand bij zonsondergang"
4. "Aanstaande vader omarmt zijn zwangere partner in de duinen"
### Shared blocks
- [ ] **Step 6** — `web/src/hooks/useReveal.ts`: returns `{ ref, visible }`; visible immediately when `prefers-reduced-motion: reduce` or `IntersectionObserver` is missing; otherwise observes once (threshold 0.12, rootMargin `0px 0px -60px 0px`, as in the design) and disconnects on reveal and on unmount.
- [ ] **Step 7** — `web/src/hooks/useReveal.test.tsx`: visible without IntersectionObserver (jsdom); visible under reduced motion; hidden until intersecting with a mocked observer, then visible, then unobserved; disconnect on unmount.
- [ ] **Step 8** — `web/src/components/Reveal/Reveal.tsx`: wraps children in a `Box`; opacity 0 + translateY(24px) until visible, transition `reveal` duration with the `smooth` easing; optional `delay` (seconds) for staggering.
- [ ] **Step 9** — `web/src/components/Reveal/Reveal.test.tsx`: children always in the DOM and accessible; visible state without observer.
- [ ] **Step 10** — `web/src/components/SectionHeading/SectionHeading.tsx`: optional eyebrow (`eyebrow` text style, `accent.deep`), h2 with `id` (`sectionTitle` text style), optional lead (`lead` text style, `ink.soft`); `align` center (default, max width 620px, centred) or start; bottom margin `sectionHeadGap`.
- [ ] **Step 11** — `web/src/components/SectionHeading/SectionHeading.test.tsx`: h2 with id, optional eyebrow/lead, axe clean.
- [ ] **Step 12** — `web/src/components/HomeSection/HomeSection.tsx`: `<section aria-labelledby>` with `py="sectionY"` (or `sectionYTight`), `bg` `paper` or `paper.alt` (`tone`), inner `Container` (`content` or `contentNarrow` width), optional `id` and `data-testid`.
- [ ] **Step 13** — `web/src/components/HomeSection/HomeSection.test.tsx`: region named by its heading, tone and width variants render, id passes through.
### The section
- [ ] **Step 14** — `web/src/components/home/IntroGallery/IntroGallery.tsx`: `HomeSection` + `SectionHeading` (in `Reveal`) + grid of four `figure`s, each in a `Reveal` with a staggered delay; 4 columns from `lg`, 2 from `sm`, 1 below; 2nd and 4th photo offset downward from `sm` (design `margin-top`); image `aspectRatio 3/4`, `objectFit cover`, `loading="lazy"`, explicit width/height; slow hover zoom (1.05, `fade` duration), none under reduced motion.
- [ ] **Step 15** — `web/src/components/home/IntroGallery/IntroGallery.test.tsx`: region "Lifestyle fotografie", h2 + lead, four images with their alt texts and lazy loading, works with any number of photos (0 shows only the heading), axe clean.
- [ ] **Step 16** — `web/src/routes/index.tsx`: render `IntroGallery` with `homeContent.intro` after the Hero.
- [ ] **Step 17** — `web/src/app.test.tsx`: the homepage shows the "Lifestyle fotografie" section after the hero, still exactly one h1, axe clean (extend the existing home checks).
### Verification and wrap-up
- [ ] **Step 18** — Run `pnpm check` (lint, format, tests incl. coverage thresholds, build, audits, Lighthouse mobile + desktop). Fix and rerun until green.
- [ ] **Step 19** — Write `aidlc-docs/features/homepage-sections/construction/lifestyle-fotografie/code/code-summary.md`: files created/modified, image script + parameters and resulting sizes, test results, Lighthouse scores, extension compliance.
- [ ] **Step 20** — Commit unit 1 on `feature/homepage-sections` ("Adds the Lifestyle fotografie section to the homepage" + attribution). Not pushed.
## Requirement traceability
| Requirement | Steps |
|---|---|
| FR-HP-02 | 5, 14–17 |
| FR-HP-11 | 6–9, 14 |
| FR-HP-12 | 2, 4, 5 |
| NFR-HP-01 | 10–15, 17, 18 (Lighthouse a11y) |
| NFR-HP-02 | 3, 8–14 |
| NFR-HP-03 | 7, 9, 11, 13, 15, 17, 18 |
| NFR-HP-05 | 2, 14, 18 |
| NFR-HP-06 | 4, 5 |
## Extension compliance (planned)
- **Security**: no new dependencies or external resources (SECURITY-10/13); no input handling; other rules N/A.
- **PBT**: PBT-01 N/A for this unit (no logic); PBT-08/09 unchanged; PBT-10 example-based tests present.