diff --git a/aidlc-docs/_shared/reverse-engineering/api-documentation.md b/aidlc-docs/_shared/reverse-engineering/api-documentation.md index 4e4e97b..236bc53 100644 --- a/aidlc-docs/_shared/reverse-engineering/api-documentation.md +++ b/aidlc-docs/_shared/reverse-engineering/api-documentation.md @@ -2,7 +2,7 @@ ## REST APIs None. There is no back-end yet (`api/` is empty). The static design README anticipates these endpoints on a .NET API: -- `POST /api/contact` — contact form, payload `{ naam, email, onderwerp, bericht }` (maps to a C# `ContactRequest` record) +- `POST /api/contact` — contact form; the design README names the payload `{ naam, email, onderwerp, bericht }`, the code sends `{ naam, email, shoot, bericht }` (homepage-sections turned `onderwerp` into the shoot choice); maps to a C# `ContactRequest` record - `/api/pages`, `/api/portfolio`, `/api/packages` — CMS content ## Internal APIs diff --git a/aidlc-docs/active-features.md b/aidlc-docs/active-features.md index 373a58f..fa1ba95 100644 --- a/aidlc-docs/active-features.md +++ b/aidlc-docs/active-features.md @@ -7,3 +7,4 @@ | 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 | +| Feature | contact-page | 🟢 Construction | feature/contact-page | web/src/routes/contact.tsx, web/src/content, possibly ContactForm/ContactSection, PageIntro, MediaText/FramedImage, web/src/seo.ts, sitePages/sitemap | 2026-10-24 | diff --git a/aidlc-docs/features/contact-page/aidlc-state.md b/aidlc-docs/features/contact-page/aidlc-state.md new file mode 100644 index 0000000..12f4f29 --- /dev/null +++ b/aidlc-docs/features/contact-page/aidlc-state.md @@ -0,0 +1,80 @@ +# AI-DLC State Tracking + +## Project Information +- **Feature Name**: Contact page (`/contact`) +- **Feature Slug**: contact-page +- **Project Type**: Brownfield +- **Start Date**: 2026-10-24T19:35:48Z +- **Current Stage**: CONSTRUCTION - Functional Design (Unit 2 Shared contact blocks) +- **Branch**: feature/contact-page (rebased onto master 11a5224 after over-mij-page merge) + +## Workspace State +- **Existing Code**: Yes +- **Programming Languages**: TypeScript (React/TSX) +- **Build System**: pnpm + Vite (`tsc && vite build`), Gitea Actions CI +- **Project Structure**: Single front-end SPA in `web/`; static HTML design reference in `design/andreaslop-static/`; `api/` folder present but empty (.NET back-end planned) +- **Reverse Engineering Needed**: Yes (incremental refresh — artifacts at 99d4610 do not cover the over-mij-page changes on this branch) +- **Workspace Root**: K:DevelopmentSlpSoftwareProjectsAndreaSlopFotografie-contact (git worktree; main checkout is used by the parallel portfolio-page session) + +## Code Location Rules +- **Application Code**: Workspace root (NEVER in aidlc-docs/) — front-end lives in `web/` +- **Feature Documentation**: aidlc-docs/features/contact-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 + +## 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 + +## Execution Plan Summary +- **Stages to Execute**: Application Design (minimal), Functional Design (units 2 and 3), Code Generation (3 units), Build and Test +- **Stages to Skip**: User Stories, Units Generation, Functional Design for unit 1, NFR Requirements, NFR Design, Infrastructure Design, Operations +- **Units**: 1 webPage helper → 2 Shared contact blocks → 3 Contact page +- **Delivery**: branch feature/contact-page, commits per unit (unit 1 hash to portfolio-page and soorten-fotoshoots-page), full `pnpm check` per unit, one PR at the end + +## Stage Progress + +### 🔵 INCEPTION PHASE +- [x] Workspace Detection +- [x] Reverse Engineering (delta, approved) → inception/reverse-engineering/contact-page-delta.md +- [x] Requirements Analysis (approved) +- [x] User Stories - SKIP +- [x] Workflow Planning (approved) +- [x] Application Design - EXECUTE (approved) +- [x] Units Generation - SKIP + +### 🟢 CONSTRUCTION PHASE +- [ ] Functional Design - EXECUTE (units 2, 3) / SKIP (unit 1) +- [x] NFR Requirements - SKIP +- [x] NFR Design - SKIP +- [x] Infrastructure Design - SKIP +- [~] Code Generation - EXECUTE (per unit) — Unit 1 webPage helper ✅ (790495d), Unit 2 next +- [ ] Build and Test - EXECUTE + +### 🟡 OPERATIONS PHASE +- [x] Deployment Setup, Monitoring Setup, Production Readiness Validation - SKIP (Operations = No) + +## Reverse Engineering Status +- [x] Reverse Engineering — delta completed on 2026-10-24T19:55:00Z (shared artifacts already current for ae769cb; one correction in api-documentation.md) +- **Artifacts Location**: aidlc-docs/_shared/reverse-engineering/ + aidlc-docs/features/contact-page/inception/reverse-engineering/contact-page-delta.md + +## Coordination +- Parallel features stacked on feature/over-mij-page: portfolio-page (main checkout), soorten-fotoshoots-page (worktree AndreaSlopFotografie-soorten-fotoshoots), contact-page (this worktree) +- Over-mij-page merged to master (11a5224, PR #7); feature/contact-page rebased onto it on 2026-10-24 +- Over-mij-page (worktree AndreaSlopFotografie-over-mij): Build and Test changed no shared code; will message the merge commit +- Portfolio-page (worktree AndreaSlopFotografie-portfolio) claims: PortfolioGrid, Lightbox, InstagramGrid → shared component +- Soorten-fotoshoots-page (worktree AndreaSlopFotografie-soorten-fotoshoots) claims: content/shootTypes.ts, CallToAction band, MediaText `reverse` prop +- Contact-page claims: ContactForm generalisation (onderwerp vs shoot), contact-details block, generic `webPage(type: WebPageType, path, extra)` JSON-LD helper (WebPageType = WebPage | AboutPage | ContactPage | ImageGallery | CollectionPage) in seo.ts (+ aboutPage onto it) — promised to portfolio and soorten as a separate first commit (hash to be sent; needs user approval) +- Open for Requirements: subject preselect via /contact?onderwerp= (asked by soorten) +- Agreed: no full shared RE refresh; hot files (sitePages.ts, lighthouserc.cjs, active-features.md) only own entries; message before changing PageIntro diff --git a/aidlc-docs/features/contact-page/audit.md b/aidlc-docs/features/contact-page/audit.md new file mode 100644 index 0000000..d46b602 --- /dev/null +++ b/aidlc-docs/features/contact-page/audit.md @@ -0,0 +1,442 @@ +# AI-DLC Audit Log — contact-page + +## Initial User Request + +**Timestamp**: 2026-10-24T19:35:48Z + +**User Input**: "Ik wil een nieuwe feature starten voor het bouwen van de Contactpagina. 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, no welcome message). Began Workspace Detection." + +**Context**: INCEPTION - Workspace Detection (start) + +--- + +## Workspace Detection — Branch Decision + +**Timestamp**: 2026-10-24T19:36:30Z + +**User Input**: "Nu starten, branch vanaf over-mij" (answer to: "De Over mij-feature staat nog in Build and Test en is niet gemerged. Hoe wil je de Contactpagina starten?" — options: Eerst Over mij afronden (Recommended) / Nu starten, branch vanaf over-mij / Nu starten, branch vanaf master) + +**AI Response**: "Created branch feature/contact-page from feature/over-mij-page (HEAD ae769cb). The contact-page PR depends on the over-mij-page PR being merged first." + +**Context**: INCEPTION - Workspace Detection (process decision) + +--- + +## Workspace Detection + +**Timestamp**: 2026-10-24T19:37:00Z + +**User Input**: (none — automatic stage) + +**AI Response**: "Classification: Feature (new page, new user-facing behaviour). Brownfield: TypeScript/React SPA in web/ (pnpm + Vite, TanStack Router, Chakra UI v3). Existing placeholder route web/src/routes/contact.tsx (PageIntro + 'in de maak', noindex via sitePages). Reusable candidates already present: PageIntro, PageSection, MediaText, FramedImage, ContactForm/ContactFormGate (homepage contact section), submitContactForm, contactFormReducer, siteContent (email/socials). Design reference: design/andreaslop-static/contact.html (page-head, contact-layout with photo + contact details, form naam/e-mail/onderwerp/bericht). Language inherited from aidlc-docs/language-preference.md (A: English docs, Dutch chat). Reverse engineering artifacts in _shared/ were refreshed at 99d4610 (master); this branch adds 43 changed web/ files from over-mij-page (shared blocks, about components) not covered → artifacts stale, next stage: Reverse Engineering (incremental refresh)." + +**Context**: INCEPTION - Workspace Detection (complete) + +⚠️ **Potential Conflict Detected** +Feature "contact-page" may affect components also touched by active feature "over-mij-page": +- Shared components: PageIntro, PageSection/MediaText/FramedImage, web/src/seo.ts, web/src/content, sitePages/sitemap +- Resolution: contact-page is branched from over-mij-page; merge over-mij-page first, then rebase/merge contact-page onto master + +--- + +## Workspace Detection — Parallel Sessions and Worktree + +**Timestamp**: 2026-10-24T19:42:00Z + +**User Input**: "Contact naar eigen worktree (Recommended)" (answer to: "Hoe wil je de parallelle sessies scheiden?" — options: Contact naar eigen worktree (Recommended) / Contact blijft in hoofdmap / Pauzeer contact-page) + +**AI Response**: "Detected three AI-DLC sessions sharing the workspace: portfolio-page (main checkout), soorten-fotoshoots-page (own worktree AndreaSlopFotografie-soorten-fotoshoots) and contact-page. Creating feature/contact-page had switched the main checkout away from feature/portfolio-page (all branches at ae769cb, no code affected). Restored the main checkout to feature/portfolio-page, removed the contact-page docs and registry row from it, created worktree K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-contact on feature/contact-page and moved the contact-page docs and registry row there." + +**Context**: INCEPTION - Workspace Detection (process decision) + +⚠️ **Potential Conflict Detected** +Features "portfolio-page" and "soorten-fotoshoots-page" are also active and stacked on feature/over-mij-page. Shared components likely touched by all: PageIntro, PageSection/MediaText, web/src/seo.ts, web/src/content, sitePages/sitemap, aidlc-docs/active-features.md and aidlc-docs/_shared/reverse-engineering/. +- Resolution: developer handles at merge time; merge over-mij-page first. + +--- + +## Coordination with Parallel Sessions + +**Timestamp**: 2026-10-24T19:50: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 worktree AndreaSlopFotografie-contact. Sent coordination messages to the sessions 'Over mij pagina' (please announce the merge commit and any shared-block changes), 'Portfolio-pagina' and 'andreaslopfotografie-3f' (proposal: no full RE refresh, each feature edits only its own lines in shared files; contact claims ContactForm generalisation, contact-details block and a generic WebPage JSON-LD helper; asked what they plan to extract). Over mij replied: Build and Test changed no shared code; it will announce the merge commit; merging is the user's call." + +**Context**: INCEPTION - Reverse Engineering (coordination) + +--- + +## Reverse Engineering (delta) + +**Timestamp**: 2026-10-24T19:55:00Z + +**User Input**: (none — automatic stage) + +**AI Response**: "Shared RE artifacts already describe the over-mij shared blocks. Wrote features/contact-page/inception/reverse-engineering/contact-page-delta.md instead of a shared refresh; corrected the contact payload line in _shared/reverse-engineering/api-documentation.md. Presented completion message, awaiting approval." + +**Context**: INCEPTION - Reverse Engineering (awaiting approval) + +--- + +## Coordination — Replies from Parallel Sessions + +**Timestamp**: 2026-10-24T20:00:00Z + +**User Input**: (none — cross-session messages from teammate sessions) + +**AI Response**: "Soorten fotoshoots (andreaslopfotografie-3f) agreed; claims content/shootTypes.ts, CallToAction band, backwards-compatible MediaText `reverse` prop; does not touch ContactForm or Pricing; asks whether /contact supports subject preselect. Portfolio-pagina agreed (moved to worktree AndreaSlopFotografie-portfolio); claims PortfolioGrid, Lightbox, InstagramGrid → shared; asks for webPage() + aboutPage refactor as a separate commit to cherry-pick. Replied to both with the proposed signature webPage(type: string, path: RoutePath, extra = {}) (extra spread last; aboutPage keeps its signature and output), planned as the first small unit of contact-page, commit only after user approval. Preselect (/contact?onderwerp= from shootTypes) to be asked in Requirements; plain /contact link until then. Main checkout verified clean (detached ae769cb)." + +**Context**: INCEPTION - Reverse Engineering (coordination) + +--- + +## Coordination — webPage Type Union + +**Timestamp**: 2026-10-24T20:03:00Z + +**User Input**: (none — cross-session message from Portfolio-pagina suggesting a union of schema.org types instead of string) + +**AI Response**: "Adopted: export type WebPageType = 'WebPage' | 'AboutPage' | 'ContactPage' | 'ImageGallery' | 'CollectionPage'. Notified Portfolio-pagina and andreaslopfotografie-3f." + +**Context**: INCEPTION - Reverse Engineering (coordination) + +--- + +## Coordination — Soorten Links and Pricing Anchor + +**Timestamp**: 2026-10-24T20:08:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: shoot links go to /#contact (?pakket=) until the /contact?onderwerp= format is final; possibly id="prijzen" on homepage Pricing) + +**AI Response**: "Replied: contact-page does not touch Pricing.tsx; the /contact?onderwerp= format follows after the user approves the requirements; /#contact with ?pakket= is fine as interim." + +**Context**: INCEPTION - Reverse Engineering (coordination, still awaiting user approval) + +--- + +## Coordination — Over Mij PR Opened + +**Timestamp**: 2026-10-24T20:15:00Z + +**User Input**: (none — cross-session message from Over mij pagina: commit 7a56a47 on feature/over-mij-page (aidlc-docs only), PR #7 to master open; merge commit will follow) + +**AI Response**: "Noted. No action until the merge commit arrives; then rebase feature/contact-page onto master." + +**Context**: INCEPTION - Reverse Engineering (coordination, still awaiting user approval) + +--- + +## Coordination — Over Mij Auto-Merge + +**Timestamp**: 2026-10-24T20:25:00Z + +**User Input**: (none — cross-session message from Over mij pagina: commit 194df71 (docs only, alt texts approved); PR #7 has auto-merge on, merges once CI is green; merge commit will follow) + +**AI Response**: "Noted. Waiting for the merge commit, then rebase feature/contact-page onto master." + +**Context**: INCEPTION - Reverse Engineering (coordination, still awaiting user approval) + +--- + +## Reverse Engineering — Approval + +**Timestamp**: 2026-10-24T20:30:00Z + +**User Input**: "ga verder naar de volgende stage" + +**AI Response**: "Reverse Engineering (delta) approved. Started Requirements Analysis." + +**Context**: INCEPTION - Reverse Engineering (approved) → Requirements Analysis + +--- + +## Requirements Analysis — Clarifying Questions + +**Timestamp**: 2026-10-24T20:45:00Z + +**User Input**: (none — questions created) + +**AI Response**: "Intent: new feature, multiple components (route, shared contact blocks, seo.ts), moderate complexity, standard depth. Compared design contact.html, current code and the live site andreaslop.nl/contact (live: shoot select like the homepage form, reply 'binnen 1 werkdag', Email + Instagram, photo without alt). Created inception/requirements/requirement-verification-questions.md with 19 questions (form fields, reply time, preselect via ?pakket=, gate, ContactPanel extraction, contact details, headings, placement vs LAYOUT.md, photo/alt, submit label, privacy line, /#contact links on Over mij, indexing, title/description, ContactPage JSON-LD, OG image, Security, PBT, Operations)." + +**Context**: INCEPTION - Requirements Analysis (awaiting answers) + +--- + +## Coordination — Soorten shootTypes packageId + +**Timestamp**: 2026-10-24T20:50:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: shootTypes.ts gets `slug` plus optional `packageId` (newborn, zwangerschap); ready for both ?pakket= and ?onderwerp=; waits for the final choice) + +**AI Response**: "Noted. Send the final format after Question 3 is answered." + +**Context**: INCEPTION - Requirements Analysis (awaiting answers) + +--- + +## Rebase onto Master after Over Mij Merge + +**Timestamp**: 2026-10-24T21:05:00Z + +**User Input**: (none — cross-session message from Over mij pagina: over-mij-page merged to master, merge commit 11a52244 (PR #7); master adds only docs commits 7a56a47 and 194df71; no shared block changed; expect a conflict in active-features.md) + +**AI Response**: "Per the user's earlier instruction (update once Over mij is done): stashed the uncommitted contact-page docs, fast-forwarded feature/contact-page to master 11a5224 (no own commits yet), popped the stash. Resolved the active-features.md conflict: kept master's over-mij row (✅ Complete) and added the contact-page row. Dropped only the contact-page stash entry (the stash list is shared across worktrees; soorten-fotoshoots has its own entry there, left untouched)." + +**Context**: INCEPTION - Requirements Analysis (awaiting answers) + +--- + +## Coordination — Portfolio Rebased + +**Timestamp**: 2026-10-24T21:10:00Z + +**User Input**: (none — cross-session message from Portfolio-pagina: fast-forwarded onto master 11a5224; dropped only its own stash entry (verified); soorten-wip untouched; will drop stashes by message from now on) + +**AI Response**: "Noted, no action needed." + +**Context**: INCEPTION - Requirements Analysis (awaiting answers) + +--- + +## Coordination — Soorten Rebased + +**Timestamp**: 2026-10-24T21:12:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: fast-forwarded onto master 11a5224; its 'soorten-wip' stash is redundant but dropping it was blocked in its session; asks not to touch it) + +**AI Response**: "Will not touch the soorten-wip stash (its removal is that session's user's decision)." + +**Context**: INCEPTION - Requirements Analysis (awaiting answers) + +--- + +## Requirements Analysis — Answers Received + +**Timestamp**: 2026-10-24T21:30:00Z + +**User Input**: "ik heb de vragen beantwoord" — answers in requirement-verification-questions.md: Q1 A, Q2 A, Q3 A, Q4 A, Q5 A, Q6 A, Q7 "X, Ik denk dat de contactgegevens mooier kunnen. Gebruik een icon bij de verschillende gegevens in plaats van een header. Kijk ook ove onder elkaar dan nog steeds de meest logische keuze is, maar de contactgegevens hanger er nu een beetje onder. Dat moet beter kunnen.", Q8 "Doe een suggestie. Op mobiel is de foto ook erg groot terwijl het formulier en de contactgegevens de belangrijkere elementen zijn. Kan je een suggestie doen voor een verbetering. Ook rekening houdend met mijn antwoor din vraag 7.", Q9 A, Q10 A, Q11 A, Q12 A, Q13 A, Q14 "B, in beschrijving kanje wat uitgebreider zijn. Bij Soorten Fotoshoots had ik ook al wat aangegeven over de locatie dat dat breder is dan huizen. Misschien dat je daar kan navragen. Misschien \"Fotoshoot boeken in Huizen en omgeving\"? Geef mij suggesties", Q15 A, Q16 A, Q17 A, Q18 A, Q19 B + +**AI Response**: "Recorded Security Baseline = Yes, PBT = Yes (full), Operations = No. Q3 A → sent final format /contact?pakket= to Soorten fotoshoots. Asked Soorten for the user's service-area wording (reply: 'Huizen en omgeving of Huizen en Gooi en Vechtstreek, maar hoeft daar niet beperkt te blijven…'; their unapproved proposal 'Huizen, het Gooi en omgeving', areaServed City Huizen + AdministrativeArea Gooi en Vechtstreek, serviceArea in siteContent; Soorten owns the professionalService change). Q7/Q8/Q14 need proposals → created requirement-clarification-questions.md with 3 layout proposals (Mermaid block diagrams, desktop + mobile), photo-on-mobile question, title options with lengths, description options (≤155 chars)." + +**Context**: INCEPTION - Requirements Analysis (awaiting clarification answers) + +--- + +## Coordination — Service Area Final + +**Timestamp**: 2026-10-24T21:40:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: its user approved 'Huizen, het Gooi en omgeving' as visible wording; areaServed City Huizen + AdministrativeArea Gooi en Vechtstreek via new siteContent.serviceArea, committed in its unit 1 (hash to follow); soorten-wip stash dropped with its user's approval) + +**AI Response**: "Updated Question D in requirement-clarification-questions.md to state the wording is approved." + +**Context**: INCEPTION - Requirements Analysis (awaiting clarification answers) + +--- + +## Requirements Analysis — Mockups Requested + +**Timestamp**: 2026-10-24T22:50:00Z + +**User Input**: "Kan je voor de voorstellen een voorbeeld-afbeelding sturen? Voorstel 1 wil ik 2 opties, namelijk foto links en foto rechts. En voorstel 2 zou ik ook wel willen zien. Voorstel 3 valt sowieso al af dus die mag je laten" + +**AI Response**: "Built static mockups from the design CSS and photo (code form fields, icon list, privacy line) and rendered them with headless Chrome: proposal 1a (form left, photo + contact card right), 1b (photo + card left, form right), 2 (contact strip under intro); desktop 1440px and mobile 390px (photo hidden on mobile). Saved to inception/requirements/mockups/. Removed proposal 3 from Question A; options now A) 1a, B) 1b, C) 2." + +**Context**: INCEPTION - Requirements Analysis (awaiting clarification answers) + +--- + +## Requirements Analysis — Mockup Question B Option C + +**Timestamp**: 2026-10-24T23:00:00Z + +**User Input**: "Kan je de optie voor vraag B antwoord C ook eens laten zien" + +**AI Response**: "Rendered a mobile mockup of proposal 1 with a small round portrait (face crop) next to 'Direct contact' and the name 'Andrea Slop' in the contact card; saved as mockups/vraag-b-c-portret-mobiel.png and linked from Question B option C, with a note that a separate small face crop avoids loading the large photo on mobile." + +**Context**: INCEPTION - Requirements Analysis (awaiting clarification answers) + +--- + +## Requirements Analysis — Clarification Answers and Requirements Document + +**Timestamp**: 2026-10-24T23:20:00Z + +**User Input**: "Ik heb de vragen beantwoord" — answers in requirement-clarification-questions.md: A = A (proposal 1a, form left, photo with contact card right), B = C (small round portrait in the card on mobile), C = A (title "Contact – fotoshoot boeken in Huizen"), D = A (description with "Huizen, het Gooi en omgeving") + +**AI Response**: "No contradictions (clarification C supersedes Q14 = B, as the user asked for suggestions). Wrote inception/requirements/requirements.md: FR-CP-01..11, SEO-CP-01..05, NFR-CP-01..06, Security and PBT compliance tables, decision summary. Proposed intro text without 'via onderstaand formulier' (form is gated) for confirmation at review. User Stories proposed as skipped (single visitor persona, concrete FRs). Presented completion message, awaiting approval." + +**Context**: INCEPTION - Requirements Analysis (awaiting approval) + +--- + +## Requirements Analysis — Approval + +**Timestamp**: 2026-10-24T23:30:00Z + +**User Input**: "ga verder" + +**AI Response**: "Requirements approved (including the proposed intro text in FR-CP-01). User Stories skipped. Started Workflow Planning." + +**Context**: INCEPTION - Requirements Analysis (approved) → Workflow Planning + +--- + +## Workflow Planning + +**Timestamp**: 2026-10-24T23:45:00Z + +**User Input**: (none — stage executed after requirements approval) + +**AI Response**: "Wrote inception/plans/execution-plan.md: risk low-medium; execute Application Design (minimal), Functional Design for units 2 and 3, Code Generation for 3 units (1 webPage helper, 2 Shared contact blocks, 3 Contact page), Build and Test; skip User Stories, Units Generation, NFR Requirements/Design, Infrastructure Design, Operations. Presented plan, awaiting approval." + +**Context**: INCEPTION - Workflow Planning (awaiting approval) + +--- + +## Workflow Planning — Approval + +**Timestamp**: 2026-10-24T23:50:00Z + +**User Input**: "ga verder" + +**AI Response**: "Execution plan approved. Started Application Design." + +**Context**: INCEPTION - Workflow Planning (approved) → Application Design + +--- + +## Application Design — Plan and Questions + +**Timestamp**: 2026-10-24T23:58:00Z + +**User Input**: (none — stage started) + +**AI Response**: "Created inception/plans/application-design-plan.md (minimal depth) with already-decided items (webPage/contactPage signatures, icons from socialPlatforms + mail icon, privacy line inside ContactForm, replyTime in SiteContent.contactForm, folders) and 4 questions: ContactPanel boundary, rendering the contact card in two places, Instagram/Facebook label source, the photo-with-card block." + +**Context**: INCEPTION - Application Design (awaiting answers) + +--- + +## Application Design — Answers and Artifacts + +**Timestamp**: 2026-10-25T00:15:00Z + +**User Input**: "ik heb de vragen beantwoord" — answers in application-design-plan.md: Q1 A, Q2 A, Q3 A, Q4 A + +**AI Response**: "No ambiguities. Generated inception/application-design/components.md, component-methods.md, services.md, component-dependency.md and application-design.md: ContactPanel (gate, lazy/eager loading, options, preselect, mail subject; heading and URL clean-up stay per page), ContactDetails rendered twice (one per screen width, own heading ids), optional SocialLink.label, ContactAside page component, webPage/WebPageType/contactPage, privacy line in ContactForm, replyTime in siteContent.contactForm. PBT-01 properties for unit 1 identified. Presented completion message, awaiting approval." + +**Context**: INCEPTION - Application Design (awaiting approval) + +--- + +## Coordination — Soorten Unit 1 Changes + +**Timestamp**: 2026-10-25T00:20:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: moves RichParagraph to components/RichParagraph/ (AboutIntro import changes), adds frame colour tokens to theme.ts, optional frameColor on FramedImage/MediaText (default unchanged)) + +**AI Response**: "Replied: no overlap — contact-page does not use RichParagraph and does not change theme.ts, FramedImage or MediaText; only aboutContent.ts link targets change in unit 3. Also sent earlier: heads-up on SocialLink.label and SiteContent.contactForm.replyTime." + +**Context**: INCEPTION - Application Design (awaiting approval) + +--- + +## Coordination — Soorten Service Area Commit + +**Timestamp**: 2026-10-25T00:30:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: commit befe97a 'Shares the service area in the structured data' on feature/soorten-fotoshoots-page (SiteContent.serviceArea, areaServed() in seo.ts, tests, arbitrary); expected conflict next to contactForm in types.ts, siteContent.ts, arbitraries.ts) + +**AI Response**: "Not cherry-picked (no functional dependency; keeps the branches independent). The branch that reaches master second rebases and keeps both blocks." + +**Context**: INCEPTION - Application Design (awaiting approval) + +--- + +## Application Design — Approval + +**Timestamp**: 2026-10-25T08:00:00Z + +**User Input**: "Akkoord, ga verder" + +**AI Response**: "Application Design approved. Started CONSTRUCTION: unit 1 (webPage helper) has no Functional Design (properties set in Application Design) → Code Generation Part 1 (planning)." + +**Context**: INCEPTION - Application Design (approved) → CONSTRUCTION - Code Generation Unit 1 + +--- + +## Code Generation — Unit 1 webPage helper — Plan + +**Timestamp**: 2026-10-25T08:10:00Z + +**User Input**: (none — Part 1 planning) + +**AI Response**: "Created construction/plans/webpage-helper-code-generation-plan.md (8 steps: pnpm install in the new worktree, webPage + WebPageType, aboutPage on webPage, example tests, property tests incl. oracle against the previous aboutPage, verification, code summary, separate commit + hash to the two peer sessions). Scope limited to seo.ts and seo.test.ts. Presented plan for approval." + +**Context**: CONSTRUCTION - Code Generation Unit 1 (plan awaiting approval) + +--- + +## Code Generation — Unit 1 — Plan Approval + +**Timestamp**: 2026-10-25T08:15:00Z + +**User Input**: "Approve plan" + +**AI Response**: "Plan approved. Started Part 2 (generation)." + +**Context**: CONSTRUCTION - Code Generation Unit 1 (generation) + +--- + +## Code Generation — Unit 1 — Steps 1–5, 7 + +**Timestamp**: 2026-10-25T08:30:00Z + +**User Input**: (none — generation; cross-session: Portfolio-pagina and andreaslopfotografie-3f proposed taking turns on port 4173 / Lighthouse (claim/free); agreed, order Portfolio → Soorten → Contact; contact also avoids CPU-heavy runs during their Lighthouse) + +**AI Response**: "pnpm install in the worktree; baseline seo tests green (21). Added WebPageType and webPage() (generic over extra so fields stay typed; call signature as agreed), aboutPage() rebuilt on it; 6 new tests in seo.test.ts (2 examples, 2 invariants, round trip, oracle against the previous aboutPage). seo tests 27/27 green, eslint and tsc clean; prettier fixed formatting of the WebPageType union. Wrote construction/webpage-helper/code/code-summary.md. Step 6 (full vitest with coverage + build) deferred until the peers report 4173 free." + +**Context**: CONSTRUCTION - Code Generation Unit 1 (waiting for 4173 free to run step 6) + +--- + +## Code Generation — Unit 1 — Verification (Step 13.5) + +**Timestamp**: 2026-10-25T09:10:00Z + +**User Input**: (none — cross-session: Portfolio-pagina and andreaslopfotografie-3f reported 4173 free) + +**AI Response**: "First full `pnpm test` run (through the rtk output filter) ended with 'Test failed' without the failing test visible; not reproducible: three further full runs green (279/279, seeds 1224587948, 1833830922, 1166240805) and seo.test.ts green on 12 random seeds. Likely environmental (first run right after the peer's check finished), but unexplained — reported to the user. Build green (existing >500 kB chunk warning, unrelated to this unit), eslint and prettier clean. Presented completion message; commit (step 8) after approval." + +**Context**: CONSTRUCTION - Code Generation Unit 1 (awaiting approval) + +--- + +## Coordination — Soorten Needs webPage + +**Timestamp**: 2026-10-25T09:15:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: needs webPage() for its unit 2; offered to add it itself if the commit is far off) + +**AI Response**: "Replied: no duplicate — webPage() is done and tested, commit waits only for the user's approval; hash follows right after. Noted the generic `extra` typing (call unchanged)." + +**Context**: CONSTRUCTION - Code Generation Unit 1 (awaiting approval) + +--- + +## Code Generation — Unit 1 — Approval + +**Timestamp**: 2026-10-25T09:30:00Z + +**User Input**: "Ga verder" + +**AI Response**: "Unit 1 approved. Committing the code (seo.ts + seo.test.ts only) and the docs separately, pushing feature/contact-page, sending the hash to portfolio-page and soorten-fotoshoots-page, then starting unit 2 (Functional Design)." + +**Context**: CONSTRUCTION - Code Generation Unit 1 (approved) + +--- diff --git a/aidlc-docs/features/contact-page/construction/plans/webpage-helper-code-generation-plan.md b/aidlc-docs/features/contact-page/construction/plans/webpage-helper-code-generation-plan.md new file mode 100644 index 0000000..3f3cc2d --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/plans/webpage-helper-code-generation-plan.md @@ -0,0 +1,45 @@ +# Code Generation Plan — Unit 1: webPage helper + +Single source of truth for generating unit 1. Workspace root: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-contact` (worktree), code in `web/`. Branch `feature/contact-page`. + +## Unit context +- **Requirements**: SEO-CP-03 (helper part); NFR-CP-03 (PBT); coordination agreement with portfolio-page and soorten-fotoshoots-page. +- **Design**: [component-methods.md](../../inception/application-design/component-methods.md) § `seo.ts`; PBT-01 properties in [application-design.md](../../inception/application-design/application-design.md). +- **Scope boundary**: only `web/src/seo.ts` and `web/src/seo.test.ts`. No `contactPage()` yet (unit 3), no other files, so other branches can cherry-pick this commit cleanly. +- **Dependencies**: none. **Depended on by**: unit 3 (`contactPage()`), portfolio-page, soorten-fotoshoots-page. + +## Steps + +- [x] **Step 1 — Prepare the worktree**: `pnpm install` in `web/` (fresh worktree has no `node_modules`; lockfile unchanged), then `pnpm test -- src/seo.test.ts` to confirm the baseline is green. +- [x] **Step 2 — `WebPageType` and `webPage()`** in `web/src/seo.ts`, next to `aboutPage()` (implemented generic over `extra`, `webPage(...)`, so fields like `mainEntity` stay typed for callers; call signature unchanged): + - `export type WebPageType = 'WebPage' | 'AboutPage' | 'ContactPage' | 'ImageGallery' | 'CollectionPage';` + - `export function webPage(type: WebPageType, path: RoutePath, extra: Record = {})` returning `@context`, `@type`, `@id` and `url` (both `canonicalUrl(path)`), `name` and `description` from `sitePages[path]`, `inLanguage: 'nl-NL'`, then `...extra`. + - Short English comment in the style of the surrounding code. +- [x] **Step 3 — Rebuild `aboutPage()` on `webPage()`**: same signature; `webPage('AboutPage', path, { mainEntity: person(content, site, image) })` with the image computed as today. Key order may change; the output must be equal as data. +- [x] **Step 4 — Example tests** in `web/src/seo.test.ts` (new `describe('webPage')`): + - builds a `ContactPage` for `/contact` with the registry's title and description, `inLanguage` and the canonical URL as both `@id` and `url`; + - extra fields appear in the output (`mainEntity`, `about`); + - existing `aboutPage` tests stay unchanged and pass. +- [x] **Step 5 — Property tests** (fast-check, PBT-01/03/05): + - **Invariant**: for every registered path and every `WebPageType`, `@id` = `url` = `canonicalUrl(path)`, `@type` = type, `name`/`description` = `sitePages[path]`, `@context` and `inLanguage` fixed. + - **Invariant**: every key of an arbitrary `extra` object (keys not overlapping the base keys) is present in the output with the same value. + - **Oracle**: `aboutPage()` equals a frozen copy of the previous implementation (kept in the test file) for generated site content (`anySiteContent`) and the registered paths. + - **Round-trip**: `JSON.parse(jsonLdScript(webPage(...)))` equals the object (extends the existing jsonLdScript property to this builder). + - Generators: `fc.constantFrom` over `Object.keys(sitePages)` and the type list; reuse `anySiteContent`. Add a shared arbitrary to `src/test/arbitraries.ts` only if needed by more than this file (expected: not needed, keeping the unit to two files). +- [x] **Step 6 — Verify (Step 13.5)**: `pnpm test` (incl. the 100% coverage threshold for `seo.ts`), `pnpm lint`, `pnpm format:check`, `pnpm build`. Fix and repeat until green. Lighthouse is not affected by this unit (no page output changes) and runs in unit 2/3 and Build and Test. +- [x] **Step 7 — Code summary**: `aidlc-docs/features/contact-page/construction/webpage-helper/code/code-summary.md` (what changed, the agreed signature, test overview). +- [x] **Step 8 — Commit and hand over** (after your approval of the generated code): one commit "Adds a generic WebPage structured data helper" containing only `web/src/seo.ts` and `web/src/seo.test.ts`; the docs go in a separate commit. Push `feature/contact-page`, then send the commit hash to portfolio-page and soorten-fotoshoots-page. + +## Expected interfaces after this unit +```ts +export type WebPageType = 'WebPage' | 'AboutPage' | 'ContactPage' | 'ImageGallery' | 'CollectionPage'; +export function webPage(type: WebPageType, path: RoutePath, extra?: Record): {...}; +export function aboutPage(path: RoutePath, content: AboutPageContent['person'], site: SiteContent): {...}; // unchanged +``` + +## Extension compliance (plan level) +- **Security**: no new dependencies, endpoints or output; structured data still escaped by `jsonLdScript` — Compliant. +- **PBT**: PBT-02 (round-trip), PBT-03 (invariants), PBT-05 (oracle), PBT-07 (generators from the registry), PBT-08 (seed logging exists), PBT-10 (examples alongside) — Planned in steps 4–5; PBT-04/06 N/A. + +## Result +- Code commit: `790495d` "Adds a generic WebPage structured data helper" (only `web/src/seo.ts`, `web/src/seo.test.ts`). diff --git a/aidlc-docs/features/contact-page/construction/webpage-helper/code/code-summary.md b/aidlc-docs/features/contact-page/construction/webpage-helper/code/code-summary.md new file mode 100644 index 0000000..f8f3b2c --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/webpage-helper/code/code-summary.md @@ -0,0 +1,56 @@ +# Code Summary — Unit 1: webPage helper + +## Changed files +- `web/src/seo.ts` — new `WebPageType` and `webPage()`; `aboutPage()` rebuilt on `webPage()` +- `web/src/seo.test.ts` — new `describe('webPage')` with example and property tests + +No other files; the commit can be cherry-picked on its own by portfolio-page and soorten-fotoshoots-page. + +## Interface + +```ts +export type WebPageType = + | 'WebPage' + | 'AboutPage' + | 'ContactPage' + | 'ImageGallery' + | 'CollectionPage'; + +export function webPage>( + type: WebPageType, + path: RoutePath, + extra?: Extra, +): { + '@context': 'https://schema.org'; + '@type': WebPageType; + '@id': string; // canonicalUrl(path) + url: string; // canonicalUrl(path) + name: string; // sitePages[path].title + description: string; // sitePages[path].description + inLanguage: 'nl-NL'; +} & Extra; +``` + +- `extra` is spread last; its fields keep their types for the caller (e.g. `page.mainEntity.image` stays typed). +- `aboutPage(path, content, site)` keeps its signature; it is now `webPage('AboutPage', path, { mainEntity: person(...) })`. +- Adding a page type: one line in the `WebPageType` union. + +## Usage for the other pages +```ts +webPage('ContactPage', '/contact', { about: { '@id': businessId } }); +webPage('ImageGallery', '/portfolio', { /* ... */ }); +webPage('WebPage', '/soorten-fotoshoots', { mainEntity: { '@type': 'ItemList', /* ... */ } }); +``` +Wrap the result with `structuredDataScript()` in the route's `head()`. + +## Tests +| Test | Kind | Property | +|---|---|---| +| describes a page from the registry | example | full `ContactPage` output | +| needs no extra fields | example | default `extra` | +| takes name, description and URL from the registry | PBT invariant | `@id` = `url` = canonical; `@type`, name, description, language | +| keeps every extra field as given | PBT invariant | arbitrary JSON extras present unchanged | +| survives the ld+json script unchanged | PBT round trip | `JSON.parse(jsonLdScript(page))` equals the page | +| leaves the about page data exactly as it was | PBT oracle | new `aboutPage()` equals the previous implementation for generated site content, paths and specialisations | + +Existing `aboutPage` tests unchanged and passing. diff --git a/aidlc-docs/features/contact-page/inception/application-design/application-design.md b/aidlc-docs/features/contact-page/inception/application-design/application-design.md new file mode 100644 index 0000000..33d1fa3 --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/application-design/application-design.md @@ -0,0 +1,51 @@ +# Application Design — Contact Page + +Consolidates [components.md](components.md), [component-methods.md](component-methods.md), [services.md](services.md) and [component-dependency.md](component-dependency.md). Decisions: [application-design-plan.md](../plans/application-design-plan.md). + +## Design decisions +| # | Decision | +|---|---| +| Q1 | `ContactPanel` = gate + form loading (`lazy` / `eager`) + shoot options + preselect + mail subject. The heading and the URL clean-up, scroll and focus stay with each page | +| Q2 | The contact card is rendered twice: one per screen width, the other `display: none`, each with its own heading id. The DOM order always matches the visual order | +| Q3 | Optional `label` per social link in the content; without a label the platform name is shown | +| Q4 | `ContactAside` (photo with an overlapping card) is a page component in `components/contact/` | +| — | `webPage()` / `WebPageType` / `contactPage()` in `seo.ts`; `aboutPage()` rebuilt with identical output | +| — | Privacy line inside `ContactForm`; reply time as `siteContent.contactForm.replyTime` | + +## Units and what they touch +| Unit | New | Changed | +|---|---|---| +| 1 webPage helper | `webPage`, `WebPageType` | `aboutPage` (internals), `seo.test.ts` | +| 2 Shared contact blocks | `ContactPanel`, `ContactDetails` | `ContactForm`, `home/ContactSection`, `routes/index.tsx` (prop pass-through), `content/types.ts`, `siteContent.ts` | +| 3 Contact page | `contact/ContactAside`, `contactContent.ts`, `contactPage()`, photos | `routes/contact.tsx`, `aboutContent.ts`, `sitePages.ts`, `lighthouserc*.cjs`, LAYOUT.md | + +## Page composition (`/contact`) + +```mermaid +graph TD + Intro["PageIntro: eyebrow, h1 Contact, intro"] + Section["PageSection flushTop"] + Narrow["ContactDetails with portrait (narrow only)"] + FormCol["Form column: hidden h2 + ContactPanel eager"] + Aside["ContactAside: photo + ContactDetails (wide only)"] + Intro --> Section + Section --> Narrow + Section --> FormCol + Section --> Aside + classDef head fill:#e76f51,stroke:#ad533d,color:#000; + classDef block fill:#2a9d8f,stroke:#20766b,color:#000; + classDef card fill:#f4a261,stroke:#b77a49,color:#000; + class Intro head; + class Section,FormCol block; + class Narrow,Aside card; +``` + +Text alternative: the page has the intro and one section; inside it, in DOM order, the narrow-screen card, the form column and the wide-screen aside with photo and card. + +## Coordination +- Unit 1 is a separate commit (only `seo.ts` + `seo.test.ts`); its hash goes to portfolio-page and soorten-fotoshoots-page. +- `content/types.ts` and `siteContent.ts` are also changed by soorten-fotoshoots-page (`serviceArea`); different fields, small rebase at most. + +## Extension compliance (design level) +- **Security**: no new endpoints or third parties; e-mail only assembled in the browser (`ContactDetails` reuses `emailAddress`); `?pakket=` validated against package ids inside `ContactPanel` and never rendered; structured data through `jsonLdScript`. Compliant / N/A as in requirements. +- **PBT-01**: properties identified now for unit 1: `webPage()` `@id` = `url` = canonical URL of the path, `@type` preserved, `inLanguage` fixed, `extra` keys present in the output; `aboutPage()` equals the previous implementation for generated content (oracle); `jsonLdScript` round-trip. Unit 2 and 3 properties follow in their Functional Design. diff --git a/aidlc-docs/features/contact-page/inception/application-design/component-dependency.md b/aidlc-docs/features/contact-page/inception/application-design/component-dependency.md new file mode 100644 index 0000000..afe0c9c --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/application-design/component-dependency.md @@ -0,0 +1,51 @@ +# Component Dependencies — Contact Page + +## Dependency graph + +```mermaid +graph TD + ContactRoute["routes/contact.tsx"] --> PageIntro["PageIntro"] + ContactRoute --> PageSection["PageSection"] + ContactRoute --> Panel["ContactPanel"] + ContactRoute --> Details["ContactDetails"] + ContactRoute --> Aside["contact/ContactAside"] + ContactRoute --> ContactContent["contactContent"] + ContactRoute --> Seo["seo.ts: contactPage, webPage"] + HomeSection["home/ContactSection"] --> Panel + Panel --> Gate["ContactFormGate"] + Panel --> Form["ContactForm"] + Panel --> Lib["lib: shootOptions, packageFromSearch, visiblePackages, mailSubject"] + Details --> Platforms["socialPlatforms"] + Details --> Lib2["lib: emailAddress, visibleSocials, mailtoLink"] + Aside --> Img["DeferredImage or eager image"] + Form --> Router["RouterLink to privacyverklaring"] + ContactRoute --> SiteContent["siteContent: email, socials, contactForm"] + AboutRoute["routes/over-mij.tsx"] --> Seo + classDef newpart fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000; + classDef changed fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef existing fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; + class ContactRoute,Panel,Details,Aside,ContactContent newpart; + class HomeSection,Form,Seo,SiteContent,AboutRoute changed; + class PageIntro,PageSection,Gate,Lib,Lib2,Platforms,Img,Router existing; +``` + +Text alternative: the contact route uses PageIntro, PageSection, the new ContactPanel, ContactDetails and ContactAside, new content and the SEO helpers; the homepage contact section also uses ContactPanel; ContactPanel wraps the gate and the form and uses the existing package helpers; ContactDetails uses the platform registry and the e-mail and social helpers; the form links to the privacy page; the about route uses the rebuilt SEO helper. + +## Dependency matrix + +| Component | Depends on | Used by | +|---|---|---| +| `webPage()` | `sitePages`, `canonicalUrl` | `aboutPage`, `contactPage`, portfolio-page, soorten-fotoshoots-page | +| `ContactPanel` | `ContactFormGate`, `ContactForm` (lazy or eager), `shootOptions`, `packageFromSearch`, `visiblePackages`, `mailSubject`, `useInView` | `home/ContactSection`, `routes/contact.tsx` | +| `ContactForm` | reducer and validation helpers, `RouterLink` (privacy) | `ContactPanel` | +| `ContactDetails` | `emailAddress`, `mailtoLink`, `mailSubject`, `visibleSocials`, `socialPlatforms`, `Eyebrow` | `routes/contact.tsx` (twice) | +| `ContactAside` | image component | `routes/contact.tsx` | +| `contactContent` | `ContactPageContent`, assets | `routes/contact.tsx` | + +## Communication patterns +- Props down only; no context, store or events beyond what exists (the form's reducer stays internal). +- The URL is the only input from outside the content: `?pakket=` read by the route, validated in `ContactPanel`, removed by the route. +- No new cycles: `ContactPanel` does not import routes; `ContactDetails` does not know the page. + +## Data flow +`siteContent` + `packages` + `contactContent` → route → components. Nothing flows back except the form submit, which goes to `submitContactForm` (unchanged, gated). diff --git a/aidlc-docs/features/contact-page/inception/application-design/component-methods.md b/aidlc-docs/features/contact-page/inception/application-design/component-methods.md new file mode 100644 index 0000000..4ca8e1d --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/application-design/component-methods.md @@ -0,0 +1,127 @@ +# Component Methods — Contact Page + +Signatures and props only; business rules follow in Functional Design (units 2 and 3). + +## `seo.ts` + +```ts +export type WebPageType = + | 'WebPage' + | 'AboutPage' + | 'ContactPage' + | 'ImageGallery' + | 'CollectionPage'; + +// Unit 1. @id = url = canonicalUrl(path); name/description from sitePages[path]; +// inLanguage 'nl-NL'; extra spread last. +export function webPage( + type: WebPageType, + path: RoutePath, + extra?: Record, +): Record; + +// Unit 1. Signature unchanged; output identical to today. +export function aboutPage( + path: RoutePath, + content: AboutPageContent['person'], + site: SiteContent, +): Record; + +// Unit 3. webPage('ContactPage', path, { about: { '@id': businessId } }) +export function contactPage(path: RoutePath): Record; +``` + +## `ContactPanel` (unit 2) + +```ts +type ContactPanelProps = { + // Prefix for the form's field ids (unique per page) + idPrefix: string; + packages: PricingPackage[]; + enabled: boolean; // siteContent.contactForm.enabled + email: EmailAddress; + replyTime: string; // siteContent.contactForm.replyTime + // Raw ?pakket= value from the page; validated inside (packageFromSearch) + pakket?: string; + // 'lazy': load the form near the screen, with a placeholder (homepage) + // 'eager': load it with the page (contact page) + load: 'lazy' | 'eager'; +}; +``` + +## `ContactForm` (changed, unit 2) + +```ts +type ContactFormProps = { + idPrefix: string; + options: ShootOption[]; + preselect?: { shoot: string; key: number }; + mailSubject: string; + email: EmailAddress; + replyTime: string; // new: used in the thank-you message + submit?: (payload: ContactPayload) => Promise; +}; +``` + +## `home/ContactSection` (changed, unit 2) + +Props unchanged: `{ content, packages, enabled, email, pakket? }`, plus `replyTime` passed through to `ContactPanel`. + +## `ContactDetails` (unit 2) + +```ts +type ContactDetailsProps = { + // Id of the h2, unique on the page (the card can appear twice) + titleId: string; + title: string; // "Direct contact" + email: EmailAddress; + socials: SocialLink[]; + // Small round portrait next to the heading (narrow screens) + portrait?: ContentImage; + 'data-testid'?: string; +}; +// Renders null when no channel is valid. +``` + +## `contact/ContactAside` (unit 3) + +```ts +type ContactAsideProps = { + image: ContentImage; // the 4:5 contact photo + children: ReactNode; // the card that overlaps the photo +}; +``` + +## Content types (`content/types.ts`) + +```ts +export interface SocialLink { + platform: SocialPlatform; + href: string; + label?: string; // new (unit 2), e.g. '@andreaslopfotografie' +} + +export interface SiteContent { + // ... + contactForm: { enabled: boolean; replyTime: string }; // replyTime new (unit 2) +} + +// Unit 3 +export interface ContactPageContent { + head: { eyebrow: string; title: string; intro: string }; + formTitle: string; // "Stuur me een bericht" (visually hidden h2) + detailsTitle: string; // "Direct contact" + image: ContentImage; // 4:5 photo (wide screens) + portrait: ContentImage; // small round face crop (narrow screens, decorative) +} +``` + +The intro and the reply time are combined in Functional Design (unit 3), so the reply time stays a single value. + +## Route `routes/contact.tsx` (unit 3) + +```ts +type ContactSearch = { pakket?: string }; +// validateSearch: keeps pakket only when it is a string (same as routes/index.tsx) +// head: pageHead('/contact') + structuredDataScript(contactPage('/contact')) +``` diff --git a/aidlc-docs/features/contact-page/inception/application-design/components.md b/aidlc-docs/features/contact-page/inception/application-design/components.md new file mode 100644 index 0000000..56b3ddf --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/application-design/components.md @@ -0,0 +1,49 @@ +# Components — Contact Page + +Decisions: [application-design-plan.md](../plans/application-design-plan.md) (Q1–Q4 = A). Requirements: [requirements.md](../requirements/requirements.md). + +## New shared components (`web/src/components/`) + +### `ContactPanel` (unit 2) +- **Purpose**: the contact form as a ready-to-place block, used by the homepage section and the contact page. +- **Responsibilities**: the "Binnenkort" gate (`ContactFormGate`); loading the form either with the page (`eager`) or when it comes near the screen (`lazy`, with the reserved placeholder height); the shoot options from the packages; the preselect from a `pakket` value and the mail subject that follows from it. *Q1 = A* +- **Not its job**: the section heading, removing `?pakket=` from the address bar, scrolling and focus — those stay with the page. + +### `ContactDetails` (unit 2) +- **Purpose**: the "Direct contact" card: a small h2 in eyebrow style and a list of channels (icon + link text). +- **Responsibilities**: show e-mail (assembled in the browser, left out when invalid), then the valid social links (`visibleSocials`), each with the platform icon and its label (or the platform name when there is no label, *Q3 = A*); render nothing when no channel is valid; optional small round portrait next to the heading. +- **Interface**: plain props (data in, no fetching); the heading id comes from the caller so the card can appear twice on one page without duplicate ids. *Q2 = A* + +## Changed shared components + +### `ContactForm` +- Privacy line under the submit button ("Lees in de privacyverklaring wat ik met je gegevens doe.", link to `/privacyverklaring`). +- Thank-you message takes the reply time from a prop instead of a hard-coded "1-2 werkdagen". + +### `home/ContactSection` +- Keeps the heading, the `?pakket=` clean-up, scroll to `#contact` and focus move; delegates gate, form, options, preselect and mail subject to `ContactPanel` with `load="lazy"`. Output and behaviour unchanged apart from the privacy line. + +## New page components (`web/src/components/contact/`) + +### `ContactAside` (unit 3) +- **Purpose**: the right column on wide screens: the contact photo (4:5) with a card overlapping its bottom edge. *Q4 = A* +- **Responsibilities**: photo and overlap layout only; the card is passed in as `children` (the page passes `ContactDetails`). Hidden on narrow screens (and the photo not downloaded there — mechanism in Functional Design unit 3). + +## Route + +### `routes/contact.tsx` (unit 3) +- Validates the `pakket` search parameter (text only), renders `PageIntro`, then one `PageSection` (`flushTop`) with: the narrow-screen `ContactDetails` (with portrait), the form column (visually hidden h2 + `ContactPanel load="eager"`) and `ContactAside` with the wide-screen `ContactDetails`. Removes `?pakket=` from the address bar after it has been applied, without a focus move. Head: `pageHead('/contact')` plus the `ContactPage` JSON-LD. + +## SEO (`web/src/seo.ts`, unit 1 and 3) +- **`webPage()`** + **`WebPageType`** (unit 1): generic page structured data, shared with portfolio-page and soorten-fotoshoots-page. +- **`aboutPage()`** (unit 1): rebuilt on `webPage()`, identical output. +- **`contactPage()`** (unit 3): `ContactPage` about the business. + +## Content (`web/src/content/`) +- `types.ts`: `SocialLink.label?` (unit 2), `SiteContent.contactForm.replyTime` (unit 2), `ContactPageContent` (unit 3). +- `siteContent.ts`: labels for Instagram and Facebook, `replyTime: '1-2 werkdagen'` (unit 2). +- `contactContent.ts` (unit 3): page head, form and card headings, photo and portrait. +- `aboutContent.ts` (unit 3): "neem contact op" and "Boek je shoot" → `/contact`. + +## Reused unchanged +`PageIntro`, `PageSection`, `Reveal`, `DeferredImage`, `Eyebrow`, `ContactFormGate`, `RouterLink`, `Link` (`underline`), `linkButton` recipe, `socialPlatforms`, `emailAddress`, `mailtoLink`/`mailSubject`, `visibleSocials`, `shootOptions`, `packageFromSearch`, `visiblePackages`, `contactFormReducer`. diff --git a/aidlc-docs/features/contact-page/inception/application-design/services.md b/aidlc-docs/features/contact-page/inception/application-design/services.md new file mode 100644 index 0000000..2ca5b0b --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/application-design/services.md @@ -0,0 +1,38 @@ +# Services — Contact Page + +There is no service layer in this SPA: routes compose components from static content, and pure helpers in `lib/` and `seo.ts` hold the logic. The only "service" is the existing `submitContactForm` (always fails until the API exists), reached through `ContactForm`; it is unchanged. + +## Composition per route + +### `/contact` (unit 3) + +```mermaid +sequenceDiagram + box rgba(99,179,237,0.4) Routing + participant R as Router + participant P as contact route + end + box rgba(255,167,38,0.4) Shared components + participant Pn as ContactPanel + participant D as ContactDetails + end + R->>P: render with search pakket + P->>D: narrow card (portrait, titleId A) + P->>Pn: load eager, pakket + Pn->>Pn: validate pakket, preselect, mail subject + P->>D: wide card in ContactAside (titleId B) + P->>R: replace URL without pakket, no focus move +``` + +Text alternative: the router renders the contact route with the search parameter; the route renders the narrow-screen card, the panel (which validates the package and preselects it) and the wide-screen card inside ContactAside, then removes the parameter from the URL without moving focus. + +### `/` (unit 2, behaviour unchanged) +`ContactSection` renders its heading, `ContactPanel` with `load="lazy"`, and keeps its own effect that removes `?pakket=`, scrolls to `#contact` and focuses the heading. + +### `/over-mij` (unit 3) +Content change only: two link targets become `/contact`. + +## Head (SEO) +- Every route: `pageHead(path)` from the page registry. +- `/over-mij`: `aboutPage()` (now on `webPage()`); `/contact`: `contactPage()`; both through `structuredDataScript` (escaped by `jsonLdScript`). +- Portfolio-page and soorten-fotoshoots-page add their own page types on `webPage()` in their branches. diff --git a/aidlc-docs/features/contact-page/inception/plans/application-design-plan.md b/aidlc-docs/features/contact-page/inception/plans/application-design-plan.md new file mode 100644 index 0000000..e41a8a3 --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/plans/application-design-plan.md @@ -0,0 +1,68 @@ +# Application Design Plan — Contact Page + +Depth: minimal. Business rules (what `ContactPanel` must keep from the homepage, which channels the card shows, the `?pakket=` handling on this page, the responsive photo) follow in Functional Design for units 2 and 3. + +## Plan + +- [x] Answer the design questions below +- [x] Generate `components.md` — new and changed components with responsibilities and interfaces +- [x] Generate `component-methods.md` — props and function signatures (incl. `webPage()`) +- [x] Generate `services.md` — composition in the routes (there is no service layer in this SPA) +- [x] Generate `component-dependency.md` — dependency matrix and data flow +- [x] Generate `application-design.md` — consolidated design +- [x] Validate completeness and consistency against requirements.md + +## Already decided (no question needed) + +- **`webPage(type: WebPageType, path: RoutePath, extra = {})`** in `seo.ts`, as agreed with portfolio-page and soorten-fotoshoots-page: `@context`, `@type`, `@id` = `url` = `canonicalUrl(path)`, `name`/`description` from `sitePages[path]`, `inLanguage: 'nl-NL'`, then `...extra`. `WebPageType = 'WebPage' | 'AboutPage' | 'ContactPage' | 'ImageGallery' | 'CollectionPage'`. `aboutPage()` keeps its signature and becomes `webPage('AboutPage', path, { mainEntity: person(...) })`. A new `contactPage(path)` = `webPage('ContactPage', path, { about: { '@id': businessId } })`. +- **Icons**: the card reuses the existing platform registry (`content/socialPlatforms.ts`: name + offline icon for Facebook and Instagram) plus one mail icon from the same set (`@iconify-icons/ant-design`). No new dependency. +- **Privacy line**: part of `ContactForm` itself (under the submit button), so every form that uses it has the line. Link target `/privacyverklaring` as a typed route. +- **Reply time**: one value in `SiteContent` (e.g. `contactForm: { enabled, replyTime: '1-2 werkdagen' }`), passed to `ContactForm` for the thank-you message and used by the contact page intro. +- **Folders**: shared pieces at the top level of `components/` (`ContactPanel/`, `ContactDetails/`), page-specific pieces in `components/contact/` (like `components/about/` for Over mij). Content in `content/contactContent.ts` with a `ContactPageContent` interface in `content/types.ts`. + +--- + +Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. + +## Vraag 1: Wat gaat er mee in `ContactPanel`? + +Het contactblok op de homepage (`ContactSection`) doet nu zes dingen: (1) de kop "Contact", (2) de gate, (3) het formulier lazy laden met een placeholder, (4) de shoot-opties uit de pakketten, (5) de voorselectie uit `?pakket=` plus het mailonderwerp, en (6) `?pakket=` uit de adresbalk halen, naar `#contact` scrollen en de focus op de kop zetten. + +- A) **Punt 2 t/m 5 gaan in `ContactPanel`**, met een prop voor het laden (`lazy` op de homepage, direct op de contactpagina). Punt 1 en 6 blijven bij de pagina, omdat ze per pagina verschillen: de homepage scrollt en verplaatst de focus, de contactpagina ruimt alleen de URL op. (aanbevolen) +- B) **Alleen punt 2, 4 en 5** in `ContactPanel`. Het lazy laden (3) blijft in `ContactSection`, dat het formulier dan als `children` aan het panel geeft. Het panel blijft kleiner, maar de koppeling tussen gate, formulier en placeholder wordt omslachtiger. +- C) **Ook punt 6** in `ContactPanel`, met opties voor wel of niet scrollen en de focus verplaatsen. Alles op één plek, maar het panel moet dan de router en de pagina kennen. +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 2: Hoe komt de contactkaart op twee plekken? + +Op brede schermen staat de kaart rechts, over de foto, ná het formulier. Op smalle schermen staat hij bovenaan, vóór het formulier en met het kleine portret. Voor toetsenbord- en screenreadergebruikers moet de volgorde in de HTML gelijk zijn aan wat je ziet. + +- A) **Twee keer renderen, per schermbreedte één zichtbaar**: één kaart in de rechterkolom (alleen breed), één boven het formulier met portret (alleen smal). De verborgen kaart is met `display: none` volledig weg, ook voor screenreaders. Ze krijgen elk een eigen id, zodat er geen dubbele ids zijn. De volgorde klopt dan altijd. (aanbevolen) +- B) **Eén keer renderen, vóór het formulier in de HTML**. Op brede schermen zet CSS hem rechts. Op desktop komt de toetsenbordfocus dan eerst langs de kaart en pas daarna bij het formulier, terwijl je het formulier links als eerste ziet. +- C) **Eén keer renderen, op de plek die past bij de schermbreedte**: React kiest met een media query waar hij staat. Na het laden kan hij één keer verspringen als de schermbreedte bekend wordt. +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 3: De tekst bij Instagram en Facebook in de kaart + +Bij e-mail is het adres de linktekst. Voor Instagram en Facebook heeft de content nu alleen het platform en de URL. + +- A) **Een optioneel `label` per sociale link in de content** (bijvoorbeeld "@andreaslopfotografie"). Zonder label toont de kaart de naam van het platform ("Instagram"). Andrea kan het straks in het CMS aanpassen. (aanbevolen) +- B) **Afleiden uit de URL**: "@" plus het laatste stuk van het pad (`instagram.com/andreaslopfotografie/` → "@andreaslopfotografie"). Geen extra veld, maar dat werkt niet voor elke link (bijvoorbeeld een Facebook-pagina met een id-URL). +- C) **Altijd de naam van het platform** ("Instagram", "Facebook"), zoals in de footer +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 4: Het blok "foto met kaart erover" + +De rechterkolom (foto 4:5 met de kaart over de onderrand) is nu alleen voor deze pagina. Het lijkt op `FramedImage` (foto met een zandkleurig vlak erachter), maar dan met inhoud over de foto heen. + +- A) **Een paginacomponent in `components/contact/`** (werktitel `ContactAside`), die `ContactDetails` en de foto samenstelt. Wordt het later ook elders nodig, dan maken we hem dan algemeen. (aanbevolen) +- B) **Nu al een algemene component** (werktitel `MediaCard`: foto met een willekeurige kaart erover), voor eventueel later gebruik op andere pagina's +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A diff --git a/aidlc-docs/features/contact-page/inception/plans/execution-plan.md b/aidlc-docs/features/contact-page/inception/plans/execution-plan.md new file mode 100644 index 0000000..da0a38f --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/plans/execution-plan.md @@ -0,0 +1,170 @@ +# Execution Plan — Contact Page + +## Detailed Analysis Summary + +### Transformation Scope (Brownfield) +- **Transformation Type**: Single component (`web/`), application-level only +- **Primary Changes**: replace the `/contact` placeholder with the real page (layout proposal 1a); extract the homepage contact form wiring into a shared `ContactPanel`; a new shared `ContactDetails` card; a privacy line and one reply-time value shared by both forms; a generic `webPage()` structured-data helper (consumed by two parallel features); page SEO (indexing, title/description, `ContactPage` JSON-LD, own preview image); Over mij links to `/contact` +- **Related Components**: `web/src/routes/contact.tsx`, `web/src/components/{ContactForm,home/ContactSection}`, new `ContactPanel` and `ContactDetails`, `web/src/content/` (`siteContent`, new contact content, `aboutContent`), `web/src/seo.ts`, `web/src/sitePages.ts`, `web/lighthouserc*.cjs`, `web/public/`, `web/src/assets/`, [LAYOUT.md](../../../../../LAYOUT.md) + +### Change Impact Assessment +- **User-facing changes**: Yes — a new page; the homepage contact section gains the privacy line and must otherwise look and behave exactly as before; two Over mij links change target +- **Structural changes**: Minor — two shared components extracted/added; no architectural change +- **Data model changes**: Yes (small) — new contact page content interface; a reply-time value in `SiteContent` +- **API changes**: No external API. Internal: `webPage()` + `WebPageType` become a shared contract for portfolio-page and soorten-fotoshoots-page; `/contact?pakket=` becomes a URL contract for soorten-fotoshoots-page +- **NFR impact**: Yes — SEO (indexed, structured data), accessibility (heading outline with a visually hidden h2, icon list), performance (form loads with the page; the large photo is the LCP on wide screens and must not load on phones) + +### Component Relationships + +```mermaid +graph TD + Route["routes/contact.tsx (new page)"] --> PageIntro["PageIntro (existing)"] + Route --> PageSection["PageSection (existing)"] + Route --> Panel["ContactPanel (new, extracted)"] + Route --> Details["ContactDetails (new)"] + Route --> Content["content: contact page content (new)"] + Route --> Seo["seo.ts: webPage + ContactPage (new)"] + HomeContact["home/ContactSection"] --> Panel + Panel --> Gate["ContactFormGate (existing)"] + Panel --> Form["ContactForm (privacy line, reply time)"] + Details --> SiteContent["siteContent (reply time added)"] + Form --> SiteContent + Seo --> AboutPage["aboutPage (rebuilt on webPage)"] + Seo --> Peers["portfolio-page and soorten-fotoshoots-page"] + AboutContent["aboutContent: links to /contact"] --> Route + classDef newpart fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000; + classDef changed fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef existing fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; + classDef peer fill:#CE93D8,stroke:#6A1B9A,stroke-width:1px,color:#000; + class Route,Panel,Details,Content,Seo newpart; + class HomeContact,Form,SiteContent,AboutPage,AboutContent changed; + class PageIntro,PageSection,Gate existing; + class Peers peer; +``` + +Text alternative: the new contact route composes the existing PageIntro and PageSection with the new ContactPanel and ContactDetails, new content and the new webPage-based structured data; the homepage contact section switches to ContactPanel; the form gains the privacy line and the shared reply time; aboutPage is rebuilt on webPage, which the two parallel features also use; Over mij content links to the new page. + +- **Primary Component**: `web` (front-end SPA) +- **Shared Components**: `seo.ts` (Minor, new `webPage()`; `aboutPage()` output unchanged), `ContactPanel` (new, used by the homepage), `ContactForm` (Minor: privacy line, reply time from content), `ContactDetails` (new) +- **Dependent Components**: homepage `ContactSection`; Over mij content; portfolio-page and soorten-fotoshoots-page (consume `webPage()` and the `?pakket=` contract) +- **Supporting Components**: Lighthouse CI config (Configuration-only), LAYOUT.md (documentation) + +### Coordination with Parallel Features +- **Critical path for others**: unit 1 (`webPage()`) — portfolio-page and soorten-fotoshoots-page cherry-pick its commit; hash sent to both sessions right after it is committed. +- **Incoming**: soorten-fotoshoots-page commits `siteContent.serviceArea` + `professionalService()` changes in `seo.ts`; whoever commits second rebases. No functional dependency for this page (the description text is static in `sitePages.ts`). +- **Hot files**: own entries only in `sitePages.ts`, `lighthouserc*.cjs`, `active-features.md`. + +### Risk Assessment +- **Risk Level**: Low to medium — the `ContactPanel` extraction touches the most intricate homepage section (lazy loading, `?pakket=` clean-up, focus, scroll); everything else is additive +- **Rollback Complexity**: Easy (one branch, commits per unit; unit 1 independent) +- **Testing Complexity**: Moderate — existing `ContactSection`, `ContactForm` and route tests guard the homepage behaviour; new tests for the page, the card, the URL parameter and the responsive photo; Lighthouse for `/contact` + +## Workflow Visualization + +```mermaid +flowchart TD + Start(["User Request"]) + + subgraph INCEPTION["🔵 INCEPTION PHASE"] + WD["Workspace Detection
COMPLETED"] + RE["Reverse Engineering
COMPLETED"] + RA["Requirements Analysis
COMPLETED"] + US["User Stories
SKIP"] + WP["Workflow Planning
IN PROGRESS"] + AD["Application Design
EXECUTE"] + UG["Units Generation
SKIP"] + end + + subgraph CONSTRUCTION["🟢 CONSTRUCTION PHASE"] + FD["Functional Design
EXECUTE (units 2 and 3)"] + NFRA["NFR Requirements
SKIP"] + NFRD["NFR Design
SKIP"] + ID["Infrastructure Design
SKIP"] + CG["Code Generation
(Planning + Generation)
EXECUTE"] + BT["Build and Test
EXECUTE"] + end + + Start --> WD + WD --> RE + RE --> RA + RA --> WP + WP --> AD + AD --> FD + FD --> CG + CG --> BT + BT --> End(["Complete"]) + + style WD fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff + style RE fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff + style RA fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff + style WP fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff + style CG fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff + style BT fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff + style AD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000 + style FD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000 + style US fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000 + style UG fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000 + style NFRA fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000 + style NFRD fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000 + style ID fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000 + style INCEPTION fill:#BBDEFB,stroke:#1565C0,stroke-width:3px,color:#000 + style CONSTRUCTION fill:#C8E6C9,stroke:#2E7D32,stroke-width:3px,color:#000 + style Start fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000 + style End fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000 + + linkStyle default stroke:#333,stroke-width:2px +``` + +Text alternative: completed Workspace Detection, Reverse Engineering and Requirements Analysis lead to Workflow Planning, then Application Design, Functional Design (units 2 and 3), Code Generation per unit and Build and Test; User Stories, Units Generation, NFR Requirements, NFR Design, Infrastructure Design and the Operations phase are skipped. + +## Phases to Execute + +### 🔵 INCEPTION PHASE +- [x] Workspace Detection (COMPLETED) +- [x] Reverse Engineering (COMPLETED — delta) +- [x] Requirements Analysis (COMPLETED) +- [x] User Stories (SKIPPED) + - **Rationale**: one persona (the visitor), concrete FRs with texts, targets and an approved mockup +- [x] Execution Plan (IN PROGRESS) +- [ ] Application Design - EXECUTE (minimal depth) + - **Rationale**: new shared components and a shared contract need agreed boundaries before code: `webPage()` signature and its properties (already announced to two sessions), `ContactPanel` (what moves out of `ContactSection`, lazy vs eager), `ContactDetails` (props, data source, label per channel), where the privacy line and the reply time live, and the content interface for the page +- [ ] Units Generation - SKIP + - **Rationale**: the split is fixed below (three units); no separate unit-of-work artifacts needed + +### 🟢 CONSTRUCTION PHASE +- [ ] Functional Design - EXECUTE for units 2 and 3 (minimal depth) + - **Rationale**: unit 2 has rules worth pinning down before code (which homepage behaviour `ContactPanel` must keep, which channels the card shows and with what label, PBT properties per PBT-01); unit 3 has the `?pakket=` handling on this page (clean-up without focus move), the responsive photo rule (LCP on wide screens, not downloaded on phones) and the content model. Unit 1 is a small pure helper whose properties are set in Application Design +- [ ] NFR Requirements - SKIP + - **Rationale**: NFRs are set at requirements level (NFR-CP-01..06) and the stack is fixed +- [ ] NFR Design - SKIP + - **Rationale**: no new NFR patterns; the responsive-photo approach is decided in Functional Design of unit 3; existing patterns (DeferredImage, Reveal, jsonLdScript, focus ring) are reused +- [ ] Infrastructure Design - SKIP + - **Rationale**: static assets only; no server config, CSP or deployment changes +- [ ] Code Generation - EXECUTE (ALWAYS, per unit) + - **Rationale**: implementation and tests +- [ ] Build and Test - EXECUTE (ALWAYS) + - **Rationale**: full `pnpm check` incl. Lighthouse for `/`, `/over-mij` and `/contact` + +### 🟡 OPERATIONS PHASE +- [ ] Deployment Setup, Monitoring Setup, Production Readiness Validation - SKIP + - **Rationale**: Operations Configuration = No; the existing pipeline deploys to test on merge + +## Units of Work (in order) + +| # | Unit | Scope | Requirements | +|---|---|---|---| +| 1 | **webPage helper** | `webPage()` + `WebPageType` in `seo.ts`; `aboutPage()` rebuilt on it with identical output; example and property tests. Only `seo.ts` and `seo.test.ts`. One commit; hash sent to portfolio-page and soorten-fotoshoots-page. | SEO-CP-03 (helper part) | +| 2 | **Shared contact blocks** | Extract `ContactPanel` from `ContactSection` (homepage unchanged apart from the privacy line); privacy line under the form; reply time as one `siteContent` value used by the thank-you message; new `ContactDetails` card (icons, valid channels only). | FR-CP-02 (shared parts), FR-CP-04, FR-CP-06, FR-CP-07, FR-CP-08, NFR-CP-02 | +| 3 | **Contact page** | Photos (original resized, small portrait crop, 1200×630 preview) with alt texts; page content + types; the route with layout 1a and the narrow-screen card; `?pakket=` preselect; SEO (indexed, title/description, `ogImage`, `ContactPage` JSON-LD, Lighthouse indexed paths); Over mij links to `/contact`; LAYOUT.md. | FR-CP-01..05, FR-CP-09..11, SEO-CP-01..05, NFR-CP-01, 03..06 | + +Unit 1 goes first because two other features wait for it and it is independent of the rest. Unit 2 before unit 3 because the page builds on its components. Each unit: one or more commits on `feature/contact-page`, full `pnpm check` (incl. Lighthouse) before its completion message; one PR to master at the end. + +## Estimated Timeline +- **Total Stages to execute from here**: 6 (Application Design, Functional Design ×2 units, Code Generation ×3 units, Build and Test) +- **Estimated Duration**: two working sessions + +## Success Criteria +- **Primary Goal**: a finished, indexed Contact page in the approved layout, reusing the homepage form +- **Key Deliverables**: `/contact` page; `webPage()` (shared with two features); `ContactPanel`, `ContactDetails`, privacy line, shared reply time; contact content; resized photos, portrait crop and preview image; updated Over mij links, LAYOUT.md and Lighthouse config +- **Quality Gates**: `pnpm check` passes (lint, format, tests with coverage thresholds, build, audits, Lighthouse: accessibility 1.0, best practices 1.0, performance ≥ 0.9 for `/contact`, homepage and Over mij budgets unchanged); axe clean; homepage contact section unchanged in behaviour after unit 2; `aboutPage()` output unchanged after unit 1 +- **Integration Testing**: route tests render `/`, `/over-mij` and `/contact` in the shell; `/contact?pakket=newborn` preselects Newborn and cleans the URL; Over mij links reach `/contact` diff --git a/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-1a-foto-rechts-desktop.png b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-1a-foto-rechts-desktop.png new file mode 100644 index 0000000..337fb50 Binary files /dev/null and b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-1a-foto-rechts-desktop.png differ diff --git a/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-1a-foto-rechts-mobiel.png b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-1a-foto-rechts-mobiel.png new file mode 100644 index 0000000..29827ca Binary files /dev/null and b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-1a-foto-rechts-mobiel.png differ diff --git a/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-1b-foto-links-desktop.png b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-1b-foto-links-desktop.png new file mode 100644 index 0000000..8a82d2b Binary files /dev/null and b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-1b-foto-links-desktop.png differ diff --git a/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-2-strip-desktop.png b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-2-strip-desktop.png new file mode 100644 index 0000000..f6de411 Binary files /dev/null and b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-2-strip-desktop.png differ diff --git a/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-2-strip-mobiel.png b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-2-strip-mobiel.png new file mode 100644 index 0000000..80d47f5 Binary files /dev/null and b/aidlc-docs/features/contact-page/inception/requirements/mockups/voorstel-2-strip-mobiel.png differ diff --git a/aidlc-docs/features/contact-page/inception/requirements/mockups/vraag-b-c-portret-mobiel.png b/aidlc-docs/features/contact-page/inception/requirements/mockups/vraag-b-c-portret-mobiel.png new file mode 100644 index 0000000..de5f3b0 Binary files /dev/null and b/aidlc-docs/features/contact-page/inception/requirements/mockups/vraag-b-c-portret-mobiel.png differ diff --git a/aidlc-docs/features/contact-page/inception/requirements/requirement-clarification-questions.md b/aidlc-docs/features/contact-page/inception/requirements/requirement-clarification-questions.md new file mode 100644 index 0000000..44c4b20 --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/requirements/requirement-clarification-questions.md @@ -0,0 +1,131 @@ +# Verduidelijkingsvragen — Contactpagina + +Je antwoorden op vraag 1–6, 9–13 en 15–19 zijn duidelijk. Bij drie vragen vroeg je om een voorstel: + +- **Vraag 7**: iconen in plaats van koppen bij de contactgegevens. Die "hangen" nu onder de foto. +- **Vraag 8**: op mobiel is de foto erg groot, terwijl het formulier en de contactgegevens belangrijker zijn. +- **Vraag 14**: je koos B (de titel houden), maar met een uitgebreidere beschrijving en een breder werkgebied dan alleen Huizen, en je vroeg om suggesties. + +## Wat er nu misgaat in het ontwerp + +- **Desktop**: links een hoge foto (4:5). Daaronder, na een lijn, drie koppen met elk een link. Dat stuk valt ver onder het formulier, waardoor de kolommen ongelijk eindigen. +- **Mobiel**: de kolommen komen onder elkaar. Eerst een foto over de volle breedte (op een telefoon ruim 450px hoog), dan de gegevens, en pas daarna het formulier. + +## Wat in alle voorstellen hetzelfde is (uit vraag 7) + +- Elke contactregel krijgt een **icoon** (envelop, Instagram, Facebook) uit de icoonset die de site al gebruikt (`@iconify-icons/ant-design`), met de link als zichtbare tekst ("info@andreaslop.nl", "@andreaslopfotografie"). Het icoon is decoratie en wordt niet voorgelezen. De hele regel is klikbaar en minstens 44px hoog. +- De gegevens staan als **lijst** (`ul`) met één kleine, zichtbare kop in de labelstijl, bijvoorbeeld "Direct contact" (een h2). Geen losse h3's per kanaal. +- Het formulier krijgt een **h2 die alleen screenreaders zien**, "Stuur me een bericht". De volgorde van koppen blijft dan logisch: h1 → h2. + +--- + +## Vraag A: Opbouw van de pagina + +### Voorstel 1: formulier voorop, gegevens als kaart bij de foto (aanbevolen) + +Desktop (variant 1a): het formulier links (de bredere kolom). Rechts de foto, met de contactgegevens als kaart die over de onderrand van de foto valt. Foto en kaart vormen één geheel, zodat de gegevens niet meer "los" hangen. De rechterkolom is ongeveer even hoog als het formulier. + +```mermaid +block-beta +columns 5 + A["Intro"]:5 + B["Contactformulier"]:3 + C["Foto met kaart Direct contact (iconen)"]:2 + style A fill:#e76f51,stroke:#ad533d,color:#000 + style B fill:#2a9d8f,stroke:#20766b,color:#000 + style C fill:#f4a261,stroke:#b77a49,color:#000 +``` + +Text alternative: desktop, intro over de volle breedte; daaronder het formulier links (drie vijfde) en de foto met contactkaart rechts (twee vijfde). + +Mobiel: intro → compacte kaart met de drie contactregels (ongeveer 150px) → formulier. Op mobiel valt de foto weg (zie vraag B). + +```mermaid +block-beta +columns 1 + A["Intro"] + C["Kaart Direct contact (iconen)"] + B["Contactformulier"] + style A fill:#e76f51,stroke:#ad533d,color:#000 + style C fill:#f4a261,stroke:#b77a49,color:#000 + style B fill:#2a9d8f,stroke:#20766b,color:#000 +``` + +Text alternative: mobiel, onder elkaar: intro, contactkaart, formulier. + +Waarom: het formulier is waarvoor de meeste bezoekers komen en staat op desktop op de plek waar je begint te lezen. Wie liever mailt of een DM stuurt, ziet op mobiel meteen de snelle route zonder langs het formulier te hoeven scrollen. De foto geeft op desktop sfeer, maar duwt op mobiel niets naar beneden. + +### Voorstel 2: snelle contactstrip onder de intro + +Direct onder de intro een strip met de drie contactregels naast elkaar, gecentreerd. Daaronder foto en formulier, zoals in het ontwerp. + +```mermaid +block-beta +columns 2 + A["Intro"]:2 + D["Strip: e-mail · Instagram · Facebook (iconen)"]:2 + C["Foto"] + B["Contactformulier"] + style A fill:#e76f51,stroke:#ad533d,color:#000 + style D fill:#264653,stroke:#1d353e,color:#000 + style C fill:#f4a261,stroke:#b77a49,color:#000 + style B fill:#2a9d8f,stroke:#20766b,color:#000 +``` + +Text alternative: desktop, intro, daaronder een strip met de drie contactregels, daaronder foto links en formulier rechts. + +Mobiel: intro → strip (drie regels onder elkaar) → formulier → foto (zie vraag B). + +Nadeel: de foto en het formulier staan weer naast elkaar met verschillende hoogtes. De strip voelt ook meer als een menu dan als contactgegevens. + +### Voorbeeldafbeeldingen + +Mockups gemaakt met de stijl en de foto uit het ontwerp en de velden van het echte formulier. Iconen en maten zijn een indicatie; de uitwerking volgt de theme-tokens. Op mobiel is de foto weggelaten (zie vraag B). + +| | Desktop | Mobiel | +| ------------------------ | ------------------------------------------------------ | ---------------------------------------------------- | +| Voorstel 1a: foto rechts | [desktop](mockups/voorstel-1a-foto-rechts-desktop.png) | [mobiel](mockups/voorstel-1a-foto-rechts-mobiel.png) | +| Voorstel 1b: foto links | [desktop](mockups/voorstel-1b-foto-links-desktop.png) | gelijk aan 1a | +| Voorstel 2: contactstrip | [desktop](mockups/voorstel-2-strip-desktop.png) | [mobiel](mockups/voorstel-2-strip-mobiel.png) | + +Bij **1b** staat de foto links en het formulier rechts, net als in het ontwerp. Het formulier heeft dan wel de bredere kolom. Je leest eerst de foto met de contactkaart en daarna het formulier. + +Welk voorstel? + +- A) Voorstel 1a: formulier links, foto met contactkaart rechts (aanbevolen: het formulier staat waar je begint te lezen) +- B) Voorstel 1b: foto met contactkaart links, formulier rechts +- C) Voorstel 2: snelle contactstrip onder de intro, foto en formulier daaronder +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag B: De foto op mobiel + +- A) Op mobiel weglaten. Op een telefoon voegt de foto weinig toe, en zo laadt hij daar ook niet (scheelt data en houdt de pagina snel). Op tablet en desktop blijft hij staan. (aanbevolen) +- B) Op mobiel als lage, brede foto (3:2, ongeveer 220px hoog) helemaal onderaan de pagina +- C) Op mobiel als kleine ronde portretfoto in de contactkaart, naast "Direct contact" en haar naam ([mockup mobiel](mockups/vraag-b-c-portret-mobiel.png)). Een aparte, kleine uitsnede van het gezicht (enkele kB), zodat de grote foto op mobiel niet geladen hoeft te worden. +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: C + +## Vraag C: Titel (SEO) + +Je koos B (de titel houden), maar je noemde ook "Fotoshoot boeken in Huizen en omgeving". Google kort een titel af na ongeveer 60 tekens; " | Andrea Slop Fotografie" telt daar al 25 van. + +- A) "Contact – fotoshoot boeken in Huizen" → "Contact – fotoshoot boeken in Huizen | Andrea Slop Fotografie" (61 tekens). Het woord "Contact" blijft vooraan, zodat de pagina herkenbaar is in de zoekresultaten en in browsertabbladen. (aanbevolen) +- B) "Fotoshoot boeken in Huizen en omgeving" → 63 tekens; kan op telefoons net worden afgekort, en het woord "Contact" ontbreekt +- C) "Contact" laten staan → "Contact | Andrea Slop Fotografie" (32 tekens) +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag D: Beschrijving (SEO) + +Over het werkgebied heb ik de sessie van Soorten fotoshoots gevraagd wat je daar hebt aangegeven: "Huizen en omgeving of Huizen en Gooi en Vechtstreek, maar hoeft daar niet beperkt te blijven". Inmiddels heb je daar de formulering **"Huizen, het Gooi en omgeving"** goedgekeurd (in de gestructureerde data: Huizen en Gooi en Vechtstreek, niet heel Nederland), met één bron in `siteContent`. Die sessie past ook de gestructureerde data van het bedrijf aan. Ik sluit daarop aan. Alle opties hieronder blijven onder de 155 tekens. + +- A) "Neem contact op voor een newborn-, zwangerschaps- of gezinsshoot in Huizen, het Gooi en omgeving. Ik denk graag met je mee en reageer binnen 1-2 werkdagen." (155) (aanbevolen: noemt de shoots, het gebied en de termijn, en de toon past bij de huidige tekst) +- B) "Fotoshoot boeken in Huizen, het Gooi of daarbuiten? Stuur me een bericht over je newborn-, zwangerschaps- of gezinsshoot. Ik reageer binnen 1-2 werkdagen." (154; zegt expliciet dat je ook buiten de regio komt) +- C) "Een fotoshoot in Huizen, het Gooi en omgeving? Vertel me over je newborn-, zwangerschaps-, gezins- of loveshoot. Ik reageer binnen 1-2 werkdagen." (145; noemt ook de loveshoot) +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A diff --git a/aidlc-docs/features/contact-page/inception/requirements/requirement-verification-questions.md b/aidlc-docs/features/contact-page/inception/requirements/requirement-verification-questions.md new file mode 100644 index 0000000..3933dbd --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/requirements/requirement-verification-questions.md @@ -0,0 +1,212 @@ +# Verificatievragen — Contactpagina + +Al vastgelegd (geen vraag nodig): + +- **Route** `/contact` bestaat al als placeholder ([contact.tsx](../../../../../web/src/routes/contact.tsx)) en wordt de echte pagina. Het hoofdmenu en de footer verwijzen er al naar. +- **Layout en stijl** komen uit het ontwerp ([contact.html](../../../../../design/andreaslop-static/contact.html)): page head (eyebrow "Neem contact op", h1 "Contact", intro), daaronder een sectie met twee kolommen: foto met contactgegevens, en het formulier. +- **Hergebruik eerst**: `PageIntro`, `PageSection` (`spacing="flushTop"`), `FramedImage`/`DeferredImage`, `Reveal`, `Eyebrow`, `ContactForm`, `ContactFormGate`, de pure logica (`contactFormReducer`, `validateContact`, `isLikelySpam`, `emailAddress`, `visibleSocials`, `mailtoLink`) en de theme-tokens. Geen hardgecodeerde kleuren, geen CSS-bestanden, geen nieuwe dependencies. +- **Formulier direct laden**: op deze pagina staat het formulier boven de vouw, dus het wordt niet lazy geladen zoals op de homepage. +- **E-mailadres** wordt, net als nu, pas in de browser samengesteld en komt nergens leesbaar in de bundle of de JSON-LD. +- **Toegankelijkheid**: dezelfde lat als Over mij: één h1, secties met een toegankelijke naam, contrast ≥ 4.5:1, `prefers-reduced-motion`, axe in de tests en Lighthouse accessibility 1.0. +- **Afspraken met de parallelle features**: generieke `webPage()`-helper voor JSON-LD als aparte eerste commit (Portfolio en Soorten fotoshoots bouwen erop), en alleen eigen regels in `sitePages.ts`, `lighthouserc.cjs` en `active-features.md`. + +Wat ik zag op het ontwerp, in de code en op de live site (andreaslop.nl/contact): + +| Onderdeel | Ontwerp | Huidige code (formulier homepage) | Live site | +| --------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------- | +| Velden | naam, e-mail, **onderwerp** (vrije tekst), bericht | naam, e-mail, **"In welke shoot heb je interesse?"** (Zwangerschap / Newborn / Gezin / Overig), bericht | zelfde als de code (Familie i.p.v. Gezin) | +| Reactietermijn | "binnen **2-3** werkdagen" (intro) | "binnen **1-2** werkdagen" (bedankbericht) | "binnen **1** werkdag" (intro) | +| Verzendknop | "Verzenden" | "(Aan)vraag versturen" | "(Aan)vraag versturen" | +| Contactgegevens | E-mail, Instagram, Facebook (h3 + link) onder de foto | bestaat nog niet als blok | Email en Instagram, plus social-iconen | +| Foto | `contact.jpg`, alt "Andrea Slop met haar camera" | — | zelfde foto, **zonder alt-tekst** | +| LAYOUT.md | — | Intro / Photo + Contact form / Contact details over de volle breedte | — | + +Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. + +--- + +## Vraag 1: Velden van het formulier + +- A) Hetzelfde formulier als op de homepage en de live site: naam, e-mail, de shoot-keuzelijst en bericht. Eén formulier, één payload (`{ naam, email, shoot, bericht }`) voor de API, en de keuzelijst blijft gekoppeld aan de pakketten. (aanbevolen) +- B) Zoals in het ontwerp: een vrij onderwerpveld in plaats van de keuzelijst. Dan krijgt `ContactForm` een variant, en de API twee soorten berichten. +- C) Allebei: de keuzelijst én een vrij onderwerpveld +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 2: Reactietermijn + +Ontwerp, code en live site beloven alle drie iets anders. Ik zet de termijn op één plek in de content (`siteContent`), zodat de intro van deze pagina en het bedankbericht van het formulier (ook op de homepage) altijd hetzelfde zeggen. Welke termijn? + +- A) 1-2 werkdagen (wat het formulier nu al zegt) (aanbevolen: haalbaar en al eerder goedgekeurd) +- B) 1 werkdag (live site) +- C) 2-3 werkdagen (ontwerp) +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 3: Shoot voorselecteren via de link + +Soorten fotoshoots wil vanaf elke shoot linken naar het formulier met die shoot alvast gekozen. Op de homepage werkt dat al met `/?pakket=newborn#contact` (een onbekende waarde wordt genegeerd en nooit op de pagina getoond). + +- A) Dezelfde parameter op deze pagina: `/contact?pakket=`, met dezelfde logica als de homepage (`packageFromSearch`). Bekende waarden: `zwangerschap`, `newborn`, `gezin`. Een shoot zonder pakket (bijvoorbeeld een loveshoot) linkt gewoon naar `/contact`. (aanbevolen) +- B) Een nieuwe parameter `/contact?onderwerp=` met de slugs van de shoot-types van Soorten fotoshoots, die ook naar "Overig" kan +- C) Geen voorselectie: altijd gewoon `/contact` +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 4: Formulier zolang er geen back-end is + +Het formulier kan nog niets versturen. Op de homepage staat het daarom gedimd en onbedienbaar onder een "Binnenkort"-melding met een mailknop (`siteContent.contactForm.enabled = false`). + +- A) Hier precies hetzelfde gedrag, via dezelfde schakelaar. Zodra de API er is, gaan beide formulieren tegelijk aan. (aanbevolen) +- B) Op deze pagina het formulier verbergen tot de API er is, en alleen de contactgegevens en een mailknop tonen +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 5: Hergebruik van de formulier-opbouw + +Op de homepage regelt `ContactSection` de koppeling tussen de gate, het formulier, de shoot-opties en de voorselectie. Deze pagina heeft precies hetzelfde nodig, alleen zonder lazy loading. + +- A) Die koppeling uit `ContactSection` halen in een gedeeld blok (werktitel `ContactPanel`) dat zowel de homepage als deze pagina gebruikt. Het gedrag op de homepage blijft gelijk. (aanbevolen) +- B) Op deze pagina zelf `ContactFormGate` en `ContactForm` samenstellen en `ContactSection` laten zoals hij is +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 6: Welke contactgegevens + +- A) E-mail, Instagram en Facebook, zoals in het ontwerp. Ze komen uit `siteContent`, dezelfde bron als de footer, en worden alleen getoond als ze geldig zijn. Gemaakt als herbruikbaar blok (werktitel `ContactDetails`). (aanbevolen) +- B) Alleen e-mail en Instagram, zoals op de live site +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 7: Koppen en structuur + +In het ontwerp staan onder de h1 meteen h3's ("E-mail", "Instagram", "Facebook"). Het formulier heeft geen kop. Een sprong van h1 naar h3 maakt de pagina lastiger te scannen met een screenreader. + +- A) Twee benoemde secties: het formulier krijgt een h2 die alleen voor screenreaders zichtbaar is (bijvoorbeeld "Stuur me een bericht"), de contactgegevens een zichtbare of verborgen h2 "Contactgegevens" met h3's per kanaal in de stijl van het ontwerp. Visueel verandert er niets. (aanbevolen) +- B) De kanalen worden h2's in de kleine labelstijl, zonder extra kop voor het formulier +- C) Letterlijk het ontwerp: alleen h3's +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: X, Ik denk dat de contactgegevens mooier kunnen. Gebruik een icon bij de verschillende gegevens in plaats van een header. Kijk ook ove onder elkaar dan nog steeds de meest logische keuze is, maar de contactgegevens hanger er nu een beetje onder. Dat moet beter kunnen. + +## Vraag 8: Plaats van de contactgegevens + +In het ontwerp staan de contactgegevens onder de foto, in dezelfde kolom. In [LAYOUT.md](../../../../../LAYOUT.md) staan ze als apart blok over de volle breedte onder foto en formulier. + +- A) Zoals in het ontwerp (onder de foto), en LAYOUT.md daarop aanpassen volgens [.ai/layout-conventions.md](../../../../../.ai/layout-conventions.md). Op telefoon komen foto en gegevens boven het formulier. (aanbevolen) +- B) Zoals in het ontwerp, maar op telefoon het formulier eerst, dan foto en gegevens (het formulier is waarvoor de bezoeker komt) +- C) Zoals in LAYOUT.md: een apart blok over de volle breedte onder foto en formulier +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: Doe een suggestie. Op mobiel is de foto ook erg groot terwijl het formulier en de contactgegevens de belangrijkere elementen zijn. Kan je een suggestie doen voor een verbetering. Ook rekening houdend met mijn antwoor din vraag 7. + +## Vraag 9: Foto en alt-tekst + +- A) De originele foto van andreaslop.nl downloaden, eenmalig verkleinen en comprimeren (zoals bij Over mij) en een beschrijvende Nederlandse alt-tekst schrijven die Andrea later kan nalezen (aanbevolen) +- B) De foto uit het ontwerp gebruiken (`assets/img/contact.jpg`) met de alt-tekst uit het ontwerp +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 10: Tekst van de verzendknop + +- A) "(Aan)vraag versturen" houden, zoals op de homepage en de live site. Eén formulier, één tekst. (aanbevolen) +- B) "Verzenden" uit het ontwerp, voor beide formulieren +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 11: Privacy bij het formulier + +Het formulier vraagt om een naam en e-mailadres. Volgens de AVG hoort de bezoeker te kunnen lezen wat er met die gegevens gebeurt. `/privacyverklaring` is nog een placeholder. + +- A) Onder het formulier één korte regel met een link: "Lees in de privacyverklaring wat ik met je gegevens doe." Op beide formulieren, want ze zijn gedeeld. (aanbevolen) +- B) Nu nog geen privacyregel, wel als de privacyverklaring af is +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 12: Links die nu naar `/#contact` gaan + +Op Over mij gaan "neem contact op" en "Boek je shoot" voorlopig naar het contactblok op de homepage (`/#contact`), tot deze pagina af is (besluit uit Over mij, vraag 3). + +- A) Die twee links omzetten naar `/contact`. De "Boek"-knoppen op de prijskaarten van de homepage blijven naar het formulier op de homepage zelf gaan, want daar hoef je de pagina niet voor te verlaten. (aanbevolen) +- B) Alle links laten zoals ze zijn +- C) Ook de "Boek"-knoppen op de homepage naar `/contact?pakket=…` laten gaan +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 13: Indexeren door zoekmachines + +`/contact` staat nu op `noindex` en ontbreekt in `sitemap.xml`. + +- A) Bij het mergen op **geïndexeerd** zetten: geen `noindex` meer, in de sitemap, in Lighthouse CI als geïndexeerde pagina controleren. Ook met het formulier nog achter de "Binnenkort"-melding is de pagina bruikbaar dankzij de mailknop en de contactgegevens. (aanbevolen) +- B) Op `noindex` laten tot het formulier echt werkt +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 14: Titel en beschrijving (SEO) + +Nu: titel "Contact | Andrea Slop Fotografie", beschrijving "Neem contact op met Andrea Slop Fotografie voor een fotoshoot in Huizen en omgeving. Ik denk graag met je mee over jullie wensen." + +- A) Titel met zoekwoorden, bijvoorbeeld "Contact – fotoshoot boeken in Huizen", en een beschrijving die de shoots en de reactietermijn noemt. Ik stel ze voor in requirements.md en jij keurt ze goed. (aanbevolen) +- B) Titel en beschrijving laten zoals ze zijn +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: B, in beschrijving kanje wat uitgebreider zijn. Bij Soorten Fotoshoots had ik ook al wat aangegeven over de locatie dat dat breder is dan huizen. Misschien dat je daar kan navragen. Misschien "Fotoshoot boeken in Huizen en omgeving"? Geef mij suggesties + +## Vraag 15: Gestructureerde data (JSON-LD) + +- A) Een `ContactPage` via de nieuwe `webPage()`-helper, met als onderwerp de bestaande `ProfessionalService` (verwijzing naar `businessId`). Zonder e-mailadres, zoals nu overal. `aboutPage()` gaat op dezelfde helper draaien, met dezelfde uitvoer. (aanbevolen) +- B) Alleen de bestaande `ProfessionalService`, niets extra (de helper komt er dan toch, voor Portfolio en Soorten fotoshoots) +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 16: Preview-afbeelding bij delen (Open Graph) + +- A) Een eigen preview voor deze pagina: de contactfoto, bijgesneden tot 1200×630 in `web/public/` (aanbevolen) +- B) De standaardafbeelding van de site houden +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 17: Beveiligingsextensies + +Moeten de beveiligingsregels als harde vereisten worden afgedwongen voor dit project? (Bij homepage en Over mij: ja.) + +- A) Ja — dwing alle BEVEILIGINGSREGELS af als blokkerende vereisten (aanbevolen voor productietoepassingen) +- B) Nee — sla alle BEVEILIGINGSREGELS over (geschikt voor PoC's, prototypes en experimentele projecten) +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 18: Property-Based Testing Extensie + +Moeten de property-based testing (PBT) regels worden afgedwongen voor dit project? (Bij homepage en Over mij: ja, volledig.) + +- A) Ja — dwing alle PBT-regels af als blokkerende vereisten (aanbevolen voor projecten met bedrijfslogica, datatransformaties, serialisatie of stateful componenten) +- B) Gedeeltelijk — dwing PBT-regels alleen af voor pure functies en serialisatie round-trips (geschikt voor projecten met beperkte algoritmische complexiteit) +- C) Nee — sla alle PBT-regels over (geschikt voor eenvoudige CRUD-applicaties, UI-only projecten of dunne integratielagen zonder significante bedrijfslogica) +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 19: Operations-fase + +Moet deze feature na Construction de Operations-fase doorlopen (deployment en monitoring inrichten)? (Bij Over mij: nee, de CI deployt al naar test.) + +- A) Ja — na Construction de Operations-fase uitvoeren (deployment + monitoring) +- B) Nee — stoppen na Build and Test (deployment/monitoring vallen buiten deze feature) +- C) Weet ik nog niet — vraag het me opnieuw na de Construction-fase +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: B diff --git a/aidlc-docs/features/contact-page/inception/requirements/requirements.md b/aidlc-docs/features/contact-page/inception/requirements/requirements.md new file mode 100644 index 0000000..155658e --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/requirements/requirements.md @@ -0,0 +1,198 @@ +# Requirements — Contact Page + +## Intent Analysis +- **User Request**: build the Contact page, again with attention to SEO, accessibility and reuse of code elements, Chakra and theming, like the previous feature (Over mij). +- **Request Type**: New Feature (replaces the `/contact` placeholder with the real page) with supporting refactors (shared contact form panel, shared contact details block, generic structured-data helper) +- **Scope Estimate**: Multiple components within one package (`web/`), plus [LAYOUT.md](../../../../../LAYOUT.md); one shared helper (`webPage()` in `seo.ts`) consumed by two parallel features +- **Complexity Estimate**: Moderate — one page with a layout that deviates from the design on purpose, two extractions from the homepage contact section, a URL parameter, responsive image handling (large photo not loaded on phones), SEO additions +- **Requirements Depth**: Standard + +## Source of Truth +- **Layout**: the approved mockup **proposal 1a** ([desktop](mockups/voorstel-1a-foto-rechts-desktop.png), [mobile with portrait](mockups/vraag-b-c-portret-mobiel.png)), which deviates from [design/andreaslop-static/contact.html](../../../../../design/andreaslop-static/contact.html) on purpose. Styling (colours, type, spacing, form fields) follows the design and the existing theme. *Source: clarification A = A, B = C* +- **Form behaviour**: the existing homepage contact form (homepage-sections feature), unchanged except where stated here. +- **Decisions**: [requirement-verification-questions.md](requirement-verification-questions.md), [requirement-clarification-questions.md](requirement-clarification-questions.md) + +## Page Structure +Shell header → **Intro** (page head, h1) → **Contact** section: **Contact form** (left) and **Photo with contact card** (right) on wide screens; **Contact card** (with small portrait) above the **Contact form** on narrow screens → shell footer. + +## Out of Scope +- The back-end (`POST /api/contact`), the robot check (Friendly Captcha) and switching the form on: the form stays behind the existing "Binnenkort" gate. *Source: Q4 = A* +- The content of `/privacyverklaring` (still a placeholder; only linked). *Source: Q11 = A* +- The service area wording in `siteContent` and `areaServed` in `professionalService()`: owned by the soorten-fotoshoots-page feature; this page only uses the same visible wording. +- A responsive image pipeline (srcset/WebP) beyond what FR-CP-05 needs. +- Operations phase. *Source: Q19 = B* + +--- + +## Functional Requirements + +### FR-CP-01 Intro (page head) +- Eyebrow **"Neem contact op"**, the page's only h1 **"Contact"** and an intro sentence, via the existing `PageIntro`. +- Intro (proposal, to confirm at review): **"Wil je een fotoshoot boeken of meer informatie ontvangen? Stuur me een berichtje, ik reageer binnen 1-2 werkdagen."** The design's "via onderstaand formulier" is dropped, because while the form is gated the visitor reaches Andrea via the mail button or the contact card. The reply time comes from the shared value in FR-CP-07. + +### FR-CP-02 Contact form +- The same form as on the homepage: **Naam**, **E-mail**, **"In welke shoot heb je interesse?"** (the shown packages, then "Overig") and **"Stel hier je vraag"**; same validation, honeypot, time check, focus handling, sent and failed states, and payload `{ naam, email, shoot, bericht }`. *Source: Q1 = A* +- Submit label stays **"(Aan)vraag versturen"**. *Source: Q10 = A* +- Behind the same "Binnenkort" gate as on the homepage, controlled by the same switch (`siteContent.contactForm.enabled`), so both forms go live together. *Source: Q4 = A* +- On this page the form loads with the page (it is above the fold); on the homepage it keeps loading lazily as today. +- Field ids are unique per page (`idPrefix`), so both forms can coexist in the code without clashes. +- The form section has a heading visible only to assistive technology: **"Stuur me een bericht"** (h2). *Source: clarification on Q7* + +### FR-CP-03 Preselect a shoot via the URL +- `/contact?pakket=` preselects that shoot in the form, with exactly the homepage rules: case and surrounding spaces ignored, unknown or non-text values ignored, the value is never shown on the page. Known ids today: `zwangerschap`, `newborn`, `gezin`. *Source: Q3 = A* +- The chosen package also goes into the mail subject of the gate's mail button and the failure message ("Aanvraag fotoshoot: Newborn"), as on the homepage. +- After applying it, `?pakket=` is removed from the address bar without a new history entry. The page is a fresh page load, so focus stays at the start of the page (no focus move). +- This URL format is the contract for the soorten-fotoshoots-page feature ("Stuur een berichtje" links per shoot; shoots without a package link to plain `/contact`). + +### FR-CP-04 Contact card ("Direct contact") +- A card with a small visible heading **"Direct contact"** (h2, eyebrow style) and a list of contact channels, each an **icon plus link text**, no per-channel headings: *Source: Q6 = A, clarification on Q7* + - **E-mail**: the address as link text, `mailto:` with the default subject "Vraag via andreaslop.nl"; + - **Instagram** and **Facebook**: a readable name or handle as link text, opening the profile. +- Data from `siteContent` (same source as the footer): the e-mail address is only assembled in the browser and the item is left out if it is invalid; social items only for valid links (`visibleSocials`). If no channel is valid, the card is not rendered. +- Icons come from the icon set already used (`@iconify-icons/ant-design`, offline) and are decorative (hidden from assistive technology). Each row is fully clickable with a target of at least 44 px high. +- Built as a reusable component (working name `ContactDetails`), not tied to this page. + +### FR-CP-05 Layout and photo +- **Wide screens** (from the breakpoint where two columns fit; the design switches at 960 px): the form in the wider left column (about 3/5), on the right the contact photo (portrait crop 4:5) with the contact card overlapping its bottom edge, so photo and card read as one unit. *Source: clarification A = A (proposal 1a)* +- **Narrow screens**: intro → contact card → form. The large photo is not shown **and not downloaded**. Instead the card shows a **small round portrait** (a separate small face crop, a few kB) next to "Direct contact" and the name "Andrea Slop". *Source: clarification B = C* +- The large photo: the original from andreaslop.nl, resized once and compressed (as for Over mij), with a descriptive Dutch alt text for Andrea to review. The small portrait is decorative (the name next to it says who it is). *Source: Q9 = A* +- Scroll reveal as on the other pages (existing `Reveal`), respecting `prefers-reduced-motion`. + +### FR-CP-06 Privacy line +- Below the submit button of **both** forms (shared component): **"Lees in de privacyverklaring wat ik met je gegevens doe."**, with "privacyverklaring" linking to `/privacyverklaring` (`underline` link variant). *Source: Q11 = A* + +### FR-CP-07 Reply time in one place +- The reply time **"1-2 werkdagen"** is one content value (in `siteContent`), used by the intro of this page and by the form's thank-you message ("Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen."), so they never disagree. *Source: Q2 = A* + +### FR-CP-08 Shared contact form panel +- The wiring that the homepage `ContactSection` does today (gate, form, shoot options from the packages, preselect from `?pakket=`, mail subject) moves into one shared component (working name `ContactPanel`), used by the homepage section and this page. The homepage looks and behaves exactly as before, including lazy loading, the placeholder height, the URL clean-up and moving focus to its heading after a "Boek …" click. *Source: Q5 = A* + +### FR-CP-09 Links to the contact page +- On Over mij, "neem contact op" and "Boek je shoot" change from `/#contact` to **`/contact`**. The "Boek …" links on the homepage price cards keep going to the homepage form (`/?pakket=…#contact`). *Source: Q12 = A* + +### FR-CP-10 Content +- All page texts and images live as API-shaped static data in `web/src/content/` (a new content object with an interface in `content/types.ts`), passed into the components from the route, as for the other pages. + +### FR-CP-11 LAYOUT.md +- Update the "Contact" diagram to the approved structure (Intro; Contact form beside Photo with contact details), following [.ai/layout-conventions.md](../../../../../.ai/layout-conventions.md). + +--- + +## SEO Requirements + +### SEO-CP-01 Indexing +- `/contact` becomes **indexed** when this feature merges: `indexed: true` in `sitePages.ts` (no `robots noindex`, in `sitemap.xml`), and moved to the indexed paths in `web/lighthouserc.cjs` / `.desktop.cjs` (the sync test must pass). *Source: Q13 = A* + +### SEO-CP-02 Title and description +- Title: **"Contact – fotoshoot boeken in Huizen"** → "Contact – fotoshoot boeken in Huizen | Andrea Slop Fotografie" (61 characters; one over the ~60 guideline, accepted to keep "Contact" first). *Source: clarification C = A (supersedes Q14 = B)* +- Description: **"Neem contact op voor een newborn-, zwangerschaps- of gezinsshoot in Huizen, het Gooi en omgeving. Ik denk graag met je mee en reageer binnen 1-2 werkdagen."** (155 characters). The service area wording matches the one approved in soorten-fotoshoots-page. *Source: clarification D = A* + +### SEO-CP-03 Structured data +- A `ContactPage` JSON-LD on this page whose subject is the existing business (`about` / `mainEntity` referencing `businessId`). No e-mail address, as everywhere. Escaped through `jsonLdScript`. *Source: Q15 = A* +- Built on a new generic, pure helper **`webPage(type: WebPageType, path, extra)`** in `seo.ts` (`@context`, `@type`, `@id` = `url` = canonical URL, `name` and `description` from `sitePages`, `inLanguage: 'nl-NL'`, then `extra`), with `WebPageType = 'WebPage' | 'AboutPage' | 'ContactPage' | 'ImageGallery' | 'CollectionPage'`. +- `aboutPage()` is rebuilt on `webPage()` with **identical output** and an unchanged signature. +- `webPage()` (with the `aboutPage()` refactor and tests, nothing else) is delivered as a **separate first commit**, because portfolio-page and soorten-fotoshoots-page build on it (agreed with those sessions; hash to be sent to them). + +### SEO-CP-04 Preview image (Open Graph) +- A page-specific preview image: the contact photo cropped to **1200×630** in `web/public/`, set as the page's `ogImage` in `sitePages.ts` with its own alt text. *Source: Q16 = A* + +### SEO-CP-05 Semantic structure +- One h1; heading outline h1 "Contact" → h2 "Stuur me een bericht" (visually hidden) and h2 "Direct contact"; `section` landmarks with accessible names; descriptive link texts; images with width and height. + +--- + +## Non-Functional Requirements + +### NFR-CP-01 Accessibility (WCAG 2.1 AA as guideline) +- Heading outline as in SEO-CP-05, no skipped levels. +- Form: visible labels linked to the fields, errors linked and announced as today, focus to the first invalid field, the gate keeps keyboard and screen reader users out of the inactive form (`inert`) and offers the mail button. +- Contact card: a list with an accessible name; decorative icons hidden; link texts that make sense on their own; focus ring from the theme; targets ≥ 44×44 px. +- Text contrast ≥ 4.5:1 (`accent.deep` for eyebrow-styled text, `ink.soft` for running text); the card's border and shadow are not the only cue for its boundaries. +- Order in the DOM matches the visual order on every screen size (no CSS reordering that changes the reading order). +- `prefers-reduced-motion` respected; works at 200% zoom and 320 px wide without horizontal scrolling. +- Axe checks in component and route tests; Lighthouse accessibility 1.0 for `/contact` (mobile and desktop). + +### NFR-CP-02 Styling and reuse +- Reuse before building: `PageIntro`, `PageSection` (`flushTop`), `FramedImage` / `DeferredImage` where they fit, `Reveal`, `Eyebrow`, `ContactForm`, `ContactFormGate`, `Link` (`underline`), the `linkButton` recipe, theme tokens and text styles. +- New shared pieces (`ContactPanel`, `ContactDetails`, the privacy line, `webPage()`) are generic and live in `components/` or `seo.ts`, not inside the route. Styling that another page may need goes into tokens, text styles or recipes, not inline per page. +- No hard-coded colours, CSS files or Tailwind; Chakra primitives where they fit; Prettier style; code comments in English in new code; visitor-facing texts in Dutch. +- Coordination with parallel features: only this feature's own entries in `sitePages.ts`, `lighthouserc*.cjs` and `active-features.md`; `PageIntro` not changed without notifying the other sessions; components claimed by portfolio-page (PortfolioGrid, Lightbox, InstagramGrid) and soorten-fotoshoots-page (shootTypes, CallToAction, MediaText `reverse`) are not touched. + +### NFR-CP-03 Testing +- **Example-based**: page structure (heading outline, landmarks, the card's channels and their targets, the privacy link), layout per breakpoint where testable, `?pakket=` preselect and URL clean-up on this page, the homepage contact section unchanged in output and behaviour after the `ContactPanel` extraction, the Over mij link targets, head tags (title, description, no `noindex`, canonical, `og:image`), axe checks. +- **Property-based** (fast-check, existing arbitraries): `webPage()` invariants (`@id` = `url` = canonical URL of the path, `@type` preserved, `extra` merged, never an e-mail address), `aboutPage()` output equal to the previous implementation for generated content, and any new pure helper (e.g. deriving the channel label from a social link). *Source: PBT = A (full)* +- `pnpm check` (lint, format, tests incl. coverage thresholds, build, audits, Lighthouse) passes. + +### NFR-CP-04 Security (Security Baseline extension enabled) +- No new third parties: no external scripts, fonts, embeds or endpoints; CSP unchanged. +- No e-mail address in markup at build time, bundle, content or structured data (assembled in the browser). +- `?pakket=` is validated against the known package ids and never reflected; form input is validated client-side as today (server-side validation belongs to the API feature). +- Structured data through `jsonLdScript`; no new runtime dependencies; image processing is a one-off local step. + +### NFR-CP-05 Performance +- On wide screens the contact photo is likely the largest contentful paint and must not be deferred; on narrow screens it must not be downloaded at all (only the small portrait). How this is done (e.g. `` with a media query, or rendering by breakpoint) is decided in design. +- Lighthouse performance for `/contact` ≥ 0.9 on mobile and desktop, including the form loading with the page. +- No layout shift from images or the form (intrinsic sizes, reserved space). + +### NFR-CP-06 Content for the future API +- The page content is plain data (strings, `ContentImage`, link targets) so the API can deliver it 1-to-1; the reply time is one value. + +--- + +## Extension Compliance — Requirements Level + +### Security Baseline +| Rule | Status | Rationale | +|---|---|---| +| SECURITY-01 Encryption | N/A | No data stores; nothing is sent while the form is gated | +| SECURITY-02 Access logging | N/A | No intermediaries added; hosting unchanged | +| SECURITY-03 Application logging | N/A | No server-side component; client errors already go to Sentry | +| SECURITY-04 HTTP security headers | Compliant | Existing header set unchanged; no CSP loosening (NFR-CP-04) | +| SECURITY-05 Input validation | Compliant | Existing client-side form validation and length limits; `?pakket=` checked against an allow-list and never reflected (FR-CP-03); server-side validation is part of the API feature | +| SECURITY-06 Least privilege | N/A | No IAM | +| SECURITY-07 Network configuration | N/A | No network infrastructure | +| SECURITY-08 Access control | N/A | Public content | +| SECURITY-09 Hardening | Compliant | No debug output; no new configuration; submit errors show a generic message only | +| SECURITY-10 Supply chain | Compliant | No new dependencies | +| SECURITY-11 Secure design | Compliant | E-mail kept out of the page source; honeypot and time check kept; structured data escaped | +| SECURITY-12 Authentication | N/A | No authentication | +| SECURITY-13 Integrity | Compliant | No external CDN resources; all assets self-hosted | +| SECURITY-14 Alerting | N/A | No server-side component; existing monitoring unchanged | +| SECURITY-15 Exception handling | Compliant | Failed submit falls back to a generic message with the mail address; global error page unchanged | + +### Property-Based Testing +| Rule | Status | Rationale | +|---|---|---| +| PBT-01 Property identification | Planned | Properties of `webPage()`, `aboutPage()` and new helpers identified in design | +| PBT-02 Round-trip | Planned | Structured data through `jsonLdScript` parses back to the same object (extend if not covered) | +| PBT-03 Invariants | Planned | `@id` = `url` = canonical; no e-mail in structured data; card shows only valid channels | +| PBT-04 Idempotency | Planned | Applying the same `?pakket=` twice gives the same form state (if a new pure function is introduced) | +| PBT-05 Oracle | Planned | New `aboutPage()` equals the previous implementation for generated content | +| PBT-06 Stateful | Compliant | `contactFormReducer` is already covered; unchanged | +| PBT-07 Generators | Planned | Reuse/extend `src/test/arbitraries.ts` | +| PBT-08 Shrinking/reproducibility | Compliant | Existing seed logging (`config/testSeed.ts`) | +| PBT-09 Framework | Compliant | fast-check already configured | +| PBT-10 Complementary testing | Planned | Example-based tests for the page and components alongside PBT | + +--- + +## Summary of Key Decisions +| # | Decision | +|---|---| +| Q1 | Same form fields as the homepage (shoot select), one payload | +| Q2 | Reply time "1-2 werkdagen", one content value for intro and thank-you | +| Q3 | Preselect via `/contact?pakket=` (contract for soorten-fotoshoots-page) | +| Q4 | Same "Binnenkort" gate and switch as the homepage | +| Q5 | Shared `ContactPanel` for the homepage and this page | +| Q6 | Contact card with e-mail, Instagram and Facebook from `siteContent` | +| Q7 / A | Icons instead of per-channel headings; layout proposal 1a (form left, photo with overlapping card right) | +| Q8 / B | Phones: card above the form, no large photo, small round portrait in the card | +| Q9 | Original live photo, resized once, descriptive alt text | +| Q10 | Submit label "(Aan)vraag versturen" | +| Q11 | Privacy line with link under both forms | +| Q12 | Over mij links → `/contact`; homepage "Boek" links unchanged | +| Q13 | Indexed on merge | +| C / D | Title "Contact – fotoshoot boeken in Huizen"; description with "Huizen, het Gooi en omgeving" | +| Q15 | `ContactPage` JSON-LD via a generic `webPage()` helper, delivered as a separate first commit | +| Q16 | Own 1200×630 preview image | +| Ext. | Security Baseline: Yes · PBT: Yes (full) · Operations: No | diff --git a/aidlc-docs/features/contact-page/inception/reverse-engineering/contact-page-delta.md b/aidlc-docs/features/contact-page/inception/reverse-engineering/contact-page-delta.md new file mode 100644 index 0000000..33a13bb --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/reverse-engineering/contact-page-delta.md @@ -0,0 +1,46 @@ +# Reverse Engineering Delta — contact-page + +**Date**: 2026-10-24T19:55:00Z +**Base**: `aidlc-docs/_shared/reverse-engineering/` (content current up to ae769cb on feature/over-mij-page; the timestamp file still names 99d4610, but code-structure, component-inventory, architecture and api-documentation already describe the over-mij shared blocks) +**Why a delta instead of a shared refresh**: three features (portfolio-page, soorten-fotoshoots-page, contact-page) are stacked on the unmerged over-mij-page branch. By agreement each feature only records what concerns its own area, so the shared artifacts do not become a merge hotspot. Shared change made: one factual correction in `api-documentation.md` (contact payload). + +## Current state of `/contact` +- `web/src/routes/contact.tsx` — placeholder: `PageIntro` ("Neem contact op" / "Contact" / "Deze pagina is nog in de maak"), `pageHead('/contact')` +- `web/src/sitePages.ts` — `/contact`: title "Contact", description present, `indexed: false` +- `web/lighthouserc.cjs` — `/contact` in `noindexPaths` (guarded by a test against sitePages) + +## Design reference (`design/andreaslop-static/contact.html`) + +```mermaid +graph TD + Head["page-head: eyebrow 'Neem contact op', h1 'Contact', intro (reply within 2-3 werkdagen)"] + Layout["section--flush-top: contact-layout (two columns)"] + Media["contact-layout__media: photo contact.jpg + contact-details (E-mail, Instagram, Facebook as h3 + link)"] + Form["form: naam, e-mail, onderwerp (text), bericht, status, 'Verzenden'"] + Head --> Layout + Layout --> Media + Layout --> Form + classDef head fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; + classDef block fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + classDef part fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + class Head head; + class Layout block; + class Media,Form part; +``` + +Text alternative: the design page is a page head followed by one flush-top section with two columns: a photo with contact details on one side and the contact form on the other. + +## Reusable code that already exists +- **Page structure**: `PageIntro` (eyebrow, h1, intro), `PageSection` (`spacing="flushTop"`, `aria-labelledby`), `MediaText`/`FramedImage` (photo next to a column), `Eyebrow`, `SectionHeading`, `Reveal`, `DeferredImage` +- **Form**: `ContactForm` (`idPrefix` for multiple pages; fields naam, e-mail, shoot select, bericht; honeypot + time check; focus handling; sent/failed states), `ContactFormGate` (inert + "Binnenkort" notice with mailto while `siteContent.contactForm.enabled` is false), lazy-loading and placeholder height in `home/ContactSection` +- **Logic (pure, PBT-tested)**: `contactFormReducer`, `validateContact`/`validateField`, `isLikelySpam`, `toContactPayload`, `shootOptions`, `mailSubject`/`mailtoLink`, `emailAddress` (assembled in the browser, never in the bundle), `visibleSocials` +- **Content**: `siteContent.email`, `siteContent.socials`, `siteContent.contactForm.enabled`; `packages` (for the shoot options) +- **SEO**: `pageHead`, `structuredDataScript`, `jsonLdScript`, `aboutPage`/`person`/`professionalService` with stable `@id`s (`businessId`); no `ContactPage` helper yet + +## Differences between design and code to resolve in Requirements +- Design form has a free-text **Onderwerp** field; the code (homepage) uses a **shoot select** (`shoot`) and the payload `{ naam, email, shoot, bericht }` +- Design intro says reply within **2-3 werkdagen**; `ContactForm`'s thank-you says **1-2 werkdagen** +- Design submit label "Verzenden"; code "(Aan)vraag versturen" +- Design shows contact details (e-mail, Instagram, Facebook) under the photo; no such component exists (Footer and Hero render socials in their own way) +- `contact.jpg` from the design is not yet in `web/src/assets` +- Form stays gated (`contactForm.enabled: false`) until the API exists; the page must work with the gate (mailto fallback)