diff --git a/LAYOUT.md b/LAYOUT.md index 0e83a9f..df65261 100644 --- a/LAYOUT.md +++ b/LAYOUT.md @@ -72,9 +72,10 @@ columns 1 A["Intro"] B["Newborn"] C["Pregnancy"] - D["Loveshoot"] - E["Portraits"] - F["Prices & Book"] + D["Family"] + E["Loveshoot"] + F["Portraits"] + G["Prices & Book"] 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 @@ -82,6 +83,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 ``` ## Contact diff --git a/aidlc-docs/_shared/reverse-engineering/api-documentation.md b/aidlc-docs/_shared/reverse-engineering/api-documentation.md index e2e5078..4e4e97b 100644 --- a/aidlc-docs/_shared/reverse-engineering/api-documentation.md +++ b/aidlc-docs/_shared/reverse-engineering/api-documentation.md @@ -14,7 +14,7 @@ None. There is no back-end yet (`api/` is empty). The static design README antic | `/` | `routes/index.tsx` | `pageHead('/')` | `Hero` + six home sections; search `?pakket=` | yes | | `/over-mij` | `routes/over-mij.tsx` | `pageHead('/over-mij')` + `AboutPage` JSON-LD | `PageIntro`, `AboutIntro`, `StorySection` ×2, `PhotoDuo`, `LinkButton` | yes | | `/portfolio` | `routes/portfolio.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | -| `/soorten-fotoshoots` | `routes/soorten-fotoshoots.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| `/soorten-fotoshoots` | `routes/soorten-fotoshoots.tsx` | `pageHead('/soorten-fotoshoots')` + `WebPage` JSON-LD (`webPage()` + `shootServices()`) | `PageIntro`, `shoots/ShootList` (5× `ShootBlock`), `CallToAction`, `RichParagraph`, `LinkButton` | yes | | `/contact` | `routes/contact.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | | `/privacyverklaring` | `routes/privacyverklaring.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | | (not found) | — | — | `NotFound` | — | @@ -33,14 +33,16 @@ None. There is no back-end yet (`api/` is empty). The static design README antic - `Hero({ content: HeroContent, socials: SocialLink[] })`, `HeroArrows({ onPrev, onNext })`, `HeroPauseButton({ stopped, onToggle })`, `HeroSocials({ socials })` - `PageIntro({ title, eyebrow?, children? })` — renders the page's only h1 - `PageSection({ labelledBy, id?, tone?: 'paper' | 'alt', width?: 'default' | 'narrow' | 'full', spacing?: 'default' | 'tight' | 'flushTop', 'data-testid'?, children })` (was `HomeSection`) -- `MediaText({ image, aspectRatio, 'data-testid'?, children })` — framed photo next to a text column +- `MediaText({ image, aspectRatio, priority?, reverse?, frameColor?, 'data-testid'?, children })` — framed photo next to a text column; `reverse` puts the photo right from `lg`, `frameColor` colours the block behind it (default `sand`) +- `CallToAction({ title, titleId, lead?, 'data-testid'?, children })` — closing block of a page: h2, lead, action, on `paper.alt` +- `RichParagraph({ paragraph: RichText })` — paragraph with inline links (moved from `about/`) - `Eyebrow(TextProps & { as?: 'p' | 'span' | 'h2' | 'h3' | 'h4' })` — accent label, optionally a heading - `SectionHeading({ id, title, eyebrow?, lead?, align?: 'center' | 'start', spacing?: 'default' | 'compact', focusable? })` — renders an h2 - `FramedImage({ image: ContentImage, aspectRatio })`, `DeferredImage(ImageProps & { image, near? })`, `Reveal(BoxProps & { delay? })` - `IntroGallery({ content })`, `AboutBlock({ content })`, `Pricing({ content, packages })`, `PriceCard(...)`, `Testimonials({ content, testimonials })`, `ContactSection({ content, packages, enabled, email, pakket? })`, `InstagramGrid({ content, profileUrl })` - `ContactForm(...)`, `ContactFormGate({ enabled, email, ... })` - `PhotoDuo({ photos: [ContentImage, ContentImage], label, 'data-testid'? })` -- `about/AboutIntro({ content })`, `about/StorySection({ content, titleId, tone?, spacing?, children? })`, `about/RichParagraph({ paragraph: RichText })` +- `about/AboutIntro({ content })`, `about/StorySection({ content, titleId, tone?, spacing?, children? })`, `shoots/ShootList({ shoots, packages, portfolioLive })`, `shoots/ShootBlock({ shoot, packages, reverse, priority, portfolioLive })` - `StatusPage({ title, children, actions? })`, `ErrorPage({ error, reset })` - `LinkButton(RouterLink props & { variant?: 'outline' | 'accent' | 'light' })` - `UmamiAnalytics({ hostname? })` diff --git a/aidlc-docs/_shared/reverse-engineering/architecture.md b/aidlc-docs/_shared/reverse-engineering/architecture.md index 5444516..d283e15 100644 --- a/aidlc-docs/_shared/reverse-engineering/architecture.md +++ b/aidlc-docs/_shared/reverse-engineering/architecture.md @@ -17,10 +17,10 @@ graph TD Shell --> Umami["UmamiAnalytics"] Outlet --> Home["routes/index.tsx: Hero + six sections"] Outlet --> About["routes/over-mij.tsx: about page"] - Outlet --> Placeholders["portfolio, soorten-fotoshoots, contact, privacyverklaring: PageIntro"] + Outlet --> Placeholders["portfolio, contact, privacyverklaring: PageIntro"] Home --> Hero["Hero (HeroArrows, HeroPauseButton, HeroSocials, useHeroSlider)"] Home --> Sections["components/home/: IntroGallery, AboutBlock, Pricing, Testimonials, ContactSection, InstagramGrid"] - Sections --> Blocks["Shared blocks: PageSection, MediaText, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal"] + Sections --> Blocks["Shared blocks: PageSection, MediaText, CallToAction, RichParagraph, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal"] Sections --> Form["ContactForm + ContactFormGate (lazy), contact/"] Content["content/: siteContent, heroContent, homeContent, packages, testimonials, types"] -.-> Shell Content -.-> Home @@ -79,7 +79,7 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r ### Shared section building blocks - **Purpose**: Reusable pieces extracted during homepage-sections; `HomeSection` was renamed to `PageSection` and `MediaText`/`Eyebrow` were extracted in over-mij-page -- **Responsibilities**: `PageSection` (section frame: `aria-labelledby`, tone `paper`/`alt`, width `default`/`narrow`/`full`, spacing `default`/`tight`/`flushTop`, anchor offset), `MediaText` (framed photo next to a text column, design `.about`), `Eyebrow` (accent label, optionally a heading), `SectionHeading` (eyebrow + h2 + lead, align start/center, compact spacing), `FramedImage` (photo with sand-coloured offset block, design `.about__media`), `DeferredImage` (loads after page load and near the viewport, reserves space), `Reveal` (fade-in on scroll, content always in the DOM, reduced motion respected) +- **Responsibilities**: `PageSection` (section frame: `aria-labelledby`, tone `paper`/`alt`, width `default`/`narrow`/`full`, spacing `default`/`tight`/`flushTop`, anchor offset), `MediaText` (framed photo next to a text column, design `.about`), `Eyebrow` (accent label, optionally a heading), `SectionHeading` (eyebrow + h2 + lead, align start/center, compact spacing), `FramedImage` (photo with a coloured offset block, sand by default, design `.about__media`), `CallToAction` (closing block: h2, lead, action; added in soorten-fotoshoots-page), `RichParagraph` (paragraph with inline links), `DeferredImage` (loads after page load and near the viewport, reserves space), `Reveal` (fade-in on scroll, content always in the DOM, reduced motion respected) - **Type**: Application (shared UI) ### components/PageIntro/, StatusPage/ diff --git a/aidlc-docs/_shared/reverse-engineering/business-overview.md b/aidlc-docs/_shared/reverse-engineering/business-overview.md index 4cd8886..1fe1735 100644 --- a/aidlc-docs/_shared/reverse-engineering/business-overview.md +++ b/aidlc-docs/_shared/reverse-engineering/business-overview.md @@ -36,7 +36,8 @@ Text alternative: visitors and crawlers use the website, which links out to soci - **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 - **Read about the photographer** — Over mij page: introduction with portrait, how it started, two photos, life outside photography, links to the portfolio and contact, "Boek je shoot" - - *Placeholder pages (noindex)*: Portfolio, Soorten fotoshoots, Contact, Privacyverklaring + - *Soorten fotoshoots* (`/soorten-fotoshoots`, indexed): the five shoot types (Newborn, Zwangerschap, Gezin, Loveshoot, Portretten) with photo, text, a contact link (package preselected where one exists) and, once the portfolio is live, a filtered portfolio link; closing call to action to the prices + - *Placeholder pages (noindex)*: Portfolio, Contact, Privacyverklaring - *Planned (static design only)*: 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) diff --git a/aidlc-docs/_shared/reverse-engineering/code-structure.md b/aidlc-docs/_shared/reverse-engineering/code-structure.md index f71dc65..c41f0aa 100644 --- a/aidlc-docs/_shared/reverse-engineering/code-structure.md +++ b/aidlc-docs/_shared/reverse-engineering/code-structure.md @@ -57,10 +57,15 @@ Candidates for modification are marked with ★ for the over-mij-page feature. - `web/src/routes/__root.tsx` — root layout, site head, 404/error - `web/src/routes/index.tsx` — home (`/`): Hero + six sections, `?pakket=` search param - `web/src/routes/over-mij.tsx` — the about page (indexed; `AboutPage` JSON-LD) -- `web/src/components/about/*` — `AboutIntro`, `StorySection`, `RichParagraph` +- `web/src/components/about/*` — `AboutIntro`, `StorySection` +- `web/src/components/shoots/*` — `ShootList`, `ShootBlock` (soorten-fotoshoots page) +- `web/src/components/{CallToAction,RichParagraph}/` — shared closing block; paragraph with inline links +- `web/src/content/{shootTypes,shootTypesPageContent}.ts` — shoot types (also used by the portfolio filters) and page texts; `web/src/assets/shoots/` — 4:5 shoot photos +- `web/src/lib/shootLinks.ts` — contact and portfolio link targets per shoot type - `web/src/components/PhotoDuo/PhotoDuo.tsx` — two photos side by side - `web/src/content/aboutContent.ts` — about page content; `web/src/assets/about/*` — portrait and duo photos; `web/public/og-over-mij.jpg` — preview image -- `web/src/routes/{portfolio,soorten-fotoshoots,contact,privacyverklaring}.tsx` — placeholders with `PageIntro` +- `web/src/routes/soorten-fotoshoots.tsx` — the shoot types page +- `web/src/routes/{portfolio,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 diff --git a/aidlc-docs/_shared/reverse-engineering/component-inventory.md b/aidlc-docs/_shared/reverse-engineering/component-inventory.md index 1c76faf..becfd09 100644 --- a/aidlc-docs/_shared/reverse-engineering/component-inventory.md +++ b/aidlc-docs/_shared/reverse-engineering/component-inventory.md @@ -8,7 +8,7 @@ - `web/config/` + `web/deploy/` — security headers and generated nginx (test) / IIS (production) configuration ## Shared Packages -- None as separate packages. Inside `web`: `theme.ts`, `recipes/`, `content/`, `lib/`, `seo.ts`, `navigation.ts`, `hooks/`, `components/LinkButton.tsx`, `components/RouterLink.tsx`, `components/PageIntro/`, and the section blocks `PageSection`, `MediaText`, `Eyebrow`, `SectionHeading`, `FramedImage`, `DeferredImage`, `Reveal` +- None as separate packages. Inside `web`: `theme.ts`, `recipes/`, `content/`, `lib/`, `seo.ts`, `navigation.ts`, `hooks/`, `components/LinkButton.tsx`, `components/RouterLink.tsx`, `components/PageIntro/`, and the section blocks `PageSection`, `MediaText`, `CallToAction`, `RichParagraph`, `Eyebrow`, `SectionHeading`, `FramedImage`, `DeferredImage`, `Reveal` ## Test Packages - 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 diff --git a/aidlc-docs/active-features.md b/aidlc-docs/active-features.md index 26d7307..373a58f 100644 --- a/aidlc-docs/active-features.md +++ b/aidlc-docs/active-features.md @@ -6,3 +6,4 @@ | 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 | | Feature | over-mij-page | ✅ Complete | feature/over-mij-page | web/src/routes/over-mij.tsx, web/src/content, possibly shared components (PageIntro, FramedImage, SectionHeading) and web/src/seo.ts | 2026-10-22 | +| Feature | soorten-fotoshoots-page | ✅ Complete | feature/soorten-fotoshoots-page | web/src/routes/soorten-fotoshoots.tsx, new web/src/content/shootTypes.ts, new web/src/assets/shoots/, new shared CallToAction, MediaText (reverse prop), Pricing (id="prijzen" only), siteContent (service area), own entries in sitePages.ts / lighthouserc.cjs, JSON-LD via the shared webPage() helper in seo.ts | 2026-10-24 | diff --git a/aidlc-docs/features/soorten-fotoshoots-page/aidlc-state.md b/aidlc-docs/features/soorten-fotoshoots-page/aidlc-state.md new file mode 100644 index 0000000..12d1120 --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/aidlc-state.md @@ -0,0 +1,89 @@ +# AI-DLC State Tracking + +## Project Information +- **Feature Name**: Soorten fotoshoots page (`/soorten-fotoshoots`) +- **Feature Slug**: soorten-fotoshoots-page +- **Project Type**: Brownfield +- **Start Date**: 2026-10-24T19:30:00Z +- **Current Stage**: Complete (PR #8 to master, auto-merge by the owner) +- **Branch**: feature/soorten-fotoshoots-page (fast-forwarded to master 11a5224 after over-mij-page merged, PR #7) +- **Worktree**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-soorten-fotoshoots + +## 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**: No (artifacts in `_shared/` already include the over-mij shared blocks as of e152153; per team agreement only the lines about this feature's own route/components are updated, no full refresh) +- **Workspace Root**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-soorten-fotoshoots + +## Code Location Rules +- **Application Code**: Workspace root (NEVER in aidlc-docs/) — front-end lives in `web/` +- **Feature Documentation**: aidlc-docs/features/soorten-fotoshoots-page/ 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 + +## Parallel Work Agreements +Agreed with the parallel sessions (contact-page, portfolio-page, over-mij-page) on 2026-10-24: +- One worktree per feature; nobody switches branches in a shared checkout +- No full RE refresh; each feature updates only its own lines in `_shared/reverse-engineering/` +- Hot files (`sitePages.ts`, `lighthouserc.cjs`, `active-features.md`): own entry/row only +- `seo.ts`: contact-page owns a generic `webPage(type: WebPageType, path, extra)` helper (separate commit, cherry-picked by the others); this feature builds its JSON-LD on it, no own `xxxPage()` +- `PageIntro` is used by everyone: message the others before changing it +- Claims of this feature: `content/shootTypes.ts`, shared `CallToAction` band, backwards-compatible `reverse` prop on `MediaText` +- contact-page does not touch `Pricing.tsx`; an `id="prijzen"` anchor there is fine with it. Until its `/contact?onderwerp=` format is final, shoot links use `/#contact` (with `?pakket=` where a package exists) +- Each entry in `shootTypes.ts` gets a `slug` plus an optional `packageId` (a `packages.ts` id), so the links work with either option contact-page is still deciding on: `/contact?pakket=` (its recommendation) or `/contact?onderwerp=` +- Photos: this feature owns the shoot photos in `web/src/assets/shoots/`; portfolio-page uses none of them (no overlap) and processes its own 10 photos into `web/src/assets/portfolio/` +- `shootTypes.ts` is also used by portfolio-page (filters per shoot type, lightbox captions). Agreed shape `{ id: ShootTypeId; name; shootLabel; paragraphs; image; packageId? }`, ids `newborn | zwangerschap | gezin | loveshoot | portret` stay stable. Delivered as the **first commit of unit 1** (types + shootTypes.ts + assets/shoots/), hash goes to portfolio-page, which cherry-picks it +- Possible extra (pending both users): portfolio filter in the URL `/portfolio?shoot=`, so shoot blocks could link to "Bekijk meer …foto's". New scope for this page, put it to the user once portfolio-page confirms +- contact-page's final preselect format: `/contact?pakket=` (unknown values ignored; shoot types without `packageId` link to plain `/contact`) +- Shared service area (`areaServed`) in `siteContent` and its use in `professionalService`: owned by this feature, in a separate small commit (siteContent + seo.ts + tests). No waiting on each other: different functions in `seo.ts`, so whoever commits first sends the hash and the other rebases on top. contact-page follows the approved wording (send it once the user approves) +- If this feature reaches Code Generation before contact-page's `webPage()` commit exists: ask contact-page first whether this feature should add `webPage()` exactly to the agreed signature (then contact-page rebases on it), rather than writing a page-specific function +- contact-page also changes `content/types.ts` and `siteContent.ts` (its unit 2): `SocialLink.label?`, `SiteContent.contactForm = { enabled, replyTime }`. Different fields from `serviceArea`; whoever commits second resolves the small textual conflict +- Lighthouse (`pnpm check`, preview on port 4173 `--strictPort`): send "claim 4173" to the other sessions before starting and "4173 free" when done; no heavy runs (full vitest with coverage, build) while someone else's Lighthouse runs +- Test environment (one, last deploy wins): "claim test" with the reason before a `deploy_test` dispatch, "test free" after the review; a merge to master also deploys to test, so check for an open test claim before merging and announce the merge +- Claims of others: contact-page — ContactForm generalisation, contact-details block, `/contact?onderwerp=` (pending its user's decision); portfolio-page — PortfolioGrid, Lightbox, InstagramGrid move to shared +- over-mij-page sends the merge commit once merged; all stacked features then rebase onto master + +## 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**: Requirements Analysis + +## Stage Progress + +### 🔵 INCEPTION PHASE +- [x] Workspace Detection +- [x] Reverse Engineering - SKIP (shared artifacts current; delta lines only) +- [x] Requirements Analysis (approved) +- [x] User Stories - SKIP +- [x] Workflow Planning (approved) +- [x] Application Design - EXECUTE (minimal) — approved +- [x] Units Generation - SKIP + +### 🟢 CONSTRUCTION PHASE +- [x] Functional Design - EXECUTE (unit 2 ✅) / SKIP (unit 1) +- [x] NFR Requirements - SKIP +- [x] NFR Design - SKIP +- [x] Infrastructure Design - SKIP +- [x] Code Generation - EXECUTE (per unit): 1 Shared blocks and content ✅ (eb23536 / befe97a / 6cf9095) → 2 Soorten fotoshoots page ✅ (4521539, d2c1d2c) +- [x] Build and Test - EXECUTE (approved) + +### 🟡 OPERATIONS PHASE +- [x] Deployment Setup, Monitoring Setup, Production Readiness Validation - SKIP (Operations = No) + +## Execution Plan Summary +- **Stages to Execute**: Application Design (minimal), Functional Design (unit 2 only), Code Generation (2 units), Build and Test +- **Stages to Skip**: Reverse Engineering (shared artifacts current), User Stories (single persona, concrete FRs), Units Generation (split fixed in the plan), Functional Design for unit 1, NFR Requirements and NFR Design (set at requirements level), Infrastructure Design (static assets only), Operations (decided No) +- **Units**: 1 Shared blocks and content → 2 Soorten fotoshoots page +- **Delivery**: branch feature/soorten-fotoshoots-page, separate commits for portfolio-page (assets/content) and contact-page (service area), full `pnpm check` per unit, one PR at the end diff --git a/aidlc-docs/features/soorten-fotoshoots-page/audit.md b/aidlc-docs/features/soorten-fotoshoots-page/audit.md new file mode 100644 index 0000000..6ea1d3e --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/audit.md @@ -0,0 +1,337 @@ +# AI-DLC Audit Log — soorten-fotoshoots-page + +## Initial User Request + +**Timestamp**: 2026-10-24T19:30:00Z + +**User Input**: "Ik wil een nieuwe feature starten voor het bouwen van de \"Soorten Fotoshoots\" pagina. Wederom met aandacht voor SEO, accessibility en reusability van code elementen, chakra en theming. Net zoals voorgaande feature." + +**AI Response**: "Started AI-DLC workflow (existing multi-feature workspace). Classified as Feature. over-mij-page was still in Build and Test and unmerged; saved a feature-selection prompt (now inception/feature-selection.md)." + +**Context**: INCEPTION - Workspace Detection (start, feature resolution) + +--- + +## Feature Resolution + +**Timestamp**: 2026-10-24T19:35:00Z + +**User Input**: "B" + +**AI Response**: "Created branch feature/soorten-fotoshoots-page from feature/over-mij-page (ae769cb). Detected that other sessions (portfolio-page, contact-page) were working in the same checkout; the branch switch had moved HEAD away from feature/contact-page. Restored the main checkout to feature/contact-page (nothing committed in between) and moved this feature into its own worktree K:\\Development\\SlpSoftware\\Projects\\AndreaSlopFotografie-soorten-fotoshoots. Asked the user how to proceed (wait for RE from portfolio / own refresh / pause)." + +**Context**: INCEPTION - Workspace Detection (branch + worktree) + +--- + +## Coordination With Parallel Features + +**Timestamp**: 2026-10-24T19:41:00Z + +**User Input**: "kan je niet verde rin eeen worktree en zorgen dat je die update zodra over mij klaar is? Ik heb meerdere features gestart omdat ik die tegelijk wilden gaan oppakken. Kan je daarmee werken? OM wel te zorgen dat er geen dubbel werk gedaan wordt? Alsof je met teamgenoten praat?" + +**AI Response**: "Continued in the worktree. Coordinated with the parallel sessions via cross-session messages (see aidlc-state.md § Parallel Work Agreements): no full RE refresh, own entries only in hot files, contact-page's generic webPage() helper for JSON-LD, claims per feature. over-mij-page will message the merge commit; this branch then rebases onto master. Verified that _shared/reverse-engineering already covers the over-mij blocks (MediaText, PhotoDuo, PageSection in component-inventory/code-structure, last changed in e152153), so Reverse Engineering is skipped. Language configuration inherited (English docs, Dutch conversation)." + +**Context**: INCEPTION - Workspace Detection (complete). Parallel features: over-mij-page (Build and Test), portfolio-page (Inception), contact-page (Inception). Conflicts: hot files sitePages.ts, lighthouserc.cjs, seo.ts, active-features.md, handled by the agreements. + +--- + +## Requirements Analysis — Questions + +**Timestamp**: 2026-10-24T19:50:00Z + +**User Input**: (none — questions file created) + +**AI Response**: "Compared the design (design/andreaslop-static/soorten-fotoshoots.html) with the live page (andreaslop.nl/soorten-fotoshoots) and the homepage packages. Created inception/requirements/requirement-verification-questions.md with 11 content questions plus the two extension opt-ins and the Operations question." + +**Context**: INCEPTION - Requirements Analysis (awaiting answers) + +--- + +## Requirements Analysis — Answers and Requirements + +**Timestamp**: 2026-10-24T20:15:00Z + +**User Input**: "ik heb de vragen beantwoord" (answers in the file: Q1 A, Q2 A, Q3 A, Q4 A, Q5 B, Q6 B, Q7 A, Q8 \"B, want optie A omvat niet alle shoots en de shoot skunnen ook in de beschrijving.\", Q9 \"A, werkgevbied is Huizen en omgeving of Huizen en Gooi en Vechstreek, maar hoeft daar niet beperkt te blijven en zou in theorie heel Nederland kunnen zijn. Wat is handig om daarvoor te doen?\", Q10 A, Q11 A, Q12 A, Security A, PBT A, Operations B) + +**AI Response**: "No contradictions; Q5 = B overrides the labels part of Q1 = A. Gezin placement (after Zwangerschap) and draft text, and the service-area advice for Q9 (Huizen + Gooi en Vechtstreek, shared with the business, not Nederland; Google Business Profile as the bigger lever) are proposed in requirements.md for approval instead of a second question round. Agreed photo ownership with portfolio-page (this feature owns assets/shoots/, assets-only commit). Wrote requirements.md; extension and operations configuration recorded in aidlc-state.md." + +**Context**: INCEPTION - Requirements Analysis (awaiting approval) + +--- + +## Branch Update After over-mij-page Merge + +**Timestamp**: 2026-10-24T20:30:00Z + +**User Input**: (none — message from the over-mij session: merged as 11a5224, PR #7) + +**AI Response**: "The branch had no own commits, so it was fast-forwarded from ae769cb to master 11a5224 (the extra commits are docs only). The uncommitted work was stashed as 'soorten-wip' and restored; the expected conflict in active-features.md was resolved by keeping master's ✅ Complete over-mij row and adding this feature's row. All restored files verified identical to the stash. Dropping the now-redundant stash was blocked by the permission classifier (the stash list is shared by all worktrees); left in place for the user." + +**Context**: INCEPTION - Requirements Analysis (awaiting approval) + +--- + +## Requirements Analysis — Approval + +**Timestamp**: 2026-10-24T20:50:00Z + +**User Input**: "Gooi de stash weg wanneer dat wel kan. Gef het desnoods door aan de andere sessies. Als dat echt niet lukt moet je het laten weten dan probee rik het zelf zodra alle features klaar zijn.\n\nIk heb de requirements gezien. Akkoord en ga verder" + +**AI Response**: "With the user's explicit approval, dropped the redundant 'soorten-wip' stash by name (stash@{0}, 8713041). Requirements approved, including the Gezin draft text and placement and the service area (Huizen + Gooi en Vechtstreek). Started Workflow Planning: wrote inception/plans/execution-plan.md (Application Design minimal, Functional Design unit 2, Code Generation in two units, Build and Test)." + +**Context**: INCEPTION - Requirements Analysis (approved) → Workflow Planning (awaiting approval) + +--- + +## Workflow Planning — Approval + +**Timestamp**: 2026-10-24T21:00:00Z + +**User Input**: "akkoord, ga verder" + +**AI Response**: "Execution plan approved. Started Application Design (minimal): wrote inception/plans/application-design-plan.md with the decisions taken from requirements and earlier features, and 2 questions (photo without frame in MediaText; CallToAction interface). Found that the design's shoot photos have no sand frame, unlike MediaText's FramedImage." + +**Context**: INCEPTION - Workflow Planning (approved) → Application Design (awaiting answers) + +--- + +## Application Design — Clarification of Question 1 + +**Timestamp**: 2026-10-24T21:10:00Z + +**User Input**: "Ik weet niet zo goed wat je met vraag 1 bedoeld. kan je dat toelichten?" + +**AI Response**: "Explained the sand-coloured block behind the photo (homepage About block, Over mij intro) and options A/B/C." + +**Context**: INCEPTION - Application Design (answers pending) + +--- + +## Application Design — Answers and Follow-up Questions + +**Timestamp**: 2026-10-24T21:20:00Z + +**User Input**: "ik heb de vragen beantwoord" — in the plan file Q1: "X, in het live design heb je op deze pagina een soortgelijk kader, maar per shoot een andere kleur. Kan je het kader niet laten staan, maar dan een kleur opgeven voor het kader met als standaard de kleurdie nu wordt gebruikt? Dus houden wat er nu is, maar de kleur kunnen meegeven."; Q2: "A" + +**AI Response**: "Q1: keep the block, make its colour configurable, default sand (the current colour). Checked the live page: block colours #ABA699 (Newborn), #975030 (Zwangerschap), #A18679 (Loveshoot), #84847C (Portretten), none in the theme; live photos are landscape 3:2 while the design crops 4:5. Portfolio-page confirmed /portfolio?shoot=. Added three follow-up questions to the plan: colours, photo orientation, portfolio link." + +**Context**: INCEPTION - Application Design (awaiting follow-up answers) + +--- + +## Application Design — Follow-up Answers and Artifacts + +**Timestamp**: 2026-10-24T21:40:00Z + +**User Input**: "Ik heb de vragen beantwoord" (follow-up 1: A, follow-up 2: B, follow-up 3: A) + +**AI Response**: "Frame colours become theme tokens (frame.stone/rust/taupe/olive, Gezin accent); portrait 4:5 crop chosen per photo and shown to the user first; portfolio links to /portfolio?shoot=, rendered only once /portfolio is indexed. Updated requirements.md (FR-SF-02 photo crop and frame colours, new FR-SF-04b, FR-SF-07 frameColor and RichParagraph move, decisions table). Generated application-design/ (components, component-methods, services, component-dependency, application-design). ShootType gains photosLabel and frameColor (announced to portfolio-page)." + +**Context**: INCEPTION - Application Design (awaiting approval) + +--- + +## Application Design — Approval + +**Timestamp**: 2026-10-24T22:00:00Z + +**User Input**: "ga verder" + +**AI Response**: "Application Design approved (incl. the proposal to show portfolio links only for shoot types with portfolio photos, via portfolio-page's helper). Functional Design is skipped for unit 1 per plan. Started Code Generation Part 1 for unit 1: wrote construction/plans/shared-blocks-and-content-code-generation-plan.md (23 steps in three commits: A shoot types + photos for portfolio-page, B service area for contact-page, C shared blocks) and asked for plan approval." + +**Context**: INCEPTION - Application Design (approved) → CONSTRUCTION - Code Generation unit 1, Part 1 (awaiting plan approval) + +--- + +## Code Generation Unit 1 — Plan Approval and Photo Checkpoint + +**Timestamp**: 2026-10-24T22:30:00Z + +**User Input**: "approve plan" + +**AI Response**: "Plan approved; Part 2 started. Step 1: downloaded the four live shoot photos (all landscape). Step 2: Gezin candidates from the live portfolio: F41A7138 (parents with baby, preferred) and F41A1579 (brother kissing baby); portfolio-page confirmed both are among its 10 portfolio photos but processes them uncropped in other sizes, so no duplicate work; whether the same photo may appear on both pages is the user's choice. Step 3: 4:5 crops (960×1200) made with a one-off scratchpad script; newborn focus adjusted to 0.44; the alternative Gezin crop cuts the boy's head off. Presented the crops to the user for approval (checkpoint)." + +**Context**: CONSTRUCTION - Code Generation unit 1, Step 3 checkpoint (awaiting crop approval) + +--- + +## Code Generation Unit 1 — Crops Approved + +**Timestamp**: 2026-10-24T23:30:00Z + +**User Input**: "Kan je uitsneden-ter-goedkeuring.jpg sturen." then "1. De uitsneden zijn goed\n2. #3, is betere foto om gezin te representeren en #4 is sowieso niet goed uitgesneden" + +**AI Response**: "Sent the contact sheet. Crops approved; Gezin = F41A7138 (also in portfolio-page's set, overlap accepted). Wrote the crops to web/src/assets/shoots/, alt texts, theme frame tokens, ShootType types, shootTypes.ts with tests and arbitraries; commit A eb23536 (hash sent to portfolio-page). Service area: types, siteContent, areaServed() in seo.ts with example and PBT tests; commit B befe97a (hash sent to contact-page, which will not cherry-pick)." + +**Context**: CONSTRUCTION - Code Generation unit 1, Steps 4-14 + +--- + +## Code Generation Unit 1 — Shared Blocks, Verification + +**Timestamp**: 2026-10-25T08:30:00Z + +**User Input**: "Ga verder waar je gebleven was" + +**AI Response**: "FramedImage/MediaText frameColor and reverse, RichParagraph moved to shared, CallToAction, Pricing id=prijzen, test helper cssRulesFor. First pnpm check stopped because portfolio-page's Lighthouse run was using port 4173; agreed the 'claim 4173 / 4173 free' protocol with both peers and cleaned up the orphaned vitest processes of this worktree. After portfolio's '4173 free': full pnpm check passed (290 tests, build, audits, Lighthouse). Visual check with puppeteer-core against the preview: homepage and Over mij unchanged, #prijzen lands below the header. Commit C 6cf9095. Removed this session's duplicate memory note in favour of the peer's more complete one." + +**Context**: CONSTRUCTION - Code Generation unit 1 (complete, awaiting approval) + +--- + +## Code Generation Unit 1 — Approval + +**Timestamp**: 2026-10-25T08:45:00Z + +**User Input**: "Ga verder" + +**AI Response**: "Unit 1 approved. active-features.md status set to 🟢 Construction. Started Functional Design for unit 2: plan and a separate question file with 3 questions (anchor per shoot, publication of the Gezin draft and alt texts, Service description source)." + +**Context**: CONSTRUCTION - Code Generation unit 1 (approved) → Functional Design unit 2 (questions open) + +--- + +## Functional Design Unit 2 — Answers and Artifacts + +**Timestamp**: 2026-10-25T09:00:00Z + +**User Input**: "Kan de vragen hierheen sturen" — answered in chat: Q1 "Ja, alleen ankers (Recommended)", Q2 "Merge wacht op Andrea (Recommended)", Q3 "Eerste alinea (Recommended)"; then "Zet de antwoorden ook in het bestand voor naslag" + +**AI Response**: "Asked the three questions in chat at the user's request and recorded the answers (A, A, A) in soorten-fotoshoots-page-fd-questions.md. Generated functional-design/ (domain-entities, business-rules BR-SF-01..18, business-logic-model with PBT properties, frontend-components)." + +**Context**: CONSTRUCTION - Functional Design unit 2 (awaiting approval) + +--- + +## Functional Design Unit 2 — Approval + +**Timestamp**: 2026-10-25T09:15:00Z + +**User Input**: "Ga verder" + +**AI Response**: "Functional design approved. Asked contact-page about the status of webPage() and offered to add it to the agreed signature in a separate commit. Wrote construction/plans/soorten-fotoshoots-page-code-generation-plan.md (19 steps) and asked for plan approval." + +**Context**: CONSTRUCTION - Functional Design unit 2 (approved) → Code Generation unit 2, Part 1 (awaiting plan approval) + +--- + +## Code Generation Unit 2 — Plan Approval and Generation + +**Timestamp**: 2026-10-25T09:30:00Z + +**User Input**: "Approve plan. Je mag meteen committen en pushen en deployen naar test zodat het daar bekeken kan worden. Alzodra de build slaagt mag je een pr maken zodat er voor deze run geen dubbele workflow draait" + +**AI Response**: "Plan approved, with permission (scoped to this unit) to commit, push, deploy to test and open a PR once the run succeeds. Generated the preview image (sent to the user), cherry-picked contact-page's webPage() (790495d → 3c7d00e), content, shootLinks, shootServices/absoluteUrl, ShootList/ShootBlock, the route, route tests, LAYOUT.md and the RE lines. Contact link name changed to aria-label after a failing test showed the hidden span's leading space was dropped. Agreed a 'claim test / test free' protocol with the peers (merge to master also deploys to test)." + +**Context**: CONSTRUCTION - Code Generation unit 2 (Part 2) + +--- + +## Code Generation Unit 2 — Lighthouse Thresholds + +**Timestamp**: 2026-10-25T11:00:00Z + +**User Input**: answered in chat: first "Bundel eerst kleiner maken", then "Drempel gelijk aan homepage-aanpak (Recommended)" + +**AI Response**: "Diagnosed failing Lighthouse runs: one homepage run at 0.69 was taken at half CPU speed (benchmarkIndex 1909); otherwise the homepage sits at 0.77–0.80 against 0.8 and the photo pages at ~0.897 against 0.9 (simulated LCP 3.22 s, same on /over-mij). Tried a no-fade priority photo (no effect, reverted); re-cropped the shoot photos at 848×1060 because the two 1600 px originals had been upscaled (fewer bytes, LCP unchanged). At the user's choice, moved the JSON-LD from head() into the page component (main bundle +0.3 kB gzip instead of +1.3 kB) and added photoPagePaths (/over-mij, /soorten-fotoshoots) with mobile 0.85 to lighthouserc.cjs; the desktop config now raises every entry to 0.9. Rule shared with portfolio-page and contact-page. A leftover vite preview of the measurement script held port 4173 for a while; stopped, script fixed, contact informed." + +**Context**: CONSTRUCTION - Code Generation unit 2 (Part 2) + +--- + +## PC Restart and Resume + +**Timestamp**: 2026-10-25T12:58:00Z + +**User Input**: "de pc is tussendoor uit gegaan. kan je de ssh agent weer starten. dan voeg ik mijn key toe dan kunnen alle sessies weer pushen wanneer ik dat vraag. Dan kan je verder waar je gebleven was" and "mijn sessielimiet zit er bijna op, die wordt over een uur gereset. kan je een timer zetten dat je over een uur weer verder gaat waar je mee bezig was?" + +**AI Response**: "Started a new ssh-agent without a lifetime (~/.ssh/agent.env); the user added their key. Reran Lighthouse on the same build (passed). Scheduled a one-shot resume at 12:58. Visual check of /soorten-fotoshoots at three widths against the design (screenshots sent); filled in the verification in the code summary." + +**Context**: CONSTRUCTION - Code Generation unit 2 (verification complete, committing) + +--- + +## Code Generation Unit 2 — Push, Deploy to Test, PR + +**Timestamp**: 2026-10-25T13:45:00Z + +**User Input**: (none — within the permission given with the plan approval) + +**AI Response**: "Committed 4521539 (page) and ce2cb92 (docs), pushed feature/soorten-fotoshoots-page, sent 'claim test' to contact-page and portfolio-page, dispatched CI run 568 with deploy_test: check, deploy-test and lighthouse succeeded. Opened PR #8 to master afterwards (no duplicate run during the deploy). The merge waits for Andrea's review of the Gezin text and alt texts on test (BR-SF-17). Presented the Code Generation completion message for unit 2." + +**Context**: CONSTRUCTION - Code Generation unit 2 (complete, awaiting approval / review on test) + +--- + +## Code Generation Unit 2 — Review: Texts Approved, Photos Smaller + +**Timestamp**: 2026-10-25T14:15:00Z + +**User Input**: "Teksten zijn akkoord, maar de afbeeldingen zijn toch te groot. kan je die verkleinen? Ik denk dat ze 50% kleiner kunnen. Kan je dan zorgen dat ik het lokaal kan testen?" — clarified in chat: "Te groot op het scherm" + +**AI Response**: "Texts (Gezin draft and alt texts) approved, so BR-SF-17 is met. Added mediaSize 'half' | 'small' to MediaText (default unchanged); the shoot photos use 'small': at most 20rem (320 px) wide, stacked or next to the text, the text column takes the rest; tests added. Started a dev server on port 5181 for the user's local test. Noted that the text lines are now long (~130 characters) and offered a narrower text column." + +**Context**: CONSTRUCTION - Code Generation unit 2 (changes requested, local test) + +--- + +## Code Generation Unit 2 — Review: Less Plain + +**Timestamp**: 2026-10-25T14:45:00Z + +**User Input**: "Ik vind hem nog steeds wat saai. de tekst is nu ook erg breed dus die mag smaller." — then in chat: "Tweede foto per shoot, Afwisselende achtergrond, De pagina in zijn geheel moet wel in lijn blijven met de rest dus het moet niet een smallere pagina worden. of niet veel smalle rin ieder geval" + +**AI Response**: "Text column max 36rem. Each shoot now has its own full-width band alternating paper / paper.alt (replaces the hairlines). MediaText gets an optional detailImage: a square photo overlapping the main photo's lower right corner (photo column 28rem); photo and text columns sit against the edges of the content column (justify space-between), so the page keeps the site's width. Proposed second photos from the live site (newborn feet, pregnant woman in the sun, brother kissing the baby, ring on the hand, heather on the tattooed arm) with alt texts, sent to the user for approval; noted that the ring photo is probably from a wedding and the heather photo is also the site's default preview image. ShootType gets optional detailImage (additive). Tests updated (49 green)." + +**Context**: CONSTRUCTION - Code Generation unit 2 (changes requested, awaiting photo approval and feedback) + +--- + +## Code Generation Unit 2 — Review: Centred Text, Portret Detail + +**Timestamp**: 2026-10-25T15:05:00Z + +**User Input**: "Nu is de witruimte tussen de tekst en de foto's weer erg groot. Misschien de tekst \"centreren\" tussen de foto en de rand van de pagina? Verder zijn de foto's goed, behalve die van Portretten. Kan je daar de kleine foto baseren op hero-4.jpg?" + +**AI Response**: "Detail photos approved except Portretten. The text track now takes the rest of the row and the text (max 36rem) is centred in it from lg. Portretten's detail photo re-cropped square from web/src/assets/hero-4.jpg (focus 0.47, face and heather), alt 'Een vrouw met lang blond haar in een jurk met bloemenprint houdt een takje heide vast op de heide'. Tests updated (49 green); screenshot sent." + +**Context**: CONSTRUCTION - Code Generation unit 2 (changes requested, local test) + +--- + +## Code Generation Unit 2 — Portfolio Links, Final Check, Push + +**Timestamp**: 2026-10-25T15:30:00Z + +**User Input**: "Stuk beter! Als het goe dis zouden er ook nog linkjes komen per shoot die linken naar de portfolio. Wordt dat meegenomen zodra de portfoliolpagina wordt afgerond?" then "Je hoeft niet naar test te deployen. Je mag verdergaan" + +**AI Response**: "Confirmed the portfolio links switch on by themselves when /portfolio is indexed (portfolio-page's merge); made the route test expect them in that case; informed portfolio-page (validateSearch for shoot, helper for types with photos later). Full pnpm check passed (325 tests, Lighthouse all assertions). Committed and pushed (PR #8 updated, PR run starts); no second deploy to test at the owner's request; released the test claim." + +**Context**: CONSTRUCTION - Code Generation unit 2 (complete, awaiting approval) + +--- + +## Build and Test + +**Timestamp**: 2026-10-25T16:00:00Z + +**User Input**: "Ga verder naar Build en Test" + +**AI Response**: "Code Generation unit 2 approved. Build and Test at d12665c: build ✅, 325 unit tests ✅ (coverage 92.4%), 19/19 browser integration checks on the production build ✅ (one check corrected: ContactSection removes ?pakket= from the URL by design), Lighthouse within all budgets (soorten 0.89/0.85 mobile, 1.0 desktop). Wrote construction/build-and-test/ (build, unit, integration, performance instructions and summary). Operations phase declined earlier, so the next step after approval is completing the workflow; merging PR #8 is the owner's call." + +**Context**: CONSTRUCTION - Build and Test (complete, awaiting approval) + +--- + +## Build and Test — Approval and Workflow Complete + +**Timestamp**: 2026-10-25T16:10:00Z + +**User Input**: "Ga verder. Ik merge de PR met auto-merge. zodra die gemerged is mag je opruimen en maste rupdaten. dan is deze sessie klaar en kunnen de andere siessies verder" + +**AI Response**: "Build and Test approved; Operations phase stays declined, so the workflow is complete: aidlc-state.md set to Complete, active-features.md to ✅ Complete. Committed and pushed the Build and Test docs to PR #8; announced the merge (which also deploys to test) to the parallel sessions. After the owner's auto-merge: clean up the worktree and local branch, update master, and send the merge commit to the other sessions so they can rebase." + +**Context**: Workflow complete (merge by the owner) + +--- diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/build-and-test-summary.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/build-and-test-summary.md new file mode 100644 index 0000000..4e1f322 --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/build-and-test-summary.md @@ -0,0 +1,52 @@ +# Build and Test Summary — soorten-fotoshoots-page + +Tested commit: `d12665c` (unit 1 shared blocks and content + unit 2 Soorten fotoshoots page, incl. the review changes), locally on Windows, 2026-10-25. + +## Build +- **Tool**: pnpm + Vite (`tsc && vite build`) +- **Status**: ✅ Success (0.9 s locally). CI run 568 (`workflow_dispatch`, deploy_test) on `ce2cb92`: `check`, `deploy-test` and `lighthouse` ✅; PR run 569 on `ce2cb92` ✅; PR run 570 on `d12665c` in progress at the time of writing +- **Artifacts**: `web/dist/` +- **Main bundle**: 169.6 kB gzip (+0.3 kB against master) + +## Unit tests +- **Total**: 325 in 65 files. **Passed**: 325. **Failed**: 0. +- **Coverage**: thresholds met; 92.4% of statements overall +- **Status**: ✅ Pass + +## Integration (browser, production build) +19 checks across the 12 scenarios in `integration-test-instructions.md`, all ✅: + +| Scenario | Result | +|---|---| +| Newborn contact link → package preselected, Contact below the header (1440 / 390) | ✅ 68 / 66 px | +| Loveshoot contact link, "de pakketten", "Boek je shoot" (1440 / 390) | ✅ all land below the header | +| Anchor `#gezin` (1440 / 390) | ✅ | +| Main menu → page at the top, h1 and title | ✅ | +| Outline and article names | ✅ | +| JSON-LD (5 services, anchors, provider, area, no prices) and head tags | ✅ | +| No e-mail in served HTML or JSON-LD | ✅ | +| Layout shift while scrolling, 10 photos loaded (1440 / 390) | ✅ CLS 0.0000 | +| No horizontal overflow, 3 pages × 5 widths | ✅ | +| Keyboard order, focus ring, touch targets | ✅ contact links 44 px, button 53 px | + +### Found in this stage +- **The Newborn contact-link check first failed, but the check was wrong, not the page.** It expected `?pakket=newborn` in the final URL. The homepage's ContactSection takes `?pakket=` over into the form and then removes it from the address bar on purpose (as with the price cards). The check now reads the link's `href` and confirms the preselected package; it passes. + +## Performance (Lighthouse CI, production build) +| Page | Mobile (budget) | Desktop | +|---|---|---| +| Homepage | 0.80 (0.8) | 0.99 | +| Over mij | 0.91 (0.85) | 1.0 | +| Soorten fotoshoots | 0.89 (0.85) | 1.0 | +| Other pages | 0.94–0.95 (0.9) | 1.0 | + +Accessibility and best practices are 1.0 on every page; SEO 1.0 on the indexed pages. Why the photo pages have a mobile budget of 0.85: see `performance-test-instructions.md`. + +## Additional +- **Security**: `pnpm audit --prod --audit-level high` clean. The full `pnpm audit` reports 17 findings in development tools only (same as master, NFR-SEC-05). No new dependencies, no new external resources, CSP unchanged. Query parameters on outgoing links only come from our own package and shoot ids (PBT). +- **Contract / E2E suite**: N/A (static front end without an API). The browser checks above cover the user flows. + +## Overall +- **Build**: ✅ **Tests**: ✅ **Performance budgets**: ✅ +- **Owner review**: texts approved; layout changed on review (smaller photos with detail photos, alternating bands, narrower text) and approved locally; no second deploy to test at the owner's request +- **Operations phase**: declined at Requirements Analysis. The next step is merging PR #8 (also deploys to test; announce it to the parallel feature sessions first). diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/build-instructions.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/build-instructions.md new file mode 100644 index 0000000..45194f8 --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/build-instructions.md @@ -0,0 +1,23 @@ +# Build Instructions — soorten-fotoshoots-page + +Unchanged from over-mij-page: this feature adds no dependencies, build steps or environment variables. + +## Prerequisites +- **Node.js** 24 and **pnpm** (version pinned in `web/package.json`) +- **Environment variables**: none for the build. `LIGHTHOUSE_PERFORMANCE=warn` only in CI. + +## Build steps +```bash +cd web +pnpm install # also runs `chakra typegen` (postinstall); needed after the new frame.* theme tokens +pnpm build # tsc && vite build +``` + +## Verify +- **Expected output**: `✓ built in …` and no TypeScript errors (0.9 s locally at d12665c) +- **Artifacts**: `web/dist/`. New in this feature: ten shoot photos under `dist/assets/` (hashed names), `dist/og-soorten-fotoshoots.jpg` (copied from `public/`, stable URL for the preview image) and the page's own chunk `soorten-fotoshoots-*.js` (the shoot texts and structured data load with it, not with the main bundle) +- **Accepted warning**: Vite's chunk-size warning for the main bundle (known, NFR-P-01) + +## Troubleshooting +- **Lighthouse or preview fails with "port in use"**: another preview on 4173 (another worktree, or a leftover `vite preview`: on Windows, killing the shell does not stop its node process). Check with `Get-NetTCPConnection -LocalPort 4173` and coordinate via "claim 4173" with the parallel feature sessions. +- **A theme token is missing in types after a cherry-pick of the shoot types commit**: run `pnpm typegen`. diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/integration-test-instructions.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/integration-test-instructions.md new file mode 100644 index 0000000..0dc38ef --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/integration-test-instructions.md @@ -0,0 +1,25 @@ +# Integration Test Instructions — soorten-fotoshoots-page + +Unit 1 (shared blocks, shoot types, service area) and unit 2 (the page) meet on the shoot types page, on the homepage (the pricing anchor and the contact section the shoot links lead to) and on Over mij (which uses the extended `MediaText` with its defaults). + +## Automated (in `pnpm test`) +- `src/app.test.tsx`: `/soorten-fotoshoots`, `/` and `/over-mij` through the real route tree +- `src/sitemap.test.ts` and the Lighthouse sync test: `/soorten-fotoshoots` indexed in `sitePages.ts`, in the sitemap and in the Lighthouse indexed and photo-page paths + +## In a real browser (production build) +Run against `pnpm build && npx vite preview --port 4180 --strictPort` (a port other than 4173, which Lighthouse uses), with headless Chrome via the `puppeteer-core` that Lighthouse already installs. Desktop viewport 1440 × 900, phone 390 × 900. The one-off script used for this run lives in the session scratchpad (`integration.mjs`); the scenarios below are what it checks. + +| # | Scenario | Expected | +|---|---|---| +| 1 | Click Newborn's "Stuur een berichtje" (1440 and 390 px) | href `/?pakket=newborn#contact`; on the homepage the form has Newborn selected, the URL becomes `/#contact` (ContactSection removes `?pakket=` by design) and Contact's top lines up with the sticky header's bottom | +| 2 | Click Loveshoot's "Stuur een berichtje" | `/#contact` without a package, lands below the header | +| 3 | Click "de pakketten" in the closing block | `/#prijzen`, the pricing section lands below the header | +| 4 | Click "Boek je shoot" | `/#contact` | +| 5 | Open `/soorten-fotoshoots#gezin` | the Gezin article lands below the header | +| 6 | Main menu "Soorten fotoshoots" from `/` | `/soorten-fotoshoots` at scroll 0, h1 "Soorten fotoshoots", title "Soorten fotoshoots \| Andrea Slop Fotografie" | +| 7 | Rendered DOM | h1 → h2 Newborn, Zwangerschap, Gezin, Loveshoot, Portretten → h2 "Benieuwd naar de prijzen?"; every article named by its h2 | +| 8 | Structured data and head | `WebPage` with an `ItemList` of 5 `Service`s, `@id` = page URL + anchor, provider = the business `@id`; the business's `areaServed` is Huizen + Gooi en Vechtstreek; no prices; no robots meta; canonical and `og:image` `/og-soorten-fotoshoots.jpg` | +| 9 | E-mail address | not in the served HTML and not in the JSON-LD | +| 10 | Scroll the page top to bottom (1440 and 390 px) | CLS < 0.1; all 10 photos (5 main, 5 detail) loaded, each with alt, width and height | +| 11 | `/`, `/over-mij`, `/soorten-fotoshoots` at 320, 390, 768, 1024 and 1440 px | `scrollWidth ≤ innerWidth`: no horizontal overflow | +| 12 | Tab through the page's main content | the 5 contact links (by their full accessible name), "de pakketten", "Boek je shoot", in that order, each with a ≥ 2 px focus ring; contact links and the button ≥ 44 px high | diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/performance-test-instructions.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/performance-test-instructions.md new file mode 100644 index 0000000..8a97feb --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/performance-test-instructions.md @@ -0,0 +1,24 @@ +# Performance Test Instructions — soorten-fotoshoots-page + +A static site, so there is no load testing. Performance means page-load performance, measured with Lighthouse CI on the production build. + +```bash +cd web +pnpm build +pnpm lighthouse # mobile (lighthouserc.cjs) then desktop (lighthouserc.desktop.cjs) +``` + +Before running: send "claim 4173" to the parallel feature sessions and keep the machine quiet; afterwards "4173 free". + +## Budgets +- **Performance, mobile**: homepage ≥ 0.8 (NFR-P-01); **photo pages `/over-mij` and `/soorten-fotoshoots` ≥ 0.85 (new in this feature)**; every other page ≥ 0.9 +- **Performance, desktop**: every page ≥ 0.9 (`lighthouserc.desktop.cjs` now raises every entry, not only the homepage's) +- **Accessibility and best practices**: 1.0 on every page +- **SEO**: 1.0 on the indexed pages; the basic audits on noindex pages + +## Measuring reliably +Check `environment.benchmarkIndex` in the JSON report: around 3900–4300 on this PC. One homepage run at 0.69 had a benchmarkIndex of 1909 (the machine at half speed during that measurement); such a run says nothing about the code. + +## Why the photo pages get 0.85 on mobile +Lighthouse simulates a slow mobile connection (lantern). On a page whose largest paint is a photo, that photo can only be requested after the main bundle and the page's own chunk have run, so `/over-mij` and `/soorten-fotoshoots` both land on LCP 3.22 s and a score of about 0.897 (FCP 0.72, SI 0.98, LCP 0.72, TBT 0.99, CLS 1.0). That rounds to 0.89 or 0.90 from run to run. +Tried during this feature and measured: fewer bytes on the LCP photo (848×1060 instead of an upscaled 960×1200) and no fade-in on the priority photo; neither moved the LCP. Moving the page's JSON-LD out of `head()` kept the main bundle 1 kB (gzip) smaller. The structural fix is prerendering or a smaller main bundle (NFR-P-01); then the photo pages go back to 0.9. diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/unit-test-instructions.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/unit-test-instructions.md new file mode 100644 index 0000000..c6d938a --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/build-and-test/unit-test-instructions.md @@ -0,0 +1,17 @@ +# Unit Test Execution — soorten-fotoshoots-page + +```bash +cd web +pnpm test # vitest run --coverage +``` + +- **Expected**: 65 files, 325 tests, 0 failures (at d12665c; 60 files / 273 tests on master before this feature, plus 6 from contact-page's cherry-picked `webPage()` tests) +- **Coverage**: thresholds met; `src/lib/` and `src/seo.ts` at 100%; overall 92.4% of statements +- **Includes, new in this feature**: + - `shootTypes` content: ids and order, existing package ids, frame colours that exist in the theme, alt texts, 4:5 photos + - `FramedImage` (`frameColor`) and `MediaText` (`reverse`, `mediaSize`, `detailImage`), with the existing callers unchanged; the generated CSS rules are read with `src/test/cssRules.ts`, since jsdom applies neither media queries nor pseudo-elements + - `CallToAction`, `RichParagraph` (moved), `Pricing` anchor `#prijzen` + - `ShootBlock` and `ShootList`: articles with anchors, link targets and names, alternation, bands, priority photo, axe + - the `/soorten-fotoshoots` route through the real route tree: outline, articles, contact links incl. `?pakket=`, portfolio links only when `/portfolio` is indexed, head tags, `WebPage` JSON-LD + - property-based tests (fast-check): `shootContactLink` (only a visible package's id goes into `?pakket=`, always the contact section), `shootPortfolioLink`, `areaServed` (named areas in order, only towns and regions), `shootServices` (one service per shoot in order, distinct anchor `@id`s, provider and area, first paragraph, no e-mail or prices), `absoluteUrl` (invariant and idempotency) +- **Report**: terminal output plus `web/coverage/` diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/shared-blocks-and-content-code-generation-plan.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/shared-blocks-and-content-code-generation-plan.md new file mode 100644 index 0000000..260e434 --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/shared-blocks-and-content-code-generation-plan.md @@ -0,0 +1,59 @@ +# Code Generation Plan — Unit 1: Shared blocks and content + +Single source of truth for code generation of this unit. Workspace root: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-soorten-fotoshoots` (worktree); code in `web/`. Branch `feature/soorten-fotoshoots-page` (on master `11a5224`). + +## Unit Context +- **Requirements**: FR-SF-02 (photos, frame colours), FR-SF-03 (anchor), FR-SF-06, FR-SF-07, SEO-SF-03 (service area), NFR-SF-02, NFR-SF-06 +- **Design**: [application-design.md](../../inception/application-design/application-design.md), [component-methods.md](../../inception/application-design/component-methods.md). No Functional Design for this unit (plan decision). +- **Depends on**: nothing new; reuses `PageSection`, `Reveal`, `DeferredImage`, theme. +- **Used by**: unit 2 (the page); portfolio-page (commit A); contact-page (commit B). +- **Behavioural contract for existing pages**: homepage and Over mij render exactly as before, except the invisible `id="prijzen"` on the pricing section and the new `areaServed` in the business JSON-LD on every page. + +The unit is delivered as **three commits**, in this order, so the parallel features can cherry-pick early (worktrees share the repository, so a local commit hash is enough; no push needed for that). + +## Steps + +### Commit A — Shoot types and photos (hash → portfolio-page) +- [x] **Step 1** — Download the four live shoot photos from andreaslop.nl into the scratchpad (not the repo): `2026/07/F41A8700_websize.jpg` (Newborn), `2026/07/F41A7856_websize.jpg` (Zwangerschap), `2025/08/e77ff000dce5a31c0a38c5d824bfdb95.jpeg` (Loveshoot), `2024/09/DSC_0433-1-scaled.jpg` (Portretten). Check which photo belongs to which shoot by looking at them. +- [x] **Step 2** — Gezin photo: collect candidates from the live site (portfolio, homepage), look at them, check with portfolio-page that the candidate is not one of its 10 portfolio photos (or reuse its file if it is), and propose one to the user. +- [x] **Step 3** — Write a one-off resize script in the scratchpad (PowerShell/System.Drawing as in earlier features, EXIF orientation, cover crop with `-FocusX`/`-FocusY`, JPEG quality 80). Make a 4:5 crop per photo (960×1200) with a chosen focus point and a contact sheet of the five crops. **Checkpoint: show the crops to the user and adjust focus points or swap a photo until approved** (FR-SF-02). +- [x] **Step 4** — Write the approved crops to `web/src/assets/shoots/{newborn,zwangerschap,gezin,loveshoot,portret}.jpg`; record exact sizes. +- [x] **Step 5** — Look at each final crop and write a descriptive Dutch alt text (for Andrea to review). +- [x] **Step 6** — `theme.ts`: colour tokens `frame.stone` `#ABA699`, `frame.rust` `#975030`, `frame.taupe` `#A18679`, `frame.olive` `#84847C` (English comments). +- [x] **Step 7** — `content/types.ts`: `ShootTypeId`, `FrameColor`, `ShootType` (as in component-methods.md). +- [x] **Step 8** — `content/shootTypes.ts`: the five shoot types in page order with the approved texts (FR-SF-02; Gezin marked in a comment as a draft pending Andrea's approval), photos, frame colours (Newborn `frame.stone`, Zwangerschap `frame.rust`, Gezin `accent`, Loveshoot `frame.taupe`, Portretten `frame.olive`) and `packageId` for newborn, zwangerschap and gezin. +- [x] **Step 9** — `content/shootTypes.test.ts`: ids unique and in the agreed order, every `packageId` exists in `packages.ts`, every `frameColor` exists as a theme token, alt texts non-empty, images 4:5. A `shootType` arbitrary in `test/arbitraries.ts` for unit 2's properties. +- [x] **Step 10** — Run the affected tests, lint and type check; commit A ("Adds the shoot types and their photos"); send the hash to portfolio-page. + +### Commit B — Service area (hash → contact-page) +- [x] **Step 11** — `content/types.ts`: `ServiceArea`, `SiteContent.serviceArea`; `content/siteContent.ts`: `[{ type: 'City', name: 'Huizen' }, { type: 'AdministrativeArea', name: 'Gooi en Vechtstreek' }]`. Update any `SiteContent` fixtures and the `siteContent` arbitrary. +- [x] **Step 12** — `seo.ts`: pure `areaServed(areas)` → schema.org items (`{ '@type': type, name }`), used by `professionalService` instead of the fixed `Place` Huizen. +- [x] **Step 13** — `seo.test.ts`: example test for the real content; PBT: one item per area, order kept, `@type` only `City`/`AdministrativeArea`, names unchanged, the business JSON-LD still contains no e-mail address; `jsonLdScript` output stays escaped. +- [x] **Step 14** — Run the affected tests, lint and type check; commit B ("Shares the service area in the structured data"); send the hash to contact-page. + +### Commit C — Shared blocks +- [x] **Step 15** — `FramedImage`: optional `frameColor` (default `sand`) on the offset block + test (default unchanged, colour applied, block stays decorative). +- [x] **Step 16** — `MediaText`: optional `reverse` (photo in the second column from `lg`, on top when stacked) and `frameColor` passed through + tests (default order unchanged, reversed order, DOM order photo-first in both cases so reading order stays the same). +- [x] **Step 17** — Move `components/about/RichParagraph/` → `components/RichParagraph/` (component and test, `git mv`), update the import in `AboutIntro`. +- [x] **Step 18** — `components/CallToAction/CallToAction.tsx` + test: section named by its h2, `paper.alt`, narrow centred column, tight spacing, lead and children rendered, `Reveal`, axe. +- [x] **Step 19** — `home/Pricing`: `id="prijzen"` on its `PageSection` + test (the section has the id; the anchor lands below the fixed header via the existing `scrollMarginTop`). +- [x] **Step 20** — `pnpm check` (lint, format, tests incl. coverage thresholds, build, audits, Lighthouse) with nothing else heavy running on the machine. +- [x] **Step 21** — Visual check: homepage (About block, pricing) and `/over-mij` against master at desktop, tablet and phone widths; only invisible changes expected. +- [x] **Step 22** — Write `construction/shared-blocks-and-content/code/code-summary.md` (files, resize commands, image sizes, alt texts, commit hashes). +- [x] **Step 23** — Commit C ("Extends the shared blocks for the shoot types page"). Push only when asked. + +## Extension Compliance (unit 1) +| Rule | Status | Rationale | +|---|---|---| +| SECURITY-04 | Compliant | CSP unchanged; only self-hosted images | +| SECURITY-10 | Compliant | No new dependencies; image processing is a one-off local step | +| SECURITY-11 | Compliant | JSON-LD through `jsonLdScript`; no e-mail (PBT, Step 13) | +| SECURITY-13 | Compliant | No external resources at runtime | +| Other SECURITY rules | N/A | No data stores, endpoints, auth or infrastructure | +| PBT-01 | Compliant | Properties for `areaServed` listed in Step 13; unit 2's in its Functional Design | +| PBT-02 | Compliant | `jsonLdScript` round-trip already tested | +| PBT-03 | Planned | `areaServed` invariants (Step 13) | +| PBT-04, PBT-05, PBT-06 | N/A | No idempotent, oracle or stateful logic in this unit | +| PBT-07 | Planned | `shootType` arbitrary, `serviceArea` in the `siteContent` arbitrary (Steps 9, 11) | +| PBT-08, PBT-09 | Compliant | Existing seed logging and fast-check setup | +| PBT-10 | Planned | Example-based component tests alongside PBT | diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/soorten-fotoshoots-page-code-generation-plan.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/soorten-fotoshoots-page-code-generation-plan.md new file mode 100644 index 0000000..daa4b71 --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/soorten-fotoshoots-page-code-generation-plan.md @@ -0,0 +1,64 @@ +# Code Generation Plan — Unit 2: Soorten fotoshoots page + +Single source of truth for code generation of this unit. Workspace root: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-soorten-fotoshoots` (worktree); code in `web/`. Branch `feature/soorten-fotoshoots-page`. + +## Unit Context +- **Requirements**: FR-SF-01..05 (incl. 04b), FR-SF-08, SEO-SF-01..05, NFR-SF-01, 03..05, 07 +- **Design**: [application-design.md](../../inception/application-design/application-design.md); functional design in [construction/soorten-fotoshoots-page/functional-design/](../soorten-fotoshoots-page/functional-design/) (BR-SF-01..18) +- **Depends on**: unit 1 (`shootTypes`, `MediaText` options, `CallToAction`, `RichParagraph`, `#prijzen`, `areaServed`) — done; `webPage()` from contact-page (see Step 6) +- **Behavioural contract for other pages**: none change, except that the sitemap and Lighthouse indexed list gain `/soorten-fotoshoots` + +## Steps + +### Preview image +- [x] **Step 1** — 1200×630 crop of the Newborn original (focus on the face) with the unit 1 scratchpad script → `web/public/og-soorten-fotoshoots.jpg`; show it to the user with the alt text before it is fixed (checkpoint, like the shoot crops). + +### Content +- [x] **Step 2** — `content/types.ts`: `ShootTypesPageContent` (domain-entities.md). +- [x] **Step 3** — `content/shootTypesPageContent.ts`: page head, closing title, lead (`RichText` with "de pakketten" → `/#prijzen`) and booking link. + +### Pure functions +- [x] **Step 4** — `lib/shootLinks.ts`: `shootContactLink(shoot, packages)`, `shootPortfolioLink(shoot)`, `isPortfolioLive(pages)` (BR-SF-01..05). +- [x] **Step 5** — `lib/shootLinks.test.ts`: examples for the real content (newborn with `?pakket`, loveshoot without, portfolio live/not live) and PBT from business-logic-model.md (`to`/`hash` fixed, `pakket` iff visible package id, no foreign values, portfolio search equals id). + +### SEO +- [x] **Step 6** — `webPage()`: contact-page has it done and tested, waiting for its user's approval (generic over `extra`: `webPage(type, path, extra?)`). Do **not** build it here: write against the signature and cherry-pick contact-page's commit (seo.ts + seo.test.ts) as soon as the hash arrives; the route and its head test can only be committed after that. +- [x] **Step 7** — `seo.ts`: `absoluteUrl(src)` and `shootServices(shoots, site)` (BR-SF-10..15). +- [x] **Step 8** — `seo.test.ts`: examples for the real shoot list (5 items, `@id`s with anchors, first paragraph, provider, area, no prices) and PBT (count and positions, distinct `@id`s, provider/area invariants, no e-mail, `absoluteUrl` invariant + idempotency). +- [x] **Step 9** — `sitePages.ts`: `/soorten-fotoshoots` `indexed: true`, new description, `ogImage`. `lighthouserc.cjs`: move `/soorten-fotoshoots` to `indexedPaths` (only this entry). + +### Components +- [x] **Step 10** — `components/shoots/ShootBlock/ShootBlock.tsx` + test: `article` with anchor id and name, h2, paragraphs, `MediaText` (4:5, frame colour, reverse, priority), contact link with hidden completion, portfolio link only when live, axe. +- [x] **Step 11** — `components/shoots/ShootList/ShootList.tsx` + test: order, alternation (`reverse` on 2nd/4th), divider on every block after the first, only the first photo with priority, axe. + +### Route +- [x] **Step 12** — `routes/soorten-fotoshoots.tsx`: head (`pageHead` + `structuredDataScript(webPage(...))`) and composition (PageIntro with intro → ShootList → CallToAction with RichParagraph lead and `LinkButton accent`). +- [x] **Step 13** — Route tests in `app.test.tsx`: `/soorten-fotoshoots` in the shell; heading outline (h1, 5× h2 shoots, h2 closing); five articles with anchors; contact links incl. `?pakket` targets; no portfolio links while `/portfolio` is noindex; `/#prijzen` link; no `noindex`; the `WebPage` script with 5 services; axe on the whole page. + +### Documentation +- [x] **Step 14** — `LAYOUT.md`: "Types of shoots" → Intro, Newborn, Pregnancy, Family, Loveshoot, Portraits, Prices & Book, per `.ai/layout-conventions.md`. +- [x] **Step 15** — `_shared/reverse-engineering/`: only this feature's lines (route table, new components `CallToAction`, `shoots/*`, `RichParagraph` location, content `shootTypes`/page content, `serviceArea`, `/soorten-fotoshoots` indexed). + +### Verification and summary +- [x] **Step 16** — `pnpm check` (lint, format, tests incl. coverage, build, audits, Lighthouse with `/soorten-fotoshoots` as indexed page), after "claim 4173" to the peers and "4173 free" afterwards. +- [x] **Step 17** — Visual check of `/soorten-fotoshoots` against `design/andreaslop-static/soorten-fotoshoots.html` at desktop, tablet and phone widths (puppeteer-core screenshots); anchors `#newborn` and `/#prijzen` land below the header; screenshots sent to the user. +- [x] **Step 18** — Write `construction/soorten-fotoshoots-page/code/code-summary.md` (files, preview image, verification, open items for Andrea). +- [x] **Step 19** — Commit(s) on `feature/soorten-fotoshoots-page`. Push/deploy to test only when asked; the merge to master waits for Andrea's approval of the Gezin text and the alt texts (BR-SF-17). + +## Extension Compliance (unit 2) +| Rule | Status | Rationale | +|---|---|---| +| SECURITY-04 | Compliant | CSP unchanged; only self-hosted images | +| SECURITY-05 | Compliant | Query parameters only from our own package and shoot ids (BR-SF-03, PBT) | +| SECURITY-10 | Compliant | No new dependencies | +| SECURITY-11 | Compliant | JSON-LD through `jsonLdScript`; no e-mail, no prices (PBT) | +| SECURITY-13 | Compliant | No external resources at runtime | +| Other SECURITY rules | N/A | No data stores, endpoints, auth or infrastructure | +| PBT-01 | Compliant | Properties identified in business-logic-model.md | +| PBT-02 | Compliant | `jsonLdScript` round-trip already tested | +| PBT-03 | Planned | Link and structured data invariants (Steps 5, 8) | +| PBT-04 | Planned | `absoluteUrl` idempotency (Step 8) | +| PBT-05, PBT-06 | N/A | No oracle, no stateful logic | +| PBT-07 | Compliant | `shootType`/`uniqueShootTypes` from unit 1, existing package and site arbitraries | +| PBT-08, PBT-09 | Compliant | Existing seed logging and fast-check setup | +| PBT-10 | Planned | Example-based component and route tests alongside PBT | diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/soorten-fotoshoots-page-fd-questions.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/soorten-fotoshoots-page-fd-questions.md new file mode 100644 index 0000000..ff9ca3e --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/soorten-fotoshoots-page-fd-questions.md @@ -0,0 +1,46 @@ +# Vragen Functional Design — Soorten fotoshoots-pagina (unit 2) + +Al vastgelegd (geen vraag nodig): + +- **Contactlink**: `?pakket=` alleen voor shoots met een bestaand pakket (Newborn, Zwangerschap, Gezin); anders zonder. Voorlopig naar `/#contact` op de homepage, later naar `/contact` (één functie). +- **Portfoliolink**: alleen zichtbaar als `/portfolio` geïndexeerd is, en (zodra de helper van portfolio er is) alleen voor shoots met portfoliofoto's. +- **Koppen**: elke shoot is een `article` met een h2 (id `shoot--title`); het afsluitende blok een `section` met een h2. +- **Foto's**: alleen de eerste shootfoto laadt meteen (die is op grote schermen direct in beeld); de rest laadt pas als hij in beeld komt. +- **Gestructureerde data**: een `Service` per shoot in paginavolgorde, met naam, foto, aanbieder (het bedrijf) en werkgebied; geen prijzen. + +Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. + +--- + +## Vraag 1: Een eigen anker per shoot + +Elke shoot kan een eigen adres krijgen, bijvoorbeeld `/soorten-fotoshoots#newborn`. Dan kun je vanaf elke plek (homepage, Instagram, een mail) direct naar één shoot linken, en zoekmachines kunnen elke `Service` aan zijn eigen plek op de pagina koppelen. Het anker landt net onder de vaste header, zoals `/#contact`. + +- A) Ja: elke shoot krijgt zijn id als anker (`#newborn`, `#zwangerschap`, `#gezin`, `#loveshoot`, `#portret`), en de gestructureerde data verwijst per `Service` naar dat adres. Geen andere pagina's aanpassen in deze feature. (aanbevolen: kost niets, en de ids liggen al vast) +- B) Ja, en meteen ook de prijskaarten op de homepage een link "Meer over deze shoot" naar het anker geven +- C) Nee, geen ankers per shoot +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A (via de chat beantwoord: "Ja, alleen ankers") + +## Vraag 2: De concepttekst van Gezin en de alt-teksten + +De tekst van Gezin is een concept en de vijf alt-teksten zijn door mij geschreven. De pagina wordt bij de merge geïndexeerd (zichtbaar voor Google). + +- A) De pagina gaat met deze teksten naar de testomgeving; Andrea leest ze daar na. De merge naar master (en dus live) wacht op haar akkoord of haar aanpassingen. (aanbevolen: zo ging het ook bij Over mij) +- B) Gewoon mergen; aanpassingen van Andrea komen later als losse wijziging +- C) Het blok Gezin voorlopig weglaten tot Andrea de tekst heeft goedgekeurd; de rest gaat wel mee +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A (via de chat beantwoord: "Merge wacht op Andrea") + +## Vraag 3: Omschrijving per shoot in de gestructureerde data + +Newborn heeft twee alinea's; de tweede is een uitnodiging ("Stuur gerust een berichtje…"), geen omschrijving van de shoot. Bij de andere shoots is er één alinea. + +- A) Alleen de eerste alinea als omschrijving (bij Newborn dus zonder de uitnodiging). Eenvoudig en altijd een echte omschrijving. (aanbevolen) +- B) Alle alinea's samengevoegd +- C) Een aparte, korte omschrijving per shoot in `shootTypes.ts` (een nieuw veld), los van de tekst op de pagina +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A (via de chat beantwoord: "Eerste alinea") diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/soorten-fotoshoots-page-functional-design-plan.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/soorten-fotoshoots-page-functional-design-plan.md new file mode 100644 index 0000000..cb9281b --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/plans/soorten-fotoshoots-page-functional-design-plan.md @@ -0,0 +1,10 @@ +# Functional Design Plan — Unit 2: Soorten fotoshoots page + +Depth: minimal. Scope from the execution plan: the rules for the contact and portfolio links, the structured data (`WebPage` + `ItemList` of `Service`) and their testable properties (PBT-01), the page content model and the component behaviour. Questions: [soorten-fotoshoots-page-fd-questions.md](soorten-fotoshoots-page-fd-questions.md). + +- [x] Collect and analyse the answers in `soorten-fotoshoots-page-fd-questions.md` +- [x] `domain-entities.md`: `ShootType` (from unit 1), `ShootTypesPageContent`, link targets, structured data entities (`WebPage`, `ItemList`, `ListItem`, `Service`, provider `@id`, `areaServed`) +- [x] `business-rules.md`: contact link rules (package preselect, fallback, switch to `/contact`), portfolio link rules (live check, types with photos), structured data rules (fields, sources, order, exclusions), content and SEO registry rules (indexed, description, preview image, alt texts) +- [x] `business-logic-model.md`: how the route turns content and site data into head tags, JSON-LD and the rendered page; the pure functions and their properties for PBT +- [x] `frontend-components.md`: component hierarchy, props, heading ids, alternation and dividers, links with accessible names, priority photo, reveal, test ids +- [x] Validate against requirements.md, application-design.md and the extension rules diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/shared-blocks-and-content/code/code-summary.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/shared-blocks-and-content/code/code-summary.md new file mode 100644 index 0000000..7bc2e23 --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/shared-blocks-and-content/code/code-summary.md @@ -0,0 +1,43 @@ +# Code Summary — Unit 1: Shared blocks and content + +Plan: [shared-blocks-and-content-code-generation-plan.md](../../plans/shared-blocks-and-content-code-generation-plan.md). Branch `feature/soorten-fotoshoots-page`, worktree `AndreaSlopFotografie-soorten-fotoshoots`. + +## Commits +| Commit | Hash | For | Contents | +|---|---|---|---| +| A — Adds the shoot types and their photos | `eb23536` | portfolio-page (cherry-picks in its unit 3) | `ShootTypeId`, `FrameColor`, `ShootType` in `content/types.ts`; `content/shootTypes.ts` + test; `assets/shoots/*.jpg`; theme tokens `frame.*`; arbitraries `shootTypeId`, `shootType`, `uniqueShootTypes` | +| B — Shares the service area in the structured data | `befe97a` | contact-page (does not cherry-pick; whoever merges second keeps both blocks) | `ServiceArea`, `SiteContent.serviceArea`, value in `siteContent.ts`; `areaServed()` in `seo.ts`, used by `professionalService`; tests (example + PBT); `serviceArea` in `anySiteContent` | +| C — Extends the shared blocks for the shoot types page | `6cf9095` | — | see below | + +## Files (commit C) +- Modified: `web/src/components/FramedImage/FramedImage.tsx` (+ test): optional `frameColor`, default `sand` +- Modified: `web/src/components/MediaText/MediaText.tsx` (+ test): optional `reverse` (CSS `order: 2` from `lg`, DOM order unchanged) and `frameColor` +- Moved: `web/src/components/about/RichParagraph/` → `web/src/components/RichParagraph/` (component and test unchanged); import in `about/AboutIntro/AboutIntro.tsx` updated +- Created: `web/src/components/CallToAction/CallToAction.tsx` (+ test) +- Modified: `web/src/components/home/Pricing/Pricing.tsx` (+ test): `id="prijzen"` +- Created: `web/src/test/cssRules.ts`: test helper that returns the generated CSS rules for an element, including media queries, since jsdom applies neither responsive styles nor pseudo-elements + +## Images +Originals from andreaslop.nl (all landscape): `2026/07/F41A8700_websize.jpg` (1600×1067, Newborn), `2026/07/F41A7856_websize.jpg` (1600×1067, Zwangerschap), `2026/04/F41A7138_websize.jpg` (1067×1600, Gezin; also one of portfolio-page's 10 photos, approved by the user), `2025/08/e77ff000dce5a31c0a38c5d824bfdb95.jpeg` (2048×1365, Loveshoot), `2024/09/DSC_0433-1-scaled.jpg` (2560×1702, Portretten). + +One-off cover crop to 4:5, 960×1200, JPEG quality 80, with a scratchpad script (`crop-image.ps1`, PowerShell/System.Drawing, EXIF orientation applied). Crops approved by the user on a contact sheet before they were fixed. + +| File | Focus | Size | +|---|---|---| +| `newborn.jpg` | x 0.44 | 88 KB | +| `zwangerschap.jpg` | x 0.41 | 123 KB | +| `gezin.jpg` | centre | 142 KB | +| `loveshoot.jpg` | x 0.55 | 183 KB | +| `portret.jpg` | x 0.42 | 116 KB | + +## Alt texts (for Andrea to review) +- Newborn: "Een pasgeboren baby in een gestreept pakje slaapt met het hoofdje opzij" +- Zwangerschap: "Een zwangere vrouw en haar partner kijken elkaar lachend aan op een zandvlakte, zijn hand op haar buik" +- Gezin: "Vader en moeder kijken samen naar hun pasgeboren baby in de armen van de vader" +- Loveshoot: "Een stel ligt in de zon op een plaid in het gras, met de hoofden tegen elkaar" +- Portretten: "Een vrouw met lang bruin haar in een witte blouse kijkt glimlachend omlaag, met bomen op de achtergrond" + +## Verification +- Commits A and B: type check, lint, Prettier and the affected tests passed before each commit. +- Commit C: full `pnpm check` passed, after waiting for portfolio-page's Lighthouse run ("claim 4173" agreement): lint, Prettier, 62 test files / 290 tests (coverage thresholds met), build, `audit:deps` clean (`audit:dev` reports 17 findings in dev tooling, non-blocking per NFR-SEC-05), Lighthouse mobile and desktop assertions passed. +- Visual check against the production build (`vite preview` on port 4180, headless Chrome via `puppeteer-core` with reduced motion, scratchpad script): homepage at 1440 and 390 px unchanged (About block keeps its sand block); `/over-mij` at desktop, tablet and phone widths unchanged; `/#prijzen` lands on the pricing section right below the fixed header. diff --git a/aidlc-docs/features/soorten-fotoshoots-page/construction/soorten-fotoshoots-page/code/code-summary.md b/aidlc-docs/features/soorten-fotoshoots-page/construction/soorten-fotoshoots-page/code/code-summary.md new file mode 100644 index 0000000..940c68d --- /dev/null +++ b/aidlc-docs/features/soorten-fotoshoots-page/construction/soorten-fotoshoots-page/code/code-summary.md @@ -0,0 +1,43 @@ +# Code Summary — Unit 2: Soorten fotoshoots page + +Plan: [soorten-fotoshoots-page-code-generation-plan.md](../../plans/soorten-fotoshoots-page-code-generation-plan.md). Branch `feature/soorten-fotoshoots-page`, worktree `AndreaSlopFotografie-soorten-fotoshoots`. + +## Files +- Cherry-picked: contact-page's `790495d` "Adds a generic WebPage structured data helper" (`seo.ts`, `seo.test.ts`), as `3c7d00e` +- Created: `web/public/og-soorten-fotoshoots.jpg` (1200×630 from the Newborn original, focus 0.5/0.42, 54 KB; alt "Een pasgeboren baby slaapt in een gestreept pakje") +- Modified: `web/src/content/types.ts` (`ShootTypesPageContent`) +- Created: `web/src/content/shootTypesPageContent.ts` +- Created: `web/src/lib/shootLinks.ts` (+ test): `shootContactLink`, `shootPortfolioLink`, `isPortfolioLive` +- Modified: `web/src/seo.ts` (+ test): `absoluteUrl`, `shootServices` +- Modified: `web/src/sitePages.ts` (`/soorten-fotoshoots` indexed, description, `ogImage`), `web/src/sitemap.test.ts` (expected indexed pages) +- Modified: `web/lighthouserc.cjs` (`/soorten-fotoshoots` indexed; new `photoPagePaths` exception, see below), `web/lighthouserc.desktop.cjs` (every entry back to 0.9) +- Created: `web/src/components/shoots/ShootBlock/` and `ShootList/` (+ tests) +- Modified: `web/src/routes/soorten-fotoshoots.tsx` (the page), `web/src/app.test.tsx` (route test) +- Modified: `web/src/assets/shoots/*.jpg` and `content/shootTypes.ts`: re-cropped at 848×1060 instead of 960×1200, same crops and focus points as approved; the two landscape 1600 px originals only give an 854 px wide 4:5 crop, so 960×1200 was upscaled (15–20% fewer bytes now) +- Modified: `LAYOUT.md` ("Types of shoots" with Family), `aidlc-docs/_shared/reverse-engineering/*` (this feature's lines only) + +## Decisions made during generation +- **Contact link name** (BR-SF-06): `aria-label` "Stuur een berichtje over een {shoot}" instead of a `VisuallyHidden` part; the accessible name dropped the hidden span's leading space ("berichtjeover"). +- **Router links**: the shoot links use TanStack's own `Link` via Chakra `asChild` (as the price cards do), so `search` is type-checked against the target route. +- **Structured data in the component, not in `head()`** (user's choice): `head()` is part of the main bundle; with the shoot texts in it the main bundle grew 1.3 kB gzip. Now +0.3 kB gzip versus unit 1; the texts load with the page's own chunk. The `WebPage` JSON-LD is a `' }); }); }); + +describe('webPage', () => { + const paths = Object.keys(sitePages) as RoutePath[]; + const anyPath = fc.constantFrom(...paths); + const anyType = fc.constantFrom( + 'WebPage', + 'AboutPage', + 'ContactPage', + 'ImageGallery', + 'CollectionPage', + ); + const baseKeys = [ + '@context', + '@type', + '@id', + 'url', + 'name', + 'description', + 'inLanguage', + ]; + // Page-specific fields: any JSON, under keys the base does not use + const anyExtra = fc.dictionary( + fc.string().filter((key) => !baseKeys.includes(key)), + fc.jsonValue(), + ); + + it('describes a page from the registry', () => { + expect( + webPage('ContactPage', '/contact', { + about: { '@id': businessId }, + }), + ).toEqual({ + '@context': 'https://schema.org', + '@type': 'ContactPage', + '@id': `${siteUrl}/contact`, + url: `${siteUrl}/contact`, + name: sitePages['/contact'].title, + description: sitePages['/contact'].description, + inLanguage: 'nl-NL', + about: { '@id': businessId }, + }); + }); + + it('needs no extra fields', () => { + expect(webPage('WebPage', '/')).not.toHaveProperty('mainEntity'); + expect(webPage('WebPage', '/')['@id']).toBe(`${siteUrl}/`); + }); + + it('takes name, description and URL from the registry (invariant)', () => { + fc.assert( + fc.property(anyType, anyPath, (type, path) => { + const page = webPage(type, path); + expect(page['@context']).toBe('https://schema.org'); + expect(page['@type']).toBe(type); + expect(page['@id']).toBe(canonicalUrl(path)); + expect(page.url).toBe(canonicalUrl(path)); + expect(page.name).toBe(sitePages[path].title); + expect(page.description).toBe(sitePages[path].description); + expect(page.inLanguage).toBe('nl-NL'); + }), + ); + }); + + it('keeps every extra field as given (invariant)', () => { + fc.assert( + fc.property(anyType, anyPath, anyExtra, (type, path, extra) => { + const page: Record = webPage( + type, + path, + extra, + ); + for (const [key, value] of Object.entries(extra)) { + expect(page[key]).toEqual(value); + } + }), + ); + }); + + it('survives the ld+json script unchanged (round trip)', () => { + fc.assert( + fc.property(anyType, anyPath, anyExtra, (type, path, extra) => { + const page = webPage(type, path, extra); + expect(JSON.parse(jsonLdScript(page))).toEqual( + JSON.parse(JSON.stringify(page)), + ); + }), + ); + }); + + // aboutPage as it was before it used webPage, kept as the oracle for the + // rebuilt version + function previousAboutPage( + path: RoutePath, + content: Parameters[1], + site: Parameters[2], + ) { + const page = sitePages[path]; + const image = siteUrl + (page.ogImage ?? defaultOgImage).path; + return { + '@context': 'https://schema.org', + '@type': 'AboutPage', + '@id': canonicalUrl(path), + url: canonicalUrl(path), + name: page.title, + description: page.description, + inLanguage: 'nl-NL', + mainEntity: person(content, site, image), + }; + } + + it('leaves the about page data exactly as it was (oracle)', () => { + fc.assert( + fc.property( + anyPath, + anySiteContent, + knowsAboutEntries, + (path, site, knowsAbout) => { + const content = { ...aboutContent.person, knowsAbout }; + expect(aboutPage(path, content, site)).toEqual( + previousAboutPage(path, content, site), + ); + }, + ), + ); + }); +}); + +describe('absoluteUrl', () => { + it('makes a bundled image path absolute and keeps absolute URLs', () => { + expect(absoluteUrl('/assets/newborn-abc.jpg')).toBe( + `${siteUrl}/assets/newborn-abc.jpg`, + ); + expect(absoluteUrl('assets/x.jpg')).toBe(`${siteUrl}/assets/x.jpg`); + expect(absoluteUrl('https://cdn.example.nl/x.jpg')).toBe( + 'https://cdn.example.nl/x.jpg', + ); + }); + + it('always gives an https URL, and applying it twice changes nothing (invariant, idempotency)', () => { + fc.assert( + fc.property(fc.oneof(fc.webPath(), fc.webUrl()), (src) => { + const once = absoluteUrl(src); + expect(once).toMatch(/^https?:\/\//); + expect(absoluteUrl(once)).toBe(once); + }), + ); + }); +}); + +describe('shootServices', () => { + const page = `${siteUrl}/soorten-fotoshoots`; + + it('lists the five shoots as services of the business, without prices', () => { + const list = shootServices(shootTypes, siteContent); + expect(list.numberOfItems).toBe(5); + const services = list.itemListElement.map((element) => element.item); + expect(services.map((service) => service['@id'])).toEqual([ + `${page}#newborn`, + `${page}#zwangerschap`, + `${page}#gezin`, + `${page}#loveshoot`, + `${page}#portret`, + ]); + expect(services[0]).toMatchObject({ + '@type': 'Service', + name: 'Newbornshoot', + serviceType: 'Newbornshoot', + provider: { '@id': businessId }, + areaServed: [ + { '@type': 'City', name: 'Huizen' }, + { '@type': 'AdministrativeArea', name: 'Gooi en Vechtstreek' }, + ], + }); + // Only the first paragraph: the newborn invitation is not a description + expect(services[0].description).toBe(shootTypes[0].paragraphs[0]); + expect(services[0].image).toMatch(/^https:\/\/andreaslop\.nl\//); + expect(JSON.stringify(list)).not.toMatch(/offers|price/i); + }); + + it('fits in the page data built with webPage', () => { + const data = webPage('WebPage', '/soorten-fotoshoots', { + mainEntity: shootServices(shootTypes, siteContent), + }); + expect(data['@id']).toBe(page); + expect(data.mainEntity.itemListElement).toHaveLength(5); + }); + + it('has one item per shoot, numbered in order (invariant)', () => { + fc.assert( + fc.property(uniqueShootTypes, anySiteContent, (shoots, site) => { + const list = shootServices(shoots, site); + expect(list.numberOfItems).toBe(shoots.length); + expect( + list.itemListElement.map((element) => element.position), + ).toEqual(shoots.map((_, index) => index + 1)); + expect( + list.itemListElement.map((element) => element.item.name), + ).toEqual(shoots.map((shoot) => shoot.shootLabel)); + }), + ); + }); + + it('gives every service its own anchor as @id (invariant)', () => { + fc.assert( + fc.property(uniqueShootTypes, anySiteContent, (shoots, site) => { + const ids = shootServices(shoots, site).itemListElement.map( + (element) => element.item['@id'], + ); + expect(new Set(ids).size).toBe(ids.length); + ids.forEach((id, index) => + expect(id).toBe(`${page}#${shoots[index].id}`), + ); + }), + ); + }); + + it('is always provided by the business in its service area, described by the first paragraph (invariant)', () => { + fc.assert( + fc.property(uniqueShootTypes, anySiteContent, (shoots, site) => { + shootServices(shoots, site).itemListElement.forEach( + ({ item }, index) => { + expect(item.provider).toEqual({ '@id': businessId }); + expect(item.areaServed).toEqual( + areaServed(site.serviceArea), + ); + expect(item.description).toBe( + shoots[index].paragraphs[0], + ); + }, + ); + }), + ); + }); + + it('never contains the e-mail address or a price (invariant)', () => { + fc.assert( + fc.property(uniqueShootTypes, anySiteContent, (shoots, site) => { + const address = emailAddress(site.email); + const out = jsonLdScript(shootServices(shoots, site)); + return ( + (address === null || !out.includes(address)) && + !/"(offers|price)"/.test(out) + ); + }), + ); + }); +}); diff --git a/web/src/seo.ts b/web/src/seo.ts index 4e14086..3ef4cfd 100644 --- a/web/src/seo.ts +++ b/web/src/seo.ts @@ -1,6 +1,11 @@ // SEO: head-tags per pagina en voor de hele site, plus gestructureerde data. // Titels en beschrijvingen staan in het pagina-register (sitePages.ts). -import type { AboutPageContent, SiteContent } from './content/types.ts'; +import type { + AboutPageContent, + ServiceArea, + ShootType, + SiteContent, +} from './content/types.ts'; import { knowsAboutList } from './lib/knowsAboutList.ts'; import { visibleSocials } from './lib/visibleSocials.ts'; import type { RoutePath } from './navigation.ts'; @@ -73,6 +78,15 @@ const huizen = { addressCountry: 'NL', } as const; +// The service area as schema.org places, in the given order. Blank names +// are left out and padding is trimmed, so a stray entry from the CMS never +// shows up as an empty place. +export function areaServed(areas: readonly ServiceArea[]) { + return areas + .map((area) => ({ '@type': area.type, name: area.name.trim() })) + .filter((place) => place.name !== ''); +} + // Gestructureerde data: een lokale fotograaf in Huizen. Bewust zonder // e-mailadres, anders staat het alsnog leesbaar in de pagina. export function professionalService(content: SiteContent) { @@ -86,7 +100,7 @@ export function professionalService(content: SiteContent) { image: siteUrl + defaultOgImage.path, description: sitePages['/'].description, address: huizen, - areaServed: { '@type': 'Place', name: 'Huizen' }, + areaServed: areaServed(content.serviceArea), sameAs: visibleSocials(content.socials).map((social) => social.href), founder: { '@id': personId }, }; @@ -115,24 +129,76 @@ export function person( }; } -// The about page with Andrea as its subject (BR-SD-06); name, description -// and preview image come from the page registry -export function aboutPage( +// The schema.org page types the site uses; add one here when a page needs it +export type WebPageType = + 'WebPage' | 'AboutPage' | 'ContactPage' | 'ImageGallery' | 'CollectionPage'; + +// Structured data for a page: its canonical URL as @id, name and description +// from the page registry. Page-specific fields (mainEntity, about, ...) come +// in through `extra`, which is added last and keeps its type for callers. +export function webPage>( + type: WebPageType, path: RoutePath, - content: AboutPageContent['person'], - site: SiteContent, + extra: Extra = {} as Extra, ) { const page = sitePages[path]; - const image = siteUrl + (page.ogImage ?? defaultOgImage).path; return { '@context': 'https://schema.org', - '@type': 'AboutPage', + '@type': type, '@id': canonicalUrl(path), url: canonicalUrl(path), name: page.title, description: page.description, inLanguage: 'nl-NL', + ...extra, + }; +} + +// The about page with Andrea as its subject (BR-SD-06); her image is the +// page's preview image from the registry +export function aboutPage( + path: RoutePath, + content: AboutPageContent['person'], + site: SiteContent, +) { + const image = siteUrl + (sitePages[path].ogImage ?? defaultOgImage).path; + return webPage('AboutPage', path, { mainEntity: person(content, site, image), + }); +} + +// An image URL for structured data: bundled images have a path, which +// becomes absolute on the site; an absolute URL stays as it is (BR-SF-13) +export function absoluteUrl(src: string): string { + return /^https?:\/\//.test(src) + ? src + : siteUrl + (src.startsWith('/') ? src : `/${src}`); +} + +// The shoot types as a list of services offered by the business, in page +// order (BR-SF-10..15). Each service points to its own anchor on the page; +// no prices, since the page does not show them. +export function shootServices(shoots: readonly ShootType[], site: SiteContent) { + const page = canonicalUrl('/soorten-fotoshoots'); + const area = areaServed(site.serviceArea); + return { + '@type': 'ItemList', + numberOfItems: shoots.length, + itemListElement: shoots.map((shoot, index) => ({ + '@type': 'ListItem', + position: index + 1, + item: { + '@type': 'Service', + '@id': `${page}#${shoot.id}`, + url: `${page}#${shoot.id}`, + name: shoot.shootLabel, + serviceType: shoot.shootLabel, + description: shoot.paragraphs[0], + image: absoluteUrl(shoot.image.src), + provider: { '@id': businessId }, + areaServed: area, + }, + })), }; } diff --git a/web/src/sitePages.ts b/web/src/sitePages.ts index a329bba..f4a8bf3 100644 --- a/web/src/sitePages.ts +++ b/web/src/sitePages.ts @@ -46,8 +46,14 @@ const sitePages: Record = { '/soorten-fotoshoots': { title: 'Soorten fotoshoots', description: - 'Van loveshoot tot gezins-, zwangerschaps- en newbornshoot: ontdek welke fotoshoots Andrea Slop Fotografie aanbiedt in Huizen en omgeving.', - indexed: false, + 'Newborn-, zwangerschaps-, gezins-, love- en portretshoots: ontdek welke fotoshoots Andrea Slop Fotografie aanbiedt in Huizen, het Gooi en omgeving.', + indexed: true, + ogImage: { + path: '/og-soorten-fotoshoots.jpg', + width: 1200, + height: 630, + alt: 'Een pasgeboren baby slaapt in een gestreept pakje', + }, }, '/contact': { title: 'Contact', diff --git a/web/src/sitemap.test.ts b/web/src/sitemap.test.ts index 2febf09..465e2e1 100644 --- a/web/src/sitemap.test.ts +++ b/web/src/sitemap.test.ts @@ -17,10 +17,11 @@ const locs = (xml: string) => { const page = fc.record({ path: routePath, indexed: fc.boolean() }); describe('sitemapXml', () => { - it('contains the homepage and the about page', () => { + it('contains the indexed pages', () => { expect(locs(sitemapXml(pageList(sitePages), base))).toEqual([ `${base}/`, `${base}/over-mij`, + `${base}/soorten-fotoshoots`, ]); }); diff --git a/web/src/test/arbitraries.ts b/web/src/test/arbitraries.ts index 9684764..4601ca1 100644 --- a/web/src/test/arbitraries.ts +++ b/web/src/test/arbitraries.ts @@ -3,7 +3,10 @@ import type { ContactField, ContactValues } from '../contact/types'; import type { ContactFormEvent } from '../lib/contactFormReducer'; import type { EmailAddress, + FrameColor, PricingPackage, + ShootType, + ShootTypeId, SiteContent, SocialLink, Testimonial, @@ -63,6 +66,26 @@ export const anySiteContent: fc.Arbitrary = fc.record({ socials: fc.array(socialLink, { maxLength: 4 }), email: validEmail, contactForm: fc.record({ enabled: fc.boolean() }), + serviceArea: fc.array( + fc.record({ + type: fc.constantFrom( + 'City' as const, + 'AdministrativeArea' as const, + ), + // Includes blanks and padding, as an editor might type + name: fc.oneof( + fc.constantFrom( + 'Huizen', + 'Gooi en Vechtstreek', + '', + ' ', + ' Bussum ', + ), + fc.string({ maxLength: 20 }), + ), + }), + { maxLength: 4 }, + ), }); // Specialisations with padding, blanks and repeats, as an editor might type @@ -132,6 +155,55 @@ const image = fc.record({ height: fc.integer({ min: 1, max: 4000 }), }); +export const shootTypeId = fc.constantFrom( + 'newborn', + 'zwangerschap', + 'gezin', + 'loveshoot', + 'portret', +); + +const frameColor = fc.constantFrom( + 'sand', + 'accent', + 'frame.stone', + 'frame.rust', + 'frame.taupe', + 'frame.olive', +); + +// A shoot type as the CMS would deliver it; packageId may name a package +// that does not exist +export const shootType: fc.Arbitrary = fc.record( + { + id: shootTypeId, + name: nonBlank, + shootLabel: nonBlank, + photosLabel: nonBlank, + paragraphs: fc.array(nonBlank, { minLength: 1, maxLength: 3 }), + image, + frameColor, + packageId: packageId, + }, + { + requiredKeys: [ + 'id', + 'name', + 'shootLabel', + 'photosLabel', + 'paragraphs', + 'image', + 'frameColor', + ], + }, +); + +// Shoot types with unique ids, in any order +export const uniqueShootTypes = fc.uniqueArray(shootType, { + selector: (shoot) => shoot.id, + maxLength: 5, +}); + // A review that meets every invariant export const testimonial: fc.Arbitrary = fc.record({ id: fc.oneof( diff --git a/web/src/test/cssRules.ts b/web/src/test/cssRules.ts new file mode 100644 index 0000000..d30afb1 --- /dev/null +++ b/web/src/test/cssRules.ts @@ -0,0 +1,24 @@ +// The CSS rules that target one of the element's classes, as text, including +// rules inside media queries (with the query in front). jsdom does not apply +// responsive styles or pseudo-elements, so tests check the generated rules +// instead of computed styles. +export function cssRulesFor(element: Element): string[] { + const classes = [...element.classList].map((name) => `.${name}`); + const matches = (rule: CSSStyleRule) => + classes.some((name) => rule.selectorText.includes(name)); + + const found: string[] = []; + const walk = (rules: CSSRuleList, prefix: string) => { + for (const rule of rules) { + if (rule instanceof CSSStyleRule && matches(rule)) { + found.push(prefix + rule.cssText); + } else if (rule instanceof CSSMediaRule) { + walk(rule.cssRules, `@media ${rule.conditionText} `); + } + } + }; + for (const sheet of document.styleSheets) { + walk(sheet.cssRules, ''); + } + return found; +} diff --git a/web/src/theme.ts b/web/src/theme.ts index 17202d7..94047bb 100644 --- a/web/src/theme.ts +++ b/web/src/theme.ts @@ -56,6 +56,14 @@ const config = defineConfig({ deep: { value: '#5f6a58' }, // accent hover }, sand: { value: '#d9cdbc' }, // zachte vlakken en decoratie + // Blocks behind the shoot photos, one per shoot type, taken + // from the live page. Decoration only, never behind text. + frame: { + stone: { value: '#aba699' }, + rust: { value: '#975030' }, + taupe: { value: '#a18679' }, + olive: { value: '#84847c' }, + }, // Form errors: the design's #a4443a, 5.7:1 on paper, 6.1:1 on white error: { value: '#a4443a' }, },