diff --git a/.ai/layout-conventions.md b/.ai/layout-conventions.md index 4c262a1..514f995 100644 --- a/.ai/layout-conventions.md +++ b/.ai/layout-conventions.md @@ -13,7 +13,7 @@ Used by every page except Shell (see exception below): - If a page needs more blocks than the template currently has letters for, add a new letter/color rather than cycling back to `A` — never reuse a color, since that would visually suggest two different blocks are "the same element." A new color's stroke is always its fill at 25% darker (multiply each RGB channel by 0.75, round, convert back to hex), kept in the same style: medium-high saturation, similar lightness to the existing set. - For two sections that sit side-by-side in one row (e.g. Contact's Photo + Contact form), switch that page's diagram to `columns 2`, give full-width blocks a `:2` span, and place the side-by-side pair as plain unspanned nodes next to each other in the code (no composite container needed) — small manual width tweaks to line them up are fine, it only needs to look "good enough." -Current letter → color template (extend with a new letter using the same formula if a 7th block is ever needed): +Current letter → color template (extend with a new letter using the same formula if an 8th block is ever needed): ``` style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px @@ -22,6 +22,7 @@ style C fill:#2a9d8f,stroke:#20766b,color:#fff,font-size:16px,width:400px,height style D fill:#264653,stroke:#1d353e,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style E fill:#e9c46a,stroke:#af9350,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style F fill:#b56576,stroke:#884c59,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px +style G fill:#6d7fcc,stroke:#525f99,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px ``` ## Exception — Shell diff --git a/LAYOUT.md b/LAYOUT.md index 12a734d..23f929a 100644 --- a/LAYOUT.md +++ b/LAYOUT.md @@ -24,8 +24,9 @@ columns 1 B["Highlights"] C["About me"] D["Prices"] - E["Contact"] - F["Instagram"] + E["Testimonials"] + F["Contact"] + G["Instagram"] style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style B fill:#f4a261,stroke:#b77a49,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px @@ -33,6 +34,7 @@ columns 1 style D fill:#264653,stroke:#1d353e,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style E fill:#e9c46a,stroke:#af9350,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style F fill:#b56576,stroke:#884c59,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px + style G fill:#6d7fcc,stroke:#525f99,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px ``` ## About me diff --git a/aidlc-docs/_shared/reverse-engineering/api-documentation.md b/aidlc-docs/_shared/reverse-engineering/api-documentation.md index 266e6be..092fb41 100644 --- a/aidlc-docs/_shared/reverse-engineering/api-documentation.md +++ b/aidlc-docs/_shared/reverse-engineering/api-documentation.md @@ -1,42 +1,67 @@ # API Documentation ## REST APIs -None. The project has no back-end yet. The static design README anticipates these future endpoints on a .NET API: -- `POST /api/contact` — contact form, payload `{ naam, email, onderwerp, bericht }` +None. There is no back-end yet (`api/` is empty). The static design README anticipates these endpoints on a .NET API: +- `POST /api/contact` — contact form, payload `{ naam, email, onderwerp, bericht }` (maps to a C# `ContactRequest` record) - `/api/pages`, `/api/portfolio`, `/api/packages` — CMS content ## Internal APIs ### Routes (TanStack Router, file-based) -| Path | File | Head | Component | -|------|------|------|-----------| -| (root) | `routes/__root.tsx` | `siteHead` | `AppShell` via `RootLayout` | -| `/` | `routes/index.tsx` | `pageHead(...)` | `Hero` | -| `/over-mij` | `routes/over-mij.tsx` | `pageHead(...)` | placeholder | +| Path | File | Head | Component | Indexed | +|------|------|------|-----------|---------| +| (root) | `routes/__root.tsx` | `siteHead(siteContent)` | `AppShell` | — | +| `/` | `routes/index.tsx` | `pageHead('/')` | `Hero` | yes | +| `/over-mij` | `routes/over-mij.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| `/portfolio` | `routes/portfolio.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| `/soorten-fotoshoots` | `routes/soorten-fotoshoots.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| `/contact` | `routes/contact.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| `/privacyverklaring` | `routes/privacyverklaring.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| (not found) | — | — | `NotFound` | — | -### seo.ts -- **Methods**: `pageHead({ title: string, description: string })` → `{ meta: [...] }`; `siteHead` constant -- **Return Types**: TanStack Router `head` option object (title, description, og:title, og:description) +### seo.ts / sitePages.ts / sitemap.ts +- `pageHead(path: RoutePath)` → `{ meta, links }` (title, description, robots noindex if not indexed, OG tags, canonical) +- `siteHead(content: SiteContent)` → `{ meta, scripts }` (OG basics, JSON-LD ProfessionalService) +- `canonicalUrl(path, base?)`, `jsonLdScript(data)`, `professionalService(content)` +- `sitePages: Record`, `pageList(pages)` +- `sitemapXml(...)` — used by `config/sitemapPlugin.ts` ### Components (props) -- `AppShell()` — no props -- `NavigationBar()` — no props; reads route via `useRouterState`, scroll via `useScrolledPast` -- `NavLink(props: ComponentProps)` -- `MobileNav({ id: string, open: boolean, onClose: () => void })` -- `Footer()` — no props -- `LinkButton(props: ChakraLink props & { variant?: 'outline' | 'accent' | 'light' })` -- `Hero({ content: HeroContent })`, `HeroArrows({ onPrev, onNext })`, `HeroSocials({ socials: HeroSocial[] })` +- `AppShell()`, `NavigationBar()`, `BackToTop()`, `NotFound()` — no props +- `MobileNav({ id, open, onClose })`, `NavLink(RouterLink props)` +- `Footer({ content: SiteContent })`, `FooterColumn({ title, children })`, `FooterLink(LinkProps)` +- `Hero({ content: HeroContent, socials: SocialLink[] })`, `HeroArrows({ onPrev, onNext })`, `HeroPauseButton({ stopped, onToggle })`, `HeroSocials({ socials })` +- `PageIntro({ title, eyebrow?, children? })` — renders the page's only h1 +- `StatusPage({ title, children, actions? })`, `ErrorPage({ error, reset })` +- `LinkButton(RouterLink props & { variant?: 'outline' | 'accent' | 'light' })` +- `UmamiAnalytics({ hostname? })` ### Hooks -- `useScrolledPast(getThreshold: () => number): boolean` — `getThreshold` must be referentially stable (it is an effect dependency) -- `useHeroSlider(count: number)` → `{ active, reducedMotion, autoplay, paused, next, prev, handlers }` +- `useHeroSlider(count)` → slider state, controls, handlers, `HeroAnnouncement` +- `useScrolledPast(getThreshold)` → boolean (stable `getThreshold` required) +- `useRouteFocus()` — focuses `
` after navigation + +### Pure helpers (`lib/`) +- `emailAddress({ user, domain }): string | null` +- `visibleSocials(socials): SocialLink[]` — only valid https links +- `copyrightLine(year): string` +- `slidesToLoad(active, count): number[]` +- `backToTopThreshold(viewportHeight): number` + +### Monitoring +- `monitoringFor(hostname): Monitoring | null`, `startSentry(hostname?)`, `reportError(error)` ## Data Models -### NavItem (`navItems.ts`) -- **Fields**: `to` (route path), `label` (Dutch menu label) -- **Validation**: `as const` — `to` must be a registered route for type-safe `Link` - -### HeroContent (`Hero/types.ts`) -- **Fields**: `title`, `tagline`, `cta: { label, to }`, `slides: { id, src, alt }[]`, `socials: { platform, href }[]` -- **Relationships**: `HeroSocial.platform` is a `SocialPlatform` key from `socialPlatforms.ts` -- **Validation**: empty `href` → social not shown +### SiteContent (`content/types.ts`) +- **Fields**: `footerIntro: string`, `socials: SocialLink[]`, `email: EmailAddress` +### SocialLink +- **Fields**: `platform: SocialPlatform` (`facebook` | `instagram`), `href: string` +- **Validation**: shown only if `href` is a valid https URL +### EmailAddress +- **Fields**: `user`, `domain` — assembled only in the browser; invalid parts → hidden +### HeroContent +- **Fields**: `title`, `tagline`, `cta: { label, to }`, `slides: { id, src, alt }[]` +### NavItem (`navigation.ts`) +- **Fields**: `to: RoutePath`, `label: string` +### PageMeta (`sitePages.ts`) +- **Fields**: `title`, `description`, `indexed`, `ogImage?` diff --git a/aidlc-docs/_shared/reverse-engineering/architecture.md b/aidlc-docs/_shared/reverse-engineering/architecture.md index f074cc4..1cadd60 100644 --- a/aidlc-docs/_shared/reverse-engineering/architecture.md +++ b/aidlc-docs/_shared/reverse-engineering/architecture.md @@ -1,79 +1,107 @@ # System Architecture ## System Overview -A single client-side React SPA (`web/`) built with Vite. Routing is file-based via TanStack Router; styling uses Chakra UI v3 with a custom theme system (tokens taken from the static design). There is no back-end, API, database or deployment pipeline yet; the README states a .NET API is planned. Content is currently hard-coded in TypeScript modules shaped so they can later come from that API. +A single client-side React SPA (`web/`) built with Vite. Routing is file-based via TanStack Router; styling uses Chakra UI v3 with a custom system (tokens from the static design). There is no back-end, API or database; `api/` is an empty placeholder for the planned .NET API. Content lives in typed TypeScript modules under `web/src/content/`, shaped so the API can later deliver it 1-to-1. One build serves both environments; the hostname decides whether monitoring is active. ## Architecture Diagram ```mermaid graph TD - Main["main.tsx: ChakraProvider + ThemeProvider + RouterProvider"] --> Root["routes/__root.tsx: HeadContent + AppShell + Devtools"] + Main["main.tsx: Sentry start, router, ChakraProvider"] --> Root["routes/__root.tsx: HeadContent, AppShell, 404 and error components"] Root --> Shell["components/AppShell.tsx"] - Shell --> Nav["NavigationBar (+ NavLink, MobileNav, navItems)"] + Shell --> Skip["SkipNavLink and main landmark"] + Shell --> Nav["NavigationBar (NavLink, MobileNav)"] Shell --> Outlet["Outlet (active page route)"] - Shell --> Footer["Footer (placeholder)"] + Shell --> Footer["Footer (FooterColumn, FooterLink)"] + Shell --> ToTop["BackToTop"] + Shell --> Umami["UmamiAnalytics"] Outlet --> Home["routes/index.tsx: Hero"] - Outlet --> About["routes/over-mij.tsx: placeholder"] - Home --> Hero["Hero (+ HeroArrows, HeroSocials, useHeroSlider)"] - Hero --> Content["heroContent.ts (static content)"] - Nav --> Scroll["hooks/useScrolledPast"] - Theme["theme.ts + recipes/linkButton.ts"] -.-> Main - Seo["seo.ts: pageHead / siteHead"] -.-> Root + Outlet --> Placeholders["over-mij, portfolio, soorten-fotoshoots, contact, privacyverklaring: PageIntro"] + Home --> Hero["Hero (HeroArrows, HeroPauseButton, HeroSocials, useHeroSlider)"] + Content["content/: siteContent, heroContent, types"] -.-> Shell + Content -.-> Home + Nav --> NavData["navigation.ts: mainNav, footerNav"] + Footer --> NavData + Seo["seo.ts + sitePages.ts"] -.-> Root Seo -.-> Home + Theme["theme.ts + recipes/"] -.-> Main classDef entry fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; classDef page fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; class Main,Root entry; - class Shell,Nav,Footer,Outlet shell; - class Home,About,Hero page; - class Content,Scroll,Theme,Seo support; + class Shell,Skip,Nav,Footer,ToTop,Umami,Outlet shell; + class Home,Placeholders,Hero page; + class Content,NavData,Seo,Theme support; ``` -Text alternative: main.tsx mounts providers and the router; the root route renders AppShell (NavigationBar, the active page via Outlet, Footer); the home route renders the Hero; theme and SEO helpers support all of it. +Text alternative: main.tsx starts Sentry and mounts the router; the root route renders AppShell (skip link, NavigationBar, the page via Outlet, Footer, BackToTop, Umami); the home route renders the Hero, the other routes render placeholder PageIntros; content, navigation, SEO and theme modules support all of it. ## Component Descriptions ### main.tsx - **Purpose**: Application bootstrap -- **Responsibilities**: Creates the router, registers types, mounts ChakraProvider (custom system), next-themes ThemeProvider (light only), loads self-hosted fonts, removes static fallback head tags -- **Dependencies**: routeTree.gen.ts, theme.ts +- **Responsibilities**: Starts Sentry (deferred), creates the router (scroll restoration, default error component), mounts ChakraProvider (light only), loads self-hosted fonts, removes static fallback head tags - **Type**: Application ### routes/__root.tsx - **Purpose**: Root route / layout -- **Responsibilities**: Site-wide head tags (`siteHead`), renders `HeadContent`, `AppShell` and router devtools -- **Dependencies**: AppShell, seo.ts +- **Responsibilities**: Site-wide head (`siteHead`: OG basics + JSON-LD), `HeadContent`, `AppShell`, dev-only router devtools, `NotFound` and `ErrorPage` - **Type**: Application ### components/AppShell.tsx -- **Purpose**: Application shell -- **Responsibilities**: Renders NavigationBar, ``, Footer. No `
` landmark, skip link or to-top button yet +- **Purpose**: Application shell (LAYOUT.md "Shell") +- **Responsibilities**: Skip link + `
`, NavigationBar, Outlet, Footer, BackToTop, UmamiAnalytics; moves focus to main on route change (`useRouteFocus`) - **Type**: Application ### components/NavigationBar/ - **Purpose**: Site header and navigation -- **Responsibilities**: Fixed header; transparent over the hero on desktop on `/` until scrolled 150px; shrinks after scroll (desktop); swaps dark/light logo; desktop link list with animated underline (`NavLink`); hamburger button and full-screen `MobileNav` below `lg` (Escape to close, body scroll lock, clip-path reveal). `navItems.ts` is the single menu source (currently Home, Over mij) +- **Responsibilities**: Fixed header, transparent over the hero on desktop until scrolled; shrinks after scroll; logo links home; desktop links and full-screen mobile menu from `mainNav` - **Type**: Application -### components/Footer.tsx +### components/Footer/ - **Purpose**: Site footer -- **Responsibilities**: Placeholder copyright line only; uses Tailwind-style `className`s that have no effect (Tailwind is not installed) +- **Responsibilities**: Logo + intro text, Socials column, Contact column (e-mail assembled in the browser), copyright line, footer menu from `footerNav`; empty columns are omitted - **Type**: Application ### components/Hero/ -- **Purpose**: Homepage hero slider -- **Responsibilities**: Crossfade slides with zoom, progress bar driven autoplay, arrows, swipe, pause on hover/focus/hidden tab, reduced-motion support, social icons. Content typed in `types.ts` for future API use; `socialPlatforms.ts` maps platform keys to offline Iconify icons +- **Purpose**: Homepage hero slider (the only homepage section so far) +- **Responsibilities**: Crossfade slides, progress-driven autoplay, arrows, swipe, pause button, pause on hover/focus/hidden tab, reduced motion, live-region announcements, lazy loading of nearby slides, social icons - **Type**: Application -### theme.ts / recipes/linkButton.ts -- **Purpose**: Design system -- **Responsibilities**: Colour, font, spacing, easing, duration tokens; semantic `bg`/`fg`, `header` size tokens; `eyebrow`/`display` text styles; `linkButton` recipe (outline / accent / light) -- **Type**: Application (shared UI foundation) +### components/PageIntro/, StatusPage/ +- **Purpose**: Shared page building blocks +- **Responsibilities**: `PageIntro` — eyebrow, the page's h1 and an intro (used by placeholders); `StatusPage` — layout for 404 and error pages +- **Type**: Application -### seo.ts -- **Purpose**: Head tag helpers -- **Responsibilities**: `pageHead({title, description})` for route `head` options; `siteHead` for site-wide Open Graph tags -- **Type**: Application (utility) +### content/ +- **Purpose**: Static content until the CMS API exists +- **Responsibilities**: `types.ts` (API-shaped interfaces), `siteContent.ts` (footer intro, socials, e-mail parts), `heroContent.ts` (title, tagline, CTA, slides), `socialPlatforms.ts` (platform → name + offline icon) +- **Type**: Application (data) + +### lib/ +- **Purpose**: Pure, fully tested helpers +- **Responsibilities**: `emailAddress`, `visibleSocials`, `copyrightLine`, `slidesToLoad`, `backToTopThreshold` +- **Type**: Application (utility, 100% coverage threshold) + +### seo.ts, sitePages.ts, sitemap.ts +- **Purpose**: SEO +- **Responsibilities**: Page registry (title, description, `indexed`), `pageHead(path)`, canonical URLs, JSON-LD, sitemap generation at build time (via `config/sitemapPlugin.ts`) +- **Type**: Application (utility, 100% coverage threshold) + +### monitoring/ +- **Purpose**: Error reporting and analytics configuration +- **Responsibilities**: Hostname → environment map, Sentry DSN and origins; Sentry loaded after the load event with a queue +- **Type**: Application + +### config/ (build-time, Node) +- **Purpose**: Server configuration as code +- **Responsibilities**: `securityHeaders.ts` (CSP + headers for dev/preview/prod), `serverConfig.ts` (generates `deploy/iis/web.config` and nginx confs; a test checks they are in sync), sitemap plugin, test seed +- **Type**: Infrastructure-as-code (small) + +### theme.ts / recipes/ +- **Purpose**: Design system +- **Responsibilities**: Colour, font, spacing, easing, duration, z-index tokens; semantic `bg`/`fg`/`focusRing`, `header`/`content`/`pageTop` sizes; `eyebrow`/`display`/`pageTitle` text styles; recipes `container`, `link` (subtle), `linkButton` (outline/accent/light), `iconControl`, `skipNavLink` +- **Type**: Application (shared UI foundation) ## Data Flow @@ -90,18 +118,19 @@ sequenceDiagram V->>R: Open URL or click nav link R->>S: Render root layout S->>P: Render matched route via Outlet - P-->>R: head() title and meta - R-->>V: Updated page and head tags + P-->>R: head() title and meta from sitePages + R-->>V: Updated page, head tags, focus on main ``` -Text alternative: a visitor navigates, the router renders the root layout (AppShell), which renders the matched page through the Outlet; the page's head() supplies title/meta tags. +Text alternative: a visitor navigates, the router renders the root layout (AppShell), which renders the matched page through the Outlet; the page's head() supplies title/meta from the page registry and focus moves to main. ## Integration Points -- **External APIs**: None yet (planned .NET API for content and contact form) +- **External APIs**: None yet (planned .NET API for content and the contact form — design README: `POST /api/contact` with `{ naam, email, onderwerp, bericht }`) - **Databases**: None -- **Third-party Services**: Outbound links only — Facebook, Instagram profiles +- **Third-party Services**: Sentry (errors, EU ingest), Umami at analytics.slpsoftware.nl (cookieless stats), UptimeRobot (availability, external), outbound links to Facebook/Instagram ## Infrastructure Components -- **CDK Stacks**: None -- **Deployment Model**: Not defined yet; output is a static Vite build (`dist/`) +- **IaC**: None beyond generated web server configs in `web/deploy/` +- **Deployment Model**: Static `dist/` build. Test: scp to nginx on a Raspberry Pi (auto on push to master). Production: FTPS to an IIS webhost (manual, `release/*` only, after Lighthouse) +- **Security headers**: Strict CSP — `script-src 'self'` + Umami, `connect-src 'self'` + Umami + Sentry, **`form-action 'self'`**, `frame-ancestors 'none'`. Any third-party form or script endpoint must be added here (and regenerated into the server configs) - **Networking**: N/A diff --git a/aidlc-docs/_shared/reverse-engineering/business-overview.md b/aidlc-docs/_shared/reverse-engineering/business-overview.md index aa97249..c91fb1e 100644 --- a/aidlc-docs/_shared/reverse-engineering/business-overview.md +++ b/aidlc-docs/_shared/reverse-engineering/business-overview.md @@ -7,7 +7,9 @@ graph LR Visitor["Website visitor (prospective client)"] --> Site["Andrea Slop Fotografie website (React SPA)"] Crawler["Search engines and link previews"] --> Site Site --> Social["Facebook and Instagram profiles"] - Site --> Mail["E-mail (info@andreaslop.nl)"] + Site --> Mail["E-mail (mailto, address assembled in the browser)"] + Site --> Umami["Umami (cookieless visitor stats)"] + Site --> Sentry["Sentry (JS error reports)"] Owner["Andrea (photographer, content owner)"] -.-> CMS["Planned .NET API / CMS"] CMS -.-> Site classDef person fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; @@ -16,32 +18,46 @@ graph LR classDef planned fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,stroke-dasharray:5 5,color:#000; class Visitor,Owner,Crawler person; class Site system; - class Social,Mail external; + class Social,Mail,Umami,Sentry external; class CMS planned; ``` -Text alternative: visitors and crawlers use the website, which links out to social profiles and e-mail; a planned .NET API/CMS (dashed) will later supply content managed by Andrea. +Text alternative: visitors and crawlers use the website, which links out to social profiles and e-mail and reports to Umami and Sentry; a planned .NET API/CMS (dashed) will later supply content managed by Andrea. ## Business Description -- **Business Description**: Portfolio and marketing website for Andrea Slop Fotografie, a lifestyle photographer in Huizen (NL). It presents her work (loveshoots, family, pregnancy and newborn shoots), tells who she is, lists shoot types and prices, and gets prospective clients to make contact. It replaces an existing WordPress (Solene theme) site at andreaslop.nl. -- **Business Transactions** (current state — front-end only, no back-end yet): - - **Browse the homepage** — hero slider with featured photos, call-to-action to "Over mij" - - **Navigate between pages** — header navigation (desktop) and hamburger menu (mobile) - - **Visit social profiles** — Facebook / Instagram links in the hero - - **Share / discover pages** — per-page title, meta description and Open Graph tags for search engines and link previews - - *Planned (static design only)*: portfolio browsing with lightbox, shoot types and pricing, contact form, Instagram feed +- **Business Description**: Portfolio and marketing website for Andrea Slop Fotografie, a lifestyle photographer in Huizen (NL). It presents her work (loveshoots, family, pregnancy and newborn shoots), tells who she is, lists shoot types and prices, and gets prospective clients to make contact. It will replace the existing WordPress (Solene theme) site at andreaslop.nl; a test build runs at test.andreaslop.nl. +- **Business Transactions** (current state — front-end only, no back-end): + - **Browse the homepage** — hero slider with featured photos (autoplay, arrows, swipe, pause button, screen reader announcements), call-to-action to "Over mij" + - **Navigate between pages** — header navigation (desktop), full-screen menu (mobile), footer menu, skip link, back-to-top button + - **Visit social profiles** — Facebook / Instagram links in the hero and footer + - **E-mail the photographer** — mailto link in the footer + - **Share / discover pages** — per-page title, description, canonical URL, Open Graph tags, JSON-LD (ProfessionalService), sitemap.xml, robots.txt + - **Recover from errors** — 404 page inside the shell, error page with retry + - *Placeholder pages (noindex)*: Over mij, Portfolio, Soorten fotoshoots, Contact, Privacyverklaring + - *Planned (static design only)*: homepage sections below the hero (lifestyle gallery, about, prices, contact form, Instagram), portfolio with lightbox, shoot types and pricing page, contact page - **Business Dictionary**: - **Shell** — the Header / page content / Footer frame shared by every page (see LAYOUT.md) - **Hero** — full-screen photo slider at the top of the homepage - - **Info menu / side area** — slide-in panel from the design with socials and e-mail (out of scope for this site, by owner decision) + - **Highlights / Lifestyle fotografie** — homepage intro section with a four-photo gallery + - **Package (pakket)** — a priced shoot offer (Newborn, Zwangerschap, Loveshoot) with what is included - **Shoot** — a photo session type (newborn, pregnancy, loveshoot, portraits) - - **CMS** — the planned .NET API that will provide page content; content is hard-coded until then + - **Info menu / side area** — slide-in panel from the design (out of scope, by owner decision) + - **CMS** — the planned .NET API that will provide page content and receive the contact form; content is hard-coded in `web/src/content/` until then + - **Placeholder page** — a route that exists for navigation but shows "in de maak" and is `noindex` ## Component Level Business Descriptions ### web (React front-end) - **Purpose**: The public website visitors see -- **Responsibilities**: Page routing, layout shell, homepage hero, SEO head tags, design system (colours, fonts, buttons) +- **Responsibilities**: Page routing, layout shell, homepage hero, SEO, monitoring, design system, server configuration for test (nginx) and production (IIS) + +### .gitea/workflows (CI/CD) +- **Purpose**: Quality gate and delivery +- **Responsibilities**: Lint, format, tests, build, audit, Lighthouse; deploy to test on merge to master; deploy to production manually from `release/*` ### design/andreaslop-static (reference only) -- **Purpose**: Static HTML/CSS/JS rebuild of the live site, used as the visual and structural source of truth -- **Responsibilities**: Defines page sections, header/footer markup, design tokens and interactions to port to React +- **Purpose**: Static HTML/CSS/JS rebuild of the live site, the visual and structural source of truth +- **Responsibilities**: Defines page sections, markup, design tokens and interactions to port to React + +### api (planned) +- **Purpose**: .NET back-end for content and the contact form +- **Responsibilities**: None yet — the folder is empty diff --git a/aidlc-docs/_shared/reverse-engineering/code-quality-assessment.md b/aidlc-docs/_shared/reverse-engineering/code-quality-assessment.md index 84b1359..3a446c4 100644 --- a/aidlc-docs/_shared/reverse-engineering/code-quality-assessment.md +++ b/aidlc-docs/_shared/reverse-engineering/code-quality-assessment.md @@ -1,26 +1,23 @@ # Code Quality Assessment ## Test Coverage -- **Overall**: None -- **Unit Tests**: None (no test runner installed) -- **Integration Tests**: None -- Verification so far is `tsc` type-checking during `pnpm build` and manual browser checks +- **Overall**: Good. Vitest with v8 coverage; 100% threshold enforced for `src/lib/**`, `src/seo.ts`, `src/sitemap.ts`; other files reported +- **Unit Tests**: Pure helpers, SEO, sitemap, monitoring config, security headers, server config (incl. drift check against `deploy/`) +- **Component Tests**: AppShell, NavigationBar, Footer, Hero (+ slider hook), BackToTop, PageIntro, StatusPage, Umami — with axe accessibility checks +- **Property-based Tests**: fast-check, shared arbitraries in `src/test/arbitraries.ts`, seed logged in CI +- **Integration / E2E**: No browser E2E; Lighthouse CI covers built pages (accessibility, best practices, SEO, performance) ## Code Quality Indicators -- **Linting**: Not configured (TypeScript `noUnused*` flags only) -- **Code Style**: Mostly consistent (Prettier: 4 spaces, single quotes). Exception: `routes/over-mij.tsx` uses double quotes and 2-space indent -- **Documentation**: Good inline comments in Dutch explaining intent; README is a stub +- **Linting**: ESLint (typescript-eslint, react-hooks, jsx-a11y), enforced in CI +- **Code Style**: Consistent, Prettier-enforced in CI +- **Documentation**: Short Dutch comments explaining *why*, often referencing requirement IDs (FR-xx, BR-xx, NFR-xx, Mx) from earlier AI-DLC features ## Technical Debt -- `theme.ts` `globalCss.body.height: '250vh'` — temporary scroll-testing hack; forces every page to be 2.5 screens tall -- `components/Footer.tsx` and `routes/over-mij.tsx` use Tailwind-style `className`s (`p-2`, `text-sm`, …) that do nothing — Tailwind is not installed -- `AppShell` has no `
` landmark; static design has a skip link targeting `#main` -- Header logo is not a link to the homepage (design: link with aria-label) -- Social links are defined inside `Hero/heroContent.ts`; the footer in the design needs the same links → candidate for shared site-level content -- `NavigationBar.tsx` uses `let [open, setOpen]` (should be `const`) -- Unused Vite starter assets: `assets/hero.png`, `assets/typescript.svg`, `assets/vite.svg` -- Design asset `footer-mark.png` (footer logo) not yet present in `web/src/assets` +- Homepage mobile Lighthouse performance target is lowered to 0.8 (images not responsive, title after JavaScript); back to 0.9 is planned with responsive images from the API and prerendering +- Five routes are placeholders (`noindex`); `lighthouserc.cjs` keeps its own list of indexed/noindex paths, guarded by a test against `sitePages.ts` +- Static design images for the homepage sections (intro gallery, about photo, pricing decorations) are not yet in `web/src/assets` +- No responsive image pipeline (srcset/sizes); hero photos are single large JPEGs ## Patterns and Anti-patterns -- **Good Patterns**: design tokens as single source of truth; API-shaped static content; accessible interactions (aria labels, Escape to close, reduced motion, focus-visible handling); shared `navItems` for desktop and mobile -- **Anti-patterns**: no-op `className` usage (see above); global body height hack +- **Good Patterns**: API-shaped content; pure, property-tested helpers; tokens and recipes as single source of truth; configuration as code for headers; strong accessibility baseline (axe in tests, Lighthouse accessibility 1.0) +- **Anti-patterns**: None significant found diff --git a/aidlc-docs/_shared/reverse-engineering/code-structure.md b/aidlc-docs/_shared/reverse-engineering/code-structure.md index 5b4edd6..8e10821 100644 --- a/aidlc-docs/_shared/reverse-engineering/code-structure.md +++ b/aidlc-docs/_shared/reverse-engineering/code-structure.md @@ -1,12 +1,15 @@ # Code Structure ## Build System -- **Type**: npm-compatible via **pnpm** (lockfile `web/pnpm-lock.yaml`) +- **Type**: pnpm (`packageManager: pnpm@12.11.2`, lockfile `web/pnpm-lock.yaml`) - **Configuration**: - - `web/package.json` — scripts `dev` (vite), `build` (`tsc && vite build`), `preview`, `typegen` (Chakra typegen for theme) - - `web/vite.config.js` — TanStack Router plugin (`autoCodeSplitting`) before `@vitejs/plugin-react`; `resolve.tsconfigPaths` - - `web/tsconfig.json` — strict-ish bundler mode, `@/*` → `src/*` alias, `noUnusedLocals/Parameters`, `erasableSyntaxOnly` + - `web/package.json` — scripts `dev`, `build` (`tsc && vite build`), `preview`, `test` (vitest + coverage), `lint`, `format:check`, `audit:deps`, `audit:dev`, `lighthouse`, `server-config`, and `check` (all of them in sequence) + - `web/vite.config.ts` — TanStack Router plugin (`autoCodeSplitting`) before React plugin, sitemap plugin, security headers on dev/preview, Vitest config (jsdom, 20 s timeout, 100% coverage threshold for `src/lib/**`, `seo.ts`, `sitemap.ts`) + - `web/tsconfig.json` — bundler mode, `@/*` → `src/*` + - `web/eslint.config.js` — JS + typescript-eslint + react-hooks + jsx-a11y recommended - `web/.prettierrc` — 4 spaces, single quotes, semicolons + - `web/lighthouserc.cjs` / `.desktop.cjs` — Lighthouse CI against `pnpm preview` (accessibility and best practices 1.0, performance 0.9; home mobile 0.8) + - `.gitea/workflows/continuous_integration.yaml` — jobs `check`, `deploy-test`, `lighthouse`, `deploy-production` ## Key Classes/Modules @@ -14,80 +17,97 @@ graph TD Root["routes/__root.tsx"] --> AppShell["components/AppShell.tsx"] AppShell --> NavigationBar["NavigationBar/NavigationBar.tsx"] - AppShell --> Footer["components/Footer.tsx"] + AppShell --> Footer["Footer/Footer.tsx"] + AppShell --> BackToTop["BackToTop/BackToTop.tsx"] + AppShell --> Umami["Analytics/UmamiAnalytics.tsx"] NavigationBar --> NavLink["NavigationBar/NavLink.tsx"] NavigationBar --> MobileNav["NavigationBar/MobileNav.tsx"] - NavigationBar --> navItems["NavigationBar/navItems.ts"] - MobileNav --> navItems - NavigationBar --> useScrolledPast["hooks/useScrolledPast.tsx"] + NavigationBar --> navigation["navigation.ts"] + Footer --> navigation Index["routes/index.tsx"] --> Hero["Hero/Hero.tsx"] Hero --> HeroArrows["Hero/HeroArrows.tsx"] + Hero --> HeroPause["Hero/HeroPauseButton.tsx"] Hero --> HeroSocials["Hero/HeroSocials.tsx"] Hero --> useHeroSlider["Hero/useHeroSlider.ts"] Hero --> LinkButton["components/LinkButton.tsx"] - HeroSocials --> socialPlatforms["Hero/socialPlatforms.ts"] + LinkButton --> RouterLink["components/RouterLink.tsx"] + Placeholder["routes/contact.tsx and other placeholders"] --> PageIntro["PageIntro/PageIntro.tsx"] classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; classDef page fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; classDef util fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; - class Root,AppShell,NavigationBar,Footer,NavLink,MobileNav shell; - class Index,Hero,HeroArrows,HeroSocials page; - class navItems,useScrolledPast,useHeroSlider,LinkButton,socialPlatforms util; + class Root,AppShell,NavigationBar,Footer,BackToTop,Umami,NavLink,MobileNav shell; + class Index,Hero,HeroArrows,HeroPause,HeroSocials,Placeholder,PageIntro page; + class navigation,useHeroSlider,LinkButton,RouterLink util; ``` -Text alternative: the root route renders AppShell (NavigationBar with NavLink/MobileNav/navItems, plus Footer); the index route renders Hero with its arrows, socials, slider hook and the shared LinkButton. +Text alternative: the root route renders AppShell (NavigationBar, Footer, BackToTop, Umami); NavigationBar and Footer read navigation.ts; the index route renders the Hero with its sub-components and LinkButton; placeholder routes render PageIntro. ### Existing Files Inventory -- `web/index.html` — HTML entry; static fallback title/meta for non-JS crawlers (`data-fallback`) -- `web/src/main.tsx` — bootstrap: providers, router, fonts, removes fallback head tags -- `web/src/routeTree.gen.ts` — generated by TanStack Router plugin (do not edit) -- `web/src/routes/__root.tsx` — root layout route, site-wide head -- `web/src/routes/index.tsx` — home page (`/`), renders Hero -- `web/src/routes/over-mij.tsx` — about page (`/over-mij`), placeholder content -- `web/src/components/AppShell.tsx` — shell: NavigationBar + Outlet + Footer -- `web/src/components/Footer.tsx` — placeholder footer -- `web/src/components/LinkButton.tsx` — router `Link` styled with `linkButton` recipe -- `web/src/components/NavigationBar/NavigationBar.tsx` — header, logo, desktop nav, hamburger -- `web/src/components/NavigationBar/NavLink.tsx` — desktop nav link with underline animation -- `web/src/components/NavigationBar/MobileNav.tsx` — full-screen mobile menu -- `web/src/components/NavigationBar/navItems.ts` — menu items (Home, Over mij) -- `web/src/components/Hero/*` — hero slider (component, arrows, socials, hook, content, types, platforms) -- `web/src/hooks/useScrolledPast.tsx` — boolean "scrolled past threshold" hook -- `web/src/recipes/linkButton.ts` — Chakra recipe for the square design button -- `web/src/theme.ts` — Chakra system config (tokens, semantic tokens, text styles, recipes) -- `web/src/seo.ts` — `pageHead` / `siteHead` helpers -- `web/src/assets/*` — hero photos, light/dark logos, unused Vite starter assets (`hero.png`, `typescript.svg`, `vite.svg`) -- `web/public/favicon.png`, `web/public/icons.svg` — static public assets +Candidates for modification are marked with ★ for the homepage-sections feature. +- `web/index.html` — HTML entry; static fallback head for non-JS crawlers +- `web/src/main.tsx` — bootstrap +- `web/src/routeTree.gen.ts` — generated (do not edit) +- `web/src/routes/__root.tsx` — root layout, site head, 404/error +- ★ `web/src/routes/index.tsx` — home (`/`), currently only the Hero +- `web/src/routes/{over-mij,portfolio,soorten-fotoshoots,contact,privacyverklaring}.tsx` — placeholders with `PageIntro` +- `web/src/components/AppShell.tsx` — shell +- `web/src/components/NavigationBar/*` — header, NavLink, MobileNav +- `web/src/components/Footer/*` — footer, FooterColumn, FooterLink +- `web/src/components/Hero/*` — hero slider, arrows, pause button, socials, slider hook +- `web/src/components/BackToTop/BackToTop.tsx` — back-to-top button +- `web/src/components/Analytics/UmamiAnalytics.tsx` — Umami script injection +- `web/src/components/PageIntro/PageIntro.tsx` — page head block (eyebrow, h1, intro) +- `web/src/components/StatusPage/*` — StatusPage layout, NotFound, ErrorPage +- `web/src/components/LinkButton.tsx`, `RouterLink.tsx` — router links (button style / Chakra-wrapped) +- ★ `web/src/content/types.ts` — content interfaces (API shape) +- ★ `web/src/content/siteContent.ts`, `heroContent.ts`, `socialPlatforms.ts` — static content +- `web/src/hooks/useRouteFocus.ts`, `useScrolledPast.tsx` +- `web/src/lib/*.ts` — pure helpers with tests +- `web/src/monitoring/*` — Sentry/Umami config and loader +- `web/src/navigation.ts` — `RoutePath`, `mainNav`, `footerNav` +- ★ `web/src/seo.ts`, `sitePages.ts`, `sitemap.ts` — SEO (home description may change) +- `web/src/theme.ts`, `web/src/recipes/*.ts` — design system +- `web/src/test/*` — `renderWithProviders`, axe matcher, fast-check arbitraries, setup +- `web/src/assets/*` — hero photos (8), light/dark logos +- ★ `web/config/securityHeaders.ts` — CSP (only if the contact form posts to a third party) +- `web/config/serverConfig.ts`, `writeServerConfig.ts`, `sitemapPlugin.ts`, `testSeed.ts` +- `web/deploy/iis/web.config`, `web/deploy/nginx/*.conf` — generated server configs +- `web/public/*` — favicon, logo, og-image, robots.txt, icons.svg ## Design Patterns -### Chakra `chakra()` factory around router `Link` -- **Location**: NavLink, MobileNav, LinkButton -- **Purpose**: Router-aware links with Chakra style props and `_currentPage` / `aria-current` styling -- **Implementation**: `const ChakraLink = chakra(Link)` +### API-shaped static content +- **Location**: `content/types.ts` + `content/*.ts` +- **Purpose**: Hard-coded today, swappable for API responses later +- **Implementation**: Plain data objects typed with interfaces, passed to components as props from the route (or AppShell) + +### Pure helpers with property-based tests +- **Location**: `lib/`, `seo.ts`, `sitemap.ts` +- **Purpose**: Logic that decides what is shown (e.g. invalid social → hidden, invalid e-mail → column omitted) lives outside components and is tested with fast-check +- **Implementation**: Small exported functions, 100% coverage threshold, shared arbitraries in `test/arbitraries.ts` ### Design tokens + recipes -- **Location**: theme.ts, recipes/ +- **Location**: `theme.ts`, `recipes/` - **Purpose**: Single source for colours, fonts, spacing, motion; reusable component variants - **Implementation**: `defineConfig` tokens/semanticTokens/textStyles, `defineRecipe` + `useRecipe` -### API-shaped static content -- **Location**: Hero/heroContent.ts + types.ts, navItems.ts -- **Purpose**: Hard-coded content today, swappable for CMS API responses later -- **Implementation**: Plain data objects typed with interfaces; components receive them as props +### Page registry +- **Location**: `sitePages.ts`, typed by `RoutePath` +- **Purpose**: One source for head tags and the sitemap; `indexed: false` for placeholders -### Route-level head management -- **Location**: seo.ts, each route's `head` option, `HeadContent` in root -- **Purpose**: Per-page SEO without SSR +### Configuration as code for hosting +- **Location**: `config/securityHeaders.ts` → `config/serverConfig.ts` → `deploy/` +- **Purpose**: Same headers in dev, preview, nginx (test) and IIS (production); a test guards drift + +### Accessibility by default +- **Location**: across components; `test/axe.ts` in component tests; Lighthouse in CI +- **Implementation**: landmarks, skip link, focus management, live regions, visible focus ring, 44px targets, reduced motion ## Critical Dependencies -### @chakra-ui/react -- **Version**: ^3.37.0 -- **Usage**: All layout and styling -- **Purpose**: Component library and styling system -### @tanstack/react-router (+ router-plugin) -- **Version**: ^1.170.39 / ^1.168.40 -- **Usage**: File-based routes, `Link`, `Outlet`, `HeadContent`, `useRouterState` -- **Purpose**: Routing and head management -### @iconify/react + @iconify-icons/ant-design -- **Version**: ^6.0.2 / 2.0.1 -- **Usage**: Offline icons in Hero -- **Purpose**: Icons bundled at build time (no API calls) +### @chakra-ui/react ^3.37.0 +- **Usage**: All layout and styling; typegen from `theme.ts` on install +### @tanstack/react-router ^1.170.39 (+ router-plugin ^1.168.40) +- **Usage**: File-based routes, `Link`, `Outlet`, `HeadContent`, typed `RoutePath` +### @sentry/react ^11.8.0 +- **Usage**: Error reporting, lazy-loaded after the load event +### @iconify/react ^6.0.2 + @iconify-icons/ant-design 2.0.1 +- **Usage**: Offline icons (bundled at build time) diff --git a/aidlc-docs/_shared/reverse-engineering/component-inventory.md b/aidlc-docs/_shared/reverse-engineering/component-inventory.md index e1ae827..4b2e9a3 100644 --- a/aidlc-docs/_shared/reverse-engineering/component-inventory.md +++ b/aidlc-docs/_shared/reverse-engineering/component-inventory.md @@ -4,21 +4,23 @@ - `web` — React 19 SPA (Vite, Chakra UI v3, TanStack Router): the public website ## Infrastructure Packages -- None (no IaC, Docker, or CI/CD configuration present) +- `.gitea/workflows/continuous_integration.yaml` — Gitea Actions CI/CD (check, lighthouse, deploy-test, deploy-production) +- `web/config/` + `web/deploy/` — security headers and generated nginx (test) / IIS (production) configuration ## Shared Packages -- None as separate packages. Inside `web`, shared modules are `theme.ts`, `recipes/`, `seo.ts`, `hooks/`, `components/LinkButton.tsx` +- None as separate packages. Inside `web`: `theme.ts`, `recipes/`, `content/`, `lib/`, `seo.ts`, `navigation.ts`, `hooks/`, `components/LinkButton.tsx`, `components/RouterLink.tsx`, `components/PageIntro/` ## Test Packages -- None +- None as separate packages. Tests are co-located (`*.test.ts(x)`) and run with Vitest (unit, component, property-based with fast-check, accessibility with axe-core); Lighthouse CI for quality budgets ## Reference (non-code) - `design/andreaslop-static` — static HTML/CSS/JS design reference (not built or deployed) - `design/AndreaSlopFotografie_React.zip` — archive of design files +- `api/` — empty placeholder for the planned .NET API ## Total Count -- **Total Packages**: 1 +- **Total Packages**: 1 (plus CI workflow and server config) - **Application**: 1 -- **Infrastructure**: 0 +- **Infrastructure**: 1 (CI/CD + server config, inside the repo) - **Shared**: 0 -- **Test**: 0 +- **Test**: 0 (co-located) diff --git a/aidlc-docs/_shared/reverse-engineering/dependencies.md b/aidlc-docs/_shared/reverse-engineering/dependencies.md index be326f4..0934c67 100644 --- a/aidlc-docs/_shared/reverse-engineering/dependencies.md +++ b/aidlc-docs/_shared/reverse-engineering/dependencies.md @@ -4,51 +4,51 @@ ```mermaid graph LR - routes["routes/*"] --> components["components/*"] - routes --> seo["seo.ts"] + main["main.tsx"] --> theme["theme.ts + recipes"] + main --> routes["routes/*"] + main --> monitoring["monitoring/*"] + routes --> components["components/*"] + routes --> content["content/*"] + routes --> seo["seo.ts + sitePages.ts"] + components --> lib["lib/*"] components --> hooks["hooks/*"] - components --> theme["theme.ts tokens (via Chakra props)"] + components --> navigation["navigation.ts"] components --> assets["assets/*"] - main["main.tsx"] --> theme - main --> routes + config["config/* (Node, build time)"] --> monitoring + config --> seo classDef app fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; + classDef build fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; class main,routes,components app; - class seo,hooks,theme,assets support; + class theme,monitoring,content,seo,lib,hooks,navigation,assets support; + class config build; ``` -Text alternative: main depends on theme and routes; routes depend on components and seo; components depend on hooks, theme tokens and assets. +Text alternative: main depends on theme, routes and monitoring; routes depend on components, content and SEO; components depend on lib, hooks, navigation and assets; build-time config reads monitoring (CSP origins) and SEO (sitemap). -### routes depend on components +### routes depend on content and components - **Type**: Compile -- **Reason**: Routes render AppShell (root) and page components +- **Reason**: Routes pass static content objects into components as props + +### config depends on monitoring/config.ts +- **Type**: Build time (Node) +- **Reason**: CSP `script-src`/`connect-src` include the Umami and Sentry origins; that file therefore has no Vite imports ### components depend on theme tokens -- **Type**: Runtime (string token references such as `bg="paper"`, `h="header"`) -- **Reason**: All visual values come from the Chakra system +- **Type**: Runtime (string token references such as `bg="paper.alt"`, `textStyle="eyebrow"`) ## External Dependencies -### @chakra-ui/react -- **Version**: ^3.37.0 -- **Purpose**: Styling system and UI primitives -- **License**: MIT -### @tanstack/react-router -- **Version**: ^1.170.39 -- **Purpose**: Routing -- **License**: MIT -### react / react-dom -- **Version**: ^19.3.0 -- **Purpose**: UI runtime -- **License**: MIT -### next-themes -- **Version**: ^0.4.6 -- **Purpose**: Colour mode -- **License**: MIT -### @iconify/react, @iconify-icons/ant-design -- **Version**: ^6.0.2, 2.0.1 -- **Purpose**: Icons -- **License**: MIT (icons: Ant Design, MIT) -### @fontsource/jost, @fontsource/marcellus -- **Version**: ^5.3.0 -- **Purpose**: Self-hosted web fonts -- **License**: OFL-1.1 +### @chakra-ui/react ^3.37.0, @emotion/react ^11.14.0 +- **Purpose**: Styling system and UI primitives — **License**: MIT +### @tanstack/react-router ^1.170.39 +- **Purpose**: Routing — **License**: MIT +### react / react-dom ^19.3.0 +- **Purpose**: UI runtime — **License**: MIT +### @sentry/react ^11.8.0 +- **Purpose**: Error reporting — **License**: MIT +### @fontsource/jost, @fontsource/marcellus ^5.3.0 +- **Purpose**: Self-hosted fonts — **License**: OFL-1.1 +### @iconify/react ^6.0.2, @iconify-icons/ant-design 2.0.1 (dev) +- **Purpose**: Icons, bundled at build time — **License**: MIT +### Dev tooling +- Vite, Vitest, Testing Library, fast-check, axe-core, ESLint, Prettier, Lighthouse CI, Chakra CLI — all MIT/Apache-2.0/MPL-2.0 (axe-core) diff --git a/aidlc-docs/_shared/reverse-engineering/reverse-engineering-timestamp.md b/aidlc-docs/_shared/reverse-engineering/reverse-engineering-timestamp.md index 322cecb..10d73a9 100644 --- a/aidlc-docs/_shared/reverse-engineering/reverse-engineering-timestamp.md +++ b/aidlc-docs/_shared/reverse-engineering/reverse-engineering-timestamp.md @@ -1,10 +1,11 @@ # Reverse Engineering Metadata -**Analysis Date**: 2026-10-14T09:58:04Z +**Analysis Date**: 2026-10-19T19:19:38Z (refresh; previous analysis 2026-10-14T09:58:04Z at 8f5841c) **Analyzer**: AI-DLC -**Workspace**: C:\Users\bdslo\Documents\Development\AndreaSlopFotografie -**Codebase Commit**: 8f5841c (branch feature/hero-slider-and-navigation) -**Total Files Analyzed**: 30 (web/src, web config files, design/andreaslop-static shell markup and README) +**Workspace**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie +**Codebase Commit**: 38c5c3e (branch master) +**Total Files Analyzed**: ~95 (web/src, web/config, web/deploy, web config files, CI workflow, design/andreaslop-static pages and README) +**Refreshed for**: feature homepage-sections ## Artifacts Generated - [x] business-overview.md diff --git a/aidlc-docs/_shared/reverse-engineering/technology-stack.md b/aidlc-docs/_shared/reverse-engineering/technology-stack.md index 0ca9cee..4238e48 100644 --- a/aidlc-docs/_shared/reverse-engineering/technology-stack.md +++ b/aidlc-docs/_shared/reverse-engineering/technology-stack.md @@ -1,28 +1,37 @@ # Technology Stack ## Programming Languages -- TypeScript — ~6.0.2 — all application code (TSX) +- TypeScript — ~6.0.2 — all application, config and test code (TSX) - HTML/CSS/JS — design reference only (`design/andreaslop-static`) - C# / .NET — planned back-end (not present) ## Frameworks - React — ^19.3.0 — UI - Chakra UI — ^3.37.0 (+ @emotion/react ^11.14.0) — styling system and components -- TanStack Router — ^1.170.39 — file-based routing, head management (devtools ^1.167.2) -- next-themes — ^0.4.6 — colour mode provider (fixed to light) +- TanStack Router — ^1.170.39 — file-based routing, head management (devtools ^1.167.2, dev only) - @fontsource/jost, @fontsource/marcellus — ^5.3.0 — self-hosted fonts - @iconify/react ^6.0.2 + @iconify-icons/ant-design 2.0.1 — offline icons +- @sentry/react — ^11.8.0 — error reporting ## Infrastructure -- None yet; static build output suitable for any static host +- Gitea Actions — CI/CD (runners: Raspberry Pi arm64 and a pc) +- nginx on Raspberry Pi — test environment (test.andreaslop.nl) +- IIS at a webhost via FTPS — production (andreaslop.nl) +- Sentry (SaaS, EU), Umami (self-hosted, analytics.slpsoftware.nl), UptimeRobot — monitoring ## Build Tools - Vite — ^8.3.0 — dev server and bundler -- @vitejs/plugin-react — ^6.1.1 +- @vitejs/plugin-react — ^6.1.2 - @tanstack/router-plugin — ^1.168.40 — route tree generation, code splitting - @chakra-ui/cli — ^3.37.0 — theme typegen -- pnpm — package manager -- Prettier — ^3.9.9 — formatting +- pnpm — 12.11.2 — package manager +- Node — 24 (CI) -## Testing Tools -- None configured (no test runner, no linter such as ESLint) +## Quality and Testing Tools +- Vitest ^5.0.5 + @vitest/coverage-v8 — unit and component tests, coverage thresholds +- @testing-library/react ^16.3.3, user-event, jest-dom, jsdom ^30.1.3 +- fast-check ^4.10.2 — property-based tests +- axe-core ^4.14.0 — accessibility checks in component tests +- ESLint ^9.39.5 + typescript-eslint, react-hooks, jsx-a11y +- Prettier ^3.9.9 +- @lhci/cli ^0.15.1 — Lighthouse CI (mobile and desktop) diff --git a/aidlc-docs/active-features.md b/aidlc-docs/active-features.md index 490ca3d..bae5d6e 100644 --- a/aidlc-docs/active-features.md +++ b/aidlc-docs/active-features.md @@ -4,3 +4,4 @@ |------|------|--------|--------|---------------------|---------------| | Bug | [hero-carousel-announce-and-pause](bugs/hero-carousel-announce-and-pause/bug-fix.md) | ✅ Complete | fix/hero-carousel-announce-and-pause | web/src/components/Hero (Hero, HeroArrows, useHeroSlider) | 2026-10-19 | | Feature | frontend-shell | ✅ Complete | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 | +| Feature | homepage-sections | ✅ Complete | feature/homepage-sections | web/src/routes/index.tsx, new homepage section components, web/src/content (types + static content), possibly web/config/securityHeaders.ts (contact form) | 2026-10-19 | diff --git a/aidlc-docs/features/homepage-sections/aidlc-state.md b/aidlc-docs/features/homepage-sections/aidlc-state.md new file mode 100644 index 0000000..b5ff94b --- /dev/null +++ b/aidlc-docs/features/homepage-sections/aidlc-state.md @@ -0,0 +1,82 @@ +# AI-DLC State Tracking + +## Project Information +- **Feature Name**: Homepage sections below the hero (Lifestyle photography, About me, Prices, Lieve woorden, Contact, Instagram) +- **Feature Slug**: homepage-sections +- **Project Type**: Brownfield +- **Start Date**: 2026-10-19T19:19:38Z +- **Current Stage**: Complete +- **Branch**: feature/homepage-sections + +## Workspace State +- **Existing Code**: Yes +- **Programming Languages**: TypeScript (React/TSX) +- **Build System**: pnpm + Vite (`tsc && vite build`), Gitea Actions CI +- **Project Structure**: Single front-end SPA in `web/`; static HTML design reference in `design/andreaslop-static/`; `api/` folder present but empty (.NET back-end planned) +- **Reverse Engineering Needed**: Yes (refresh — artifacts stale since commit 8f5841c) +- **Workspace Root**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie + +## Code Location Rules +- **Application Code**: Workspace root (NEVER in aidlc-docs/) — front-end lives in `web/` +- **Feature Documentation**: aidlc-docs/features/homepage-sections/ only +- **Shared Artifacts**: aidlc-docs/_shared/ +- **Structure patterns**: See code-generation.md Critical Rules + +## Language Configuration +- **Documentation Language**: English +- **Conversation Language**: User Language (Dutch) +- **Source**: inherited from aidlc-docs/language-preference.md (answer A); user may override + +## Extension Configuration +| Extension | Enabled | Decided At | +|---|---|---| +| Security Baseline | Yes | Requirements Analysis | +| Property-Based Testing | Yes (full enforcement) | Requirements Analysis | + +## Operations Configuration +- **Include Operations Phase**: No +- **Decided At**: Build and Test + +## Scope Notes (from user) +- One feature, one unit per homepage block: Lifestyle photography, About me, Prices, Lieve woorden (testimonials, new — from the live site), Contact, Instagram +- Contact form: built with anti-spam and a robot check, but covered by an overlay ("coming soon, e-mail info@andreaslop.nl for now") until the API exists +- Lieve woorden: user asked for a design proposal, possibly added to design/andreaslop-static +- Hero already exists and is out of scope + +## Execution Plan Summary +- **Stages to Execute**: Application Design (incl. static design update, FR-HP-01), Units Generation, Functional Design (Prijzen, Lieve woorden, Contact), Code Generation (6 units), Build and Test +- **Stages to Skip**: User Stories (single persona), Functional Design for Lifestyle fotografie / Over mij / Instagram (presentational), NFR Requirements (NFRs set at requirements level), NFR Design (no new patterns), Infrastructure Design (no infrastructure changes) +- **Operations**: No (decided at Build and Test) +- **Delivery**: one branch feature/homepage-sections, commits per unit, one PR at the end; full `pnpm check` (incl. Lighthouse) after each unit +- **Unit order**: 1 Lifestyle fotografie (+ shared blocks) → 2 Over mij → 3 Prijzen → 4 Lieve woorden → 5 Contact → 6 Instagram + +## Stage Progress + +### 🔵 INCEPTION PHASE +- [x] Workspace Detection +- [x] Reverse Engineering (refresh, approved) +- [x] Requirements Analysis (approved) +- [x] User Stories - SKIP (single visitor persona, concrete FRs) +- [x] Workflow Planning (approved) +- [x] Application Design - EXECUTE (approved) +- [x] Units Generation - EXECUTE (approved) + +### 🟢 CONSTRUCTION PHASE +- [x] Functional Design - EXECUTE (Prijzen ✅, Lieve woorden ✅, Contact ✅) / SKIP (Lifestyle fotografie, Over mij, Instagram) +- [x] NFR Requirements - SKIP +- [x] NFR Design - SKIP +- [x] Infrastructure Design - SKIP +- [x] Code Generation - EXECUTE (per unit) — Unit 1 Lifestyle fotografie ✅, Unit 2 Over mij ✅ (desktop review deferred by user), Unit 3 Prijzen ✅, Unit 4 Lieve woorden ✅, Unit 5 Contact ✅, Unit 6 Instagram ✅ +- [x] Build and Test - EXECUTE + +### 🟡 OPERATIONS PHASE +- [x] Deployment Setup, Monitoring Setup, Production Readiness Validation - SKIP (declined at Build and Test) + +## Current Status +- **Lifecycle Phase**: Complete +- **Current Stage**: Complete (Operations declined at Build and Test) +- **Next Stage**: none — merge PR #6 + +## Reverse Engineering Status +- [x] Reverse Engineering - Artifacts refreshed on 2026-10-19T19:19:38Z at commit 38c5c3e (approved 2026-10-19T19:31:00Z) +- **Artifacts Location**: aidlc-docs/_shared/reverse-engineering/ diff --git a/aidlc-docs/features/homepage-sections/audit.md b/aidlc-docs/features/homepage-sections/audit.md new file mode 100644 index 0000000..af3214c --- /dev/null +++ b/aidlc-docs/features/homepage-sections/audit.md @@ -0,0 +1,919 @@ +# AI-DLC Audit Log — homepage-sections + +## Initial User Request + +**Timestamp**: 2026-10-19T19:19:38Z + +**User Input**: "Ik wil met aidlc de homepage toe gaan voegen. De Hero staat er al, maar de 4 blokken eronder nog niet. Die wil ik in 1 feature opppakken met elk blok als een losse unit. Voor de duidleijkheid. De 4 blokken zijn: +1. Lifestyle fotografie +2. Over mij +3. Prijzen +4. Contact + +Nou is het nog een statische site zonder back-end dus het contactformulier kan nog niet functioneel gemaakt worden dus ik hoor graag een suggestie hoe ik dit tijdelijk kan oplossen totdat we een API hebben." + +**AI Response**: "Started AI-DLC workflow (existing multi-feature workspace, no welcome message). Began Workspace Detection." + +**Context**: INCEPTION - Workspace Detection (start) + +--- + +## Workspace Detection + +**Timestamp**: 2026-10-19T19:19:38Z + +**User Input**: (none — automatic stage) + +**AI Response**: "Feature resolution: all existing items (frontend-shell, hero-carousel-announce-and-pause) are ✅ Complete and the request is clearly new work, so a new feature was started without a feature-selection prompt. Classification: Feature (new user-facing sections, no defect). Slug: homepage-sections. Brownfield (React SPA in web/). Language configuration inherited from aidlc-docs/language-preference.md (answer A: English docs, Dutch conversation) and stated to the user for correction instead of re-asking. Reverse engineering artifacts in _shared/ are stale: generated at commit 8f5841c (2026-10-14), before the front-end shell, CI/CD, monitoring and the hero fix landed (HEAD 38c5c3e). Next: refresh Reverse Engineering." + +**Context**: INCEPTION - Workspace Detection (complete). Parallel features: none active. Conflicts: none. + +--- + +## Reverse Engineering (refresh) + +**Timestamp**: 2026-10-19T19:19:38Z + +**User Input**: (none — automatic stage) + +**AI Response**: "Refreshed all eight artifacts in aidlc-docs/_shared/reverse-engineering/ against commit 38c5c3e: CI/CD (Gitea Actions, test on Pi nginx, production FTPS to IIS), monitoring (Sentry, Umami), complete shell (footer, skip link, back-to-top, 404/error), content/ modules, pure lib/ helpers with property-based tests, page registry and sitemap, security headers as code. Key finding for this feature: CSP has form-action 'self' and connect-src limited to self/Umami/Sentry, so a third-party contact form endpoint requires a CSP change in web/config/securityHeaders.ts plus regenerated server configs. LAYOUT.md Home lists six blocks (Hero, Highlights, About me, Prices, Contact, Instagram); the user named four — Instagram is to be confirmed in requirements questions. Design images for the four blocks exist in design/andreaslop-static/assets/img. Presented completion message and awaited approval." + +**Context**: INCEPTION - Reverse Engineering (complete, awaiting approval) + +--- + +## Reverse Engineering — User Response + +**Timestamp**: 2026-10-19T19:31:00Z + +**User Input**: "Oh je hebt gelijk. Die Instagram-module moet er ook komen, die ben ik gewoon vergeten. Sterker nog. In het design staat het niet, want het is later op de live werbsite gekomen. Op de huidige website op https://andreaslop.nl/ is het blok \"Lieve woorden\" erbij gekomen. Zou je daar ook een voorstel voor design kunnen doen? Eventueel verwerken in het design in deze workspace?. Voor het formulier moet er inderdaad ook nog anti-spam inkomen en een robot check. Misschien kunnen we voor het formulier wel bouwen, maar dan een overlay er overheen met een tekst dat die binnenkort komt en dta je voor nu een email moet sturen naar info@andreaslop.nl?" + +**AI Response**: "Treated as implicit approval of the Reverse Engineering refresh (no changes requested to the analysis). Scope extended: Instagram block added; new 'Lieve woorden' (testimonials) block from the live site added, needing a design proposal and possibly an update to design/andreaslop-static. Contact form: build it with anti-spam and a robot check, covered by an overlay saying the form is coming soon and to e-mail info@andreaslop.nl for now. Proceeding to Requirements Analysis; inspecting the live site's 'Lieve woorden' block first." + +**Context**: INCEPTION - Reverse Engineering approved; scope change recorded + +--- + +## Requirements Analysis — Clarifying Questions + +**Timestamp**: 2026-10-19T20:07:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Inspected live andreaslop.nl: 'Lieve Woorden' is an owl-slider testimonial widget (photo, shoot-type title, text, author) with two reviews; live prices differ from the static design (Zwangerschap 175, Newborn 185, Gezin 175, richer inclusions); live form has a shoot-type select (Zwangerschap/Newborn/Familie/Overig) instead of a free-text subject plus a honeypot; live Instagram widget is broken. Created inception/requirements/requirement-verification-questions.md with 16 content questions plus the Security, PBT and Operations opt-in questions (Dutch, matching the previous feature's question files). Depth: Standard." + +**Context**: INCEPTION - Requirements Analysis (awaiting answers) + +--- + +## Requirements Analysis — Answers Received + +**Timestamp**: 2026-10-19T20:40:00Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Read answers: Q1–Q13 A, Q11 A with note 'Als we het er dan toch inbouwen dan kan ik het later ook makkelijk uitzetten mocht dat nodig zijn.', Q14 B (Friendly Captcha), Q15 A, Q16 A, Security Baseline A, PBT A, Operations C. No contradictions or ambiguities found. Loaded security-baseline.md and property-based-testing.md (opted in). Generated inception/requirements/requirements.md (12 functional, 6 non-functional requirements, extension compliance tables). Recorded extension and operations configuration in aidlc-state.md. User Stories proposed to be skipped (single visitor persona, concrete requirements). Presented completion message and awaited approval." + +**Context**: INCEPTION - Requirements Analysis (complete, awaiting approval) + +--- + +## Requirements Analysis — Change Request + +**Timestamp**: 2026-10-19T20:48:00Z + +**User Input**: "NFR-HP-02: Code comments wil ik liever in het Engels." + +**AI Response**: "Updated NFR-HP-02: code comments in English for all new code, including new comments in existing files; existing Dutch comments are not translated in this feature; visitor-facing texts stay Dutch. Re-presented the completion message." + +**Context**: INCEPTION - Requirements Analysis (change applied, awaiting approval) + +--- + +## Requirements Analysis — Approval + +**Timestamp**: 2026-10-19T20:52:00Z + +**User Input**: "Ga verder naar de volgende stage" + +**AI Response**: "Requirements approved; User Stories skipped (user did not choose 'Add User Stories'). The question whether English code comments should become a standing preference for future features was not answered; treated as applying to this feature only. Proceeding to Workflow Planning." + +**Context**: INCEPTION - Requirements Analysis approved; User Stories SKIP + +--- + +## Workflow Planning + +**Timestamp**: 2026-10-19T20:55:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created inception/plans/execution-plan.md. Execute: Application Design (incl. FR-HP-01 static design + LAYOUT.md update as a review gate before React work), Units Generation (six units), Functional Design for Prijzen, Lieve woorden and Contact, Code Generation per unit, Build and Test. Skip: User Stories, Functional Design for presentational units, NFR Requirements, NFR Design, Infrastructure Design. Operations undecided. Risk: Low. Prompt: 'Ready to proceed with this plan?'" + +**Context**: INCEPTION - Workflow Planning (awaiting approval) + +--- + +## Workflow Planning — Approval + +**Timestamp**: 2026-10-19T21:00:00Z + +**User Input**: "akkoord, ga verder" + +**AI Response**: "Execution plan approved. Proceeding to Application Design." + +**Context**: INCEPTION - Workflow Planning approved + +--- + +## Application Design — Plan and Questions + +**Timestamp**: 2026-10-19T21:05:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created inception/plans/application-design-plan.md with the plan (incl. FR-HP-01 static design steps) and 6 design questions: folder structure, content modules, testimonial carousel (Chakra Carousel available in the installed @chakra-ui/react), Prijzen → Contact handover, location of contactFormEnabled, testimonial photo style. Recorded already-decided items (SectionHeading, HomeSection, Reveal/useReveal, Chakra Field/Input/Textarea/NativeSelect, no form library, submitContactForm adapter)." + +**Context**: INCEPTION - Application Design (awaiting answers) + +--- + +## Application Design — Answers and Artifacts + +**Timestamp**: 2026-10-19T21:40:00Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Answers: Q1 B, Q2 A, Q3 A, Q4 A, Q5 A, Q6 A — no ambiguities. Executed FR-HP-01: design/andreaslop-static index.html (live packages with ?pakket preselect links, new Lieve woorden section, live contact fields with honeypot and coming-soon gate, contact section moved to plain background), style.css (13b testimonials, select, honeypot, form gate, responsive), main.js (contact form handles shoot/onderwerp, honeypot + time check, preselect, initFormGate, initTestimonials), manifest intro-3 updated to the live photo; LAYOUT.md Home now seven blocks with new colour G (also added to .ai/layout-conventions.md). Verified with headless Chrome screenshots (desktop 1440, mobile 520). contact.html left unchanged (out of scope). Generated components.md, component-methods.md, services.md, component-dependency.md, application-design.md. Security/PBT compliance included; no blocking findings." + +**Context**: INCEPTION - Application Design (complete, awaiting approval) + +--- + +## Application Design — Approval + +**Timestamp**: 2026-10-19T21:50:00Z + +**User Input**: "ga verder naar de volgende stage" + +**AI Response**: "Application design (incl. static design update) approved. Proceeding to Units Generation." + +**Context**: INCEPTION - Application Design approved + +--- + +## Units Generation — Plan and Questions + +**Timestamp**: 2026-10-19T21:52:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created inception/plans/unit-of-work-plan.md: six units per block in the approved order, shared pieces assigned to the first unit that needs them; two questions on delivery (one PR vs PR per unit) and per-unit verification depth (full pnpm check incl. Lighthouse vs without)." + +**Context**: INCEPTION - Units Generation, Part 1 Planning (awaiting answers) + +--- + +## Units Generation — Answers + +**Timestamp**: 2026-10-19T21:58:00Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Answers: Q1 A (one PR for the whole feature, commits per unit on feature/homepage-sections, optional manual 'Deploy to Test' on the branch), Q2 A (full pnpm check incl. Lighthouse per unit). No ambiguities. Prompt: 'Unit of work plan complete. Review the plan in aidlc-docs/features/homepage-sections/inception/plans/unit-of-work-plan.md. Ready to proceed to generation?'" + +**Context**: INCEPTION - Units Generation, Part 1 Planning (awaiting plan approval) + +--- + +## Units Generation — Plan Approval and Generation + +**Timestamp**: 2026-10-19T22:02:00Z + +**User Input**: "ja genereer de unit-documenten" + +**AI Response**: "Plan approved. Generated inception/application-design/unit-of-work.md (six units with scope, shared pieces, images, Functional Design execute/skip, done criteria), unit-of-work-dependency.md (matrix, order diagram), unit-of-work-story-map.md (requirement-to-unit map; all FR-HP/NFR-HP assigned). Presented completion message." + +**Context**: INCEPTION - Units Generation (complete, awaiting approval) + +--- + +## Units Generation — Approval + +**Timestamp**: 2026-10-19T22:08:00Z + +**User Input**: "Ga verder naar de volgende stage" + +**AI Response**: "Units approved. Inception complete. Proceeding to CONSTRUCTION — Unit 1 Lifestyle fotografie (Functional Design skipped per plan) → Code Generation Part 1 Planning." + +**Context**: INCEPTION complete; CONSTRUCTION start + +--- + +## Unit 1 Lifestyle fotografie — Code Generation Plan + +**Timestamp**: 2026-10-19T22:15:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created construction/plans/lifestyle-fotografie-code-generation-plan.md (20 steps): branch + baseline commit, image resize to 800x1200 via one-off System.Drawing script (ImageMagick not available; no project dependency), theme tokens, content types and homeContent, useReveal/Reveal, SectionHeading, HomeSection, IntroGallery, route, tests, pnpm check, code summary, commit (not pushed). Functional Design skipped; PBT-01 recorded as N/A (no logic). Test names in English proposed. Prompt: approve plan or request changes." + +**Context**: CONSTRUCTION - Unit 1 Code Generation Part 1 (awaiting plan approval) + +--- + +## Unit 1 Lifestyle fotografie — Plan Approval + +**Timestamp**: 2026-10-19T22:20:00Z + +**User Input**: "approve plan" + +**AI Response**: "Plan approved (incl. local commits on feature/homepage-sections, not pushed). Starting Code Generation Part 2." + +**Context**: CONSTRUCTION - Unit 1 Code Generation Part 2 (start) + +--- + +## Unit 1 Lifestyle fotografie — Code Generation Complete + +**Timestamp**: 2026-10-20T00:10:00Z + +**User Input**: (none — generation) + +**AI Response**: "Executed all 20 plan steps. Step 13.5 self-check: Prettier failed on CRLF from an edit script (reformatted); tsc rejected constructor parameter properties in a test (rewritten); a leftover vite preview from an earlier session occupied port 4173 (stopped); Lighthouse home mobile failed 0.78 < 0.8 — root cause: Chrome eagerly fetches lazy images within ~1250px of the viewport, so gallery photos competed with the hero (LCP 3.8s → 5.3s). Fixed with useInView, usePageLoaded and DeferredImage (recorded as Step 18a). Final pnpm check green: 138 tests, build ok, audits ok (dev audit report-only), Lighthouse home mobile 0.85 / desktop 1.0, a11y/BP/SEO 1.0. Code summary written. Committed locally on feature/homepage-sections (not pushed)." + +**Context**: CONSTRUCTION - Unit 1 Code Generation (complete, awaiting approval) + +--- + +## Unit 1 Lifestyle fotografie — Change Request + +**Timestamp**: 2026-10-20T00:30:00Z + +**User Input**: "o pmobiel staan nu 4 afbeeldingen onder elkaar. dat is een beetje veel. kan je zorgen dat op mobiele schermen 1 afbeelding tegelijk wordt getoond die je kan swipen naar de volgende foto en dat je zo alle 4 de foto's alsnog kan bekijken?" + +**AI Response**: "Implemented a CSS scroll-snap row below sm (85% wide photos, next one peeking in, keyboard-focusable list), gallery-level deferred loading (DeferredImage near prop) because clipped items never intersect, single fade-in for the gallery. Updated the static design and FR-HP-02. Verified at an emulated 390px phone via CDP. pnpm check green (139 tests; Lighthouse home mobile 0.84, desktop 1.0, a11y 1.0). Committed locally. Re-presented the completion message." + +**Context**: CONSTRUCTION - Unit 1 Code Generation (change applied, awaiting approval) + +--- + +## Unit 1 Lifestyle fotografie — Approval + +**Timestamp**: 2026-10-20T00:35:00Z + +**User Input**: "ziet er goed uit, ga verder" + +**AI Response**: "Unit 1 approved. active-features.md updated to 🟢 Construction. Proceeding to Unit 2 Over mij (Functional Design skipped per plan) → Code Generation Part 1 Planning." + +**Context**: CONSTRUCTION - Unit 1 complete; Unit 2 start + +--- + +## Unit 2 Over mij — Code Generation Plan + +**Timestamp**: 2026-10-20T00:45:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created construction/plans/over-mij-code-generation-plan.md (14 steps): original 1600px photo resized to 1200x800, HomeContent.about with RoutePath-typed link, link recipe 'underline' variant, SectionHeading compact spacing, FramedImage, AboutBlock, route + app test, pnpm check with visual check, summary, commit. PBT-01 N/A. Prompt: approve plan or request changes." + +**Context**: CONSTRUCTION - Unit 2 Code Generation Part 1 (awaiting plan approval) + +--- + +## Unit 2 Over mij — Plan Approval + +**Timestamp**: 2026-10-20T00:50:00Z + +**User Input**: "approve plan" + +**AI Response**: "Plan approved. Starting Code Generation Part 2." + +**Context**: CONSTRUCTION - Unit 2 Code Generation Part 2 (start) + +--- + +## Unit 2 Over mij — Code Generation Complete + +**Timestamp**: 2026-10-20T01:20:00Z + +**User Input**: (none — generation) + +**AI Response**: "Executed all 14 steps. Step 13.5: Lighthouse home mobile failed (0.77). Root cause found by comparing observed LCP with deferred image request start across all runs: a race, photos starting before the observed LCP inflate Lighthouse's simulated LCP (5.3s vs 3.8s); the 600px load margin reached the gallery right after the load event. Lowered to a shared 200px DEFERRED_LOAD_MARGIN; latest runs request no below-hero photos on open. Final pnpm check green: 142 tests, mobile 0.84, desktop 1.0, a11y/BP/SEO 1.0. Visual check desktop + 390px phone. Committed locally (not pushed)." + +**Context**: CONSTRUCTION - Unit 2 Code Generation (complete, awaiting approval) + +--- + +## Unit 2 Over mij — Approval + +**Timestamp**: 2026-10-20T01:25:00Z + +**User Input**: "Op mobiel ziet het er goed uit. Op desktop kan ik nu niet goed zien. Dus als ik daar issues mee heb zal ik het later via bugfixes oppakken.. ga verder" + +**AI Response**: "Unit 2 approved (desktop review deferred by the user; issues will come in as bug fixes). Proceeding to Unit 3 Prijzen — Functional Design." + +**Context**: CONSTRUCTION - Unit 2 complete; Unit 3 start + +--- + +## Unit 3 Prijzen — Functional Design Plan and Questions + +**Timestamp**: 2026-10-20T01:30:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created construction/plans/prijzen-functional-design-plan.md (7 steps) and prijzen-fd-questions.md with 5 questions: VAT note, accessible names for the three 'Boek je shoot' links, second click behaviour, keeping ?pakket in the URL, package without a price." + +**Context**: CONSTRUCTION - Unit 3 Functional Design (awaiting answers) + +--- + +## Unit 3 Prijzen — Functional Design Answers + +**Timestamp**: 2026-10-20T01:40:00Z + +**User Input**: "1C +2b, mits dat past anders 2a. De knop moet 1 regel blijven. In ieder geval op desktop +3a +4b +5a" + +**AI Response**: "Recorded answers in prijzen-fd-questions.md. Interpretation: Q1 C — Andrea uses the KOR, no VAT note. Q2 — deterministic rule: visible 'Boek {name}' when the name is short enough to stay on one line down to a 320px phone (≤ 14 characters), otherwise 'Boek je shoot' with the package name as visually hidden text; button never wraps. Q3 A — last click wins. Q4 B — ?pakket is removed from the URL (history replace, keeping #contact) as soon as the form has taken over the value; a reload no longer keeps the choice. Q5 A — price required. Generating functional design artifacts." + +**Context**: CONSTRUCTION - Unit 3 Functional Design (answers received) + +--- + +## Unit 3 Prijzen — Functional Design Complete + +**Timestamp**: 2026-10-20T01:55:00Z + +**User Input**: (none — generation) + +**AI Response**: "Generated construction/prijzen/functional-design/: domain-entities.md (PricingPackage invariants, initial live data, KOR note), business-rules.md (BR-PRICE-01..03, BR-BOOK-01..03 with the 14-character label rule, BR-PARAM-01..04, two decision flowcharts, misuse notes), business-logic-model.md (booking sequence, four pure functions incl. new visiblePackages and bookLabel, 11 PBT properties, generators), frontend-components.md (Pricing, PriceCard, route validateSearch, accessibility). Prompt: Request Changes or Continue to Code Generation." + +**Context**: CONSTRUCTION - Unit 3 Functional Design (awaiting approval) + +--- + +## Unit 3 Prijzen — Functional Design Approval + +**Timestamp**: 2026-10-20T02:00:00Z + +**User Input**: "Ga verder" + +**AI Response**: "Functional design approved. Proceeding to Code Generation Part 1 (planning) for unit 3." + +**Context**: CONSTRUCTION - Unit 3 Functional Design approved + +--- + +## Unit 3 Prijzen — Code Generation Plan + +**Timestamp**: 2026-10-20T02:05:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created construction/plans/prijzen-code-generation-plan.md (17 steps): decorations copied, content types and data, four pure helpers with PBT, arbitraries, linkButton 'fit' size (nowrap, smaller phone padding), PriceCard, Pricing, route validateSearch, app tests, pnpm check with visual check at 1440/390/320, summary, commit. Prompt: approve plan or request changes." + +**Context**: CONSTRUCTION - Unit 3 Code Generation Part 1 (awaiting plan approval) + +--- + +## Unit 3 Prijzen — Plan Approval + +**Timestamp**: 2026-10-20T02:08:00Z + +**User Input**: "Approve plan" + +**AI Response**: "Plan approved. Starting Code Generation Part 2." + +**Context**: CONSTRUCTION - Unit 3 Code Generation Part 2 (start) + +--- + +## Unit 3 Prijzen — Code Generation Complete + +**Timestamp**: 2026-10-20T03:05:00Z + +**User Input**: (none — generation) + +**AI Response**: "Executed all 17 steps. Step 13.5: tsc rejected search on chakra(Link) (route generics lost) — switched the card link to TanStack's typed Link with the linkButton recipe via asChild; two test assertions corrected (NBSP normalisation, alt='' role); ESLint no-irregular-whitespace from escapes written as literal characters — rewritten as escapes, src scanned. Visual check found the second decoration covered by the last card — moved into the section's bottom padding. Final pnpm check green: 170 tests, 100% coverage on new lib files, Lighthouse home mobile 0.83–0.89, desktop 1.0, a11y/BP/SEO 1.0. Committed locally (not pushed)." + +**Context**: CONSTRUCTION - Unit 3 Code Generation (complete, awaiting approval) + +--- + +## Unit 3 Prijzen — Approval, Push and Test Deploy + +**Timestamp**: 2026-10-20T03:10:00Z + +**User Input**: "Ziet er goed uit. Kan je de changes tot nu toe committed en pushen. Kan je dan een deploy naar test doen?" + +**AI Response**: "Unit 3 approved. All work was already committed (5 commits on feature/homepage-sections). Pushed the branch to origin (new branch). Dispatched the CI workflow on feature/homepage-sections with deploy_test=true, deploy_production=false (run 552); following it until completion." + +**Context**: CONSTRUCTION - Unit 3 complete; branch pushed; test deploy requested + +--- + +## Unit 4 Lieve woorden — Functional Design Plan and Questions + +**Timestamp**: 2026-10-20T03:15:00Z + +**User Input**: "Ga ondertussen verder naar de volgende stage" + +**AI Response**: "Started unit 4 Functional Design while CI run 552 (test deploy) is running. Created construction/plans/lieve-woorden-functional-design-plan.md (6 steps) and lieve-woorden-fd-questions.md with 3 questions: behaviour at the end of the list, slide vs crossfade transition, equal vs adaptive height." + +**Context**: CONSTRUCTION - Unit 4 Functional Design (awaiting answers) + +--- + +## Unit 4 Lieve woorden — Functional Design Answers + +**Timestamp**: 2026-10-20T03:25:00Z + +**User Input**: "1a +2a +3a" + +**AI Response**: "Recorded answers (loop around at the ends; sliding transition via Chakra Carousel; all slides the height of the tallest). No ambiguities. Generating functional design artifacts." + +**Context**: CONSTRUCTION - Unit 4 Functional Design (answers received) + +--- + +## Unit 4 Lieve woorden — Functional Design Complete + +**Timestamp**: 2026-10-20T03:40:00Z + +**User Input**: (none — generation) + +**AI Response**: "Generated construction/lieve-woorden/functional-design/: domain-entities.md (Testimonial invariants, live data with alt texts), business-rules.md (BR-REV-01..11, two decision flowcharts), business-logic-model.md (navigation sequence; carousel state is Chakra's; visibleTestimonials and slideLabel with 6 PBT properties; PBT-06 N/A), frontend-components.md (Testimonials with Chakra Carousel parts, TestimonialSlide, equal height, reduced motion, single live announcement). Prompt: Request Changes or Continue to Code Generation." + +**Context**: CONSTRUCTION - Unit 4 Functional Design (awaiting approval) + +--- + +## Unit 4 Lieve woorden — Functional Design Approval + +**Timestamp**: 2026-10-20T03:45:00Z + +**User Input**: "Ga verder naar de volgende stage" + +**AI Response**: "Functional design approved. Proceeding to Code Generation Part 1 (planning) for unit 4." + +**Context**: CONSTRUCTION - Unit 4 Functional Design approved + +--- + +## Test Deploy Result (units 1–3) + +**Timestamp**: 2026-10-20T03:50:00Z + +**User Input**: (none — CI run finished) + +**AI Response**: "CI run 552 (workflow_dispatch on feature/homepage-sections, deploy_test=true) completed: check success, deploy-test success, lighthouse success, deploy-production skipped. Verified test.andreaslop.nl serves the new route chunk containing the Lifestyle fotografie, Over mij and Prijzen content." + +**Context**: Test environment updated with units 1–3 + +--- + +## Unit 4 Lieve woorden — Code Generation Plan + +**Timestamp**: 2026-10-20T03:55:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created construction/plans/lieve-woorden-code-generation-plan.md (14 steps). Findings from @zag-js/carousel 1.43.3 that shape it: built-in triggers/indicators/keys always scroll smoothly from JS (CSS cannot honour reduced motion) but the API accepts an instant flag → own prev/next/dots/arrow keys calling the API with instant = reduced motion; item group has aria-live polite → set off, one own live region; default translations English → item label via slideLabel. Prompt: approve plan or request changes." + +**Context**: CONSTRUCTION - Unit 4 Code Generation Part 1 (awaiting plan approval) + +--- + +## Unit 4 Lieve woorden — Plan Approval + +**Timestamp**: 2026-10-20T04:00:00Z + +**User Input**: "Approve plan" + +**AI Response**: "Plan approved. Starting Code Generation Part 2." + +**Context**: CONSTRUCTION - Unit 4 Code Generation Part 2 (start) + +--- + +## Unit 4 Lieve woorden — Code Generation Complete + +**Timestamp**: 2026-10-20T05:00:00Z + +**User Input**: (none — generation) + +**AI Response**: "Executed all 14 steps. Step 13.5 findings: jsdom cannot page Zag (no layout) — unit tests cover our wiring, paging/looping/dots verified in real Chrome via CDP; jsdom lacks IntersectionObserver/ResizeObserver/Element.scrollTo — ResizeObserver no-op added to test setup, the others stubbed per test; real-browser check showed slides clipping/overlapping the sand block — spacing and per-slide padding added; Lighthouse home mobile median 0.83 → 0.81 because the carousel joined the route chunk (measured with 5-run medians against a unit-3 worktree build) — React.lazy alone did not help, the carousel now loads only when the section is within 200px of the screen; median back to 0.83. Reduced motion verified: instant scroll in the first frame vs ±330ms smooth. Final pnpm check green: 190 tests, mobile 0.83, desktop 1.0, a11y/BP/SEO 1.0. Note: a git checkout of routes/index.tsx during the lazy experiment also reverted the uncommitted Testimonials wiring; it was restored immediately. Temporary worktree and preview servers cleaned up. Committing locally (incl. earlier pending audit/state updates), not pushed." + +**Context**: CONSTRUCTION - Unit 4 Code Generation (complete, awaiting approval) + +--- + +## Change Request — Price Card Hover (unit 3), Commit, Push, Test Deploy + +**Timestamp**: 2026-10-20T20:55:00Z + +**User Input**: "okee top. ik wil verder met de openstaande feature voor de homepage sections. Ik heb de het Prijzen/Pakketten onderdeel getest. Die hover op de verschillende pakketten mag wel. De donkere border die je dna krijgt en helemaal die animatie op en neer. Alleen de knoppen mogen hun effecten behouden. Commit daarna de changes, push ze en start dan een deploy naar test. Laat me weten als je de changes hebt voltoid dan kan ik die vast testen via LAN" + +**AI Response**: "Interpreted as: remove the hover effect from the price cards (accent border, lift animation, shadow); the booking buttons keep theirs. Removed in PriceCard.tsx, the now unused 'lift' shadow token, the static design (.price-card:hover) and the functional design; unit 3 code summary updated. pnpm check: a Testimonials test timed out waiting for the lazy carousel chunk under the full suite (cold import > 1s default findBy timeout) — given a 10s timeout for that wait; one Lighthouse mobile run scored 0.75 (TBT 410ms) right after the reboot — a 5-run median on the same build was 0.83 (0.83–0.85), Lighthouse rerun green (mobile 0.83, desktop 1.0). Committing, pushing feature/homepage-sections and dispatching CI with deploy_test=true. Unit 4 (Lieve woorden) is included in this push; its approval is still pending." + +**Context**: CONSTRUCTION - change request on unit 3; push and test deploy (units 1–4) + +--- + +## Feedback — Review Photo Size and Hero After Back-to-Top + +**Timestamp**: 2026-10-20T21:20:00Z + +**User Input**: "Ik heb even gekeken. De lieve woorden Carousel is grotendeels goed, maar op mobiel is het plaatje enorm en vult het scherm. Op desktop moet ik later even controleren, tenzij je hier een screenshot kan tonen van de desktop versie. Functioneel geloof ik het wel. Ik wil vooral de layout checken. + +Dan zie ik ook het volgende gebeuren: +Ik navigeer naar de pagina en ik zie een beeldvullende hero. Ik scroll naar beneden en de back to top knop komt tevoorschijn en van de browser verdwijnen de ui balken boven en onder.. Ik klik op de knop en ga terug naar boven. Dat werkt zoals verwacht, maar vervolgens is de Hero niet schermvullend meer omdat die browserbalken weg zijn. Als ik gewoon naar boven scroll handmatig komen die balken terug en is de Hero wel schermvullend. Is daar wat aan te doen zonder vieze workarounds of iets? Anders accepteer ik het wel en dan is het geen probleem." + +**AI Response**: "Review photo: limited to 240px wide on phones and 320px on tablets (was up to 420px), left-aligned; placeholder heights re-measured (390: 772px, 768: 813px). Sent desktop (1440) and phone (390) screenshots. Hero: explained the cause — the hero is 100svh (small viewport, toolbars shown); mobile browsers only bring their toolbars back on a user scroll, not on a scroll from JavaScript, and there is no API to show them; the clean alternative is 100dvh (always fills, but the hero and everything below change height whenever the toolbars slide in or out); recommended accepting. Changes not yet committed (awaiting the user's call)." + +**Context**: CONSTRUCTION - Unit 4 review feedback + +--- + +## Feedback — Viewport Units and Review Photo Size + +**Timestamp**: 2026-10-20T21:40:00Z + +**User Input**: "Ah ja dat is inderdaad een vieze oplossing. Heel irritant als alles constant verspringt. Dus dat scrollen lekker laten. Wel vraag ik me af wat de verschillen zijn tussen de verschillende view height waarden. Vh, dvh en volgens mij svh? + +De foto mag nog iets kleiner? 75% van huidige groote maken is denk ik goed. Het moet ook niet te klein worden. Kan je de afbeelding wel in het midden uitlijnen op mobiel?" + +**AI Response**: "Hero stays at 100svh (accepted). Explained vh, svh, lvh and dvh. Interpreted '75%' as the answer to the desktop question: desktop grid 5fr 7fr → 5fr 11fr (photo ±75%, ±395×495 at 1440; block fits a ±1000px screen); phones keep 240px (not too small), now centred, tablets 320px centred. Placeholder heights re-measured; static design and functional design updated; screenshots sent; tests green. Not committed yet." + +**Context**: CONSTRUCTION - Unit 4 review feedback (applied) + +--- + +## Correction — Review Photo Size + +**Timestamp**: 2026-10-20T21:50:00Z + +**User Input**: "Ik zei dat je de grootte van de mobiele versie op ongeveer 75% moest zetten van de huidige grootte. Desktop wilde ik eerst zien met een screenshot voordat we daar wat aan gaan doen" + +**AI Response**: "Misread the previous request. Reverted the desktop change (back to 5fr 7fr) and set the phone photo to 180px (75% of 240px), centred; tablets stay 320px. Static design, functional design and code summary aligned; placeholder heights re-measured (phones ±700px). Sent desktop (unchanged) and phone screenshots for review. CI run 553 (test deploy of 02a7b84) completed successfully. Not committed yet." + +**Context**: CONSTRUCTION - Unit 4 review feedback (corrected) + +--- + +## Feedback — Desktop Review Photo + +**Timestamp**: 2026-10-20T21:55:00Z + +**User Input**: "Hoe je desktop net had aangepast was mooier. De afbeelding nu is misschien toch wat te groot." + +**AI Response**: "Re-applied the smaller desktop layout (grid 5fr 11fr, photo ±395×495 at 1440); phones stay 180px centred, tablets 320px. Docs, static design and placeholder heights (lg 460, xl 625) updated; tests green. Not committed yet." + +**Context**: CONSTRUCTION - Unit 4 review feedback (applied) + +--- + +## Feedback — Review Alignment on Phones + +**Timestamp**: 2026-10-20T22:05:00Z + +**User Input**: "Nee nog niet. Op mobiel is de uitlijning niet goed voor lieve woorden. Ze moeten verticaal omhoog uitgelijnd worden. De kleinere items met minder tekst worden nu gecentreerd ofzo. Dat ziet er gek uit. Ook mag de witruimte tussen de afbeelding en de tekst iets minder op mobiel" + +**AI Response**: "Cause: all slides share the tallest one's height, and the stacked grid centred its content (alignItems center), so the short review floated in the middle. Below lg the slide grid now aligns content and rows to the top; desktop keeps vertical centring. Gap between photo and text below lg reduced to 1.25rem. Verified with screenshots of both reviews at 390px; placeholder heights re-measured; docs updated; tests green. Not committed (user: 'nog niet')." + +**Context**: CONSTRUCTION - Unit 4 review feedback (applied) + +--- + +## Unit 4 Lieve woorden — Approval, Push and Test Deploy + +**Timestamp**: 2026-10-20T22:15:00Z + +**User Input**: "Commit, push en deploy naar test. Ga dan verder naar de volgende stage" + +**AI Response**: "pnpm check green (190 tests; Lighthouse mobile 0.83, desktop 1.0). Committing the review-photo layout changes, pushing feature/homepage-sections and dispatching CI with deploy_test=true. Unit 4 approved; proceeding to Unit 5 Contact — Functional Design." + +**Context**: CONSTRUCTION - Unit 4 complete; Unit 5 start + +--- + +## Unit 5 Contact — Functional Design Plan and Questions + +**Timestamp**: 2026-10-20T22:20:00Z + +**User Input**: (none — AI-initiated, following "Ga dan verder naar de volgende stage") + +**AI Response**: "Committed 0b8e8d5, pushed, dispatched CI run 554 (deploy to test). Created construction/plans/contact-functional-design-plan.md (6 steps, listing what is already fixed) and contact-fd-questions.md with 6 questions: when errors appear, error messages, success behaviour (+ reply time text), mail button subject, focus after a 'Boek' click, failure message." + +**Context**: CONSTRUCTION - Unit 5 Functional Design (awaiting answers) + +--- + +## Unit 5 Contact — Functional Design Answers (partial) + +**Timestamp**: 2026-10-20T22:30:00Z + +**User Input**: "1B +2X, emailadres: \"Dit e-mailadres is ongeldig.\" Te lang: \"Het bericht is te lang\" +3A, maar het bericht is: \"Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen. +4A +5A" + +**AI Response**: "Recorded answers 1–5 in contact-fd-questions.md. Question 6 unanswered; the 'too long' message is ambiguous for the name and e-mail fields. Created contact-fd-clarification-questions.md with 2 follow-up questions." + +**Context**: CONSTRUCTION - Unit 5 Functional Design (awaiting clarifications) + +--- + +## Unit 5 Contact — Clarification Answers + +**Timestamp**: 2026-10-20T22:40:00Z + +**User Input**: "1A, 2A" + +**AI Response**: "Recorded: failure message with mailto link, input kept (Q6 = A); per-field 'too long' messages (A). Added design detail for Q1 = B: an untouched empty field gets no error on blur, and a shown error clears as soon as the field becomes valid while typing. Generating functional design artifacts." + +**Context**: CONSTRUCTION - Unit 5 Functional Design (answers complete) + +--- + +## Unit 5 Contact — Clarification Answers + +**Timestamp**: 2026-10-20T22:40:00Z + +**User Input**: "1A, 2A" + +**AI Response**: "Recorded: failure message with mailto link, input kept (Q6 = A); per-field 'too long' messages (A). Added design detail for Q1 = B: an untouched empty field gets no error on blur, and a shown error clears as soon as the field becomes valid while typing. Generating functional design artifacts." + +**Context**: CONSTRUCTION - Unit 5 Functional Design (answers complete) + +--- + +## Unit 5 Contact — Functional Design Complete + +**Timestamp**: 2026-10-20T23:00:00Z + +**User Input**: (none — generation) + +**AI Response**: "Generated construction/contact/functional-design/: domain-entities.md (values, errors, payload, shoot options, limits, setting, anti-spam inputs), business-rules.md (BR-FORM-01..13 incl. the user's messages and blur timing, BR-SEND-01..04 with the 1-2 werkdagen thank-you, BR-SPAM-01..03, BR-GATE-01..03, BR-MAIL-01 subject, BR-PARAM-02/04 and BR-FOCUS-01; two decision flowcharts; misuse notes), business-logic-model.md (submit sequence, pure reducer state machine, 8 pure functions, 10 PBT properties incl. stateful PBT-06), frontend-components.md (ContactSection, ContactFormGate, ContactForm, content, accessibility). Prompt: Request Changes or Continue to Code Generation." + +**Context**: CONSTRUCTION - Unit 5 Functional Design (awaiting approval) + +--- + +## Test Deploy Result (units 1–4 incl. review fixes) + +**Timestamp**: 2026-10-20T23:05:00Z + +**User Input**: (none — CI run finished) + +**AI Response**: "CI run 554 (workflow_dispatch on feature/homepage-sections at 0b8e8d5, deploy_test=true) completed: check success, deploy-test success, lighthouse success, deploy-production skipped." + +**Context**: Test environment updated with units 1–4 and the review fixes + +--- + +## Unit 5 Contact — Functional Design Approval + +**Timestamp**: 2026-10-20T23:10:00Z + +**User Input**: "Ga verder naar de volgende stage" + +**AI Response**: "Functional design approved. Proceeding to Code Generation Part 1 (planning) for unit 5." + +**Context**: CONSTRUCTION - Unit 5 Functional Design approved + +--- + +## Unit 5 Contact — Code Generation Plan + +**Timestamp**: 2026-10-20T23:15:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created construction/plans/contact-code-generation-plan.md (19 steps): types/content, six pure helpers incl. the form reducer with stateful PBT, adapter, formControl recipe and panel shadow, ContactForm, ContactFormGate, ContactSection (preselect, URL clean-up, focus), route + app tests, pnpm check with a performance comparison (defer the form like the carousel if it costs performance), visual checks, summary, commit. Prompt: approve plan or request changes." + +**Context**: CONSTRUCTION - Unit 5 Code Generation Part 1 (awaiting plan approval) + +--- + +## Unit 5 Contact — Plan Approval + +**Timestamp**: 2026-10-20T23:20:00Z + +**User Input**: "Approve plan. Je mag na het genereren de code alvast committed, pushen en een deploy naar test doen" + +**AI Response**: "Plan approved. Authorised for this unit: after generation, commit, push and dispatch a test deploy. Starting Code Generation Part 2." + +**Context**: CONSTRUCTION - Unit 5 Code Generation Part 2 (start) + +--- + +## Unit 5 Contact — Code Generation Complete, Push and Test Deploy + +**Timestamp**: 2026-10-21T00:30:00Z + +**User Input**: "Kan je mij een screenshot van de desktop versie sturen zodra je klaar bent?" (received mid-generation) + +**AI Response**: "Executed all 19 steps. Findings: labels were not linked (control id overridden; Ark uses Field.Root id) — fixed; React-compiler lint on field refs — focus by id instead; lazy form unmounted after ?pakket= cleanup — latched once loaded; two reducer branches only randomly covered — deterministic tests added. Performance: 5-run medians against a rebuilt unit-4 build (sparse worktree; a full worktree hit the Windows path limit): 0.83 → 0.80 with the form in the route chunk, 0.81 with the form lazy, 0.83 after replacing Chakra List/Blockquote (slot recipes) in PriceCard and TestimonialSlide with plain elements so the route no longer fetches a new shared chunk. Placeholder heights measured. Final pnpm check green: 237 tests, 100% lib coverage, Lighthouse mobile 0.83, desktop 1.0, a11y/BP/SEO 1.0. Sent desktop screenshots (overlay; form switched on locally and reverted) and a phone screenshot. Committing, pushing and dispatching a test deploy as authorised for this unit." + +**Context**: CONSTRUCTION - Unit 5 Code Generation (complete, awaiting approval) + +--- + +## Unit 5 Contact — Bugs Reported on LAN, Fixed + +**Timestamp**: 2026-10-21T01:30:00Z + +**User Input**: "Er gebeurt niks als ik klik op de Boeken-knoppen. Geen effect en hij scrolt niet" / "Ik heb op lan getest" / "Zodra je klaar bent mag je weer comitten, pushen en deployen" / "Als ik op boek zwangerschap klik scrolt hij minder ver dan op de andere 2 knoppen" / "Wederom. Je mag comitten, pushen en deployen zodra je klaar bent" + +**AI Response**: "Reproduced in real Chrome (CDP trace): the click pushed /?pakket=newborn#contact, our clean-up replaced it with hashScrollIntoView:false before the router's onRendered scroll, so no scroll happened (test still had unit 4, where #contact did not exist yet). Fixed: the clean-up navigation requests the hash scroll (smooth / auto under reduced motion); anchored sections get scroll-margin-top = header. Added an app test clicking 'Boek Newborn' asserting scrollIntoView on #contact (verified failing on the old code). Second bug: from the top card the review carousel loaded mid-scroll and its fixed placeholder height differed from the real height except at measured widths (+29px at 360, -44px at 600). Placeholder is now the longest review rendered like a slide plus the control height; no movement at 7 widths. CI run 555: deploy-test succeeded, Lighthouse job died on the Pi runner with exit -1 after pnpm install (infra). pnpm check green (238 tests, mobile 0.83, desktop 1.0). Committing, pushing, dispatching a test deploy as authorised." + +**Context**: CONSTRUCTION - Unit 5 bug fixes (awaiting approval of unit 5) + +--- + +## Test Deploy Result (unit 5 incl. scroll fixes) + +**Timestamp**: 2026-10-21T02:00:00Z + +**User Input**: (none — CI run finished) + +**AI Response**: "CI run 556 (0b00b78, deploy_test=true) completed: check, deploy-test and lighthouse success, deploy-production skipped. The Lighthouse failure of run 555 did not recur (runner issue). test.andreaslop.nl serves the Contact section." + +**Context**: Test environment updated with unit 5 and the scroll fixes + +--- + +## Unit 5 Contact — Change Request: Section Heading Size + +**Timestamp**: 2026-10-21T20:10:48Z + +**User Input**: "ik wil verder met d eopenstaande feature in aidlc. Ik had in ieder geval al een opmerking over de

-tags. Die zijn wat groot. Kunnen die een grootte krijgen wat vertaald naar 30 pixels? Ze zijn nu in iede rgeval wat te groot en nu zijn ze computed 40px" + +**AI Response**: "Resumed homepage-sections (unit 5 awaiting approval). The section h2s use textStyle sectionTitle (1.85rem / 2.125rem / 2.5rem = 40px at xl, from the design's --fs-h2). Changed it to a flat 1.875rem (30px) at every width; mobile was already 29.6px so a single size is simplest. Applies to all SectionHeading h2s on the homepage; footer h2s (eyebrow) and h1/h3 unchanged. Design static CSS left as is." + +**Context**: CONSTRUCTION - Unit 5 change request (typography) + +--- + +## Unit 5 Contact — Change Request: Price Card Heading Size + +**Timestamp**: 2026-10-21T20:21:27Z + +**User Input**: "de maten voor de prijskaarten mogen ietsje kleiner. Ze zijn nu bijna even groot als de h2's" + +**AI Response**: "Price card h3 (package name) reduced from 1.75rem (28px) to 1.5rem (24px). The price itself stays 2.25rem (36px), larger than the 30px h2 — asked the owner whether that should shrink too." + +**Context**: CONSTRUCTION - Unit 5 change request (typography) + +--- + +## Unit 5 Contact — Change Request: Testimonial Quote Size + +**Timestamp**: 2026-10-21T20:23:58Z + +**User Input**: "De tekst van de lieve woorden. De blockquote is een beetje groot. zou je die ook wat kleiner kunnen maken?" + +**AI Response**: "Testimonial blockquote reduced from clamp(1.35rem, 2.2vw, 1.75rem) (21.6–28px) to clamp(1.15rem, 1.7vw, 1.375rem) (18.4–22px). The carousel placeholder renders the longest slide itself, so its height follows automatically." + +**Context**: CONSTRUCTION - Unit 5 change request (typography) + +--- + +## Unit 5 Contact — Approval + +**Timestamp**: 2026-10-21T20:36:20Z + +**User Input**: "top het werkt. okee. dan kan je nu verder met de volgende unit" + +**AI Response**: "Unit 5 approved (incl. the review typography changes: section h2 30px, price card h3 24px, testimonial quote 18.4–22px; price amount size question left open). Moving to Unit 6 Instagram." + +**Context**: CONSTRUCTION - Unit 5 Code Generation approved + +--- + +## Unit 6 Instagram — Code Generation Plan + +**Timestamp**: 2026-10-21T20:36:20Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created construction/plans/instagram-code-generation-plan.md (11 steps): content type and data reusing six already-bundled photos, HomeSection width='full' for the design's full-bleed grid, InstagramGrid (handle link, list of six square tiles 2/3/6 columns, accessible names alt + hint, hover/focus with reduced motion), route renders it only with a valid https Instagram link via visibleSocials, tests, pnpm check, LAYOUT.md check, summary, commit (typography changes in a separate commit first). Prompt: approve plan or request changes." + +**Context**: CONSTRUCTION - Unit 6 Code Generation Part 1 (awaiting plan approval) + +--- + +## Unit 6 Instagram — Plan Approval + +**Timestamp**: 2026-10-21T20:40:08Z + +**User Input**: "approve plan" + +**AI Response**: "Plan approved. Starting Code Generation Part 2 (commit at the end, not pushed)." + +**Context**: CONSTRUCTION - Unit 6 Code Generation Part 2 (start) + +--- + +## Unit 6 Instagram — Code Generation (Lighthouse gate pending) + +**Timestamp**: 2026-10-21T21:01:47Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Steps 1–7, 9, 10 done. pnpm check: lint, format, 244 tests, build, audits green; Lighthouse home mobile 0.73 (budget 0.8), /contact 0.84 in the first run. Benchmark index was halved (1889 vs ~4200). A/B with the unit 5 build (git stash of web/, 3 runs each): both 0.68–0.84, TBT 190–600 ms, no difference; machine under load (game and a Vite dev server). Visual check in headless Chrome: 6/3/2 columns, full-bleed, h2 30px, no extra image requests. Not committed; asked the owner whether to rerun the gate on a quiet machine first." + +**Context**: CONSTRUCTION - Unit 6 Code Generation, Step 8 Lighthouse pending + +--- + +## Unit 6 Instagram — Lighthouse Rerun + +**Timestamp**: 2026-10-21T22:26:33Z + +**User Input**: "ik heb rocket league afgesloten. Ik zie in de browser bij performance ook ineens maar een score van 44 en 51 op desktop. De rest is in beide gevallen 100. Op mobiel is dat 35 en 33 terwijl de andere onderdelen 100 zijn." + +**AI Response**: "The browser scores come from the Vite dev server (port 5173): measured it at desktop 0.55 / mobile 0.36 with 137 unbundled requests, so not representative. Rebuilt and reran pnpm lighthouse on the production build: passed — home mobile 0.81 (TBT 230 ms), desktop 1.0, other pages 0.93–0.94 / 1.0, a11y/BP/SEO 1.0. Step 8 ticked; committing as in the approved plan (Step 11), not pushed." + +**Context**: CONSTRUCTION - Unit 6 Code Generation, Step 8 complete + +--- + +## Unit 6 Instagram — Approval + +**Timestamp**: 2026-10-21T23:24:36Z + +**User Input**: "je mag committen pushen en deployen. dan mag je ook een PR gaan aanmaken als die er nog niet is en dan mag je door naar Build & Test" + +**AI Response**: "Unit 6 approved. Authorised: commit, push, test deploy, create the PR to master if none exists, then start Build and Test." + +**Context**: CONSTRUCTION - Unit 6 Code Generation approved + +--- + +## Build and Test — Push, PR, Browser Checks + +**Timestamp**: 2026-10-21T23:29:37Z + +**User Input**: (none — continuing the authorised steps) + +**AI Response**: "Pushed 1905295, dispatched a test deploy (run 557), created PR #6 (Gitea rejects 4-byte emoji in PR bodies, so the attribution line has none). Scripted browser checks on the production build (headless Chrome, 1440 and 390): section order ✅, layout shift while scrolling 0.0008 / 0 ✅, every Boek button selects its package and tidies the URL ✅, keyboard focus on Instagram tiles visible and on top ✅. Contact lands 24px below the header on desktop: its scroll-margin is the full header height (92px) while the header has shrunk to 68px by then. On phones 9px: the page is 394px wide instead of 390 because the Lifestyle fotografie row (unit 1) bleeds out by the gutter token (20px) while Chakra's Container pads 16/24/32px instead of the design's --gutter (clamp(20px, 4vw, 48px)); Chrome zooms the layout viewport and the visual viewport sits 9px lower. Asked the owner how to fix (site-wide Container padding = gutter as in the design, or a local fix in the gallery) and whether to align the Contact offset with the shrunken header." + +**Context**: CONSTRUCTION - Build and Test (in progress, awaiting decision) + +--- + +## Build and Test — Owner Decisions on the Findings + +**Timestamp**: 2026-10-21T23:33:28Z + +**User Input**: "Zijmarge: Overal zoals design (Recommended)" / "Contact: Direct onder header" + +**AI Response**: "Container padding becomes the design's gutter token site-wide; anchored sections use the shrunken (sticky) header height as scroll margin." + +**Context**: CONSTRUCTION - Build and Test, fixes + +--- + +## Build and Test Stage + +**Timestamp**: 2026-10-21T23:46:08Z + +**Build Status**: Success + +**Test Status**: Pass (244 unit/app tests; browser integration scenarios after two fixes; Lighthouse home mobile 0.83, desktop 1.0, other pages 0.94–0.95 / 1.0) + +**Files Generated**: +- build-instructions.md +- unit-test-instructions.md +- integration-test-instructions.md +- performance-test-instructions.md +- build-and-test-summary.md + +**Fixes**: Container padding = gutter site-wide (page was 394px wide on phones), header extra padding removed, to-top aligned to gutter, anchored sections scroll to the sticky header height. A local pnpm check failed once on port 4173, occupied by the CI Lighthouse job on the PC runner (host network); rerun after the job: green. + +**Operations Phase Decision**: Undecided (asked in the completion message) + +--- + +## Build and Test — Operations Decision and Workflow Complete + +**Timestamp**: 2026-10-22T00:04:22Z + +**User Input**: "Complete without operations" + +**AI Response**: "Operations Phase set to No (decided at Build and Test). Feature marked ✅ Complete in active-features.md and aidlc-state.md. Deployment stays with the existing CI pipeline (merge of PR #6 to master deploys to test; production via a release/* branch). Presented the Workflow Complete summary." + +**Context**: Workflow complete + +--- diff --git a/aidlc-docs/features/homepage-sections/construction/build-and-test/build-and-test-summary.md b/aidlc-docs/features/homepage-sections/construction/build-and-test/build-and-test-summary.md new file mode 100644 index 0000000..aaf2b4c --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/build-and-test/build-and-test-summary.md @@ -0,0 +1,52 @@ +# Build and Test Summary — homepage-sections + +## Build +- **Tool**: pnpm + Vite (`tsc && vite build`) +- **Status**: ✅ Success (built in ~2.5 s locally; CI `check` job green on the Pi and on the PC runner) +- **Artifacts**: `web/dist/` + +## Unit tests +- **Total**: 244 in 53 files. **Passed**: 244. **Failed**: 0. +- **Coverage**: `src/lib/` 100%, overall ~92% of statements +- **Status**: ✅ Pass + +## Integration (whole homepage) +- **Automated, in the suite**: section order with one h1 and axe clean; "Boek Newborn" scrolls to Contact and selects the package; `?pakket=` selects, tidies and focuses; Instagram absent without a valid https link. ✅ +- **Browser, production build, 1440 px and 390 px phone** (scenarios in `integration-test-instructions.md`): + +| Scenario | Result | +|---|---| +| Section order | ✅ | +| Layout shift while scrolling the whole page | ✅ 0.0008 / 0 | +| All three "Boek" buttons | ✅ after fixes 1 and 2 below | +| Keyboard focus on the Instagram tiles | ✅ | +| Horizontal overflow, 7 pages × 5 widths | ✅ after fix 1 below | +| No new image requests from Instagram | ✅ | + +### Found and fixed in this stage +1. **Phones: the page was 4 px too wide.** + - Cause: Chakra's `Container` padded 16 / 24 / 32 px, while the design's `.container` uses `--gutter` (clamp(20 px, 4vw, 48 px)). The Lifestyle fotografie row bleeds out by the gutter, so it stuck out 4 px on both sides. + - Effect: Chrome widened the layout viewport to 394 px, and the page could be nudged sideways. + - Fix (the owner chose to follow the design everywhere): `Container` pads with `gutter`. The header loses its extra padding from the first hero commit, and the to-top button aligns with the gutter. The logo, hero controls and content now share one edge. +2. **Desktop: Contact landed 24 px below the header.** + - Cause: the scroll margin was the full header height (92 px), but the header has shrunk to 68 px by the time the page reaches Contact. + - Fix: anchored sections use the sticky header height (`spacing.header.sticky`). + +## Performance (Lighthouse CI, production build) +| Page | Mobile | Desktop | +|---|---|---| +| Homepage | 0.83 (budget 0.8) | 1.0 | +| Other pages | 0.94–0.95 (budget 0.9) | 1.0 | + +Accessibility and best practices are 1.0 on every page, and SEO passes everywhere. CI `lighthouse` job: ✅ (reporting only). + +Two things disturb local measurements: a busy machine, and the CI Lighthouse job on the PC runner. That job uses `--network host`, so it occupies port 4173 and makes a local `pnpm check` fail with "port in use". See `performance-test-instructions.md`. + +## Additional +- **Security**: `pnpm audit --prod` clean. The new section adds no new dependencies or external resources. External links use `noopener noreferrer`, and only https links are rendered. +- **Contract / E2E suite**: N/A (static front end without an API). The browser checks above cover the user flows. + +## Overall +- **Build**: ✅ **Tests**: ✅ **Performance budgets**: ✅ +- **Test environment**: test.andreaslop.nl was updated with unit 6 (run 557). The layout fixes are deployed in a follow-up run. +- **Ready for Operations**: yes, depending on the owner's decision about the Operations phase diff --git a/aidlc-docs/features/homepage-sections/construction/build-and-test/build-instructions.md b/aidlc-docs/features/homepage-sections/construction/build-and-test/build-instructions.md new file mode 100644 index 0000000..fa831cb --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/build-and-test/build-instructions.md @@ -0,0 +1,24 @@ +# Build Instructions — homepage-sections + +## Prerequisites +- **Node.js** 24 and **pnpm** (version pinned in `web/package.json`) +- **OS**: Windows, Linux or macOS. CI builds on the Raspberry Pi runner (arm64). +- **Environment variables**: none for the build. `LIGHTHOUSE_PERFORMANCE=warn` only in CI (see performance instructions) + +## Build steps +```bash +cd web +pnpm install # also runs `chakra typegen` (postinstall) +pnpm build # tsc && vite build +``` + +After changing theme tokens (`src/theme.ts`), run `pnpm typegen` so token names such as `header.sticky` type-check. + +## Verify +- **Expected output**: `✓ built in …s` and no TypeScript errors +- **Artifacts**: `web/dist/` (`index.html`, `assets/*.js|css|jpg|png`) +- **Accepted warning**: Vite's chunk-size warning for the main bundle (`index-*.js`, ~575 kB unminified size before gzip). This is known and tracked under responsive images and prerendering (NFR-P-01). + +## Troubleshooting +- **Unknown token type errors after a theme change** → `pnpm typegen`. +- **Lighthouse or preview fails with "port in use"** → a preview server is still running on 4173. Stop it first. diff --git a/aidlc-docs/features/homepage-sections/construction/build-and-test/integration-test-instructions.md b/aidlc-docs/features/homepage-sections/construction/build-and-test/integration-test-instructions.md new file mode 100644 index 0000000..786109e --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/build-and-test/integration-test-instructions.md @@ -0,0 +1,19 @@ +# Integration Test Instructions — homepage-sections + +The six units are sections of one page, so "integration" means how they behave together on the real homepage. + +## Automated (in `pnpm test`, `src/app.test.tsx`) +- **Section order**: Hero → Lifestyle fotografie → Over mij → Prijzen → Lieve woorden → Contact → Instagram, exactly one h1, axe clean on the whole page +- **Prijzen → Contact**: a click on "Boek Newborn" scrolls to `#contact` and selects Newborn. A `?pakket=` link selects the package, tidies the URL and focuses Contact. +- **siteContent → Instagram**: the section is absent when the Instagram link is missing or not https + +## In a real browser (production build) +Run against `pnpm build && pnpm preview`, with headless Chrome (puppeteer-core and chrome-launcher are already installed as Lighthouse dependencies) or by hand, at 1440 px and at an emulated 390 px phone: + +| # | Scenario | Expected | +|---|---|---| +| 1 | Scroll the whole homepage in steps | Cumulative layout shift < 0.1 (measured 0.0008 / 0) | +| 2 | Each "Boek …" button, starting from the top | Contact's top edge lines up with the bottom of the (shrunken) header, the select shows the package, the URL ends in `/#contact` | +| 3 | Tab from the Instagram handle to the first tile | 2px focus ring visible on top of the neighbouring tiles; the photo zooms in | +| 4 | Every page at 320, 390, 768, 1024 and 1440 px | `scrollWidth === innerWidth`: no horizontal overflow | +| 5 | Network panel while scrolling the homepage | The Instagram section requests no new images | diff --git a/aidlc-docs/features/homepage-sections/construction/build-and-test/performance-test-instructions.md b/aidlc-docs/features/homepage-sections/construction/build-and-test/performance-test-instructions.md new file mode 100644 index 0000000..666dfa9 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/build-and-test/performance-test-instructions.md @@ -0,0 +1,22 @@ +# Performance Test Instructions — homepage-sections + +A static site: there is no load or throughput testing. Performance means page-load performance, measured with Lighthouse CI. + +```bash +cd web +pnpm build +pnpm lighthouse # mobile (lighthouserc.cjs) then desktop (lighthouserc.desktop.cjs) +``` + +## Budgets +- **Performance**: + - homepage on mobile ≥ 0.8. This is a temporary budget until responsive images and prerendering arrive (NFR-P-01). + - every other page on mobile ≥ 0.9. + - every page on desktop ≥ 0.9. +- **Accessibility and best practices**: 1.0 on every page +- **SEO**: the basic audits on every page; `is-crawlable` only on indexed pages + +## Measuring reliably +- Measure the **production build**. The Vite dev server (`pnpm dev`) serves 137 unbundled modules and scores ~0.55 on desktop and ~0.36 on mobile, which says nothing about the site. +- Lighthouse throttles the CPU relative to the machine's own speed. A busy machine (a game, a dev server rebuilding) scatters the homepage mobile score between 0.68 and 0.84. Compare `environment.benchmarkIndex` in the report: when it is far below ~3500–4200, rerun on a quiet machine. +- In CI the Raspberry Pi scores 30–40 points lower, so performance is reported there and does not block (`LIGHTHOUSE_PERFORMANCE=warn`). diff --git a/aidlc-docs/features/homepage-sections/construction/build-and-test/unit-test-instructions.md b/aidlc-docs/features/homepage-sections/construction/build-and-test/unit-test-instructions.md new file mode 100644 index 0000000..9837d68 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/build-and-test/unit-test-instructions.md @@ -0,0 +1,12 @@ +# Unit Test Execution — homepage-sections + +```bash +cd web +pnpm test # vitest run --coverage +``` + +- **Expected**: 53 files, 244 tests, 0 failures (count at the end of unit 6) +- **Coverage**: `src/lib/` (all business logic) at 100%. The suite overall is ~92% of statements. +- **Includes**: axe checks per section and per page, property-based tests (fast-check) for the contact form logic, and app-level tests through the real route tree (`src/app.test.tsx`) +- **Report**: terminal output plus `web/coverage/` +- jsdom has no layout or scrolling, so anything about positions, sizes and scroll behaviour is checked in the browser instead (see integration instructions). diff --git a/aidlc-docs/features/homepage-sections/construction/contact/code/code-summary.md b/aidlc-docs/features/homepage-sections/construction/contact/code/code-summary.md new file mode 100644 index 0000000..6c84a3e --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/contact/code/code-summary.md @@ -0,0 +1,66 @@ +# Code Summary — Unit 5: Contact + +Plan: [contact-code-generation-plan.md](../../plans/contact-code-generation-plan.md). Functional design: [../functional-design/](../functional-design/). Branch: `feature/homepage-sections`. + +## Files + +### Created +| File | Purpose | +|---|---| +| `web/src/contact/types.ts` | Values, errors, payload, shoot option, limits, empty values | +| `web/src/contact/submitContactForm.ts` + test | The single submission adapter; fails until the API exists (comment shows the future `POST /api/contact`) | +| `web/src/lib/shootOptions.ts` + test | Shown packages + Overig | +| `web/src/lib/validateContact.ts` + test | `validateField` / `validateContact` with the agreed messages | +| `web/src/lib/toContactPayload.ts` + test | Trimmed payload | +| `web/src/lib/isLikelySpam.ts` + test | Honeypot or under 3000 ms | +| `web/src/lib/mailLink.ts` + test | `mailSubject`, `mailtoLink` | +| `web/src/lib/contactFormReducer.ts` + test | The form as a pure state machine (editing → sending → sent / failed) | +| `web/src/recipes/formControl.ts` | The design's square fields for Input, Textarea and NativeSelect | +| `web/src/components/ContactForm/ContactForm.tsx` + test | The form (lazy chunk) | +| `web/src/components/ContactForm/ContactFormGate.tsx` + test | Dimmed, inert form under the coming-soon notice | +| `web/src/components/home/ContactSection/ContactSection.tsx` + test | The section: heading, gate, lazy form, `?pakket=` handling, focus | + +### Modified +| File | Change | +|---|---| +| `web/src/content/types.ts`, `homeContent.ts`, `siteContent.ts` | `HomeContent.contact`; `SiteContent.contactForm = { enabled: false }` | +| `web/src/theme.ts` | `error` colour (#a4443a: 5.7:1 on paper, 6.1:1 on white), `panel` shadow, `formControl` recipe | +| `web/src/components/SectionHeading/SectionHeading.tsx` | `focusable` (tabIndex −1 for the programmatic focus) | +| `web/src/components/home/Pricing/PriceCard.tsx` | Feature list as plain `ul`/`li` instead of Chakra `List` (see performance) | +| `web/src/components/home/Testimonials/TestimonialSlide.tsx` | Plain `figure`/`blockquote`/`figcaption` instead of Chakra `Blockquote` (see performance) | +| `web/src/routes/index.tsx` | Renders `ContactSection` with `pakket` from `Route.useSearch()` | +| `web/src/test/arbitraries.ts` | `contactValues`, `anyContactValues`, `contactEvent` | +| `web/src/test/setup.ts` | No-op `Element.scrollIntoView` (the router's hash scroll; jsdom lacks it) | +| `web/src/app.test.tsx` | "Contact" in the page order; full "Boek Newborn" path through the real route | + +## Findings and fixes during generation +- **Labels not linked** (found by a test): Chakra's `Field.Root` links the label to the control through its own id; overriding the control's `id` broke that. In Ark, `Field.Root`'s `id` is the control's id (and `ids.control` is, confusingly, the root group's id), so the id now goes on `Field.Root`. Ark links the error text with `aria-errormessage` (not `aria-describedby` as written in the functional design); `aria-invalid` is set. +- **Field refs vs the React compiler lint**: refs set from a helper called during render were rejected; focus now finds the first invalid field by its id. +- **Form disappearing after a "Boek" arrival**: with the form loaded because of `?pakket=`, removing the parameter made it unload until the observer fired, losing typed input. Once loaded the form now stays (asserted in the app test). +- **Coverage**: two reducer branches were only reached randomly by the stateful property test; fixed with deterministic example tests (100% on `src/lib/**`). +- **Performance** (5-run Lighthouse medians, unit 4 rebuilt alongside for the same conditions): + + | Build | Median | LCP | TBT | + |---|---|---|---| + | Unit 4 | 0.83 | 3.84 s | 177 ms | + | Unit 5, form in the route chunk | 0.80 | 3.99 s | 232 ms | + | Unit 5, form lazy | 0.81 | 3.99 s | 207 ms | + | Unit 5, form lazy, no slot recipes in the route chunk | **0.83** | 3.84 s | 175 ms | + + First the form was moved into its own chunk, loaded when the section comes within 200 px of the screen, or at once when arriving via "Boek …". The remaining gap came from a new shared chunk (Chakra's slot-recipe factory, now used by three chunks) that the route had to fetch on page load: the price cards' `List` and the review slide's `Blockquote` were the only slot-recipe components on the route, so they became plain elements with the same styling, and the route no longer needs that chunk. +- **Placeholder** while the form loads: measured 604 px on phones, 502 px from `sm`. + +## Bugs found by the owner on LAN, fixed (2026-10-21) +1. **"Boek …" did not scroll.** The click navigates to `/?pakket=#contact` and the router scrolls to the hash in its `onRendered` step. Our clean-up navigation (removing `?pakket=`) ran first and passed `hashScrollIntoView: false`, so the router's last instruction was "don't scroll". Traced in real Chrome: `pushState`, `replaceState`, no `scrollIntoView`. The clean-up now asks the router to scroll to `#contact` (`smooth`, or `auto` under reduced motion). Anchored sections get `scroll-margin-top` equal to the header, so the section lands below the fixed header. A new app test clicks "Boek Newborn" on the price card and asserts the scroll to `#contact`; it fails with the old code and passes with the fix. jsdom tests missed it because `scrollIntoView` is a stub there. +2. **"Boek Zwangerschap" scrolled less far than the others.** Smooth scrolling fixes its target when it starts. From the top card the review carousel was not loaded yet and loaded during the scroll; its fixed-height placeholder only matched the carousel at the measured widths, so `#contact` moved by +29 px (360 px wide) or −44 px (600 px) mid-scroll. The placeholder is now the longest review rendered like a slide plus the control bar's height, which is as tall as the carousel at every width. Measured at 360, 390, 412, 600, 768, 1024 and 1440 px: no movement during the scroll; every button ends at the same place. +3. CI run 555: the Lighthouse job on the Pi runner stopped with exit code −1 right after `pnpm install`, before any measurement (runner/infra, not a check failure); rerun with the next deploy. + +## Verification (`pnpm check`) +- Lint ✅, Prettier ✅, build ✅ (`ContactForm` in its own chunk, ±5.7 KB gzipped) +- Tests: 52 files, **238 passed** (after the fixes); 100% coverage on `src/lib/**` +- Lighthouse home: mobile **0.83**, desktop **1.0**; accessibility, best practices, SEO **1.0** +- Visual check: 1440 and 390 with the overlay; 1440 with the form switched on locally (reverted before the build that was checked) + +## Extension compliance +- **Security Baseline**: client-side limits and format (SECURITY-05, server side in the API feature); misuse: gate + honeypot + time check (SECURITY-11); generic failure text (SECURITY-15); the e-mail address is assembled in the browser; no new dependencies or external resources; CSP unchanged. +- **PBT**: PBT-02 (mailto round-trip), PBT-03 (validation invariants), PBT-04 (payload idempotency), PBT-05 (spam and e-mail oracles), PBT-06 (stateful reducer test over random event sequences), PBT-07 (generators), PBT-08/09 (existing seed setup), PBT-10 (example tests). diff --git a/aidlc-docs/features/homepage-sections/construction/contact/functional-design/business-logic-model.md b/aidlc-docs/features/homepage-sections/construction/contact/functional-design/business-logic-model.md new file mode 100644 index 0000000..d2c6772 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/contact/functional-design/business-logic-model.md @@ -0,0 +1,80 @@ +# Business Logic Model — Unit 5: Contact + +## Submit sequence + +```mermaid +sequenceDiagram + box rgba(246,224,94,0.4) Visitor + participant V as Visitor + end + box rgba(99,179,237,0.4) Homepage + participant F as ContactForm + participant L as PureHelpers + participant A as SubmitAdapter + end + V->>F: Clicks the send button + F->>L: validateContact with the values and options + L-->>F: Errors per field, or none + F->>L: isLikelySpam with honeypot and elapsed time + L-->>F: Spam or not + F->>A: submitContactForm with the trimmed payload + A-->>F: Resolved or rejected + F-->>V: Thank-you message, or failure message with mail link +``` + +Text alternative: on submit the form validates, checks for spam, sends the trimmed payload through the single adapter, and shows the thank-you or the failure message. + +## Form state (a pure reducer) + +The form's behaviour is a pure reducer `contactFormReducer(state, event)`, so it can be tested as a state machine (PBT-06) independently of React. + +```mermaid +graph LR + Editing["editing"] -->|"submit, invalid"| Editing + Editing -->|"submit, spam"| Sent["sent"] + Editing -->|"submit, valid"| Sending["sending"] + Sending -->|"resolved"| Sent + Sending -->|"rejected"| Failed["failed"] + Failed -->|"edit or blur"| Failed + Failed -->|"submit, valid"| Sending + + classDef state fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef final fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + class Editing,Sending,Failed state; + class Sent final; +``` + +Text alternative: the form is editing until a submit; an invalid submit stays in editing (with errors), spam goes straight to sent, a valid submit goes to sending, which ends in sent or failed; from failed, a valid submit sends again. + +**State**: `{ status: 'editing' | 'sending' | 'sent' | 'failed'; values; touched: Set of fields; errors }` +**Events**: `edit(field, value)`, `blur(field)`, `preselect(shoot)`, `submit({ now, shownAt, honeypot })`, `resolved`, `rejected`. + +## Pure functions (`web/src/lib/`) + +| Function | Purpose | Rules | +|---|---|---| +| `shootOptions(packages)` | shown packages + Overig | domain-entities.md | +| `validateField(field, values, options)` | first failing message for one field, or undefined | BR-FORM-01…07 | +| `validateContact(values, options)` | errors for all fields | BR-FORM-01…07 | +| `toContactPayload(values)` | trimmed payload | BR-SEND-01 | +| `isLikelySpam({ honeypot, shownAt, now })` | honeypot or under 3000 ms | BR-SPAM-01 | +| `mailSubject(packageName?)` | "Aanvraag fotoshoot: X" or "Vraag via andreaslop.nl" | BR-MAIL-01 | +| `mailtoLink(address, subject)` | `mailto:` with encoded subject | BR-MAIL-01 | +| `contactFormReducer(state, event)` | the state machine above | BR-FORM-10…12, BR-SEND-01…04, BR-SPAM-02 | + +## Testable properties (PBT-01) + +| Function | Category | Property | +|---|---|---| +| `shootOptions` | Invariant | Last option is Overig; the others are the packages' ids and names in order | +| `validateContact` | Oracle | For generated valid values there are no errors | +| `validateContact` | Invariant | Emptying any one required field gives exactly that field's "required" message | +| `validateContact` | Invariant | Exceeding a limit gives that field's "te lang" message | +| `validateContact` | Oracle | E-mail error ⇔ the trimmed value fails the format regex (for non-empty, short values) | +| `toContactPayload` | Idempotency | Making a payload of a payload changes nothing; no field has outer whitespace | +| `isLikelySpam` | Oracle | Equals `honeypot !== '' \|\| now - shownAt < 3000` | +| `mailtoLink` | Round-trip | Decoding the `subject` parameter gives back the subject; the link starts with `mailto:
?` | +| `mailSubject` | Invariant | Contains the package name when given, otherwise the general subject | +| `contactFormReducer` | Stateful (PBT-06) | For random event sequences: status only moves along the allowed transitions; `sending` only after a valid, non-spam submit; values never change while `sending`; errors never show for an untouched field unless a submit happened; after `sent` nothing changes | + +Generators (PBT-07): valid `contactValues` (realistic names, e-mails from the existing `validEmail`, a shoot from the options, messages up to the limit), `anyContactValues` (empty, whitespace, overlong, bad e-mails), and event sequences for the reducer (`fc.commands` or a list of events). diff --git a/aidlc-docs/features/homepage-sections/construction/contact/functional-design/business-rules.md b/aidlc-docs/features/homepage-sections/construction/contact/functional-design/business-rules.md new file mode 100644 index 0000000..a959640 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/contact/functional-design/business-rules.md @@ -0,0 +1,114 @@ +# Business Rules — Unit 5: Contact + +Sources: FR-HP-06…09, unit 3's BR-PARAM-02…04, [contact-fd-questions.md](../../plans/contact-fd-questions.md) and [contact-fd-clarification-questions.md](../../plans/contact-fd-clarification-questions.md). + +## Validation + +| ID | Rule | Message | +|---|---|---| +| BR-FORM-01 | `naam` is required (after trimming) | "Vul je naam in." | +| BR-FORM-02 | `email` is required | "Vul je e-mailadres in." | +| BR-FORM-03 | `email` must look like an address: `^[^\s@]+@[^\s@]+\.[^\s@]{2,}$` after trimming | "Dit e-mailadres is ongeldig." | +| BR-FORM-04 | `shoot` must be one of the shoot options | "Kies een soort shoot." | +| BR-FORM-05 | `bericht` is required | "Schrijf hier je vraag." | +| BR-FORM-06 | Maximum lengths: `naam` 100, `email` 254, `bericht` 2000 (also `maxLength` on the fields) | "De naam is te lang." / "Het e-mailadres is te lang." / "Het bericht is te lang." | +| BR-FORM-07 | Per field the first failing rule wins, in the order required → length → format | — | + +## When errors show (Q1 = B) + +| ID | Rule | +|---|---| +| BR-FORM-10 | A field is checked when the visitor **leaves** it, but only once they have typed in it; tabbing through an untouched empty field shows nothing. | +| BR-FORM-11 | On **submit** every field is checked; if any is invalid, nothing is sent and focus moves to the first invalid field. | +| BR-FORM-12 | A shown error is re-checked while typing and **disappears** as soon as the field is valid (it is not re-shown while typing; a new error only appears on leaving or submitting). | +| BR-FORM-13 | Errors are linked to their field (`aria-describedby`, `aria-invalid`) and announced. | + +## Sending + +| ID | Rule | +|---|---| +| BR-SEND-01 | Valid and not spam → state **sending**: button disabled, label "Versturen…"; the payload (trimmed values) goes to `submitContactForm`. | +| BR-SEND-02 | Success → state **sent**: the form is replaced by "Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen." and focus moves to that message (Q3 = A). | +| BR-SEND-03 | Failure → state **failed**: above the button "Versturen lukte niet. Probeer het later nog eens of mail naar info@andreaslop.nl" with the address as a mail link (BR-MAIL-01); what the visitor typed stays; the next submit tries again (Q6 = A). | +| BR-SEND-04 | A second submit while sending is ignored. | + +## Anti-spam (FR-HP-08) + +| ID | Rule | +|---|---| +| BR-SPAM-01 | Spam when the honeypot `website` is not empty, or less than 3000 ms passed since the form became usable. | +| BR-SPAM-02 | Spam gets the normal success (state **sent**), but nothing is sent. Validation still runs first, like for a person. | +| BR-SPAM-03 | No robot-check script is loaded in this feature; the form keeps a slot for Friendly Captcha (FR-HP-09). | + +## Gate (FR-HP-07) + +| ID | Rule | +|---|---| +| BR-GATE-01 | `contactForm.enabled = false` → the form is visible but dimmed and `inert`; over it the notice "Binnenkort", "Het contactformulier komt binnenkort. Mail me voor nu op info@andreaslop.nl" and the button "Stuur een e-mail". | +| BR-GATE-02 | The address is assembled from `siteContent.email` in the browser (existing `emailAddress`); if it is invalid the notice shows only "Het contactformulier komt binnenkort." without address or button. | +| BR-GATE-03 | `enabled = true` → the form works normally and the notice is not rendered. | + +## Mail link (Q4 = A) + +| ID | Rule | +|---|---| +| BR-MAIL-01 | Every mail link (notice button, address in the notice, address in the failure message) opens a mail with a subject: "Aanvraag fotoshoot: " when the visitor arrived via a "Boek …" link (a package is selected from `?pakket=`), otherwise "Vraag via andreaslop.nl". Subject is URL-encoded. | + +## Preselection from "Boek …" (unit 3, BR-PARAM-02…04) + +| ID | Rule | +|---|---| +| BR-PARAM-02 | When the page has a `pakket` value: if it names a shown package (`packageFromSearch`), the shoot field takes that package — replacing an earlier choice (last click wins, BR-PARAM-03). Then `pakket` is removed from the URL with a history *replace*, keeping `#contact`, without scrolling. Unknown values are removed the same way and change nothing. | +| BR-PARAM-04 | This happens the same way with the gate on or off (with the gate on, the package still feeds the mail subject). | +| BR-FOCUS-01 | After arriving via a "Boek …" link (any `pakket` value present), focus moves to the "Contact" heading (programmatic focus, no visible ring), so keyboard and screen reader users continue in the right place (Q5 = A). A normal page load does not move focus. | + +## Decision flow: submit + +```mermaid +graph TD + Submit["Visitor submits"] --> Busy{"Already sending?"} + Busy -->|"yes"| Ignore["Ignore"] + Busy -->|"no"| Valid{"All fields valid?"} + Valid -->|"no"| ShowErrors["Show errors, focus first invalid field"] + Valid -->|"yes"| Spam{"Honeypot filled or under 3 s?"} + Spam -->|"yes"| FakeSent["Show thank-you, send nothing"] + Spam -->|"no"| Sending["Sending: button disabled"] + Sending --> Result{"Adapter result"} + Result -->|"ok"| Sent["Replace form by thank-you, focus it"] + Result -->|"error"| Failed["Failure message with mail link, keep input"] + + classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; + classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + class Submit input; + class Busy,Valid,Spam,Result decision; + class Ignore,ShowErrors,FakeSent,Sending,Sent,Failed outcome; +``` + +Text alternative: a submit is ignored while sending; otherwise invalid input shows errors and focuses the first invalid field; valid spam gets the thank-you without sending; valid input is sent, and the result either replaces the form by the thank-you or shows the failure message with a mail link while keeping the input. + +## Decision flow: arriving with `?pakket=` + +```mermaid +graph TD + Arrive["Homepage with pakket in the URL"] --> Known{"Names a shown package?"} + Known -->|"yes"| Select["Shoot field takes the package, replacing an earlier choice"] + Known -->|"no"| Keep["Shoot field unchanged"] + Select --> Clean["Remove pakket with history replace, keep hash contact"] + Keep --> Clean + Clean --> Focus["Focus the Contact heading"] + + classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; + classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + class Arrive input; + class Known decision; + class Select,Keep,Clean,Focus outcome; +``` + +Text alternative: a known package is selected (replacing an earlier choice), an unknown one changes nothing; either way the parameter is removed from the URL with a history replace and focus moves to the Contact heading. + +## Misuse considerations (SECURITY-11) +- Form spam: gate today; honeypot and time check in the browser; Friendly Captcha, server-side validation and rate limiting in the API feature (the browser checks are never the only defence). +- Input is only ever rendered as text by React and sent as JSON later; `pakket` is never reflected. +- Failure messages are generic (no technical details, SECURITY-15). diff --git a/aidlc-docs/features/homepage-sections/construction/contact/functional-design/domain-entities.md b/aidlc-docs/features/homepage-sections/construction/contact/functional-design/domain-entities.md new file mode 100644 index 0000000..6ebdc19 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/contact/functional-design/domain-entities.md @@ -0,0 +1,57 @@ +# Domain Entities — Unit 5: Contact + +## Relationships + +```mermaid +graph TD + Values["ContactValues"] + Errors["ContactErrors"] + Payload["ContactPayload"] + Option["ShootOption"] + Package["PricingPackage"] + Config["Contact form setting"] + Address["EmailAddress"] + + Package -->|"becomes, plus Overig"| Option + Option -->|"allowed values of shoot"| Values + Values -->|"checked into"| Errors + Values -->|"trimmed into"| Payload + Config -->|"switches form or notice"| Values + Address -->|"mail link in notice and failure message"| Config + + classDef entity fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000; + classDef value fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000; + classDef config fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + class Values,Payload entity; + class Errors,Option,Package,Address value; + class Config config; +``` + +Text alternative: packages (plus Overig) become the shoot options that limit the shoot value; what the visitor typed is checked into errors and trimmed into the payload; the contact form setting switches between the form and the coming-soon notice, which, like the failure message, uses the site's e-mail address. + +## ContactValues (what the visitor typed) + +| Field | Type | Limit | Required | +|---|---|---|---| +| `naam` | string | 100 characters | yes | +| `email` | string | 254 characters | yes, valid format | +| `shoot` | string | one of the shoot option values | yes | +| `bericht` | string | 2000 characters | yes | + +The limits are also set as `maxLength` on the fields, so in practice they are rarely exceeded; the check is a safety net (and the server repeats it). + +## ContactErrors +`Partial>` — one message per field at most. + +## ContactPayload (sent to the API later) +Same four fields, trimmed. `shoot` is a package id (e.g. `newborn`) or `overig`. The Friendly Captcha token is added in the API feature. + +## ShootOption +`{ value: string; label: string }` — the shown packages in their order (`value` = package id, `label` = name), then `{ value: 'overig', label: 'Overig' }`. The empty "Kies een optie..." is the placeholder, not an option. + +## Contact form setting +`siteContent.contactForm.enabled: boolean` — `false` today (coming-soon notice); later delivered by the CMS. + +## Anti-spam inputs +- Honeypot field `website` (hidden from people and assistive technology). +- `shownAt`: when the form became usable (shown and enabled); minimum fill time **3000 ms**. diff --git a/aidlc-docs/features/homepage-sections/construction/contact/functional-design/frontend-components.md b/aidlc-docs/features/homepage-sections/construction/contact/functional-design/frontend-components.md new file mode 100644 index 0000000..517a0b3 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/contact/functional-design/frontend-components.md @@ -0,0 +1,66 @@ +# Frontend Components — Unit 5: Contact + +## Hierarchy + +```mermaid +graph TD + Route["routes/index.tsx"] --> Section["home/ContactSection"] + Section --> Home["HomeSection id contact, narrow"] + Section --> Heading["SectionHeading, focus target"] + Section --> Gate["ContactForm/ContactFormGate"] + Gate --> Form["ContactForm/ContactForm"] + Gate --> Notice["Coming-soon notice with mail button"] + Form --> Fields["Chakra Field: Input, NativeSelect, Textarea"] + Form --> Honeypot["Honeypot field"] + Form --> Slot["Robot-check slot, empty"] + Form --> Status["Sending, failure and thank-you"] + Logic["lib: reducer, validation, spam, mail link"] -.-> Form + Logic -.-> Gate + Adapter["contact/submitContactForm"] -.-> Form + + 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; + classDef ext fill:#F44336,stroke:#b71c1c,stroke-width:1px,color:#000; + class Route root; + class Section,Home,Heading,Gate,Form,Notice,Fields,Honeypot,Slot,Status ui; + class Logic logic; + class Adapter ext; +``` + +Text alternative: the home route renders ContactSection (HomeSection with id contact, the heading as focus target, and the gate); the gate wraps the form and the coming-soon notice; the form has Chakra fields, a honeypot, an empty robot-check slot and status messages; pure helpers and the submit adapter support it. + +## ContactSection (`components/home/ContactSection`) +- **Props**: `{ content: HomeContent['contact']; packages: PricingPackage[]; enabled: boolean; email: EmailAddress; pakket?: string }` +- **Behaviour**: resolves `pakket` with `packageFromSearch`; passes the selected id to the form (`preselect`) and the package name to the mail subject; removes `pakket` from the URL (router `navigate({ search: {}, hash: 'contact', replace: true, resetScroll: false })`); moves focus to the heading when `pakket` was present (BR-PARAM-02, BR-FOCUS-01). +- **Layout**: `HomeSection` `id="contact"`, `width="narrow"`, plain background, centred `SectionHeading` "Contact" with lead; the heading has `tabIndex={-1}` for the programmatic focus (no visible ring, theme rule `[tabindex="-1"]:focus`). + +## ContactFormGate (`components/ContactForm/ContactFormGate`) +- **Props**: `{ enabled: boolean; email: EmailAddress; subject: string; children }` +- **Off**: wraps children in a dimmed (`opacity 0.35`, slight blur), `inert`, non-selectable box; renders the notice centred over it: eyebrow "Binnenkort", the text with the address as an underline link, and an accent `LinkButton`-style anchor "Stuur een e-mail" (`mailtoLink`). White panel, hairline border, `shadow` from the design (a theme token). Invalid address → text only. +- **On**: renders children only. + +## ContactForm (`components/ContactForm/ContactForm`) +- **Props**: `{ idPrefix: string; options: ShootOption[]; preselect?: { shoot: string; key: number }; mailSubject: string; email: EmailAddress; submit?: (payload) => Promise }` (`key` changes per "Boek" click so the same package can be applied again) +- **State**: `useReducer(contactFormReducer)`; `shownAt` recorded when the form becomes usable. +- **Fields**: Chakra `Field.Root` + `Field.Label` + control + `Field.ErrorText` (`invalid` from state); square inputs in the design style (theme), `autocomplete` name/email, `maxLength` per limit; the select has the placeholder "Kies een optie..." and the shoot options; the textarea min height 170 px with placeholder "Vul hier je bericht in". +- **Honeypot**: label "Website" + input `name="website"`, off-screen, `aria-hidden`, `tabIndex={-1}`, `autoComplete="off"`. +- **Robot-check slot**: an empty `div` with `data-robot-check` (FR-HP-09). +- **Submit button**: accent `linkButton` style on a `button`, "(Aan)vraag versturen" / "Versturen…" while sending, disabled while sending. +- **Failure**: a status box above the button (`role="alert"`) with the mail link. +- **Sent**: the form is replaced by the thank-you (`role="status"`, `tabIndex={-1}`, focused). +- **Layout**: name and e-mail side by side from `sm`, the rest full width; labels in the eyebrow style (`ink.soft` for contrast). +- **Test ids**: `contact-form`, `contact-form-`, `contact-form-submit`, `contact-form-status`, `contact-form-sent`, `contact-gate-notice`, `contact-gate-mail`. + +## Loading +The form is a lazy chunk, loaded when the section comes within 200 px of the screen or at once when arriving via "Boek …", and it stays once loaded; the heading and the gate's notice render immediately over a placeholder of the form's height (unit 5 code summary, performance). + +## Content +- `HomeContent.contact = { title: 'Contact', lead: 'Wil je meer informatie ontvangen? Neem gerust contact met mij op.' }` +- `siteContent.contactForm = { enabled: false }` + +## Accessibility (NFR-HP-01) +- Labels visible and linked; errors via `aria-errormessage`/`aria-invalid` (Ark's Field) and announced; focus to the first invalid field on submit; thank-you focused; failure announced (`role="alert"`). +- With the gate on, the inert form is skipped by keyboard and screen readers; the notice and its button are reachable. +- Contrast: labels and placeholder text meet 4.5:1 (no `ink.muted` on paper); the dimmed form is decorative while inert. +- Axe clean in both gate states; Lighthouse accessibility stays 1.0. diff --git a/aidlc-docs/features/homepage-sections/construction/instagram/code/code-summary.md b/aidlc-docs/features/homepage-sections/construction/instagram/code/code-summary.md new file mode 100644 index 0000000..15cadd6 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/instagram/code/code-summary.md @@ -0,0 +1,25 @@ +# Code Summary — Unit 6: Instagram + +Plan: [instagram-code-generation-plan.md](../../plans/instagram-code-generation-plan.md) + +## Files + +| File | Change | +|---|---| +| `web/src/content/types.ts` | `HomeContent.instagram: { title; handle; photos: ContentImage[] }` | +| `web/src/content/homeContent.ts` | Intro photos moved to a shared `introPhotos` constant; `instagram` content reuses them plus the two review photos (`testimonials`), so one photo keeps one alt text and the section adds no image downloads | +| `web/src/components/HomeSection/HomeSection.tsx` + test | `width="full"`: no `Container`, for edge-to-edge content | +| `web/src/components/SectionHeading/SectionHeading.tsx` | `lead` accepts a `ReactNode` (the handle link) | +| `web/src/components/home/InstagramGrid/InstagramGrid.tsx` + test | New section: centred heading with the handle as external link, full-bleed list of square tiles (2 / 3 from `md` / 6 from `xl`, 2px gap), each an external link named by the photo's alt plus "(Instagram, opent in nieuw tabblad)"; hover and keyboard focus zoom 1.06 and fade to 85%, fade only under reduced motion; focused tile lifted above its neighbours so the ring is not covered | +| `web/src/routes/index.tsx` | Renders `InstagramGrid` last, only when `visibleSocials` yields an Instagram link (https) | +| `web/src/app.test.tsx` | Instagram added to the page-order check; section absent when the link is missing or not https (`siteContent.socials` overridable through a hoisted mock) | + +`LAYOUT.md` already lists Instagram as the last homepage block: unchanged. + +## Verification + +- Lint, Prettier, typecheck/build, dependency audit: ✅ +- Tests: 244 passed (53 files); new: 3 InstagramGrid, 1 HomeSection, 3 app (order + two absent cases) +- Visual (headless Chrome, preview build): 6 columns at 1440px, 3 at 1024px, 2 at 390px; grid as wide as the viewport; h2 30px; the page requests the same 15 images as before (no new ones) +- Lighthouse (`pnpm lighthouse`, production build): ✅ homepage mobile 0.81 (TBT 230 ms, LCP 3.8 s), desktop 1.0; other pages mobile 0.93–0.94, desktop 1.0; accessibility, best practices and SEO 1.0 everywhere. +- A first run failed (home mobile 0.73, /contact 0.84) while the machine was under load (a game and a Vite dev server). Back-to-back runs of the unit 5 build and this build both scattered between 0.68 and 0.84, with no difference between them; with the game closed the gate passed. Scores measured in the browser against the Vite dev server (desktop 0.55, mobile 0.36, 137 unbundled requests) say nothing about the production site. diff --git a/aidlc-docs/features/homepage-sections/construction/lieve-woorden/code/code-summary.md b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/code/code-summary.md new file mode 100644 index 0000000..b2086f9 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/code/code-summary.md @@ -0,0 +1,52 @@ +# Code Summary — Unit 4: Lieve woorden + +Plan: [lieve-woorden-code-generation-plan.md](../../plans/lieve-woorden-code-generation-plan.md). Functional design: [../functional-design/](../functional-design/). Branch: `feature/homepage-sections`. + +## Files + +### Created +| File | Purpose | +|---|---| +| `web/src/assets/home/review-trouwshoot.jpg`, `review-newbornshoot.jpg` | Live photos, centre-cropped to 4:5, 880×1100, ±100 KB | +| `web/src/content/testimonials.ts` | The two live reviews | +| `web/src/lib/visibleTestimonials.ts` + test | Invariants filter, first-wins de-duplication (BR-REV-01) | +| `web/src/lib/slideLabel.ts` + test | "Review n van m" (BR-REV-08/09) | +| `web/src/recipes/carouselControl.ts` | Arrow and dot buttons under a carousel | +| `web/src/components/home/Testimonials/Testimonials.tsx` + test | The section; heading always rendered; carousel loaded when near the screen | +| `web/src/components/home/Testimonials/TestimonialCarousel.tsx` | Chakra `Carousel` (Zag) with our own controls and live region; separate chunk | +| `web/src/components/home/Testimonials/TestimonialSlide.tsx` + test | One review: framed photo, quotation mark, shoot, quote, names | + +### Modified +| File | Change | +|---|---| +| `web/src/content/types.ts`, `homeContent.ts` | `Testimonial`; `HomeContent.testimonials` | +| `web/src/theme.ts` | Registers `carouselControl` | +| `web/src/test/arbitraries.ts` | `testimonial`, `uniqueTestimonials`, `anyTestimonial` | +| `web/src/test/setup.ts` | No-op `ResizeObserver` (jsdom lacks it; the carousel needs it) | +| `web/src/routes/index.tsx` | Renders `Testimonials` after `Pricing` | +| `web/src/app.test.tsx` | "Lieve woorden" in the page order; stubs `IntersectionObserver` and `Element.scrollTo` for the carousel | + +## Decisions and fixes during generation +- **Own controls for reduced motion** (plan finding 1): Zag's built-in triggers, dots and keys scroll smoothly from JavaScript; ours pass `instant` when the visitor prefers reduced motion. Verified in real Chrome: normally the slide moves over ±330 ms, with reduced motion it is in place in the first frame. +- **One announcement** (finding 2): the item group's `aria-live` is off; our polite region says "Review n van m" on each change, nothing on load. +- **Slides clipped each other's frame**: the sand block sticks out 1.5 rem left and below the photo, and the item group clips everything outside a slide, so the next slide's block showed over the quote. Fixed with 4 rem `spacing` between slides and 1.5 rem padding left/bottom in each slide (from `sm`). +- **Carousel cost on page load**: the carousel in the route chunk lowered home mobile Lighthouse from a median **0.83** (unit 3, 5 runs) to **0.81**; `React.lazy` alone did not help (the chunk still loaded at once). Now the section and heading render immediately, and the carousel chunk loads only when the section comes within 200 px of the screen (same rule as the deferred photos), with a placeholder of the measured height. Median back to **0.83** (LCP 3.84 s). +- **Testing approach**: jsdom has no layout, so Zag cannot page there. Unit tests check our wiring (calls to `scrollNext/scrollPrev/scrollTo` with the right `instant`, announcements, labels, loop option, deferred loading); paging, looping, dots and the hidden off-screen slide were checked in real Chrome via the DevTools protocol (next → "Review 2 van 2", next again → back to review 1, dot 2 → review 2). + +## Change request after testing on test (2026-10-20) +The photo was too large on phones (it filled the screen). Now: phones max 180 px wide (±75% of a first 240 px step), tablets max 320 px, centred above the quote. Desktop grid `5fr 11fr` after reviewing screenshots of both, so the photo is ±75% of its earlier size (±395×495 px at 1440) and the whole block fits a ±1000 px high screen. Stacked slides align their content to the top (a short review no longer floats in the middle of the shared height) with a 1.25 rem gap between photo and text. Placeholder heights re-measured. + +## Later change (unit 5) +The carousel's fixed-height placeholder was replaced by the longest review rendered like a slide plus the control bar's height, so it matches the carousel at every width (a mismatch moved `#contact` during a "Boek" scroll; see the unit 5 code summary). + +The quote is a plain `figure`/`blockquote`/`figcaption` instead of Chakra's `Blockquote`: its slot recipe pulled a shared chunk into the route bundle on page load (see the unit 5 code summary, performance). + +## Verification (`pnpm check`) +- Lint ✅, Prettier ✅, build ✅ — carousel in its own chunk (`TestimonialCarousel-*.js`, 43 KB raw) +- Tests: 42 files, **190 passed**; 100% coverage on the new `lib/` files +- Lighthouse home: mobile **0.83** (LCP 3.8 s), desktop **1.0** (LCP 0.8 s); accessibility, best practices, SEO **1.0** +- Visual check: 1440 and 390, both reviews + +## Extension compliance +- **Security Baseline**: content rendered as text; no new dependencies (Chakra Carousel and Ant Design icons already installed); no external resources. Other rules N/A. +- **PBT**: PBT-02 (`slideLabel` round-trip), PBT-03 (invariants), PBT-04 (idempotency), PBT-05 (oracle), PBT-07 (generators), PBT-08/09 (existing), PBT-10 (example tests). PBT-06 N/A — the stateful part is Zag's. diff --git a/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/business-logic-model.md b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/business-logic-model.md new file mode 100644 index 0000000..52b2614 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/business-logic-model.md @@ -0,0 +1,45 @@ +# Business Logic Model — Unit 4: Lieve woorden + +## Navigation flow + +```mermaid +sequenceDiagram + box rgba(246,224,94,0.4) Visitor + participant V as Visitor + end + box rgba(99,179,237,0.4) Testimonials + participant C as Carousel + participant L as LiveRegion + end + V->>C: Next button, dot, arrow key or swipe + C->>C: Compute target page, looping at the ends + C->>C: Scroll to the target slide, instantly under reduced motion + C->>L: Page changed to n + L-->>V: Announces Review n van m +``` + +Text alternative: a navigation action makes the carousel compute the target page (looping), scroll to it (instantly under reduced motion) and report the new page to a polite live region, which announces "Review n van m". + +The carousel state (current page, scrolling, dragging, looping) is Chakra's `Carousel` (Ark UI); this unit does not reimplement it. Our own logic is limited to the pure functions below and wiring `onPageChange` to the live region. + +## Pure functions (`web/src/lib/`) + +| Function | Input → output | Rules | +|---|---|---| +| `visibleTestimonials(items: Testimonial[]): Testimonial[]` | raw list → shown list | BR-REV-01 | +| `slideLabel(index: number, count: number): string` | `(1, 2)` → `'Review 2 van 2'` (index is zero-based) | BR-REV-08/09 | + +## Testable properties (PBT-01) + +| Function | Category | Property | +|---|---|---| +| `visibleTestimonials` | Invariant | Every result meets the invariants; ids unique | +| `visibleTestimonials` | Invariant | Result is a subsequence of the input | +| `visibleTestimonials` | Idempotency | Applying it twice equals applying it once | +| `visibleTestimonials` | Oracle | Valid, unique input comes back unchanged | +| `slideLabel` | Round-trip | The two numbers parsed back from the label are `index + 1` and `count` | +| `slideLabel` | Invariant | For `0 ≤ index < count` the label has the form `Review n van m` with `1 ≤ n ≤ m` | + +The looping and paging itself is Chakra's (tested upstream); our component tests cover the behaviour at our boundary: loop from last to first, announcement text, controls hidden for one review, nothing rendered for none. PBT-06 (stateful) is N/A because the state machine is not ours. + +Generators (PBT-07) in `src/test/arbitraries.ts`: `testimonial` (valid; slug ids, non-blank texts, image with positive size), `uniqueTestimonials`, `anyTestimonial` (incl. blank quote/author/shoot, empty src, zero size, duplicate ids). diff --git a/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/business-rules.md b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/business-rules.md new file mode 100644 index 0000000..9b336c1 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/business-rules.md @@ -0,0 +1,64 @@ +# Business Rules — Unit 4: Lieve woorden + +## Rules + +| ID | Rule | Source | +|---|---|---| +| BR-REV-01 | Only testimonials that meet the invariants are shown; duplicates by id keep the first; order is kept. | domain-entities.md | +| BR-REV-02 | No valid testimonial → the section is not rendered. One → it is shown without arrows, dots or carousel semantics. Two or more → carousel. | FR-HP-05 | +| BR-REV-03 | One review is visible at a time; there is no autoplay. | FR-HP-05, design Q2 | +| BR-REV-04 | Navigation: previous/next buttons, one dot per review, arrow keys when focus is in the carousel, and swiping (and mouse dragging) on the slides. | FR-HP-05 | +| BR-REV-05 | At the ends the carousel loops: "next" on the last review goes to the first, "previous" on the first to the last. The buttons are never disabled. | Q1 = A | +| BR-REV-06 | A change slides horizontally (the slides lie side by side; a swipe follows the finger). Under `prefers-reduced-motion` the change is immediate, without animation. | Q2 = A | +| BR-REV-07 | Every slide has the height of the tallest one, so the page below does not move when the review changes. | Q3 = A | +| BR-REV-08 | Every manual change is announced once, politely, as "Review n van m". Nothing is announced on page load. | NFR-HP-01 | +| BR-REV-09 | Each slide is labelled "Review n van m"; the buttons are "Vorige review" / "Volgende review"; each dot is "Review n", and the current dot is marked as current. | NFR-HP-01 | +| BR-REV-10 | Off-screen slides are hidden from assistive technology and not focusable. | NFR-HP-01 | +| BR-REV-11 | The quote is shown as a blockquote with the author as its caption; the large quotation mark is decorative and hidden from assistive technology. | design | + +## Decision flow: what is rendered (BR-REV-01/02) + +```mermaid +graph TD + In["Testimonials from content"] --> Filter["Keep valid, first of each id"] + Filter --> Count{"How many remain?"} + Count -->|"none"| Nothing["Section not rendered"] + Count -->|"one"| Single["Single review, no controls"] + Count -->|"two or more"| Carousel["Carousel with arrows, dots, keyboard and swipe, looping"] + + classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; + classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + class In,Filter input; + class Count decision; + class Nothing,Single,Carousel outcome; +``` + +Text alternative: after filtering, no testimonials means no section, one means a single review without controls, two or more means a looping carousel with arrows, dots, keyboard and swipe. + +## Decision flow: navigation (BR-REV-05/06/08) + +```mermaid +graph TD + Act["Visitor uses arrow, dot, key or swipe"] --> Target{"Past the last or before the first?"} + Target -->|"yes"| Wrap["Wrap around to the other end"] + Target -->|"no"| Go["Go to the chosen review"] + Wrap --> Motion{"Prefers reduced motion?"} + Go --> Motion + Motion -->|"yes"| Jump["Switch immediately"] + Motion -->|"no"| Slide["Slide horizontally"] + Jump --> Say["Announce Review n van m once"] + Slide --> Say + + classDef input fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; + classDef decision fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef outcome fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + class Act input; + class Target,Motion decision; + class Wrap,Go,Jump,Slide,Say outcome; +``` + +Text alternative: any navigation action wraps around at the ends, then either switches immediately (reduced motion) or slides, and is announced once as "Review n van m". + +## Misuse considerations (SECURITY-11) +Testimonials are static content (later from the CMS) and rendered as text by React; no HTML from content is interpreted. diff --git a/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/domain-entities.md b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/domain-entities.md new file mode 100644 index 0000000..2fa7cc8 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/domain-entities.md @@ -0,0 +1,57 @@ +# Domain Entities — Unit 4: Lieve woorden + +## Relationships + +```mermaid +graph TD + List["Testimonial list"] + Item["Testimonial"] + Image["ContentImage"] + Slide["Carousel slide"] + + List -->|"contains, in display order"| Item + Item -->|"has one photo"| Image + Item -->|"shown as"| Slide + + classDef entity fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000; + classDef value fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000; + classDef ui fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + class List,Item entity; + class Image value; + class Slide ui; +``` + +Text alternative: the testimonial list holds testimonials in display order; each has one photo and is shown as one carousel slide (blue = data, orange = value, green = UI). + +## Testimonial + +| Field | Type | Required | Description | +|---|---|---|---| +| `id` | string | yes | Stable, unique key (e.g. `majella-mark`) | +| `shoot` | string | yes | Shoot type as a label (e.g. "Trouwshoot") | +| `quote` | string | yes | The review text, without quotation marks (the design adds a decorative one) | +| `author` | string | yes | Names as they should appear (e.g. "Majella & Mark") | +| `image` | ContentImage | yes | Photo for the review, with alt text and size | + +### Invariants +- `id` unique within the list. +- `shoot`, `quote` and `author` non-empty after trimming. +- `image.src` non-empty; `image.width` and `image.height` positive. +- List order is the display order. + +Testimonials that break an invariant are skipped; of two with the same id the first is kept (same approach as packages and socials). + +## Initial data (live site, 2026-10-19) + +| id | shoot | author | quote (start) | photo | +|---|---|---|---|---| +| `majella-mark` | Trouwshoot | Majella & Mark | "Super mooie foto's door Andrea gemaakt op onze trouwdag en pré-wedding shoot. …" | live `IMG_2497-5.jpg` (rings), alt "Bruidegom schuift de trouwring om de vinger van de bruid" | +| `demi-kevin` | Newbornshoot | Demi & Kevin | "Heel tevreden met de newbornshoot. …" | live `5-F41A4650-scaled.jpg` (baby's fist), alt "Vuistje van een pasgeboren baby tussen gebreide dekens" | + +Full texts: requirements FR-HP-05. + +## Section content (`HomeContent.testimonials`) + +| Field | Value | +|---|---| +| `title` | "Lieve woorden" | diff --git a/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/frontend-components.md b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/frontend-components.md new file mode 100644 index 0000000..78867b9 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/lieve-woorden/functional-design/frontend-components.md @@ -0,0 +1,49 @@ +# Frontend Components — Unit 4: Lieve woorden + +## Hierarchy + +```mermaid +graph TD + Route["routes/index.tsx"] --> T["home/Testimonials"] + T --> Section["HomeSection tone alt"] + T --> Heading["SectionHeading"] + T --> Root["Carousel.Root loop"] + Root --> Group["Carousel.ItemGroup"] + Group --> Item["Carousel.Item x n"] + Item --> Slide["home/Testimonials/TestimonialSlide"] + Slide --> Framed["FramedImage 4 by 5"] + Root --> Control["Carousel.Control: Prev, Indicators, Next"] + T --> Live["Live region"] + Lib["lib: visibleTestimonials, slideLabel"] -.-> T + + 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,Root,Group,Item,Slide,Framed,Control,Live ui; + class Lib logic; +``` + +Text alternative: the home route renders Testimonials, which uses HomeSection, SectionHeading, a looping Chakra Carousel with one item per review (each a TestimonialSlide with a FramedImage) and a control bar with previous, dots and next, plus a live region; pure helpers supply the shown reviews and labels. + +## Testimonials +- **Props**: `{ content: HomeContent['testimonials']; testimonials: Testimonial[] }` +- **Behaviour**: `visibleTestimonials`; none → `null`; one → the `TestimonialSlide` directly (no carousel); two or more → `Carousel.Root` with `slideCount`, `loop`, `allowMouseDrag`, one slide per page. +- **Layout**: `HomeSection` with `tone="alt"`, `data-testid="testimonials"`, centred `SectionHeading`. Controls centred below the slides, margin `clamp(2.5rem, 5vw, 4rem)`. +- **Equal height** (BR-REV-07): items stretch in the item group's row, so all slides take the tallest height; content vertically centred within. +- **Reduced motion** (BR-REV-06): the item group's scrolling is instant (`scroll-behavior: auto`). +- **Announcements** (BR-REV-08): a `VisuallyHidden` polite live region, empty on load, set to `slideLabel(page, count)` in `onPageChange`. Any live region Chakra adds itself is checked so only one announcement is made. +- **Controls**: `Carousel.PrevTrigger` / `NextTrigger` with Dutch `aria-label`s and arrow icons from the offline icon set (as the hero), 48 px square, `line` border, `ink` border on hover/focus; `Carousel.Indicator` per page, 44 px hit area around an 8 px dot (`accent.deep` outline, filled when current). +- **Test ids**: `testimonials`, `testimonials-prev`, `testimonials-next`, `testimonials-dot-{n}`, `testimonial-{id}`. + +## TestimonialSlide +- **Props**: `{ testimonial: Testimonial }` +- **Layout**: grid `5fr 11fr` from `lg` (photo column ±75% of the design's `5fr 7fr`) with gap `clamp(2rem, 6vw, 5.5rem)`, centred vertically; stacked below `lg` with the photo centred, max 180 px wide on phones and 320 px on tablets, content aligned to the top (slides share the tallest height) and a 1.25 rem gap between photo and text (owner's choices after review). +- **Photo**: `FramedImage` with aspect `4 / 5` (the source photos are cropped to 4:5 when prepared). +- **Text**: decorative quotation mark (Marcellus, `clamp(5rem, 9vw, 7.5rem)`, `accent`, `aria-hidden`); shoot as eyebrow (`accent.deep`); `figure` > `Blockquote` (Marcellus, `clamp(1.35rem, 2.2vw, 1.75rem)`, line-height 1.5, `ink`) > `figcaption` with "— " + author in small caps (`ink.soft`). + +## Accessibility (NFR-HP-01) +- Region named by the h2 "Lieve woorden"; the carousel has `aria-roledescription` "carrousel" and a label "Reviews"; slides "Review n van m" (BR-REV-09). +- Hidden slides are inert to keyboard and screen readers (BR-REV-10). +- Focus ring from the theme on all controls; targets ≥ 44 px. +- Axe clean; Lighthouse accessibility stays 1.0. diff --git a/aidlc-docs/features/homepage-sections/construction/lifestyle-fotografie/code/code-summary.md b/aidlc-docs/features/homepage-sections/construction/lifestyle-fotografie/code/code-summary.md new file mode 100644 index 0000000..f6cf460 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/lifestyle-fotografie/code/code-summary.md @@ -0,0 +1,92 @@ +# Code Summary — Unit 1: Lifestyle fotografie + +Plan: [lifestyle-fotografie-code-generation-plan.md](../../plans/lifestyle-fotografie-code-generation-plan.md). Branch: `feature/homepage-sections`. + +## Files + +### Created +| File | Purpose | +|---|---| +| `web/src/assets/home/intro-1…4.jpg` | Gallery photos, 800×1200, 92–141 KB | +| `web/src/content/homeContent.ts` | Homepage section content (intro part) | +| `web/src/hooks/useInView.ts` | Shared "has come into/near view, once" hook (IntersectionObserver; immediate without it) | +| `web/src/hooks/useReveal.ts` + test | Reveal trigger on top of `useInView`; immediate under reduced motion | +| `web/src/hooks/usePageLoaded.ts` + test | True once the window load event has fired | +| `web/src/components/Reveal/Reveal.tsx` + test | Fade-in-and-up wrapper, optional stagger delay, passes Box props | +| `web/src/components/DeferredImage/DeferredImage.tsx` + test | Below-the-fold image that loads after the load event and within 600 px of the viewport | +| `web/src/components/SectionHeading/SectionHeading.tsx` + test | Eyebrow, h2 with id, lead | +| `web/src/components/HomeSection/HomeSection.tsx` + test | Section frame: rhythm, tone, width, `aria-labelledby`, anchor | +| `web/src/components/home/IntroGallery/IntroGallery.tsx` + test | The "Lifestyle fotografie" section | +| `web/src/test/fakeIntersectionObserver.ts` | Shared, controllable IntersectionObserver test double | + +### Modified +| File | Change | +|---|---| +| `web/src/theme.ts` | Spacing `sectionY`, `sectionYTight`, `sectionHeadGap`, `gridGap`; size `contentNarrow`; duration `reveal`; text styles `sectionTitle`, `lead` | +| `web/src/content/types.ts` | `ContentImage`, `HomeContent` (intro) | +| `web/src/routes/index.tsx` | Renders `IntroGallery` after the Hero | +| `web/src/app.test.tsx` | Homepage: sections follow the hero in order, one h1, axe clean | + +## Deviation from the plan (Step 18a) +The first `pnpm check` failed on Lighthouse home mobile performance (0.78, budget 0.8). The LCP rose from 3.8 s to 5.3 s because Chrome fetches `loading="lazy"` images within ±1250 px of the viewport straight away: the gallery photos right under the hero were downloaded together with the first hero photo and, under Lighthouse's throttling, took its bandwidth. `DeferredImage` now holds back the `src` until the page has loaded and the image is near the viewport. Every later unit uses it for its photos. + +## Change request after review: swipeable row on phones +Requested: on phones the four photos stacked vertically were too much; show one at a time and swipe to the next. +- `IntroGallery` now renders the photos as a list (`ul` named "Foto's"). Below `sm` it is a full-bleed row with CSS scroll snap: each photo 85% of the width, centred on snap, the next one peeking in; scrollbar hidden; the list is focusable (`tabIndex=0`, only while it scrolls, via `useBreakpointValue`) so keyboard users can scroll it with the arrow keys. From `sm` the grid (2 / 4 columns, staggered offsets) is unchanged. +- Photos clipped by the scroller never intersect on their own, so the gallery observes its list once (`useInView`, 600 px margin) and passes `near` to each `DeferredImage` (new optional prop). The gallery now fades in as one block instead of per photo. +- Static design updated to match (`style.css`, ≤ 680 px); FR-HP-02 updated. +- Verified at an emulated 390×844 phone via the Chrome DevTools Protocol (one photo with the next peeking in; second photo snaps to the centre after swiping). +- `pnpm check` green: **139 tests**, Lighthouse home mobile **0.84** (LCP 3.9 s), desktop **1.0**, accessibility/best practices/SEO **1.0**. + +## Image script +Images are resized with a one-off PowerShell script (not part of the project; .NET `System.Drawing`, Windows). Command used: + +```powershell +1..4 | ForEach-Object { + & .\resize-image.ps1 -Source "design\andreaslop-static\assets\img\intro-$_.jpg" ` + -Target "web\src\assets\home\intro-$_.jpg" -Width 800 -Quality 80 +} +``` + +```powershell +param( + [Parameter(Mandatory)] [string] $Source, + [Parameter(Mandatory)] [string] $Target, + [Parameter(Mandatory)] [int] $Width, + [int] $Quality = 80 +) +Add-Type -AssemblyName System.Drawing +$image = [System.Drawing.Image]::FromFile((Resolve-Path $Source)) +try { + $height = [int][Math]::Round($image.Height * $Width / $image.Width) + $bitmap = New-Object System.Drawing.Bitmap $Width, $height + try { + $graphics = [System.Drawing.Graphics]::FromImage($bitmap) + $graphics.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic + $graphics.PixelOffsetMode = [System.Drawing.Drawing2D.PixelOffsetMode]::HighQuality + $graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality + $graphics.DrawImage($image, 0, 0, $Width, $height) + $graphics.Dispose() + $codec = [System.Drawing.Imaging.ImageCodecInfo]::GetImageEncoders() | Where-Object MimeType -eq 'image/jpeg' + $params = New-Object System.Drawing.Imaging.EncoderParameters 1 + $params.Param[0] = New-Object System.Drawing.Imaging.EncoderParameter ([System.Drawing.Imaging.Encoder]::Quality), ([long]$Quality) + $bitmap.Save($Target, $codec, $params) + } + finally { $bitmap.Dispose() } +} +finally { $image.Dispose() } +``` + +Results: intro-1 92 KB, intro-2 141 KB, intro-3 137 KB, intro-4 110 KB. + +## Verification (`pnpm check`) +- Lint ✅, Prettier ✅ (after reformatting CRLF line endings introduced by an edit script) +- Tests: 30 files, **138 passed** (incl. existing property-based tests; coverage thresholds met) +- Build ✅ (`tsc` + Vite) — after rewriting constructor parameter properties in a test (`erasableSyntaxOnly`) +- `audit:deps` ✅ no known vulnerabilities; `audit:dev` 8 findings in dev tooling (report-only, unchanged from master) +- Lighthouse home: mobile performance **0.85** (LCP 3.8 s, equal to master), desktop **1.0**; accessibility, best practices and SEO **1.0** on all 7 URLs +- Note: a leftover `vite preview` on port 4173 from an earlier session blocked the first Lighthouse run; it was stopped. + +## Extension compliance +- **Security Baseline**: SECURITY-10 compliant (no new dependencies); SECURITY-13 compliant (no external resources); SECURITY-04 compliant (headers unchanged); other rules N/A (no input, server, data store or auth in this unit). +- **PBT**: PBT-01 N/A — no business logic, data transformation or algorithm in this unit; PBT-10 compliant (example-based tests for every component and hook); PBT-08/09 unchanged. diff --git a/aidlc-docs/features/homepage-sections/construction/over-mij/code/code-summary.md b/aidlc-docs/features/homepage-sections/construction/over-mij/code/code-summary.md new file mode 100644 index 0000000..716495f --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/over-mij/code/code-summary.md @@ -0,0 +1,37 @@ +# Code Summary — Unit 2: Over mij + +Plan: [over-mij-code-generation-plan.md](../../plans/over-mij-code-generation-plan.md). Branch: `feature/homepage-sections`. + +## Files + +### Created +| File | Purpose | +|---|---| +| `web/src/assets/home/andrea.jpg` | Photo of Andrea, 1200×800, 75 KB (from the 1600×1067 original; the live site shows a 1024 px version) | +| `web/src/components/FramedImage/FramedImage.tsx` + test | Photo with the sand offset block behind it (CSS `::before`, hidden below `sm`); uses `DeferredImage` | +| `web/src/components/home/AboutBlock/AboutBlock.tsx` + test | The "Over mij" section | + +### Modified +| File | Change | +|---|---| +| `web/src/content/types.ts` | `HomeContent.about`; the link target is a `RoutePath` | +| `web/src/content/homeContent.ts` | About content (live texts, photo, link to `/over-mij`) | +| `web/src/recipes/link.ts` | New `underline` variant (design `.link-underline`), reused by later units | +| `web/src/components/SectionHeading/*` | `spacing="compact"` for a heading above running text | +| `web/src/components/DeferredImage/*`, `IntroGallery.tsx` | Load margin 600 px → **200 px**, shared constant `DEFERRED_LOAD_MARGIN` (see below) | +| `web/src/routes/index.tsx` | Renders `AboutBlock` after `IntroGallery` | +| `web/src/app.test.tsx` | Page-order check includes the "Over mij" section | + +## Fix during verification: deferred images raced the hero +The first `pnpm check` failed again on Lighthouse home mobile (0.77, LCP 5.3 s). Comparing all runs showed a race: when the gallery photos *started* before the observed LCP (164 ms vs 190 ms; 196 ms vs 219 ms) the simulated LCP was 5.3 s; when they started at or after it (221 ms vs 220 ms) it was 3.8 s. With a 600 px margin the gallery, ±240 px below the full-height hero, was "near" right after the load event. With 200 px nothing below the hero is in range when the page opens; the latest runs request none of those photos (mobile 0.84, LCP 3.9 s; desktop 1.0), so the result no longer depends on timing. Photos load as the visitor scrolls towards them; the placeholder and the reveal fade cover the short wait. + +## Verification (`pnpm check`) +- Lint ✅, Prettier ✅, build ✅ +- Tests: 32 files, **142 passed** +- `audit:deps` ✅; `audit:dev` report-only (unchanged) +- Lighthouse home: mobile **0.84**, desktop **1.0**; accessibility, best practices, SEO **1.0** on all URLs +- Visual check (CDP): desktop 1440 — photo with sand block left, text right; phone 390 — stacked, no block + +## Extension compliance +- **Security Baseline**: no new dependencies or external resources (SECURITY-10/13); internal link only; other rules N/A. +- **PBT**: PBT-01 N/A (no logic); PBT-10 example-based tests for FramedImage, AboutBlock and the SectionHeading variant. diff --git a/aidlc-docs/features/homepage-sections/construction/plans/contact-code-generation-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/contact-code-generation-plan.md new file mode 100644 index 0000000..c3855ea --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/contact-code-generation-plan.md @@ -0,0 +1,65 @@ +# Code Generation Plan — Unit 5: Contact + +**This plan is the single source of truth for Code Generation of unit 5.** + +## Unit context +- **Requirements**: FR-HP-06, FR-HP-07, FR-HP-08, FR-HP-09, NFR-HP-01/02/03/04/05/06 +- **Functional design**: [contact/functional-design/](../contact/functional-design/) — BR-FORM-01…13, BR-SEND-01…04, BR-SPAM-01…03, BR-GATE-01…03, BR-MAIL-01, BR-PARAM-02/04, BR-FOCUS-01 +- **Depends on**: unit 1 (`HomeSection`, `SectionHeading`, `Reveal`), unit 3 (`packages`, `visiblePackages`, `packageFromSearch`, `pakket` search), existing `emailAddress`, `linkButton` and `link` recipes +- **PBT**: full — all pure helpers plus a stateful test of the form reducer (PBT-06) +- Conventions as in units 1–4. + +## Steps + +### Types and content +- [x] **Step 1** — `src/contact/types.ts`: `ContactField`, `ContactValues`, `ContactErrors`, `ContactPayload`, `ShootOption`, `CONTACT_LIMITS` (naam 100, email 254, bericht 2000). `content/types.ts`: `HomeContent.contact { title; lead }`, `SiteContent.contactForm { enabled }`. Content: `homeContent.contact`, `siteContent.contactForm = { enabled: false }`. + +### Pure helpers (`src/lib/`, each with example and property tests) +- [x] **Step 2** — `shootOptions.ts`: shown packages (`visiblePackages`) + Overig. +- [x] **Step 3** — `validateContact.ts`: `validateField` and `validateContact` with the exact messages of BR-FORM-01…07. +- [x] **Step 4** — `toContactPayload.ts`: trimmed payload. +- [x] **Step 5** — `isLikelySpam.ts`: honeypot or under `MIN_FILL_MS = 3000`. +- [x] **Step 6** — `mailLink.ts`: `mailSubject(packageName?)`, `mailtoLink(address, subject)`. +- [x] **Step 7** — `contactFormReducer.ts`: state `{ status, values, touched, errors }`, events `edit`, `blur`, `preselect`, `submit`, `resolved`, `rejected` (BR-FORM-10…12, BR-SEND-01…04, BR-SPAM-02). Stateful property test with random event sequences checking the invariants of business-logic-model.md. +- [x] **Step 8** — `test/arbitraries.ts`: `contactValues` (valid), `anyContactValues`, `contactEvent`. + +### Adapter +- [x] **Step 9** — `src/contact/submitContactForm.ts` (+ test): `async (payload) => { throw new Error(...) }` today, with a comment pointing to `POST /api/contact` and the captcha token; generic, no details shown to visitors. + +### Styling +- [x] **Step 10** — `recipes/formControl.ts`: the design's square fields (white, `line` border, 0.95 × 1.1 rem padding, weight 300, `accent` border + soft ring on focus, error border with sufficient contrast), applied to `Input`, `Textarea` and `NativeSelect.Field`; register in `theme.ts`. Add a `panel` shadow token (design `--shadow-md`) for the notice; error colour token if needed (≥ 4.5:1 on paper). + +### Components +- [x] **Step 11** — `components/ContactForm/ContactForm.tsx`: reducer, `shownAt`, Chakra `Field` per field (labels in the eyebrow style, `ink.soft`), name + e-mail side by side from `sm`, select with placeholder, textarea, honeypot, empty `data-robot-check` slot, failure status (`role="alert"`, mail link), submit button (accent `linkButton` style, "Versturen…" while sending), thank-you replacing the form (`role="status"`, focused); `preselect` prop applied on change of its key; injectable `submit`. +- [x] **Step 12** — `components/ContactForm/ContactFormGate.tsx`: off → dimmed, `inert` wrapper + notice (eyebrow, text with underline mail link, "Stuur een e-mail" button), text only when the address is invalid; on → children. +- [x] **Step 13** — `components/home/ContactSection/ContactSection.tsx`: `HomeSection id="contact" width="narrow"`, heading (`tabIndex={-1}`) and lead, gate + form; resolves `pakket`, preselects, removes it from the URL (`navigate` replace, keep `#contact`, no scroll reset) and focuses the heading (BR-PARAM-02, BR-FOCUS-01). +- [x] **Step 14** — Tests: `ContactForm.test.tsx` (labels; blur shows errors only after typing; messages per rule; submit focuses first invalid; errors clear while typing; spam → thank-you, `submit` not called; success → thank-you focused; failure → alert with mail link, values kept; double submit ignored; preselect; axe), `ContactFormGate.test.tsx` (inert form, notice, mailto with subject, invalid address → text only, enabled → form only, axe both), `ContactSection.test.tsx` (preselect from `pakket`, URL cleaned with replace, heading focused, unknown value ignored and cleaned, no focus move without `pakket`). + +### Route +- [x] **Step 15** — `routes/index.tsx`: render `ContactSection` after `Testimonials` with `homeContent.contact`, `packages`, `siteContent.contactForm.enabled`, `siteContent.email` and `pakket` from `Route.useSearch()`. +- [x] **Step 16** — `app.test.tsx`: "Contact" in the page order; `/?pakket=newborn` → shoot "Newborn" selected, URL without `pakket`, focus on the Contact heading. + +### Verification and wrap-up +- [x] **Step 17** — `pnpm check`; Lighthouse home mobile compared with a 5-run median against the unit 4 build. **If the form code costs measurable performance** (as the carousel did), load the form (not the heading and notice) when the section comes near the screen, as in unit 4. Visual check at 1440 / 390 (gate on), and with the gate switched on locally for one screenshot of the working form. +- [x] **Step 18** — `construction/contact/code/code-summary.md`. +- [x] **Step 19** — Commit ("Adds the Contact section to the homepage" + attribution). Not pushed. + +### Fixes during Step 17 +- [x] **Step 17a** — Lighthouse median 0.83 → 0.80: the form moved to its own chunk, loaded when the section is within 200 px of the screen or at once via "Boek …", and stays once loaded; placeholder of the measured height. +- [x] **Step 17b** — Remaining 0.81: a new shared chunk (Chakra's slot-recipe factory) was fetched by the route on load. PriceCard's `List` and TestimonialSlide's `Blockquote` replaced by plain elements with the same styling; median back to 0.83. + +## Requirement / rule traceability +| Item | Steps | +|---|---| +| FR-HP-06 / BR-FORM-* | 1–3, 7, 10, 11, 14 | +| FR-HP-07 / BR-GATE-* | 1, 12, 14 | +| FR-HP-08 / BR-SPAM-* | 5, 7, 11, 14 | +| FR-HP-09 | 11 (slot) | +| BR-SEND-* | 4, 7, 9, 11, 14 | +| BR-MAIL-01 | 6, 11, 12, 14 | +| BR-PARAM-02/04, BR-FOCUS-01 | 13, 14, 16 | +| NFR-HP-05 | 17 | + +## Extension compliance (planned) +- **Security**: client-side limits/format checks (server-side in the API feature, SECURITY-05); misuse covered by gate + honeypot + time check (SECURITY-11); generic failure text (SECURITY-15); e-mail never literal in HTML or bundle; no new dependencies or external resources; CSP unchanged. +- **PBT**: PBT-02 (mailto round-trip), PBT-03 (validation invariants), PBT-04 (payload idempotency), PBT-05 (spam and e-mail oracles), PBT-06 (reducer state machine), PBT-07 (generators), PBT-08/09 (existing), PBT-10 (example tests). diff --git a/aidlc-docs/features/homepage-sections/construction/plans/contact-fd-clarification-questions.md b/aidlc-docs/features/homepage-sections/construction/plans/contact-fd-clarification-questions.md new file mode 100644 index 0000000..cfeb60e --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/contact-fd-clarification-questions.md @@ -0,0 +1,20 @@ +# Functional Design — Vervolgvragen Unit 5: Contact + +## Ontbrekend antwoord: Vraag 6 — Versturen mislukt (straks, met de API) +Vraag 6 in [contact-fd-questions.md](contact-fd-questions.md) is nog niet beantwoord. + +- A) Een melding boven de knop: "Versturen lukte niet. Probeer het later nog eens of mail naar info@andreaslop.nl", met het adres als mailto-link. Wat de bezoeker typte blijft staan. (aanbevolen) +- B) Alleen "Versturen lukte niet. Probeer het later nog eens." +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Onduidelijkheid: melding "te lang" bij Vraag 2 +Je gaf voor "te lang": "Het bericht is te lang". Er gelden ook grenzen voor naam (100 tekens) en e-mail (254 tekens). +Let op: de velden krijgen ook een maximum in de browser, zodat je er niet meer in kunt typen of plakken. De melding is dus vooral een vangnet en zal een bezoeker zelden zien. + +- A) Per veld een eigen melding: "De naam is te lang.", "Het e-mailadres is te lang.", "Het bericht is te lang." (aanbevolen) +- B) Overal dezelfde melding: "Het bericht is te lang" +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A diff --git a/aidlc-docs/features/homepage-sections/construction/plans/contact-fd-questions.md b/aidlc-docs/features/homepage-sections/construction/plans/contact-fd-questions.md new file mode 100644 index 0000000..46cf7ee --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/contact-fd-questions.md @@ -0,0 +1,63 @@ +# Functional Design Questions — Unit 5: Contact + +Vul per vraag de letter in na `[Answer]:` (of geef ze in de chat, bijv. "1A, 2A, …"). Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**. + +Zolang het formulier achter de overlay zit, merkt een bezoeker van vraag 1–3 nog niets; ze bepalen hoe het werkt zodra je het aanzet (of als je het op test even aanzet om te proberen). + +## Vraag 1: Wanneer verschijnen foutmeldingen? + +- A) Pas bij versturen. Daarna wordt per veld opnieuw gecontroleerd zodra de bezoeker het aanpast, zodat een melding verdwijnt zodra het goed is. Niemand krijgt een fout tijdens het typen van een eerste poging. (aanbevolen) +- B) Bij het verlaten van elk veld (tab of klik ergens anders), en bij versturen +- C) Alleen bij versturen; meldingen blijven staan tot de volgende poging +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: B + +## Vraag 2: Foutmeldingen +Voorstel (uit het ontwerp, aangevuld): +- Naam leeg: "Vul je naam in." +- E-mail leeg: "Vul je e-mailadres in." · ongeldig: "Dit e-mailadres klopt nog niet." +- Shoot niet gekozen: "Kies een soort shoot." +- Bericht leeg: "Schrijf hier je vraag." +- Te lang (naam 100, e-mail 254, bericht 2000 tekens): "Dit is te lang (maximaal N tekens)." + +- A) Zo overnemen (aanbevolen) +- X) Anders (pas hieronder aan na de [Answer]:-tag) + +[Answer]: X — E-mail ongeldig: "Dit e-mailadres is ongeldig." Te lang: "Het bericht is te lang" + +## Vraag 3: Na succesvol versturen + +- A) Het formulier verdwijnt en er komt een bevestiging voor in de plaats: "Bedankt voor je bericht! Andrea reageert binnen 2-3 werkdagen." De focus gaat naar die bevestiging, zodat ook een schermlezer hem hoort. (aanbevolen) +- B) Het formulier blijft staan en wordt leeggemaakt; de bevestiging staat eronder +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +Klopt "binnen 2-3 werkdagen"? Pas het anders aan bij je antwoord. + +[Answer]: A, maar het bericht is: "Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen." + +## Vraag 4: De mailknop in de overlay + +- A) De mail krijgt alvast een onderwerp: "Vraag via andreaslop.nl", en als de bezoeker via "Boek …" kwam het pakket erbij: "Aanvraag fotoshoot: Newborn". Scheelt de bezoeker typen en Andrea ziet meteen waar het over gaat. (aanbevolen) +- B) Een gewone mailto zonder onderwerp +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 5: Waar komt de focus na "Boek …"? +Na een klik op "Boek Newborn" scrollt de pagina naar Contact. De toetsenbordfocus staat dan nog op de knop bij Prijzen, buiten beeld: wie daarna op Tab drukt, springt terug omhoog. + +- A) De focus gaat naar de kop "Contact" (onzichtbaar, zonder focusring). Toetsenbord- en schermlezergebruikers zitten dan op de juiste plek; de volgende Tab gaat naar het formulier, of nu naar de mailknop. (aanbevolen) +- B) De focus gaat direct naar het keuzeveld "In welke shoot …" (of nu naar de mailknop) +- C) Niets aan doen +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 6: Versturen mislukt (straks, met de API) + +- A) Een melding boven de knop: "Versturen lukte niet. Probeer het later nog eens of mail naar info@andreaslop.nl", met het adres als mailto-link. Wat de bezoeker typte blijft staan. (aanbevolen) +- B) Alleen "Versturen lukte niet. Probeer het later nog eens." +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A (via contact-fd-clarification-questions.md) diff --git a/aidlc-docs/features/homepage-sections/construction/plans/contact-functional-design-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/contact-functional-design-plan.md new file mode 100644 index 0000000..15a0d65 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/contact-functional-design-plan.md @@ -0,0 +1,12 @@ +# Functional Design Plan — Unit 5: Contact + +Scope: FR-HP-06 (form), FR-HP-07 (coming-soon gate), FR-HP-08 (anti-spam, browser side), FR-HP-09 (robot-check slot), and BR-PARAM-02…04 from unit 3 (applying and removing `?pakket=`). Questions: [contact-fd-questions.md](contact-fd-questions.md). + +Already fixed by requirements and earlier design (no question): fields Naam, E-mail, "In welke shoot heb je interesse?" (package names + Overig), "Stel hier je vraag"; button "(Aan)vraag versturen"; gate on by default via `siteContent.contactForm.enabled = false`, form dimmed and `inert`, notice "Het contactformulier komt binnenkort. Mail me voor nu op info@andreaslop.nl" with a mail button; address assembled in the browser; honeypot + ±3 s time check, spam gets the normal success and nothing is sent; `submitContactForm` adapter (rejects generically today); Friendly Captcha later; last "Boek" click wins; `?pakket=` removed from the URL once applied. + +- [x] 1. Collect and analyze answers (follow-up questions if needed) +- [x] 2. `domain-entities.md` — `ContactValues`, `ContactPayload`, `ContactErrors`, `ShootOption`, field limits, `siteContent.contactForm` +- [x] 3. `business-rules.md` — validation rules and messages, when errors appear and disappear, spam rules, submit states (idle, sending, sent, failed), gate on/off, mail link, preselection and URL clean-up, focus after "Boek"; decision flowcharts +- [x] 4. `business-logic-model.md` — submit sequence, the form state machine, pure functions (`shootOptions`, `validateContact`, `toContactPayload`, `isLikelySpam`, `mailtoLink`), PBT-01 properties incl. a stateful check of the form states (PBT-06) +- [x] 5. `frontend-components.md` — `ContactSection`, `ContactFormGate`, `ContactForm`; props, states, layout, accessibility +- [x] 6. Validate against FR-HP-06…09, BR-PARAM-02…04, NFR-HP-01/03/04 and the Security/PBT extensions diff --git a/aidlc-docs/features/homepage-sections/construction/plans/instagram-code-generation-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/instagram-code-generation-plan.md new file mode 100644 index 0000000..52c9fbf --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/instagram-code-generation-plan.md @@ -0,0 +1,58 @@ +# Code Generation Plan — Unit 6: Instagram + +**This plan is the single source of truth for Code Generation of unit 6.** + +## Unit context +- **Requirements**: FR-HP-10, FR-HP-11 (reveal, reused), FR-HP-12, NFR-HP-01/02/03/05/06; security NFR on external links +- **Design**: [unit-of-work.md](../../inception/application-design/unit-of-work.md) unit 6; [component-methods.md](../../inception/application-design/component-methods.md) (`HomeContent.instagram`, `InstagramGrid` props); design reference `design/andreaslop-static/index.html` (Instagram section: `.section--tight`, centred `.section__head`, handle as `.lead` with `.link-underline`) and `style.css` §17 (`.instagram__grid`, `.instagram__tile`) plus the 1100px (3 columns) and 680px (2 columns) breakpoints +- **Depends on**: unit 1 (`HomeSection` incl. `spacing="tight"`, `SectionHeading`, `Reveal`, `DeferredImage`), unit 2 (`underline` link variant), the existing `visibleSocials` helper (BR-SOC-01) and the footer's external-link pattern +- **Functional Design**: skipped (presentational). **PBT-01**: N/A, no new business logic; picking the Instagram link reuses `visibleSocials`, which already has tests. Example-based tests (PBT-10). +- Conventions as in the earlier units: English comments and test names, Dutch visitor text, `data-testid`, theme tokens, deferred images. + +## Decisions taken in this plan +- **Full-bleed grid**: in the design the tile grid sits outside `.container` and runs from edge to edge, while the heading stays in the content column. `HomeSection` gets a `width="full"` option (no `Container`), and `InstagramGrid` puts its heading in its own `Container`. +- **Images, no new files**: the six tiles reuse photos that the homepage already bundles and loads (`intro-1` to `intro-4`, `review-newbornshoot`, `review-trouwshoot`). The browser fetches them only once, so the section adds no image bytes. They show as squares (`object-fit: cover`). Andrea can replace them later, and the API feature replaces them with the real feed. +- **Accessible names**: each tile is a link to the profile. Its name is the photo's alt text plus a hidden "(Instagram, opent in nieuw tabblad)". Six links with the same name "Instagramfoto", as in the design, would tell a screen reader user nothing. +- **Hidden without a valid link**: the route picks the Instagram entry from `visibleSocials(siteContent.socials)`. Without one, the section is not rendered at all, because the handle and every tile would have nowhere to link to. +- **Hover**: as in the design, the photo scales to 1.06 and drops to 85% opacity on hover and on keyboard focus. Under reduced motion it changes opacity only, without scaling. Focus gets the theme's visible focus ring. + +## Steps + +### Content +- [x] **Step 1** — `content/types.ts`: extend `HomeContent` with `instagram: { title: string; handle: string; photos: ContentImage[] }`. +- [x] **Step 2** — `content/homeContent.ts`: title "Instagram", handle "@andreaslopfotografie", the six reused photos with their existing alt texts (shared constants where the intro gallery already defines them, so the texts do not drift apart). + +### Shared pieces +- [x] **Step 3** — `HomeSection`: `width` gains `'full'` (children rendered without `Container`). Test for the full-width variant. + +### The section +- [x] **Step 4** — `components/home/InstagramGrid/InstagramGrid.tsx`: `HomeSection` with `spacing="tight"`, `width="full"`; a `Container` with a `Reveal` around the centred `SectionHeading` (h2 "Instagram") and below it the handle as a `lead`-sized external link (`underline` variant, `target="_blank"`, `rel="noopener noreferrer"`, hidden "(opent in nieuw tabblad)"), `data-testid="instagram-handle-link"`. Below it a `Reveal` with the grid: plain `ul`/`li` (a list of six), 2 columns, 3 from `md`, 6 from `xl` (the design's 680/1100px steps mapped onto the theme breakpoints), 2px gap; each tile is an external link (`data-testid="instagram-tile-{n}"`) with a square `DeferredImage` on a `paper.deep` background, hover and focus as decided above. +- [x] **Step 5** — `components/home/InstagramGrid/InstagramGrid.test.tsx`: region named by the h2; handle link with href, `target`, `rel` and the hidden hint; six tiles, each linking to the profile with `target`/`rel` and a name made of the alt text plus the hint; zero photos still renders heading and handle; axe clean. +- [x] **Step 6** — `routes/index.tsx`: find the Instagram link in `visibleSocials(siteContent.socials)` and render `InstagramGrid` after `ContactSection` only when it exists. +- [x] **Step 7** — `app.test.tsx`: add "Instagram" (named by its h2) as the last section in the page-order check; a test that the section is absent when there is no valid Instagram link (mocked `siteContent`, as the earlier unit tests do for the contact form). + +### Verification and wrap-up +- [x] **Step 8** — `pnpm check` (incl. Lighthouse); fix and rerun until green. Visual check at desktop width (6 columns, full-bleed), at 1024px (3 columns) and at an emulated 390px phone (2 columns); confirm in the network panel that no extra image requests appear. +- [x] **Step 9** — `LAYOUT.md`: check the homepage diagram against the finished section order (following `.ai/layout-conventions.md`), update it only if it differs. +- [x] **Step 10** — `construction/instagram/code/code-summary.md`. +- [x] **Step 11** — Commit on `feature/homepage-sections` ("Adds the Instagram section to the homepage" + attribution), together with the typography changes from the unit 5 review in a separate commit before it. Not pushed unless the owner asks. + +## Requirement traceability +| Requirement | Steps | +|---|---| +| FR-HP-10 | 1, 2, 4–7 | +| FR-HP-11 | 4 | +| FR-HP-12 | 2 | +| NFR-HP-01 (accessibility) | 4, 5, 8 | +| NFR-HP-02 (design fidelity) | 3, 4, 8 | +| NFR-HP-03 (tests) | 3, 5, 7, 8 | +| NFR-HP-05 (performance) | 2, 4, 8 | +| NFR-HP-06 (API-ready content) | 1, 2 | +| External links (security NFR) | 4–6 | + +## Extension compliance (planned) +- **Security**: no new dependencies or external resources (no embed, no third-party script, no request to Instagram); external links use `noopener noreferrer`; only `https:` links are rendered (BR-SOC-01 via `visibleSocials`). Other rules N/A. +- **PBT**: PBT-01 N/A (no new logic); PBT-10 example-based tests present. + +### Note on Step 8 +- Everything except the Lighthouse performance gate is green. The homepage mobile score scattered between 0.68 and 0.84 for both the unit 5 build and this build in back-to-back runs (machine under load), so the gate was rerun on a quiet machine: passed (home mobile 0.81, desktop 1.0). diff --git a/aidlc-docs/features/homepage-sections/construction/plans/lieve-woorden-code-generation-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/lieve-woorden-code-generation-plan.md new file mode 100644 index 0000000..7fc363e --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/lieve-woorden-code-generation-plan.md @@ -0,0 +1,64 @@ +# Code Generation Plan — Unit 4: Lieve woorden + +**This plan is the single source of truth for Code Generation of unit 4.** + +## Unit context +- **Requirements**: FR-HP-05, FR-HP-11, FR-HP-12, NFR-HP-01/02/03/05/06 +- **Functional design**: [lieve-woorden/functional-design/](../lieve-woorden/functional-design/) — BR-REV-01…11 +- **Depends on**: unit 1 (`HomeSection`, `SectionHeading`, `Reveal`, `DeferredImage`), unit 2 (`FramedImage`) +- **PBT**: full — `visibleTestimonials`, `slideLabel`; PBT-06 N/A (carousel state machine is Chakra's/Zag's). +- Conventions as in units 1–3. + +## Findings that shape the plan (from the installed `@zag-js/carousel` 1.43.3) +1. **Reduced motion**: the built-in triggers, indicators and arrow keys call `scrollTo({ behavior: 'smooth' })` from JavaScript; CSS `scroll-behavior` cannot override that. The API does accept an `instant` flag (`scrollPrev(instant)`, `scrollNext(instant)`, `scrollTo(page, instant)`). → We keep Chakra's carousel for state, snapping, looping, swiping, slide semantics and hidden off-screen slides, but render **our own** previous/next buttons and dots (and arrow-key handling on the controls) that pass `instant = prefersReducedMotion` (BR-REV-06). +2. **Double announcement**: the item group already carries `aria-live="polite"`. → We set it to `off` and keep one own polite live region with "Review n van m" (BR-REV-08). +3. **Labels**: Zag's default translations are English. → `translations.item = slideLabel` so slides are "Review n van m" (BR-REV-09). + +## Steps + +### Images and content +- [x] **Step 1** — Extend the one-off resize script with a centre crop to a target aspect ratio. Prepare the two live photos, cropped to **4:5** from the centre and resized to **880×1100**, quality 80: `IMG_2497-5.jpg` → `web/src/assets/home/review-trouwshoot.jpg`, `5-F41A4650-scaled.jpg` → `web/src/assets/home/review-newbornshoot.jpg`. Record the script change in the summary. +- [x] **Step 2** — `content/types.ts`: `Testimonial { id; shoot; quote; author; image: ContentImage }`; `HomeContent.testimonials { title }`. +- [x] **Step 3** — `content/testimonials.ts` with the two live reviews (full texts from FR-HP-05, alt texts from domain-entities.md); `homeContent.testimonials.title = 'Lieve woorden'`. + +### Pure helpers +- [x] **Step 4** — `lib/visibleTestimonials.ts` (+ test): invariants filter, first-wins de-duplication. Properties: valid + unique; subsequence; idempotent; oracle. +- [x] **Step 5** — `lib/slideLabel.ts` (+ test): `slideLabel(index, count)` → `Review ${index + 1} van ${count}`. Properties: numbers round-trip; form and range invariant. +- [x] **Step 6** — `test/arbitraries.ts`: `testimonial`, `uniqueTestimonials`, `anyTestimonial`. + +### Components +- [x] **Step 7** — `components/home/Testimonials/TestimonialSlide.tsx`: grid `5fr 7fr` from `lg` (stacked below, photo max 420 px), `FramedImage` 4/5, decorative quotation mark (`aria-hidden`), shoot as eyebrow (`accent.deep`), `figure` > `Blockquote` > `figcaption` "— author"; `data-testid="testimonial-"`. +- [x] **Step 8** — `components/home/Testimonials/Testimonials.tsx`: `visibleTestimonials`; none → `null`; one → `TestimonialSlide` without carousel; two or more → `useCarousel({ slideCount, loop: true, allowMouseDrag: true, translations })` + `Carousel.RootProvider` (`aria-label="Reviews"`, `aria-roledescription="carrousel"`), `Carousel.ItemGroup` with `aria-live="off"` and stretched items (equal height, BR-REV-07), one `Carousel.Item` per review; own controls: "Vorige review" / "Volgende review" buttons (Ant Design left/right outlined icons, offline), one dot per review (`aria-label="Review n"`, `aria-current` on the current one, 44 px hit area), arrow keys on the control bar; every control calls the API with `instant = reducedMotion`; `onPageChange` sets the polite `VisuallyHidden` live region to `slideLabel`. `HomeSection tone="alt"`, centred heading. +- [x] **Step 9** — Tests: `TestimonialSlide.test.tsx` (photo alt, shoot, quote in a blockquote, author caption, quotation mark hidden, axe) and `Testimonials.test.tsx` (region "Lieve woorden"; two slides labelled "Review 1 van 2" / "Review 2 van 2"; buttons and dots named in Dutch; next from the last review goes to the first (loop) and is announced; a dot jumps to its review and marks itself current; arrow keys move; with reduced motion the API is called with `instant`; one review → no controls; none → no section; invalid reviews skipped; live region empty on load; axe clean). + +### Route +- [x] **Step 10** — `routes/index.tsx`: render `Testimonials` after `Pricing` with `homeContent.testimonials` and `testimonials`. +- [x] **Step 11** — `app.test.tsx`: "Lieve woorden" in the page-order check. + +### Verification and wrap-up +- [x] **Step 12** — `pnpm check` (incl. Lighthouse); visual check at 1440, 390 (CDP), including a swipe/next to the second review. +- [x] **Step 13** — `construction/lieve-woorden/code/code-summary.md`. +- [x] **Step 14** — Commit (including the pending audit/state updates) — "Adds the Lieve woorden section to the homepage" + attribution. Not pushed. + +### Fixes during Step 12 +- [x] **Step 12a** — Real-browser check showed the next slide's sand block over the quote and the own block clipped: 4 rem `spacing` between slides, 1.5 rem padding left/bottom per slide (from `sm`). +- [x] **Step 12b** — Home mobile Lighthouse median 0.83 → 0.81 with the carousel in the route chunk. `React.lazy` alone did not help; the carousel moved to `TestimonialCarousel.tsx` and loads only when the section is within 200 px of the screen (heading always rendered, placeholder of the measured height). Median back to 0.83. + +## Requirement / rule traceability +| Item | Steps | +|---|---| +| FR-HP-05 | 2, 3, 7–11 | +| BR-REV-01 | 4, 8, 9 | +| BR-REV-02 | 8, 9 | +| BR-REV-03/04/05 | 8, 9 | +| BR-REV-06 | 8, 9 (finding 1) | +| BR-REV-07 | 8, 12 | +| BR-REV-08 | 5, 8, 9 (finding 2) | +| BR-REV-09 | 5, 8, 9 (finding 3) | +| BR-REV-10 | 8 (Zag sets `aria-hidden` on off-screen slides), 9 | +| BR-REV-11 | 7, 9 | +| NFR-HP-05 | 1, 7 (deferred image), 12 | + +## Extension compliance (planned) +- **Security**: content rendered as text; no new dependencies (Chakra Carousel and Ant Design icons already installed); no external resources. +- **PBT**: PBT-02 (slideLabel round-trip), PBT-03 (invariants), PBT-04 (idempotency), PBT-05 (oracle), PBT-07 (generators), PBT-08/09 (existing), PBT-10 (example tests); PBT-06 N/A. diff --git a/aidlc-docs/features/homepage-sections/construction/plans/lieve-woorden-fd-questions.md b/aidlc-docs/features/homepage-sections/construction/plans/lieve-woorden-fd-questions.md new file mode 100644 index 0000000..9f6243e --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/lieve-woorden-fd-questions.md @@ -0,0 +1,31 @@ +# Functional Design Questions — Unit 4: Lieve woorden + +Vul per vraag de letter in na `[Answer]:` (of geef ze in de chat, bijv. "1A, 2A, 3A"). Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**. + +## Vraag 1: Aan het einde van de reeks +Een bezoeker staat op de laatste review en klikt op "volgende". + +- A) Hij gaat rond naar de eerste review. Met maar een paar reviews voelt dat natuurlijk, en de knoppen werken altijd. (aanbevolen) +- B) Het stopt: op de laatste review is "volgende" uitgeschakeld, op de eerste "vorige" +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 2: Hoe wisselt een review? + +- A) **Schuiven**: de reviews liggen naast elkaar en schuiven opzij; bij vegen op een telefoon volgt de review je vinger. Zo werkt Chakra's Carousel uit zichzelf, en het sluit aan bij het vegen in de galerij. (aanbevolen) +- B) **Overvloeien**: de oude review vervaagt en de nieuwe verschijnt, zoals in het statische ontwerp. Vegen werkt dan als "volgende/vorige", zonder dat de review je vinger volgt. +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +Bij "minder beweging" (systeeminstelling) wisselt de review in beide gevallen direct, zonder animatie. + +[Answer]: A + +## Vraag 3: Verschillende lengtes +De trouwshoot-review is ongeveer twee keer zo lang als de newbornshoot-review. + +- A) Alle reviews krijgen de hoogte van de langste. Bij het wisselen springt de rest van de pagina (Contact eronder) dan niet op en neer. (aanbevolen) +- B) De hoogte past zich per review aan; minder witruimte bij korte reviews, maar de pagina eronder verschuift bij elke wissel +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A diff --git a/aidlc-docs/features/homepage-sections/construction/plans/lieve-woorden-functional-design-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/lieve-woorden-functional-design-plan.md new file mode 100644 index 0000000..cde3cf7 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/lieve-woorden-functional-design-plan.md @@ -0,0 +1,10 @@ +# Functional Design Plan — Unit 4: Lieve woorden + +Scope: FR-HP-05 — one review at a time with photo, quotation mark, shoot label, quote and names; previous/next and dots; no autoplay; announcements; Chakra `Carousel`. Questions: [lieve-woorden-fd-questions.md](lieve-woorden-fd-questions.md). + +- [x] 1. Collect and analyze answers (follow-up questions if needed) +- [x] 2. `domain-entities.md` — `Testimonial`, its invariants, initial data, relation to `ContentImage` +- [x] 3. `business-rules.md` — which reviews are shown, 0 / 1 / many reviews, navigation at the ends, transitions and reduced motion, height of the slides, announcements, accessible names; decision flowchart +- [x] 4. `business-logic-model.md` — navigation flow (buttons, dots, keyboard, swipe), pure functions (`visibleTestimonials`, `slideLabel`), PBT-01 properties +- [x] 5. `frontend-components.md` — `Testimonials` (Chakra Carousel parts), `TestimonialSlide`; props, states, responsive layout, accessibility +- [x] 6. Validate against FR-HP-05, NFR-HP-01/02/03/05/06 and the Security/PBT extensions diff --git a/aidlc-docs/features/homepage-sections/construction/plans/lifestyle-fotografie-code-generation-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/lifestyle-fotografie-code-generation-plan.md new file mode 100644 index 0000000..e6f4ae0 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/lifestyle-fotografie-code-generation-plan.md @@ -0,0 +1,83 @@ +# 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 +- [x] **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 +- [x] **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) +- [x] **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 +- [x] **Step 4** — `web/src/content/types.ts`: add `ContentImage` and `HomeContent` with the `intro` part only (`{ title, lead, photos: ContentImage[] }`); later units extend `HomeContent`. +- [x] **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 +- [x] **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. +- [x] **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. +- [x] **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. +- [x] **Step 9** — `web/src/components/Reveal/Reveal.test.tsx`: children always in the DOM and accessible; visible state without observer. +- [x] **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`. +- [x] **Step 11** — `web/src/components/SectionHeading/SectionHeading.test.tsx`: h2 with id, optional eyebrow/lead, axe clean. +- [x] **Step 12** — `web/src/components/HomeSection/HomeSection.tsx`: `
` with `py="sectionY"` (or `sectionYTight`), `bg` `paper` or `paper.alt` (`tone`), inner `Container` (`content` or `contentNarrow` width), optional `id` and `data-testid`. +- [x] **Step 13** — `web/src/components/HomeSection/HomeSection.test.tsx`: region named by its heading, tone and width variants render, id passes through. + +### The section +- [x] **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. +- [x] **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. +- [x] **Step 16** — `web/src/routes/index.tsx`: render `IntroGallery` with `homeContent.intro` after the Hero. +- [x] **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 +- [x] **Step 18** — Run `pnpm check` (lint, format, tests incl. coverage thresholds, build, audits, Lighthouse mobile + desktop). Fix and rerun until green. +- [x] **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. +- [x] **Step 20** — Commit unit 1 on `feature/homepage-sections` ("Adds the Lifestyle fotografie section to the homepage" + attribution). Not pushed. + +### Fix during Step 18 (Step 13.5 self-check) +- [x] **Step 18a** — Lighthouse home mobile failed (0.78 < 0.8; LCP 3.8 s → 5.3 s). Root cause: Chrome fetches `loading="lazy"` images within ±1250 px of the viewport immediately, so the gallery photos right under the hero competed with the hero for bandwidth under Lighthouse's throttling. Fix: `hooks/useInView.ts` (shared observer logic; `useReveal` now builds on it), `hooks/usePageLoaded.ts`, `components/DeferredImage` (sets `src` only after the load event and when within 600 px of the viewport; width/height reserve the space), `test/fakeIntersectionObserver.ts` (shared test double); IntroGallery uses DeferredImage with a `paper.deep` placeholder. Result: mobile 0.85 (LCP 3.8 s, equal to master). + +### Change request at review +- [x] **Step 21** — Phones: one photo at a time in a swipeable scroll-snap row with the next photo peeking in; keyboard-scrollable list; gallery-level loading via `DeferredImage near`; static design and FR-HP-02 updated; `pnpm check` green. + +## 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. diff --git a/aidlc-docs/features/homepage-sections/construction/plans/over-mij-code-generation-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/over-mij-code-generation-plan.md new file mode 100644 index 0000000..bfbe25d --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/over-mij-code-generation-plan.md @@ -0,0 +1,56 @@ +# Code Generation Plan — Unit 2: Over mij + +**This plan is the single source of truth for Code Generation of unit 2.** + +## Unit context +- **Requirements**: FR-HP-03, FR-HP-11 (reveal, reused), FR-HP-12, NFR-HP-01/02/03/05/06 +- **Design**: [unit-of-work.md](../../inception/application-design/unit-of-work.md) unit 2; design reference `design/andreaslop-static/index.html` (`.about`, `.about__media`, `.about__body`, `.link-underline`) and `style.css` §5, §12 +- **Depends on**: unit 1 (`HomeSection`, `SectionHeading`, `Reveal`, `DeferredImage`, `ContentImage`, `homeContent.ts`) +- **Introduces**: `FramedImage` (reused by unit 4), the `underline` link variant (reused by units 5 and 6) +- **Functional Design**: skipped (presentational). **PBT-01**: N/A — no business logic in this unit; example-based tests (PBT-10). +- Conventions as in unit 1 (English comments and test names, Dutch visitor text, `data-testid`, theme tokens, deferred images). + +## Steps + +### Image +- [x] **Step 1** — Resize the original live photo of Andrea (`WhatsApp-Image-2024-10-27-at-14.31.42.jpeg`, 1600×1067; the live site shows the 1024 px version) to **1200×800**, quality 80, into `web/src/assets/home/andrea.jpg`, with the resize script from unit 1. + +### Content +- [x] **Step 2** — `content/types.ts`: extend `HomeContent` with `about: { eyebrow; title; paragraphs: string[]; image: ContentImage; link: { label; to: RoutePath } }` (`RoutePath` from `navigation.ts`, so a wrong route is a type error). +- [x] **Step 3** — `content/homeContent.ts`: eyebrow "Over mij", title "Lifestyle fotograaf met een passie voor storytelling", the three live paragraphs, the photo (alt "Andrea Slop met haar camera, glimlachend over haar schouder"), link "Lees mijn verhaal" → `/over-mij`. + +### Shared pieces +- [x] **Step 4** — `recipes/link.ts`: add variant `underline` (design `.link-underline`): ink text, 1px underline in `currentColor` that slides in from the left on hover and focus, `interaction` duration, `smooth` easing, no motion under reduced motion. Used with `asChild` around `RouterLink`, like the footer menu. +- [x] **Step 5** — `SectionHeading`: optional `spacing: 'default' | 'compact'` (compact = `1.5rem` below, design `.about__body h2`), so the about text can use the same heading block left-aligned. Test for the compact variant. +- [x] **Step 6** — `components/FramedImage/FramedImage.tsx`: `DeferredImage` with a fixed `aspectRatio` on a `paper.deep` placeholder, plus the decorative sand block behind it (bottom-left, offset 1.5rem, 55% × 55%, `sand`), hidden below `sm`; the block is CSS only (`::before`), so it is never announced. +- [x] **Step 7** — `components/FramedImage/FramedImage.test.tsx`: image with alt and dimensions, lazy, axe clean. + +### The section +- [x] **Step 8** — `components/home/AboutBlock/AboutBlock.tsx`: `HomeSection` with `tone="alt"`; grid 1 column, 2 equal columns from `lg`, gap `clamp(2rem, 6vw, 5.5rem)`, vertically centred; left `FramedImage` (aspect 4/3) in a `Reveal`; right in a `Reveal`: `SectionHeading` (eyebrow, h2, start-aligned, compact), the paragraphs (`ink.soft`), and the link with the `underline` variant. +- [x] **Step 9** — `components/home/AboutBlock/AboutBlock.test.tsx`: region named by the h2, eyebrow, three paragraphs, photo alt, link to `/over-mij`, axe clean. +- [x] **Step 10** — `routes/index.tsx`: render `AboutBlock` after `IntroGallery`. +- [x] **Step 11** — `app.test.tsx`: add the "Over mij" section (named by its h2) to the page-order check. + +### Verification and wrap-up +- [x] **Step 12** — `pnpm check` (incl. Lighthouse); fix and rerun until green. Visual check at desktop width and at an emulated 390 px phone. +- [x] **Step 13** — `construction/over-mij/code/code-summary.md`. +- [x] **Step 14** — Commit on `feature/homepage-sections` ("Adds the Over mij section to the homepage" + attribution). Not pushed. + +### Fix during Step 12 +- [x] **Step 12a** — Lighthouse home mobile 0.77: deferred photos started before the observed LCP whenever they won a race (600 px margin reached the gallery right after the load event). Load margin lowered to 200 px and shared as `DEFERRED_LOAD_MARGIN` (DeferredImage + IntroGallery); no photo below the hero is requested on page open any more. + +## Requirement traceability +| Requirement | Steps | +|---|---| +| FR-HP-03 | 2, 3, 6, 8–11 | +| FR-HP-11 | 8 | +| FR-HP-12 | 1–3 | +| NFR-HP-01 | 4, 6–9, 11, 12 | +| NFR-HP-02 | 4–8 | +| NFR-HP-03 | 5, 7, 9, 11, 12 | +| NFR-HP-05 | 1, 6, 12 | +| NFR-HP-06 | 2, 3 | + +## Extension compliance (planned) +- **Security**: no new dependencies or external resources; internal link only; other rules N/A. +- **PBT**: PBT-01 N/A (no logic); PBT-10 example-based tests present. diff --git a/aidlc-docs/features/homepage-sections/construction/plans/prijzen-code-generation-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-code-generation-plan.md new file mode 100644 index 0000000..7b282c6 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-code-generation-plan.md @@ -0,0 +1,62 @@ +# Code Generation Plan — Unit 3: Prijzen + +**This plan is the single source of truth for Code Generation of unit 3.** + +## Unit context +- **Requirements**: FR-HP-04, FR-HP-11, FR-HP-12, NFR-HP-01/02/03/04/05/06 +- **Functional design**: [prijzen/functional-design/](../prijzen/functional-design/) — BR-PRICE-01…03, BR-BOOK-01…03, BR-PARAM-01 (BR-PARAM-02…04 are carried out in unit 5) +- **Depends on**: unit 1 (`HomeSection`, `SectionHeading`, `Reveal`, `DeferredImage`, `ContentImage`) +- **Introduces for unit 5**: `PricingPackage`, `content/packages.ts`, `visiblePackages`, `packageFromSearch`, `pakket` search on `/` +- **PBT**: full enforcement — properties from business-logic-model.md for all four helpers; generators per PBT-07. +- Conventions as in units 1–2. + +## Steps + +### Assets and content +- [x] **Step 1** — Copy `design/andreaslop-static/assets/img/deco-1.png` (143×112, 15 KB) and `deco-2.png` (239×224, 42 KB) unchanged to `web/src/assets/home/`. +- [x] **Step 2** — `content/types.ts`: `PricingPackage { id; name; price; features }`; `HomeContent.pricing { title; lead; decorations: ContentImage[] }`. +- [x] **Step 3** — `content/packages.ts`: the three live packages in live order (domain-entities.md). `content/homeContent.ts`: pricing title "Prijzen", lead "Pakketten", two decorations with `alt=""` and their sizes. + +### Pure helpers (each with example-based and property-based tests) +- [x] **Step 4** — `lib/formatPrice.ts` (+ test): `Intl.NumberFormat('nl-NL', { style: 'currency', currency: 'EUR', maximumFractionDigits: 0 })`; ensures a non-breaking space after `€` (BR-PRICE-01). Properties: digit round-trip, prefix and no regular space. +- [x] **Step 5** — `lib/visiblePackages.ts` (+ test): invariants filter and first-wins de-duplication (BR-PRICE-02). Properties: every result valid, unique ids, subsequence, idempotent, oracle for valid unique input. +- [x] **Step 6** — `lib/bookLabel.ts` (+ test): `BOOK_LABEL_MAX_NAME = 14`; `{ visible: 'Boek ' }` or `{ visible: 'Boek je shoot', hidden: ': ' }` (BR-BOOK-02). Properties: name always in the full text; visible form exactly per the length rule. +- [x] **Step 7** — `lib/packageFromSearch.ts` (+ test): string only, trimmed, case-insensitive match → the package's id (BR-PARAM-01). Properties: result is undefined or a given id; any-case/whitespace oracle; non-strings undefined; idempotent. +- [x] **Step 8** — `test/arbitraries.ts`: `pricingPackage` (valid), `uniquePackages`, `anyPackage` (incl. invalid: empty name, price 0 / negative / fractional / NaN, bad id, duplicates). + +### Styling +- [x] **Step 9** — `recipes/linkButton.ts`: new `size` variant `fit` — `white-space: nowrap`, horizontal padding 1.25 rem on phones and the design's 2.4 rem from `sm` (BR-BOOK-03); default size unchanged so the hero button stays as it is. Verify at an emulated 320 px phone that "Boek Zwangerschap" stays on one line inside the card. + +### Components +- [x] **Step 10** — `components/home/Pricing/PriceCard.tsx`: `article` with h3, formatted price (`accent.deep`), feature list, `LinkButton` (`size="fit"`) to `/` with `search={{ pakket: id }}` and `hash="contact"`, label per `bookLabel` with `VisuallyHidden`; hover lift/border/shadow, none under reduced motion; `data-testid`s per frontend-components.md. +- [x] **Step 11** — `components/home/Pricing/Pricing.tsx`: `HomeSection` (plain), decorations (`DeferredImage`, `aria-hidden`, positioned behind content), `SectionHeading` with lead, grid of `PriceCard`s from `visiblePackages` (1 column max 460 px centred below `lg`, 3 from `lg`), staggered `Reveal`; renders nothing when no package is valid. +- [x] **Step 12** — `components/home/Pricing/Pricing.test.tsx` and `PriceCard.test.tsx`: region "Prijzen", three cards in order with h3, price `€ 175` etc., features as list items, link names "Boek Zwangerschap" / "Boek Newborn" / "Boek Gezin" with `href="/?pakket=#contact"`, long name → "Boek je shoot" + hidden name, invalid packages skipped, empty list → no section, decorations hidden from assistive technology, axe clean. + +### Route +- [x] **Step 13** — `routes/index.tsx`: `validateSearch` → `{ pakket?: string }` (string kept, everything else dropped); render `Pricing` after `AboutBlock` with `homeContent.pricing` and `packages`. +- [x] **Step 14** — `app.test.tsx`: "Prijzen" in the page-order check; `/?pakket=newborn` and `/?pakket=123` both render the homepage without errors. + +### Verification and wrap-up +- [x] **Step 15** — `pnpm check` (coverage 100% for the new `lib/` files, Lighthouse); visual check desktop 1440 and phones 390 and 320. +- [x] **Step 16** — `construction/prijzen/code/code-summary.md`. +- [x] **Step 17** — Commit ("Adds the Prijzen section to the homepage" + attribution). Not pushed. + +## Requirement / rule traceability +| Item | Steps | +|---|---| +| FR-HP-04 | 2, 3, 10–14 | +| BR-PRICE-01 | 4, 10 | +| BR-PRICE-02 | 5, 11 | +| BR-PRICE-03 | — (no note rendered) | +| BR-BOOK-01 | 10, 12 | +| BR-BOOK-02 | 6, 10, 12 | +| BR-BOOK-03 | 9, 15 | +| BR-PARAM-01 | 7, 13, 14 | +| NFR-HP-01 | 10–12, 15 | +| NFR-HP-03 / PBT | 4–8, 12, 14, 15 | +| NFR-HP-05 | 1, 11, 15 | +| NFR-HP-06 | 2, 3 | + +## Extension compliance (planned) +- **Security**: `pakket` never reflected, only known ids come out (SECURITY-05 spirit for client input, SECURITY-11 misuse noted); no new dependencies or external resources. +- **PBT**: PBT-01 done in functional design; PBT-02 (round-trip formatPrice), PBT-03 (invariants), PBT-04 (idempotency), PBT-05 (oracles), PBT-07 (domain generators), PBT-08/09 (existing seed setup), PBT-10 (example tests alongside). PBT-06 N/A (no stateful component in this unit). diff --git a/aidlc-docs/features/homepage-sections/construction/plans/prijzen-fd-questions.md b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-fd-questions.md new file mode 100644 index 0000000..4a0b964 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-fd-questions.md @@ -0,0 +1,50 @@ +# Functional Design Questions — Unit 3: Prijzen + +Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**. + +## Vraag 1: BTW bij de prijzen +Voor consumenten moeten prijzen in Nederland inclusief btw getoond worden. Op de live site staat er niets bij. + +- A) De prijzen zijn inclusief btw; zet er een korte regel onder de kaarten: "Alle prijzen zijn inclusief btw." (aanbevolen, als Andrea btw rekent) +- B) De prijzen zijn inclusief btw; geen extra regel, net als nu op de live site +- C) Andrea valt onder de kleineondernemersregeling (KOR) en rekent geen btw; geen regel nodig +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: C + +## Vraag 2: Drie keer "Boek je shoot" +Elke kaart heeft een knop met dezelfde tekst. Een schermlezer die alle links opsomt, hoort dan drie keer "Boek je shoot" zonder te weten welk pakket. + +- A) Zichtbaar blijft "Boek je shoot"; voor schermlezers komt de naam van het pakket erbij ("Boek je shoot: Newborn"), via verborgen tekst. (aanbevolen) +- B) De zichtbare tekst wordt "Boek Newborn", "Boek Zwangerschap", enzovoort +- C) Zo laten, drie keer dezelfde tekst +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: B, mits dat past, anders A. De knop moet 1 regel blijven, in ieder geval op desktop. + +## Vraag 3: Nog een keer klikken +Een bezoeker klikt "Boek je shoot" bij Newborn, kiest in het formulier zelf toch "Gezin", scrolt terug en klikt "Boek je shoot" bij Zwangerschap. + +- A) De laatste klik wint: het formulier springt naar Zwangerschap. De bezoeker heeft immers net opnieuw gekozen. (aanbevolen) +- B) Wat de bezoeker zelf in het formulier koos, blijft staan; een klik vult alleen een lege keuze in +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 4: `?pakket=` in de adresbalk +Na een klik staat bijvoorbeeld `andreaslop.nl/?pakket=newborn#contact` in de adresbalk. + +- A) Laten staan. De link is te delen ("boek een newbornshoot"), en een refresh houdt de keuze vast. (aanbevolen) +- B) Na het invullen van het formulier weghalen, zodat de adresbalk weer `andreaslop.nl/` toont; delen kan dan niet meer +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: B + +## Vraag 5: Pakket zonder prijs +Straks levert de API de pakketten. Wat als Andrea een pakket zonder vaste prijs toevoegt (bijv. een bruiloft)? + +- A) Prijs is altijd verplicht; een pakket zonder prijs kan niet (de API controleert dat). Eenvoudigst. (aanbevolen) +- B) Prijs is optioneel; zonder prijs toont de kaart "Prijs op aanvraag" +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A diff --git a/aidlc-docs/features/homepage-sections/construction/plans/prijzen-functional-design-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-functional-design-plan.md new file mode 100644 index 0000000..e58c55f --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/prijzen-functional-design-plan.md @@ -0,0 +1,11 @@ +# Functional Design Plan — Unit 3: Prijzen + +Scope: FR-HP-04 (cards, link with package), the package data that unit 5 reuses, and the `pakket` search parameter on `/`. Questions: [prijzen-fd-questions.md](prijzen-fd-questions.md). + +- [x] 1. Collect and analyze answers (follow-up questions if needed) +- [x] 2. `domain-entities.md` — `PricingPackage`, its invariants (unique id slug, positive whole-euro price, non-empty features) and its relation to the contact form's shoot options +- [x] 3. `business-rules.md` — price formatting, `pakket` search parameter (accepted values, unknown/invalid values, multiple values, case), link targets, what happens on a second "Boek je shoot" click, VAT note, accessible link names; decision flowchart +- [x] 4. `business-logic-model.md` — flow from "Boek je shoot" via the URL to the preselected form value (unit 5 consumes it), and the pure functions `formatPrice` and `packageFromSearch` +- [x] 5. `frontend-components.md` — `Pricing`, `PriceCard`, decorations; props, states (hover, focus, reduced motion), responsive layout, accessibility +- [x] 6. PBT-01 property identification for `formatPrice` and `packageFromSearch` (invariants, oracle, idempotency where relevant) +- [x] 7. Validate against FR-HP-04, NFR-HP-01/02/03/06 and the Security/PBT extensions diff --git a/aidlc-docs/features/homepage-sections/construction/prijzen/code/code-summary.md b/aidlc-docs/features/homepage-sections/construction/prijzen/code/code-summary.md new file mode 100644 index 0000000..fd4663d --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/prijzen/code/code-summary.md @@ -0,0 +1,57 @@ +# Code Summary — Unit 3: Prijzen + +Plan: [prijzen-code-generation-plan.md](../../plans/prijzen-code-generation-plan.md). Functional design: [../functional-design/](../functional-design/). Branch: `feature/homepage-sections`. + +## Files + +### Created +| File | Purpose | +|---|---| +| `web/src/assets/home/deco-1.png`, `deco-2.png` | Design decorations, unchanged (15 KB, 42 KB) | +| `web/src/content/packages.ts` | The three live packages (Zwangerschap 175, Newborn 185, Gezin 175) | +| `web/src/lib/formatPrice.ts` + test | `€ 175` with a non-breaking space (BR-PRICE-01) | +| `web/src/lib/visiblePackages.ts` + test | `isValidPackage` + filter with first-wins de-duplication (BR-PRICE-02) | +| `web/src/lib/bookLabel.ts` + test | "Boek " up to 14 characters, else "Boek je shoot" + hidden name (BR-BOOK-02) | +| `web/src/lib/packageFromSearch.ts` + test | `?pakket=` → known id or undefined (BR-PARAM-01) | +| `web/src/components/home/Pricing/Pricing.tsx` + test | The section: decorations, heading, card grid | +| `web/src/components/home/Pricing/PriceCard.tsx` + test | One package card with the booking link | + +### Modified +| File | Change | +|---|---| +| `web/src/content/types.ts` | `PricingPackage`; `HomeContent.pricing` | +| `web/src/content/homeContent.ts` | Pricing title, lead, decorations | +| `web/src/recipes/linkButton.ts` | `size: 'fit'` — no wrapping, smaller side padding on phones (BR-BOOK-03); default unchanged | +| `web/src/theme.ts` | ~~Shadow token `lift` for the card hover~~ — removed again with the card hover (change request 2026-10-20) | +| `web/src/test/arbitraries.ts` | `pricingPackage`, `uniquePackages`, `anyPackage` | +| `web/src/routes/index.tsx` | `validateSearch` keeps `pakket` only as a string; renders `Pricing` after `AboutBlock` | +| `web/src/app.test.tsx` | "Prijzen" in the page order; `?pakket=newborn`, `?pakket=123` and `?pakket=