diff --git a/LAYOUT.md b/LAYOUT.md index df65261..dbb3079 100644 --- a/LAYOUT.md +++ b/LAYOUT.md @@ -92,14 +92,11 @@ block-beta columns 2 A["Intro"]:2 - B["Photo"] - C["Contact form"] - - D["Contact details"]:2 + B["Contact form"] + C["Photo + contact details"] style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px - style B fill:#f4a261,stroke:#b77a49,color:#fff,font-size:16px,stroke-width:2px,height:125px - style C fill:#2a9d8f,stroke:#20766b,color:#fff,font-size:16px,stroke-width:2px,height:125px,width:192px - style D fill:#264653,stroke:#1d353e,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px - + style B fill:#f4a261,stroke:#b77a49,color:#fff,font-size:16px,stroke-width:2px,height:125px,width:192px + style C fill:#2a9d8f,stroke:#20766b,color:#fff,font-size:16px,stroke-width:2px,height:125px + ``` \ No newline at end of file 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..cf0c422 --- /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 - Build and Test complete; PR to master +- **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 +- [x] Functional Design - EXECUTE (units 2, 3) / SKIP (unit 1) — Unit 2 ✅, Unit 3 ✅ +- [x] NFR Requirements - SKIP +- [x] NFR Design - SKIP +- [x] Infrastructure Design - SKIP +- [x] Code Generation - EXECUTE (per unit) — Unit 1 webPage helper ✅ (now 3c7d00e on master), Unit 2 Shared contact blocks ✅, Unit 3 Contact page ✅ (deploy to test for review) +- [x] 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..cd4be2a --- /dev/null +++ b/aidlc-docs/features/contact-page/audit.md @@ -0,0 +1,862 @@ +# 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) + +--- + +## Commit, Push and Hand-over of Unit 1 + +**Timestamp**: 2026-10-25T09:40:00Z + +**User Input**: (none — continuation of "Ga verder") + +**AI Response**: "Committed 790495d (seo.ts + seo.test.ts) and 9127eba (docs), pushed feature/contact-page to origin (new branch). Sent hash 790495d to andreaslopfotografie-3f and Portfolio-pagina (Portfolio will cherry-pick it at its unit 3). active-features.md: contact-page → 🟢 Construction." + +**Context**: CONSTRUCTION - Code Generation Unit 1 (complete) + +--- + +## Functional Design — Unit 2 Shared contact blocks — Plan and Questions + +**Timestamp**: 2026-10-25T09:45:00Z + +**User Input**: (none — stage started) + +**AI Response**: "Created construction/plans/shared-contact-blocks-functional-design-plan.md and shared-contact-blocks-fd-questions.md (4 questions: channel order, Instagram/Facebook labels, privacy line while gated, hover/focus style). Decided without question: new-tab behaviour as in footer/hero/Instagram grid, mailto default subject, thank-you text with replyTime, homepage behaviour preserved." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers) + +--- + +## Coordination — Test Environment Claims + +**Timestamp**: 2026-10-25T09:55:00Z + +**User Input**: (none — cross-session messages from andreaslopfotografie-3f: cherry-picked 790495d without conflicts; claims 4173 for its unit 2 check; proposes 'claim test' / 'test free' for the single test environment before a deploy_test dispatch) + +**AI Response**: "Verified in the CI workflow that a branch push does not deploy (only workflow_dispatch with deploy_test or a push to master). Replied: nothing of contact-page on test, agreed; added that a merge to master also deploys to test, so check test claims before merging. Relayed the protocol to Portfolio-pagina." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers) + +--- + +## Coordination — CPU Slowdown During Soorten Lighthouse + +**Timestamp**: 2026-10-25T09:11:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: homepage mobile Lighthouse 0.69 because the machine was ~half as fast around 09:07 (benchmarkIndex 1909 vs ~4200); rerunning Lighthouse, asks for no heavy work) + +**AI Response**: "Checked timestamps: contact-page's last heavy work was the build at 08:25:12 (vitest 08:20–08:25), commits at 08:50, nothing heavy since. Replied with these times; suggested Portfolio or a non-session cause (antivirus/updates/the PC runner); noted the unexplained first vitest failure at 08:19 may have had the same cause. No heavy work until '4173 free'." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers) + +--- + +## Coordination — 4173 Free and Lighthouse Finding + +**Timestamp**: 2026-10-25T09:30:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: 4173 free for now; finding: Lighthouse mobile (lantern simulation) puts content pages with an image LCP at LCP ≈ 3.22 s ≈ score 0.895, right at the 0.9 threshold (over-mij and soorten); image size does not matter, the main bundle + route chunk do) + +**AI Response**: "Recorded as a risk for unit 3: /contact loads the form eagerly (larger route chunk), so NFR-CP-05 (≥ 0.9 mobile) is at risk; to be addressed in Functional Design of unit 3 (e.g. what loads with the page vs. after it)." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers) + +--- + +## Coordination — Lighthouse Budgets Change (Soorten Unit 2) + +**Timestamp**: 2026-10-25T09:40:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3f: claims 4173 for its final unit 2 check; its user decided a lighthouserc change: photoPagePaths ['/over-mij', '/soorten-fotoshoots'] with mobile performance 0.85 (back to 0.9 with prerendering, NFR-P-01); assertMatrix home 0.8 → photo pages 0.85 → other indexed 0.9 → noindex → 404; desktop config sets every entry to 0.9) + +**AI Response**: "Noted for unit 3: on phones /contact has no large photo (portrait card + form), so its LCP is likely text; whether /contact goes into photoPagePaths (0.85) or stays under the other indexed pages (0.9, as NFR-CP-05 requires today) is a decision for the user in Functional Design of unit 3. On rebase, keep soorten's lighthouserc structure and add /contact to the right list. No heavy work until '4173 free'." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers) + +--- + +## Session Pause until 12:59 + +**Timestamp**: 2026-10-25T11:58:00Z + +**User Input**: "mijn sessielimiet zit er bijna op, die wordt over een uur gereset. kan je een timer zetten dat je over een uur weer verder gaat waar je mee bezig was? Dit heb ik ook al tegen de sessie gezegd van Soorten fotoshoots. Die pakt alles om 12:58 weer op. Hij kon jou net niet bereiken dus zodra je start mag je ook een melding naar die sessie doen." + +**AI Response**: "Scheduled a one-shot resume at 12:59 local (job 6d6b192c, session-only): notify the Soorten fotoshoots session (now 'andreaslopfotografie-3e'), then continue Functional Design unit 2 (answers in shared-contact-blocks-fd-questions.md). Also received from Soorten: 4173 free; agreements recorded in memory project_parallel_feature_sessions.md." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (paused, awaiting answers) + +--- + +## Session Resume (scheduled, 12:59) + +**Timestamp**: 2026-10-25T12:59:00Z + +**User Input**: (scheduled resume prompt) "Hervat de contact-page AIDLC-sessie (worktree K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-contact, branch feature/contact-page). Stap 1: stuur via SendMessage aan de Soorten fotoshoots-sessie [...] een melding dat de contact-page sessie weer actief is [...]. Stap 2: lees aidlc-state.md en het einde van audit.md. [...] Als alle [Answer]-tags zijn ingevuld: verwerk ze [...]; anders: meld de gebruiker [...] dat de vragen nog openstaan. Log de hervatting in audit.md." + +**AI Response**: "This session is now 'andreaslopfotografie-fe'. Notified andreaslopfotografie-3e (Soorten) and Portfolio-pagina of the new address and asked Soorten for changes since ~12:00 affecting contact. State: CONSTRUCTION - Functional Design unit 2; the 4 [Answer] tags in shared-contact-blocks-fd-questions.md are still empty → told the user the questions are still open." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers) + +--- + +## Coordination — Soorten Status after Resume + +**Timestamp**: 2026-10-25T13:02:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3e: 4173 free; will push and claim test for a deploy_test (Andrea's review) — no merges to master until 'test free'; its unit 2 commit will touch lighthouserc(.desktop).cjs, sitePages.ts (own entry), sitemap.test.ts, seo.ts (absoluteUrl, shootServices on top of 790495d); no changes to siteContent/types beyond serviceArea, PageIntro or aboutPage; ssh-agent restarted, user re-adding the key) + +**AI Response**: "Noted. Expect rebase overlap in sitemap.test.ts and lighthouserc for unit 3 (/contact entry); no merges planned before 'test free'." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers) + +--- + +## Coordination — Soorten PR #8 + +**Timestamp**: 2026-10-25T14:00:00Z + +**User Input**: (none — cross-session messages from andreaslopfotografie-3e: claimed test for a deploy_test (Andrea's text review), then 4173 for a final check; now 4173 free and test free; texts approved; PR #8 feature/soorten-fotoshoots-page → master updated with d2c1d2c (MediaText optional mediaSize and detailImage, defaults unchanged) and d12665c (docs); merging PR #8 also deploys to test, announced beforehand) + +**AI Response**: "Noted. After PR #8 merges, rebase feature/contact-page onto master (expected overlaps: seo.ts, sitePages.ts, lighthouserc*.cjs, sitemap.test.ts, content/types.ts, siteContent.ts, arbitraries.ts)." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers) + +--- + +## Coordination — PR #8 Auto-merge Announced + +**Timestamp**: 2026-10-25T14:10:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3e: its user enables auto-merge of PR #8; the master push deploys to test; asks whether contact has an open test claim; lists what lands on master) + +**AI Response**: "Replied: no test claim or review open for contact; send the merge commit for the rebase. Noted that the cherry-picked webPage commit lands on master with a different hash; the rebase should skip contact's identical 790495d — to verify." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers) + +--- + +## Functional Design — Unit 2 — Answers and Artifacts + +**Timestamp**: 2026-10-25T14:30:00Z + +**User Input**: "Ik heb de vragen beantwoord" — answers in shared-contact-blocks-fd-questions.md: Q1 A, Q2 A, Q3 B, Q4 A + +**AI Response**: "No ambiguities. Q3 = B handled with a shared PrivacyNote used by ContactForm and the gate notice. Generated construction/shared-contact-blocks/functional-design/: domain-entities.md (SocialLink.label, contactForm.replyTime, socials reordered Instagram first, ContactChannel), business-rules.md (BR-CD-01..08, BR-PR-01..04, BR-RT-01..02, BR-CPN-01..07 with decision flowchart), business-logic-model.md (new pure contactChannels() in lib/, panel flow, 6 PBT properties), frontend-components.md (ContactPanel, ContactSection, ContactForm, ContactFormGate, PrivacyNote, ContactDetails). Visible changes on existing pages: privacy line in the homepage contact section, Instagram before Facebook in the footer." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting approval) + +--- + +## Functional Design — Unit 2 — Approval + +**Timestamp**: 2026-10-25T14:40:00Z + +**User Input**: "ga verder" + +**AI Response**: "Functional Design unit 2 approved. Started Code Generation unit 2 Part 1 (planning); checked whether PR #8 has reached master to rebase first." + +**Context**: CONSTRUCTION - Functional Design Unit 2 (approved) → Code Generation Unit 2 + +--- + +## Code Generation — Unit 2 — Plan + +**Timestamp**: 2026-10-25T14:50:00Z + +**User Input**: (none — Part 1 planning) + +**AI Response**: "PR #8 not yet on origin/master. Created construction/plans/shared-contact-blocks-code-generation-plan.md (13 steps: sync with master, content model, contactChannels + tests, PrivacyNote, ContactForm, ContactFormGate, ContactPanel, ContactSection, ContactDetails, verification incl. Lighthouse with 4173 claim, summary, commit). Presented for approval." + +**Context**: CONSTRUCTION - Code Generation Unit 2 (plan awaiting approval) + +--- + +## Rebase onto Master after PR #8 (Soorten fotoshoots) + +**Timestamp**: 2026-10-25T15:05:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3e: PR #8 merged as a58bc1c; 790495d is on master as 3c7d00e; expected small conflicts; soorten session finished and cleaned up) + +**AI Response**: "Per the user's standing instruction to update after a merge (and step 1 of the unit 2 plan): stashed docs by name, rebased onto origin/master a58bc1c. 790495d conflicted instead of being skipped: verified its +/- lines are identical to 3c7d00e (the conflict comes from soorten's later seo.ts/seo.test.ts edits around the same lines), so skipped it (`git rebase --skip`). Resolved active-features.md keeping both rows. Restored the stash (dropped by name). Full test suite 325/325 (seed 726668228), tsc clean. Remote branch now needs a force-with-lease push (at the unit 2 commit). Told Portfolio-pagina to rebase on master instead of cherry-picking 790495d." + +**Context**: CONSTRUCTION - Code Generation Unit 2 (plan awaiting approval; step 1 done) + +--- + +## Coordination — Documentation Fix Request (D6) + +**Timestamp**: 2026-10-25T15:08:00Z + +**User Input**: (none — cross-session message from andreaslopfotografie-3e on behalf of its user: include in the contact PR an update of deployment plan D6 (aidlc-docs/features/frontend-shell/operations/deployment/deployment-plan.md, and deployment-instructions.md if repeated) — lighthouse is a required check on master since 2026-10-19; then remove the first bullet of memory project_open_doc_followups.md) + +**AI Response**: "The owner's memory note project_open_doc_followups.md says to include this fix in the next change on the site, so added it to the unit 2 plan as step 12b (separate docs commit; remove the memory bullet afterwards)." + +**Context**: CONSTRUCTION - Code Generation Unit 2 (plan awaiting approval) + +--- + +## Code Generation — Unit 2 — Plan Approval + +**Timestamp**: 2026-10-25T15:20:00Z + +**User Input**: "Approve plan" + +**AI Response**: "Plan approved (incl. step 12b, the D6 documentation follow-up). Started Part 2 (generation) from step 2." + +**Context**: CONSTRUCTION - Code Generation Unit 2 (generation) + +--- + +## Code Generation — Unit 2 — Generated and Verified + +**Timestamp**: 2026-10-25T16:40:00Z + +**User Input**: (none — generation; cross-session: claimed 4173 with Portfolio-pagina for the check, released after verifying no listener remained) + +**AI Response**: "Steps 2–12b done: content model (label, replyTime, Instagram first), contactChannels + 10 tests, PrivacyNote, ContactForm/ContactFormGate, ContactPanel (form always a lazy chunk; eager starts loading at once with the measured placeholder — deviation from BR-CPN-05 to keep the homepage split and the contact route small), ContactSection on ContactPanel (homepage tests unchanged and green), ContactDetails. Footer and hero tests adjusted (they assumed Facebook first; hero socials also follow the new order). Placeholder re-measured in the production build: 649/546.6 px → 649/547 px. pnpm test 354/354, lint, format, build green; Lighthouse mobile + desktop passed. D6 in frontend-shell deployment-plan updated (lighthouse is a required check since 2026-10-19). Code summary written. Awaiting approval; commit after." + +**Context**: CONSTRUCTION - Code Generation Unit 2 (awaiting approval) + +--- + +## Code Generation — Unit 2 — Approval + +**Timestamp**: 2026-10-25T16:50:00Z + +**User Input**: "Akkoord en ga verder" + +**AI Response**: "Unit 2 approved. Committing code, unit docs and the D6 documentation fix separately; pushing with --force-with-lease (branch rebased); removing the D6 bullet from the memory note; notifying Portfolio; starting unit 3 Functional Design." + +**Context**: CONSTRUCTION - Code Generation Unit 2 (approved) + +--- + +## Commit and Push of Unit 2; Functional Design Unit 3 Started + +**Timestamp**: 2026-10-25T17:30:00Z + +**User Input**: (none — continuation of "Akkoord en ga verder") + +**AI Response**: "Committed 26a8bd9 (code), 9bb341d (D6 fix in frontend-shell deployment-plan), ad85e3f (docs); pushed with --force-with-lease (9127eba...ad85e3f). Memory project_open_doc_followups: D6 bullet now says fixed on feature/contact-page (9bb341d), drop after merge (fix is not on master yet); index line updated. Informed Portfolio-pagina. Created construction/plans/contact-page-functional-design-plan.md and contact-page-fd-questions.md (decided: layout 1a, media source for the photo, ?pakket= clean-up without focus move, intro with replyTime, headings, photos, SEO, Over mij links, LAYOUT.md; questions: two-column breakpoint, mobile Lighthouse budget)." + +**Context**: CONSTRUCTION - Functional Design Unit 3 (awaiting answers) + +--- + +## Functional Design — Unit 3 — Answers (in chat) + +**Timestamp**: 2026-10-25T17:40:00Z + +**User Input**: "Kan je de vragen hier sturen" — then answered via the chat question dialog: Q1 "Vanaf 1024px (Recommended)", Q2 "0,9 – gewone drempel (Recommended)" + +**AI Response**: "Presented the two questions in chat at the user's request; recorded the answers as A and A in contact-page-fd-questions.md. Generating the functional design artifacts." + +**Context**: CONSTRUCTION - Functional Design Unit 3 + +--- + +## Functional Design — Unit 3 — Artifacts + +**Timestamp**: 2026-10-25T17:55:00Z + +**User Input**: (none — generation after the answers) + +**AI Response**: "Generated construction/contact-page/functional-design/: domain-entities.md (ContactPageContent with {reactietermijn} placeholder, images, ContactPage, registry/test lists), business-rules.md (BR-CP-01..20: two columns from 1024 px, with a media source so phones never fetch the photo — data: already allowed by the CSP, LCP priority on wide screens, ?pakket= clean-up without focus, headings/ids, SEO, Lighthouse 0.9 with report-back rule, Over mij links, LAYOUT.md), business-logic-model.md (route flow, contactPage(), withReplyTime() with 5 PBT properties), frontend-components.md (route, ContactAside, responsive table, accessibility). Awaiting approval." + +**Context**: CONSTRUCTION - Functional Design Unit 3 (awaiting approval) + +--- + +## Functional Design — Unit 3 — Approval + +**Timestamp**: 2026-10-25T18:05:00Z + +**User Input**: "Ga verder" + +**AI Response**: "Functional Design unit 3 approved. Started Code Generation unit 3 Part 1 (planning)." + +**Context**: CONSTRUCTION - Functional Design Unit 3 (approved) → Code Generation Unit 3 + +--- + +## Code Generation — Unit 3 — Plan + +**Timestamp**: 2026-10-25T18:20:00Z + +**User Input**: (none — Part 1 planning) + +**AI Response**: "Found the original of the live contact photo (1600×1067; the live page and design use a 632×658 crop, too small for the desktop column); verified it differs from the Over mij preview image. Created construction/plans/contact-page-code-generation-plan.md (11 steps: images with contact sheet for approval, content, withReplyTime, SEO/registry/Lighthouse/sitemap, ContactAside, route, Over mij links, LAYOUT.md, verification incl. a network check that phones do not fetch the photo and Lighthouse with the 0.9 report-back rule, summary, commit + optional test deploy)." + +**Context**: CONSTRUCTION - Code Generation Unit 3 (plan awaiting approval) + +--- + +## Code Generation — Unit 3 — Plan Approval + +**Timestamp**: 2026-10-25T18:30:00Z + +**User Input**: "approve plan" + +**AI Response**: "Plan approved. Started Part 2 with step 1 (image crops for approval)." + +**Context**: CONSTRUCTION - Code Generation Unit 3 (generation) + +--- + +## Code Generation — Unit 3 — Step 1 Images + +**Timestamp**: 2026-10-25T18:55:00Z + +**User Input**: "waar kan ik die controleren?" — then: "desktop en preview zijn goed. het portret rondje is misschien te ver ingezoomd. kan die wat meer uitgezomd? Sanp je wta i bedoel?" — then chose "B: verder uitgezoomd" + +**AI Response**: "Cropped the original live photo (1600×1067) with a scratchpad PowerShell/System.Drawing script: contact.jpg 840×1050 (4:5, 80 KB), og-contact.jpg 1200×630 (60 KB), portrait first 320 px square (too tight), redone as variants A (440 px) and B (560 px) → B, 144×144 (5 KB). Sent the contact sheet and the portrait comparison to the user (portrait-variants.png kept in construction/contact-page/code/). Copied the approved crops to web/src/assets/contact/ and web/public/. Alt texts as proposed (photo: 'Andrea Slop kijkt lachend over haar schouder, met haar camera in de hand, op een bospad'; preview: 'Andrea Slop met haar camera op een bospad'; portrait decorative), for Andrea to review." + +**Context**: CONSTRUCTION - Code Generation Unit 3 (step 1 done) + +--- + +## Code Generation — Unit 3 — Steps 2–8 and Verification Findings + +**Timestamp**: 2026-10-25T20:10:00Z + +**User Input**: (none — generation) + +**AI Response**: "Steps 2–8 done: ContactPageContent + contactContent, withReplyTime (+4 tests; tightened a generator after spotting that half placeholders around a real one could form a new one), contactPage() + 4 tests, sitePages /contact (indexed, title, description, og-contact), lighthouserc /contact indexed, sitemap test, ContactAside (fixed: chakra.img read width/height as CSS props → Chakra Image with htmlWidth/htmlHeight), route /contact with app tests (outline, cards, JSON-LD, ?pakket= preselect + clean-up without focus, unknown value dropped), Over mij links → /contact, LAYOUT.md Contact diagram. Mail icon switched to the filled variant to match the platform icons. pnpm test 367/367 (seed 1871355946), lint, format, build green. Browser check on the production build: no photo request up to 1023 px (LCP = intro text), one request with priority High from 1024 px (LCP = the photo). Screenshots at 390 and 1280 px match mockup 1a. Lighthouse mobile (port 4173 claimed and released): (1) /contact accessibility 0.96 — color-contrast of the gate's 'Stuur een e-mail' accent button: white on #7f8b76 = 3.58:1; root cause in the linkButton recipe (accent variant), site-wide; not caught before because Reveal keeps below-the-fold buttons at opacity 0 during Lighthouse and jsdom computes no colours; (2) /contact performance 0.88 then 0.90 (numberOfRuns 1), LCP ≈ 3.1–3.2 s: same client-rendering mechanism as the photo pages; (3) homepage 0.79 (threshold 0.8): measured 3× on the unit 2 build and 3× on the current build — identical (0.79–0.80, LCP 4.06 s), so pre-existing and borderline, not caused by unit 3. Stopped per BR-CP-17 to put the decisions to the user." + +**Context**: CONSTRUCTION - Code Generation Unit 3 (step 9, awaiting decisions) + +--- + +## Code Generation — Unit 3 — Decisions and Final Verification + +**Timestamp**: 2026-10-25T21:00:00Z + +**User Input**: Decisions via chat dialog: accent contrast = "Donkerder groen (Recommended)"; /contact mobile budget = "0,9 houden"; homepage 0.79–0.80 = "Apart oppakken (Recommended)" + +**AI Response**: "Accent button now on accent.deep with hover on new token accent.deeper (#475042); typegen run. Homepage budget recorded as open follow-up in memory project_open_doc_followups.md. Re-verified with 4173 claimed/released: 367/367 tests, lint, format, build green; Lighthouse accessibility now 1 everywhere; desktop all pass (/contact 0.99/1/1/1); mobile performance still fails on '/' (0.78, pre-existing) and '/contact' (0.88; kept at 0.9 by the owner) — report-only in CI per D6. Code summary written; awaiting approval." + +**Context**: CONSTRUCTION - Code Generation Unit 3 (awaiting approval) + +--- + +## Code Generation — Unit 3 — Soorten Links and Approval + +**Timestamp**: 2026-10-25T21:20:00Z + +**User Input**: "Die punten over de metingen zijn prima. Dat kan verder zo blijven. Over get \"Stuur een berichtje\"-linkjes zouden we jusit nu oppakken toch nu het contactformulier er is. Of moeten we wahcten totdat het formulier actief wordt?" — then: "ja pak nu op, dan kan je committen, pushen en deployen naar test" + +**AI Response**: "Measurements accepted as they are. Advised doing the links now (the contact page already handles the gate with mailto and the package in the subject; the form will preselect automatically once enabled). Changed shootContactLink (to /contact, ?pakket= only for a shown package) and the Soorten 'Boek je shoot' booking target to /contact; updated shootLinks, ShootBlock and app tests; requirements FR-CP-09 extended. 367/367 tests, lint, format, build green. Unit 3 approved; committing, pushing and deploying to test (after 'claim test')." + +**Context**: CONSTRUCTION - Code Generation Unit 3 (approved) + +--- + +## Commit, Push and Deploy to Test (Unit 3) + +**Timestamp**: 2026-10-25T21:30:00Z + +**User Input**: (continuation of "ja pak nu op, dan kan je committen, pushen en deployen naar test") + +**AI Response**: "Committed e92b652 (code) and 9c2601d (docs), pushed feature/contact-page. Sent 'claim test' to Portfolio-pagina. Dispatched workflow continuous_integration.yaml on feature/contact-page with deploy_test=true (HTTP 204) → run 573; following it in the background." + +**Context**: CONSTRUCTION - Code Generation Unit 3 (deploying to test) + +--- + +## Deploy to Test — Run 573 Failed, Re-dispatched as 574 + +**Timestamp**: 2026-10-25T21:45:00Z + +**User Input**: (none — CI result) + +**AI Response**: "Run 573: job check on raspberry-pi-arm64 failed with exit code -1 right after `pnpm install --frozen-lockfile` had finished (cold pnpm store, 839 packages downloaded, chakra typegen done); no tests ran, deploy skipped. No changes to package.json/lockfile since master, where the same install passed (run 572). Exit code -1 from the runner means the process in the job container was terminated rather than a command failing; the exact cause on the Pi (e.g. memory) could not be verified from here. Re-dispatched deploy_test → run 574, following it; test stays claimed." + +**Context**: CONSTRUCTION - deploying unit 3 to test + +--- + +## Deploy to Test — Run 574 Failed (DNS on the Pi) + +**Timestamp**: 2026-10-25T21:55:00Z + +**User Input**: (none — CI result) + +**AI Response**: "Run 574: job check on raspberry-pi-arm64 failed before any step: the runner could not clone the standard actions — 'lookup github.com on 192.168.1.1:53: server misbehaving' (router DNS). Together with the slow downloads (14–33 KiB/s) and the terminated install in run 573 this points to a network/DNS problem on the Pi or router, not the code. Stopped retrying; reported to the user. Test claim kept until the user decides." + +**Context**: CONSTRUCTION - deploying unit 3 to test (blocked by runner network) + +--- + +## Deploy to Test — Retry after DNS Fix + +**Timestamp**: 2026-10-25T22:10:00Z + +**User Input**: "dns werkt weer" + +**AI Response**: "Verified: router 192.168.1.1 resolves github.com again. Re-dispatched deploy_test → run 575; following it." + +**Context**: CONSTRUCTION - deploying unit 3 to test + +--- + +## Deploy to Test — Run 575 Succeeded + +**Timestamp**: 2026-10-25T22:40:00Z + +**User Input**: (none — CI result) + +**AI Response**: "Run 575 on raspberry-pi-arm64: check, deploy-test and lighthouse all success. Contact page (9c2601d) is on test; awaiting the user's review. Test stays claimed." + +**Context**: CONSTRUCTION - unit 3 on test, awaiting review + +--- + +## Review on Test and Build and Test + +**Timestamp**: 2026-10-25T23:10:00Z + +**User Input**: "de versturen-knop van het formulier moet naar rechts. op home en op de contactpagina. Daarna mag je committen, pushen en PR maken. Zodra die PR gemerged is mag je opruimen en updaten en kan je de portfolio-sessie een update geven." + +**AI Response**: "ContactForm submit button alignSelf flex-end (homepage and contact page); the privacy line below it aligned to the end as well (visual check: left-aligned under a right-aligned button looked detached; the gate's line stays centred). Build and Test: 367/367 tests, lint, format, build, prod audit clean; 16 browser checks on the production build (4173 claimed and released). One real defect found: from a scrolled Soorten page on a phone, /contact opened mid-page (scrollY 652) because the ?pakket= clean-up navigation used resetScroll:false and replaced the incoming navigation before the router reset the scroll — fixed by keeping the default reset; BR-CP-12 corrected; rechecked. Wrote construction/build-and-test/ (build, unit, integration, performance instructions and summary). Next: commit, push, PR." + +**Context**: CONSTRUCTION - Build and Test (complete) + +--- diff --git a/aidlc-docs/features/contact-page/construction/build-and-test/build-and-test-summary.md b/aidlc-docs/features/contact-page/construction/build-and-test/build-and-test-summary.md new file mode 100644 index 0000000..ba5f4f1 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/build-and-test/build-and-test-summary.md @@ -0,0 +1,31 @@ +# Build and Test Summary — contact-page + +Tested on branch `feature/contact-page` (units 1–3 on master a58bc1c, plus the review changes), locally on Windows, 2026-10-25. + +## Build +- **Tool**: pnpm + Vite (`tsc && vite build`) +- **Status**: ✅ Success (0.8 s locally). CI: run 573 failed (runner process terminated after `pnpm install`) and 574 failed (router DNS) — both infrastructure; run 575 (`workflow_dispatch`, deploy_test, `9c2601d`): `check`, `deploy-test`, `lighthouse` ✅ +- **Main bundle**: 149.3 kB gzip (was 169.6 kB: Rolldown moved shared modules into a separate chunk; homepage performance measured identical, see performance) + +## Unit tests +- **Total**: 367 in 71 files. **Passed**: 367. **Failed**: 0. Coverage thresholds met; 92.7% of statements overall +- **Status**: ✅ Pass + +## Integration (browser, production build) +16 checks across the scenarios in `integration-test-instructions.md`, all ✅ after one fix: +- **Found in this stage**: on a phone, "Stuur een berichtje" on Soorten fotoshoots opened `/contact` at the previous scroll position (scrollY 652) instead of the top. Cause: the contact route removes `?pakket=` with a second navigation that used `resetScroll: false` (copied from the homepage, where it serves the `#contact` jump); it replaced the incoming navigation before the router had reset the scroll. Fix: keep the default scroll reset on that navigation (BR-CP-12 corrected). Rechecked at 1440 and 390 px: top of the page. +- Network check: no photo request below 1024 px, priority High from 1024 px. + +## Performance +See `performance-test-instructions.md`: desktop all ≥ 0.99; mobile `/contact` 0.88–0.90 (budget 0.9, kept by the owner) and `/` 0.78–0.80 (pre-existing, owner: separately). Accessibility 1.0 everywhere after the accent-button contrast fix. + +## Additional +- **Security**: `pnpm audit --prod --audit-level high` clean. No new dependencies, external resources or CSP changes (`data:` images were already allowed). No e-mail address in served HTML or JSON-LD. `?pakket=` validated against the package ids and never rendered (property-tested). +- **Contract / E2E suite**: N/A (static front end without an API); the browser checks cover the user flows. + +## Review changes after the test deploy +- Submit button of the contact form right-aligned (homepage and contact page), the privacy line below it aligned with it. + +## Overall +- **Build**: ✅ **Tests**: ✅ **Integration**: ✅ **Performance**: desktop ✅, mobile per the owner's decisions +- **Operations phase**: declined at Requirements Analysis. Next: PR to master (merging also deploys to test). diff --git a/aidlc-docs/features/contact-page/construction/build-and-test/build-instructions.md b/aidlc-docs/features/contact-page/construction/build-and-test/build-instructions.md new file mode 100644 index 0000000..6285460 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/build-and-test/build-instructions.md @@ -0,0 +1,23 @@ +# Build Instructions — contact-page + +This feature adds no dependencies, build steps or environment variables. + +## Prerequisites +- **Node.js** 24 and **pnpm** (version pinned in `web/package.json`) +- **Environment variables**: none for the build. `LIGHTHOUSE_PERFORMANCE=warn` only in CI. + +## Build steps +```bash +cd web +pnpm install # also runs `chakra typegen` (postinstall); needed for the new accent.deeper token +pnpm build # tsc && vite build +``` + +## Verify +- **Expected output**: `✓ built in …` and no TypeScript errors +- **Artifacts**: `web/dist/`. New in this feature: `dist/assets/contact-*.jpg` and `contact-portret-*.jpg` (hashed), `dist/og-contact.jpg` (stable URL for the preview image), the page chunk `contact-*.js` (4.6 kB) and the shared `ContactForm-*.js` chunk (15 kB), which the homepage and the contact page load on demand +- **Accepted warning**: Vite's chunk-size warning for the main bundle (known, NFR-P-01) + +## Troubleshooting +- **"Port 4173 is already in use"**: a leftover `vite preview` (on Windows, killing the shell does not stop its node process). Check with `Get-NetTCPConnection -LocalPort 4173`, and coordinate with "claim 4173" / "4173 free" with parallel feature sessions. +- **CI `check` ends with exit code -1 after `pnpm install`, or "lookup github.com … server misbehaving"**: a network/DNS problem on the Pi or the router (seen on 2026-10-25, runs 573 and 574), not the code. Check the router's DNS (`nslookup github.com 192.168.1.1`), then dispatch the run again. diff --git a/aidlc-docs/features/contact-page/construction/build-and-test/integration-test-instructions.md b/aidlc-docs/features/contact-page/construction/build-and-test/integration-test-instructions.md new file mode 100644 index 0000000..fcc194a --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/build-and-test/integration-test-instructions.md @@ -0,0 +1,14 @@ +# Integration Test Instructions — contact-page + +Browser checks on the production build (`pnpm build && pnpm preview`, port 4173), across pages and units. A scratchpad puppeteer script (`puppeteer-core` from Lighthouse CI's dependencies, local Chrome) ran them on 2026-10-25; they can be repeated by hand. + +| # | Scenario | Expected | +|---|---|---| +| 1 | Soorten fotoshoots → "Stuur een berichtje" at Newborn (1440 / 390 px) | lands on `/contact` at the top, `?pakket=` removed from the URL, Newborn preselected, gate mail subject "Aanvraag fotoshoot: Newborn" | +| 2 | Soorten fotoshoots → Loveshoot link, "Boek je shoot" | `/contact` | +| 3 | Over mij → "neem contact op", "Boek je shoot" | `/contact` | +| 4 | Homepage price card "Boek …" | stays on the homepage form (`/?pakket=…#contact`) | +| 5 | `/contact` at 320, 390, 768, 1024, 1440 px, scrolled to the end | no horizontal overflow, CLS < 0.1 | +| 6 | Keyboard on `/contact` (1440 px) | tab order: form (gate mail button) before the wide card | +| 7 | Served HTML and JSON-LD of `/contact` | no e-mail address; `ContactPage` present | +| 8 | Network: `/contact` at 390–1023 px vs 1024+ px | no request for `contact.jpg` below 1024 px; one request with priority High from 1024 px (LCP = the photo) | diff --git a/aidlc-docs/features/contact-page/construction/build-and-test/performance-test-instructions.md b/aidlc-docs/features/contact-page/construction/build-and-test/performance-test-instructions.md new file mode 100644 index 0000000..ff15ab9 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/build-and-test/performance-test-instructions.md @@ -0,0 +1,20 @@ +# Performance Test Instructions — contact-page + +```bash +cd web +pnpm build +pnpm lighthouse # mobile (lighthouserc.cjs), then desktop (lighthouserc.desktop.cjs) +``` + +Announce "claim 4173" to parallel feature sessions first and "4173 free" afterwards; avoid other heavy work on the machine while Lighthouse runs (it measures CPU). + +## Budgets (mobile performance) +| Page | Budget | Measured (2026-10-25) | +|---|---|---| +| `/` | 0.8 | 0.78–0.80 — pre-existing (identical on the unit 2 build, 3 runs each); owner: handle separately | +| `/contact` | 0.9 | 0.88 / 0.90 / 0.88 — owner chose to keep 0.9 | +| `/over-mij`, `/soorten-fotoshoots` | 0.85 | 0.85–0.88 | + +The contact page shares the cause of the photo pages: the page text appears only after the main bundle and the route chunk have run (client rendering), so LCP lands around 3.1–3.2 s in Lighthouse's simulation. Prerendering is the structural fix (NFR-P-01). In CI, performance is report-only (D6), so these do not block a merge; locally `pnpm check` fails on them. + +Desktop: every page ≥ 0.99; `/contact` 0.99 / 1 / 1 / 1. Accessibility, best practices and SEO (indexed pages) are 1.0 everywhere. diff --git a/aidlc-docs/features/contact-page/construction/build-and-test/unit-test-instructions.md b/aidlc-docs/features/contact-page/construction/build-and-test/unit-test-instructions.md new file mode 100644 index 0000000..247ea70 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/build-and-test/unit-test-instructions.md @@ -0,0 +1,11 @@ +# Unit Test Instructions — contact-page + +```bash +cd web +pnpm test # vitest run --coverage (unit, component, property-based, axe) +``` + +- **Expected**: 71 test files, 367 tests, 0 failures; coverage thresholds met (100% for `src/lib/**`, `seo.ts`, `sitemap.ts`) +- **Property-based tests** print their seed (`fast-check seed: …`); rerun a failure with `FC_SEED= pnpm test` +- **New in this feature**: `lib/contactChannels`, `lib/withReplyTime`, `PrivacyNote`, `ContactPanel`, `ContactDetails`, `contact/ContactAside`, `webPage`/`contactPage` in `seo.test.ts`, the contact route in `app.test.tsx` +- **Note**: run without an output filter (e.g. `rtk proxy pnpm test` in agent shells), so a failing test is visible in full diff --git a/aidlc-docs/features/contact-page/construction/contact-page/code/code-summary.md b/aidlc-docs/features/contact-page/construction/contact-page/code/code-summary.md new file mode 100644 index 0000000..3eb9450 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/contact-page/code/code-summary.md @@ -0,0 +1,34 @@ +# Code Summary — Unit 3: Contact page + +## Created +- `web/src/routes/contact.tsx` — replaces the placeholder: page head, the narrow card, the form column (visually hidden h2 + `ContactPanel load="eager"`), `ContactAside` with the wide card; `?pakket=` validation and clean-up; head with `ContactPage` JSON-LD +- `web/src/components/contact/ContactAside/ContactAside.tsx` (+ test) — `picture` with a `(min-width: 64em)` source and a transparent `data:` fallback, priority, intrinsic size; card slot over the bottom of the photo +- `web/src/content/contactContent.ts` — head texts (intro with `{reactietermijn}`), headings, photo and portrait +- `web/src/lib/withReplyTime.ts` (+ test) — fills in the reply time +- `web/src/assets/contact/contact.jpg` (840×1050, 80 KB), `contact-portret.jpg` (144×144, 5 KB), `web/public/og-contact.jpg` (1200×630, 60 KB) — crops of the original live photo (1600×1067), approved by the owner (portrait zoomed out, variant B) + +## Modified +- `web/src/content/types.ts` — `ContactPageContent` +- `web/src/seo.ts` (+ test) — `contactPage()` +- `web/src/sitePages.ts` — `/contact`: title, description, `indexed: true`, `ogImage` +- `web/lighthouserc.cjs` — `/contact` indexed (standard 0.9 mobile budget, owner's choice) +- `web/src/sitemap.test.ts` — expects `/contact` +- `web/src/content/aboutContent.ts`, `web/src/app.test.tsx`, `web/src/components/about/AboutIntro/AboutIntro.test.tsx` — Over mij links to `/contact`; contact route tests +- `web/src/components/ContactDetails/ContactDetails.tsx` — filled mail icon, matching the filled platform icons +- `web/src/theme.ts`, `web/src/recipes/linkButton.ts` — accent button on `accent.deep` (white ≈ 5.7:1), hover on new `accent.deeper` (#475042) +- `LAYOUT.md` — Contact: Intro; Contact form beside Photo + contact details +- `web/src/lib/shootLinks.ts` (+ test), `web/src/content/shootTypesPageContent.ts`, `web/src/components/shoots/ShootBlock/ShootBlock.test.tsx` — Soorten fotoshoots: "Stuur een berichtje" → `/contact?pakket=` (or `/contact`), "Boek je shoot" → `/contact` (FR-CP-09 extension, owner's request) + +## Findings fixed during verification +- `chakra.img` treated `width`/`height` as CSS props, so the intrinsic size was missing; now Chakra `Image` with `htmlWidth`/`htmlHeight`. +- A property test of `withReplyTime` passed by chance: half placeholders around a real one could form a new one; generator restricted to brace-free text. +- **Accent button contrast** (site-wide, pre-existing): white on `#7f8b76` = 3.58:1. Lighthouse only caught it here because the button is in the first screen; elsewhere `Reveal` keeps it at opacity 0 during the measurement, and jsdom computes no colours. Fixed in the recipe (owner's choice: darker green). + +## Verification +- `pnpm test`: 71 files, 367 tests passed (seed 1926155072; after the Soorten link change again 367/367, seed 1607463937); lint, format, build clean. Lighthouse not re-run for the link change (href-only change, no effect on performance or accessibility). +- Production build in Chrome: no request for `contact.jpg` up to 1023 px (LCP = intro text); one request with priority **High** from 1024 px (LCP = the photo). Screenshots at 390 and 1280 px match mockup 1a. +- Lighthouse desktop: all pass; `/contact` 0.99 / 1 / 1 / 1. +- Lighthouse mobile: accessibility, best practices and SEO pass everywhere. **Performance fails on two pages:** + - `/` 0.78–0.80 vs 0.8 — pre-existing: identical on the unit 2 build (3 runs each); owner chose to handle it separately (recorded as an open follow-up). + - `/contact` 0.88 / 0.90 / 0.88 vs 0.9 — same client-rendering cause as the photo pages (text appears after the JavaScript); owner chose to keep 0.9. + - In CI, performance is report-only (D6), so these do not block a merge; locally `pnpm check` fails on them. diff --git a/aidlc-docs/features/contact-page/construction/contact-page/code/portrait-variants.png b/aidlc-docs/features/contact-page/construction/contact-page/code/portrait-variants.png new file mode 100644 index 0000000..e230e3f Binary files /dev/null and b/aidlc-docs/features/contact-page/construction/contact-page/code/portrait-variants.png differ diff --git a/aidlc-docs/features/contact-page/construction/contact-page/functional-design/business-logic-model.md b/aidlc-docs/features/contact-page/construction/contact-page/functional-design/business-logic-model.md new file mode 100644 index 0000000..11d4d09 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/contact-page/functional-design/business-logic-model.md @@ -0,0 +1,43 @@ +# Business Logic Model — Unit 3: Contact page + +## Route flow + +```mermaid +sequenceDiagram + box rgba(99,179,237,0.4) Routing + participant R as Router + participant P as ContactRoute + end + box rgba(255,167,38,0.4) Components + participant Pn as ContactPanel + end + R->>P: render with validated search + P->>Pn: pakket and load eager + Pn->>Pn: preselect when the package is known + P->>R: navigate to contact page with empty search, replace, no scroll +``` + +Text alternative: the router renders the contact route with the validated search parameter; the route passes the package to the panel, which preselects a known package; the route then replaces the URL without the parameter, without scrolling. + +## Head +`pageHead('/contact')` (title, description, canonical, Open Graph incl. the page's preview image, no `noindex`) plus `structuredDataScript(contactPage('/contact'))`. + +## Pure helpers + +### `contactPage(path: RoutePath)` in `seo.ts` +`webPage('ContactPage', path, { about: { '@id': businessId } })`. + +### `withReplyTime(text: string, replyTime: string): string` in `lib/withReplyTime.ts` +Replaces every `{reactietermijn}` in `text` with `replyTime`; text without the placeholder comes back unchanged. + +## Properties for property-based testing (PBT-01) + +| Function | Property | Category | +|---|---|---| +| `withReplyTime` | No `{reactietermijn}` is left (when `replyTime` itself does not contain it) | Invariant | +| `withReplyTime` | Text without the placeholder is returned unchanged | Invariant | +| `withReplyTime` | Splitting the template on the placeholder and joining with `replyTime` gives the result | Oracle | +| `contactPage` | `@type` = `ContactPage`, `@id` = `url` = canonical URL, `about` = business id, never an e-mail address | Invariant | +| `contactPage` | Survives `jsonLdScript` unchanged | Round trip | + +The layout, the photo loading and the URL clean-up are covered by component and route tests (they are rendering over helpers that are already property-tested). diff --git a/aidlc-docs/features/contact-page/construction/contact-page/functional-design/business-rules.md b/aidlc-docs/features/contact-page/construction/contact-page/functional-design/business-rules.md new file mode 100644 index 0000000..df607f4 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/contact-page/functional-design/business-rules.md @@ -0,0 +1,66 @@ +# Business Rules — Unit 3: Contact page + +Answers: [contact-page-fd-questions.md](../../plans/contact-page-fd-questions.md) (Q1 A, Q2 A). + +## Layout + +| Id | Rule | +|---|---| +| BR-CP-01 | From **1024 px** (`lg`): two columns, the form column (≈ 3/5) left and `ContactAside` (≈ 2/5) right, aligned at the top. *Q1 = A* | +| BR-CP-02 | Below 1024 px: one column — the narrow card (with the round portrait) above the form, both full width; `ContactAside` is not shown. | +| BR-CP-03 | DOM order = visual order on every width: narrow card, form column, aside. The narrow card is hidden from 1024 px, the aside below it (`display: none`, so also hidden from assistive technology). | +| BR-CP-04 | The section sits directly under the page head (`PageSection spacing="flushTop"`), as in the design. Both columns fade in with `Reveal`. | + +```mermaid +graph TD + W{"Viewport at least 1024 px?"} + W -->|"yes"| Wide["Form left; photo with card right; narrow card hidden"] + W -->|"no"| Narrow["Card with portrait, then form; aside hidden and photo not fetched"] + classDef decision fill:#FFF59D,stroke:#F57F17,stroke-width:1px,color:#000; + classDef result fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + class W decision; + class Wide,Narrow result; +``` + +Text alternative: from 1024 px the page shows the form with the photo and card beside it; below that it shows the card with the portrait above the form and does not fetch the large photo. + +## Photo + +| Id | Rule | +|---|---| +| BR-CP-06 | The large photo is a `` whose source only applies from 1024 px; below that the `img` falls back to a tiny inline transparent image, so phones and portrait tablets never download the photo. (`data:` is already allowed by the CSP.) | +| BR-CP-07 | On wide screens the photo is the largest paint: no deferral, `fetchpriority="high"`, intrinsic width and height to reserve space. | +| BR-CP-08 | The portrait is a separate small crop, decorative (`alt=""`), only in the narrow card. | +| BR-CP-09 | The card overlaps the bottom edge of the photo (as in mockup 1a); the aside reserves room below the photo so the card never covers the next content. | + +## `?pakket=` on this page + +| Id | Rule | +|---|---| +| BR-CP-10 | The route keeps `pakket` from the search only when it is text (same `validateSearch` as the homepage). | +| BR-CP-11 | `ContactPanel load="eager"` receives it and applies the preselect per BR-CPN-02 (unit 2). | +| BR-CP-12 | After it was applied, the route replaces the URL with `/contact` without search, no history entry, no focus move; the page starts at the top. An invalid value is removed the same way. *Corrected at Build and Test: 'no scroll' left a visitor coming from a scrolled page mid-page.* | + +## Texts and headings + +| Id | Rule | +|---|---| +| BR-CP-05 | The intro is `head.intro` with `{reactietermijn}` replaced by the reply time; without the placeholder the text is used as is. | +| BR-CP-13 | One h1 "Contact" (`PageIntro`); h2 "Stuur me een bericht" visually hidden, labelling the form section; h2 "Direct contact" in each card with its own id (`contact-details-narrow`, `contact-details-wide`). | +| BR-CP-14 | The contact section is a landmark named by the form heading. | + +## SEO and checks + +| Id | Rule | +|---|---| +| BR-CP-15 | `sitePages['/contact']` gets the approved title and description, `indexed: true` and the preview image; head tags via `pageHead('/contact')`. | +| BR-CP-16 | The route adds the `ContactPage` JSON-LD via `structuredDataScript(contactPage('/contact'))`. | +| BR-CP-17 | `/contact` becomes an indexed path in Lighthouse CI with the standard mobile budget 0.9 (not a photo page). If it does not reach 0.9, report the measurement and cause to the owner before changing any budget. *Q2 = A* | +| BR-CP-18 | The sitemap test expects `/contact`. | + +## Other pages + +| Id | Rule | +|---|---| +| BR-CP-19 | Over mij: "neem contact op" and "Boek je shoot" link to `/contact` (no hash). The homepage "Boek …" links stay on the homepage form. | +| BR-CP-20 | LAYOUT.md "Contact": Intro over the full width, then Contact form beside Photo with contact details, per `.ai/layout-conventions.md`. | diff --git a/aidlc-docs/features/contact-page/construction/contact-page/functional-design/domain-entities.md b/aidlc-docs/features/contact-page/construction/contact-page/functional-design/domain-entities.md new file mode 100644 index 0000000..07ca2c6 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/contact-page/functional-design/domain-entities.md @@ -0,0 +1,51 @@ +# Domain Entities — Unit 3: Contact page + +## Entity relationships + +```mermaid +graph TD + Page["ContactPageContent"] -->|"has"| Head["head: eyebrow, title, intro template"] + Page -->|"has"| Titles["formTitle, detailsTitle"] + Page -->|"has"| Photo["image: ContentImage 4:5"] + Page -->|"has"| Portrait["portrait: ContentImage face crop"] + Site["SiteContent"] -->|"replyTime fills"| Head + Site -->|"email, socials"| Card["ContactDetails (twice)"] + Registry["sitePages /contact"] -->|"title, description, ogImage"| Head2["head tags + ContactPage JSON-LD"] + Business["ProfessionalService @id"] -->|"about"| Head2 + classDef content fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + classDef derived fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000; + classDef registry fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; + class Page,Head,Titles,Photo,Portrait,Site content; + class Card,Head2 derived; + class Registry,Business registry; +``` + +Text alternative: the page content holds the head texts, the two section titles, the photo and the portrait; the site content fills in the reply time and feeds the contact card; the page registry and the business id produce the head tags and the ContactPage structured data. + +## `ContactPageContent` (`content/types.ts`, values in `content/contactContent.ts`) + +| Field | Type | Value | +|---|---|---| +| `head.eyebrow` | `string` | "Neem contact op" | +| `head.title` | `string` | "Contact" | +| `head.intro` | `string` | "Wil je een fotoshoot boeken of meer informatie ontvangen? Stuur me een berichtje, ik reageer binnen {reactietermijn}." | +| `formTitle` | `string` | "Stuur me een bericht" (visually hidden h2) | +| `detailsTitle` | `string` | "Direct contact" | +| `image` | `ContentImage` | the contact photo, 4:5, descriptive alt text | +| `portrait` | `ContentImage` | square face crop from the same photo, `alt: ''` is set by the card (decorative) | + +`{reactietermijn}` is the one placeholder in the intro; it is replaced by `siteContent.contactForm.replyTime` (BR-CP-05). Plain strings, so the API can deliver the same shape. + +## Images +| Image | Location | Size | Notes | +|---|---|---|---| +| Contact photo | `web/src/assets/contact/contact.jpg` | about 900×1125 (4:5), compressed | original from andreaslop.nl/contact, resized once | +| Portrait crop | `web/src/assets/contact/contact-portret.jpg` | 144×144 (72 px at 2×) | face crop, a few kB | +| Preview image | `web/public/og-contact.jpg` | 1200×630 | crop of the same photo, own alt text in `sitePages` | + +## Structured data +`ContactPage` = `webPage('ContactPage', '/contact', { about: { '@id': businessId } })` — name and description from the registry, no e-mail address. + +## Registry and test lists +- `sitePages['/contact']`: title "Contact – fotoshoot boeken in Huizen", description from SEO-CP-02, `indexed: true`, `ogImage` the preview image. +- `lighthouserc.cjs`: `/contact` moves from `noindexPaths` to `indexedPaths` (not in `photoPagePaths`, Q2 = A); `sitemap.test.ts`: `/contact` in the expected list. diff --git a/aidlc-docs/features/contact-page/construction/contact-page/functional-design/frontend-components.md b/aidlc-docs/features/contact-page/construction/contact-page/functional-design/frontend-components.md new file mode 100644 index 0000000..5da09a7 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/contact-page/functional-design/frontend-components.md @@ -0,0 +1,51 @@ +# Frontend Components — Unit 3: Contact page + +## Hierarchy + +```mermaid +graph TD + Route["routes/contact.tsx"] --> Intro["PageIntro: eyebrow, h1, intro"] + Route --> Section["PageSection flushTop, labelled by the form heading"] + Section --> NarrowCard["ContactDetails with portrait (below lg)"] + Section --> Grid["Grid: one column, two from lg"] + Grid --> FormCol["Form column: hidden h2 + ContactPanel eager"] + Grid --> Aside["contact/ContactAside (from lg)"] + Aside --> Photo["picture: photo from lg only"] + Aside --> WideCard["ContactDetails (overlapping the photo)"] + classDef page fill:#2196F3,stroke:#0d47a1,color:#000; + classDef shared fill:#4CAF50,stroke:#2e7d32,color:#000; + classDef small fill:#e2e8f0,stroke:#4a5568,color:#000; + class Route,Section,Grid,FormCol page; + class Intro,NarrowCard,WideCard,Aside shared; + class Photo small; +``` + +Text alternative: the contact route renders PageIntro and one PageSection; inside it the narrow-screen card, then a grid with the form column and, from lg, ContactAside with the photo and the wide-screen card. + +## `routes/contact.tsx` +- `validateSearch` keeps `pakket` when it is a string; `head` per the business logic model. +- Effect: when `pakket` is defined, `navigate({ to: '/contact', search: {}, replace: true, resetScroll: false })`. +- Renders `PageIntro` with `withReplyTime(head.intro, replyTime)`, then the section. +- **Section**: `PageSection labelledBy="contact-form-title" spacing="flushTop" data-testid="contact-page"`. +- **Narrow card**: wrapper `display={{ base: 'block', lg: 'none' }}`, `ContactDetails titleId="contact-details-narrow" portrait={portrait} data-testid="contact-details-narrow"`, margin below it. +- **Grid**: `templateColumns={{ base: '1fr', lg: '3fr 2fr' }}`, gap as `MediaText` (`clamp(2rem, 6vw, 5.5rem)`), `alignItems="start"`. +- **Form column**: `VisuallyHidden` `h2` with `id="contact-form-title"`, then `ContactPanel idPrefix="contact" load="eager"` with the route's `pakket`. +- Test ids: `contact-page`, `contact-details-narrow`, `contact-details-wide`, `contact-aside`, `contact-aside-photo`. + +## `components/contact/ContactAside` +- Props: `image: ContentImage`, `children: ReactNode` (the card). +- Wrapper `display={{ base: 'none', lg: 'block' }}`, `position="relative"`, padding below the photo for the overlapping card. +- `chakra.picture` with `` and an `img` with a 1×1 transparent `data:` GIF as `src`, `alt={image.alt}`, intrinsic `width`/`height`, `fetchPriority="high"`, `decoding="async"`, aspect ratio 4:5, `objectFit="cover"`, background `paper.deep` while loading. +- Card position: absolutely placed over the bottom of the photo with side insets (`left`/`right` ≈ 1.5rem, `bottom` 0), as in the mockup. + +## Responsive behaviour +| Width | What shows | +|---|---| +| < 480 px | intro, card with portrait, form (name and e-mail stacked) | +| 480–1023 px | same, name and e-mail side by side | +| ≥ 1024 px | intro, form left, photo with card right | + +## Accessibility +- Reading and tab order: intro → (narrow card) → form → (wide card); hidden variants are `display: none`. +- The visually hidden form heading names the section; the cards each have a labelled list. +- Photo alt text describes the photo; portrait decorative. diff --git a/aidlc-docs/features/contact-page/construction/plans/contact-page-code-generation-plan.md b/aidlc-docs/features/contact-page/construction/plans/contact-page-code-generation-plan.md new file mode 100644 index 0000000..b5efc08 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/plans/contact-page-code-generation-plan.md @@ -0,0 +1,31 @@ +# Code Generation Plan — Unit 3: Contact page + +Single source of truth for generating unit 3. Workspace: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-contact\web`, branch `feature/contact-page` (on master a58bc1c + units 1–2). + +## Unit context +- **Requirements**: FR-CP-01..05, FR-CP-09..11, SEO-CP-01..05, NFR-CP-01, 03..06. +- **Design**: [functional design](../contact-page/functional-design/) (BR-CP-01..20); shared blocks from unit 2 (`ContactPanel`, `ContactDetails`, `PrivacyNote`); `webPage()` from unit 1. +- **Source photo**: the original of the live contact photo, `https://andreaslop.nl/wp-content/uploads/2024/10/WhatsApp-Image-2024-10-27-at-14.31.42.jpeg` (1600×1067, landscape). The live page and the design use a 632×658 crop of it, too small for the desktop column. +- **Shared resources**: "claim 4173" / "4173 free" with Portfolio-pagina around Lighthouse; no deploy to test without "claim test". + +## Steps + +- [x] **Step 1 — Images** (one-off scratchpad script, PowerShell/System.Drawing with EXIF orientation, as in earlier features; not a build dependency): + - `web/src/assets/contact/contact.jpg` — 4:5 cover crop around Andrea, 840×1050, JPEG quality 80; + - `web/src/assets/contact/contact-portret.jpg` — square face crop, 144×144; + - `web/public/og-contact.jpg` — 1200×630 crop with her face in the upper third. + - Show the three crops on one contact sheet for approval before they are fixed; draft the alt texts (photo: descriptive Dutch; preview: own alt in `sitePages`). +- [x] **Step 2 — Content**: `ContactPageContent` in `content/types.ts`; `content/contactContent.ts` with the head texts (intro with `{reactietermijn}`), `formTitle`, `detailsTitle`, `image`, `portrait`. +- [x] **Step 3 — `lib/withReplyTime.ts` + test**: examples and the 3 properties (BR-CP-05). +- [x] **Step 4 — SEO**: `contactPage()` in `seo.ts` + tests (examples, invariants, round trip); `sitePages['/contact']` (title, description, `indexed: true`, `ogImage`); `lighthouserc.cjs` `/contact` → `indexedPaths` (not a photo page); `sitemap.test.ts` expects `/contact`. +- [x] **Step 5 — `components/contact/ContactAside` + test**: `picture` with the `lg` media source and the transparent fallback, priority, intrinsic size, overlapping card slot; tests for the source/fallback markup, alt text, priority and the card slot, axe. +- [x] **Step 6 — Route `routes/contact.tsx`**: `validateSearch`, head (page head + JSON-LD), intro with the reply time, the section per the component design, URL clean-up of `?pakket=`. Route tests (in `app.test.tsx` or a route test file): head tags (title, description, no noindex, canonical, `og:image`, JSON-LD), heading outline, both cards present with their own ids, form section named, `/contact?pakket=newborn` preselects and cleans the URL without moving focus, invalid value removed, axe. +- [x] **Step 7 — Over mij links**: `aboutContent.ts` "neem contact op" and "Boek je shoot" → `/contact`; update the Over mij tests that expect `/#contact`. +- [x] **Step 8 — LAYOUT.md**: the "Contact" diagram per `.ai/layout-conventions.md` (Intro full width; Contact form beside Photo with contact details). +- [x] **Step 9 — Verify (Step 13.5)**: `pnpm test` (no rtk filter), `pnpm lint`, `pnpm format:check`, `pnpm build`; a browser check on the production build that a 390 px viewport does not request `contact.jpg` and a 1280 px viewport does (with high priority); then "claim 4173" → `pnpm lighthouse` → "4173 free". `/contact` mobile must reach 0.9; if not, stop and report the measurement and cause (BR-CP-17). +- [x] **Step 10 — Code summary**: `aidlc-docs/features/contact-page/construction/contact-page/code/code-summary.md`. +- [x] **Step 11 — Commit** (after approval): code commit and docs commit; push. Offer a deploy to test for your review (only after "claim test" to Portfolio-pagina). + +## Extension compliance (plan level) +- **Security**: no new endpoints, scripts or CSP changes (`data:` images already allowed); JSON-LD through `jsonLdScript`, no e-mail; `?pakket=` validated and never rendered; external links `noopener noreferrer` — Compliant. +- **PBT**: PBT-01/03/05 for `withReplyTime` and `contactPage`, PBT-02 round trip, PBT-07/08/10 as before — Planned. diff --git a/aidlc-docs/features/contact-page/construction/plans/contact-page-fd-questions.md b/aidlc-docs/features/contact-page/construction/plans/contact-page-fd-questions.md new file mode 100644 index 0000000..b2baf15 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/plans/contact-page-fd-questions.md @@ -0,0 +1,36 @@ +# Functional Design-vragen — Unit 3: Contactpagina + +Al vastgelegd (geen vraag nodig): + +- **Opbouw**: zoals de goedgekeurde mockup 1a. Op brede schermen het formulier links (circa 3/5) en rechts de foto (4:5) met de kaart over de onderrand. Op smalle schermen de kaart met het ronde portret, daarna het formulier. +- **De grote foto laadt niet op telefoons**. Dat regelt de browser zelf met een ``-element met een media query: alleen op brede schermen vraagt hij de foto op. Zonder JavaScript-trucs, en op desktop meteen met hoge prioriteit, want daar is de foto het grootste element (LCP). Het ronde portret is een aparte, kleine uitsnede. +- **`?pakket=`**: het panel neemt het pakket over. Daarna haalt de pagina `?pakket=` uit de adresbalk, zonder nieuwe geschiedenisregel en zonder de focus te verplaatsen (de bezoeker komt op een nieuwe pagina binnen). +- **Intro**: "Wil je een fotoshoot boeken of meer informatie ontvangen? Stuur me een berichtje, ik reageer binnen 1-2 werkdagen." De termijn komt uit `siteContent`. De rest van de zin staat in de content van de pagina, met een vaste plek voor de termijn. +- **Koppen**: h1 "Contact", een h2 "Stuur me een bericht" die alleen screenreaders zien, en h2 "Direct contact" in de kaart. De kaart staat twee keer in de HTML (smal en breed), elk met een eigen id. +- **Foto's**: het origineel van andreaslop.nl, eenmalig verkleind en gecomprimeerd, met een beschrijvende alt-tekst die Andrea kan nalezen. Daaruit ook de portretuitsnede en de preview-afbeelding van 1200×630. +- **SEO**: geïndexeerd, titel en beschrijving uit de requirements, `ContactPage` JSON-LD over het bedrijf, en `/contact` in de sitemap-test en de Lighthouse-lijsten. +- **Over mij**: "neem contact op" en "Boek je shoot" gaan naar `/contact`. **LAYOUT.md** krijgt de nieuwe opbouw. + +Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. + +--- + +## Vraag 1: Vanaf welke breedte twee kolommen? + +Het formulier heeft genoeg ruimte nodig om naam en e-mail naast elkaar te tonen. Op een tablet staand (768px) zou het formulier in 3/5 van de breedte ongeveer 430px breed worden. + +- A) **Twee kolommen vanaf 1024px** (laptop, tablet liggend). Daaronder dezelfde opbouw als op telefoon: kaart met portret, dan het formulier over de volle breedte. (aanbevolen: het formulier blijft ruim, en op een staande tablet is de volgorde duidelijk) +- B) Twee kolommen vanaf 768px (ook tablet staand), met een smaller formulier +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 2: Lighthouse-drempel voor `/contact` op mobiel + +Sinds Soorten fotoshoots geldt op mobiel een drempel van 0,85 voor pagina's waar een foto het grootste element is (`photoPagePaths`), en 0,9 voor de andere geïndexeerde pagina's. Op een telefoon toont de contactpagina geen grote foto, alleen het kleine portret. Het grootste element is daar waarschijnlijk tekst of het formulier. + +- A) **Uitgaan van 0,9** (de gewone drempel, zoals in de requirements staat). Haalt de pagina dat niet, dan kom ik met de meting en de oorzaak bij je terug voordat ik iets aan de drempel verander. (aanbevolen) +- B) Meteen in `photoPagePaths` zetten (0,85), net als Over mij en Soorten fotoshoots +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A diff --git a/aidlc-docs/features/contact-page/construction/plans/contact-page-functional-design-plan.md b/aidlc-docs/features/contact-page/construction/plans/contact-page-functional-design-plan.md new file mode 100644 index 0000000..10a1a7e --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/plans/contact-page-functional-design-plan.md @@ -0,0 +1,10 @@ +# Functional Design Plan — Unit 3: Contact page + +Depth: minimal. Scope from the execution plan: the `?pakket=` handling on this page, the responsive photo (LCP on wide screens, not downloaded on phones), the content model and its link to the shared reply time, structured data, the SEO registry and Lighthouse lists, and the Over mij link change. Questions: [contact-page-fd-questions.md](contact-page-fd-questions.md). + +- [x] Collect and analyse the answers in `contact-page-fd-questions.md` +- [x] `domain-entities.md` — `ContactPageContent`, images (photo, portrait crop, preview image), `ContactPage` structured data +- [x] `business-rules.md` — layout per breakpoint, photo loading, `?pakket=` on this page, intro with reply time, headings and ids, SEO registry and Lighthouse lists, Over mij links, LAYOUT.md +- [x] `business-logic-model.md` — route flow (search → panel → URL clean-up), head tags, pure helpers and their properties (PBT-01) +- [x] `frontend-components.md` — page hierarchy, `ContactAside`, ids and test ids, responsive behaviour +- [x] Validate against requirements.md, application-design.md and the extension rules diff --git a/aidlc-docs/features/contact-page/construction/plans/shared-contact-blocks-code-generation-plan.md b/aidlc-docs/features/contact-page/construction/plans/shared-contact-blocks-code-generation-plan.md new file mode 100644 index 0000000..e6b5dbf --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/plans/shared-contact-blocks-code-generation-plan.md @@ -0,0 +1,31 @@ +# Code Generation Plan — Unit 2: Shared contact blocks + +Single source of truth for generating unit 2. Workspace: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-contact\web`, branch `feature/contact-page`. + +## Unit context +- **Requirements**: FR-CP-02 (shared parts), FR-CP-04, FR-CP-06, FR-CP-07, FR-CP-08, NFR-CP-01..04. +- **Design**: [application-design.md](../../inception/application-design/application-design.md); functional design in [../shared-contact-blocks/functional-design/](../shared-contact-blocks/functional-design/) (BR-CD, BR-PR, BR-RT, BR-CPN). +- **Depends on**: unit 1 (no direct use). **Used by**: unit 3 (contact page). +- **Parallel features**: soorten-fotoshoots-page (PR #8) changes `content/types.ts`, `siteContent.ts`, `test/arbitraries.ts`, `seo.ts`, `lighthouserc*`, `MediaText`. Rebase first if it has merged (step 1). +- **Shared resources**: Lighthouse only after a "claim 4173" to the other sessions and "4173 free" afterwards; no deploy to test. + +## Steps + +- [x] **Step 1 — Sync with master** (done 2026-10-25: rebased onto a58bc1c; duplicate webPage commit skipped; 325/325 tests green): fetch; if PR #8 has merged, rebase `feature/contact-page` onto master (check that the cherry-picked webPage commit is skipped as an identical patch, resolve conflicts keeping both sides) and run the seo tests. If not merged yet, continue and rebase at the end of the unit. +- [x] **Step 2 — Content model**: `content/types.ts`: `SocialLink.label?: string`; `SiteContent.contactForm.replyTime: string`. `content/siteContent.ts`: socials reordered to Instagram, Facebook with labels "@andreaslopfotografie" and "Andrea Slop Fotografie"; `contactForm: { enabled: false, replyTime: '1-2 werkdagen' }`. `test/arbitraries.ts`: `socialLink` with an optional label (absent, empty, whitespace, text); `anySiteContent` with `replyTime`. Fix tests that assume the old footer order. +- [x] **Step 3 — `lib/contactChannels.ts`** (BR-CD-01..05): `ContactChannel` type and `contactChannels(email, socials)`, built on `emailAddress`, `mailtoLink`, `mailSubject`, `visibleSocials`, `socialPlatforms`. +- [x] **Step 4 — `lib/contactChannels.test.ts`**: examples (site content, invalid e-mail, no socials, label fallback) and the 6 properties from the business logic model. +- [x] **Step 5 — `PrivacyNote`** (`components/PrivacyNote/`, BR-PR-01): component + test (text, link target, axe). +- [x] **Step 6 — `ContactForm`**: prop `replyTime`, thank-you text (BR-RT-01), `PrivacyNote` under the submit button (BR-PR-02); update its tests. +- [x] **Step 7 — `ContactFormGate`**: `PrivacyNote` under the mail button in the notice (BR-PR-03); update its tests. +- [x] **Step 8 — `ContactPanel`** (`components/ContactPanel/`, BR-CPN-01..06): move gate, lazy/eager loading with placeholder, options, preselect and mail subject out of `ContactSection`; tests for eager, lazy (placeholder, load near screen, load on `pakket`), preselect (valid, invalid, same value again), subject, gate on/off, axe. +- [x] **Step 9 — `home/ContactSection`** (BR-CPN-07): render `ContactPanel load="lazy"`; keep heading, URL clean-up, scroll and focus; pass `replyTime` from `routes/index.tsx`. Existing `ContactSection` and `app.test.tsx` tests must pass unchanged in intent (only additions for the privacy line). +- [x] **Step 10 — `ContactDetails`** (`components/ContactDetails/`, BR-CD-06..08): card, eyebrow h2 with `titleId`, labelled list, icon rows (mail icon from `@iconify-icons/ant-design`, platform icons from `socialPlatforms`), new-tab hint, optional round portrait (decorative); tests: channels and order, link targets, new-tab attributes and hint, nothing rendered without channels, portrait on/off, unique ids when rendered twice, axe. +- [x] **Step 11 — Verify (Step 13.5)**: `pnpm test` (coverage thresholds, run without the rtk output filter so failures are visible), `pnpm lint`, `pnpm format:check`, `pnpm build`; then "claim 4173" → `pnpm lighthouse` (homepage budgets unchanged) → "4173 free". Fix and repeat until green. +- [x] **Step 12 — Code summary**: `aidlc-docs/features/contact-page/construction/shared-contact-blocks/code/code-summary.md`. +- [x] **Step 12b — Open documentation follow-up** (from the owner's memory note "include in the next change on the site"): update deployment-plan D6 (and deployment-instructions.md if it repeats it) in `aidlc-docs/features/frontend-shell/operations/deployment/` — `lighthouse` is a required check on master since 2026-10-19; separate docs commit; then remove that bullet from the memory note. +- [x] **Step 13 — Commit** (after approval of the generated code): one code commit and one docs commit; push with `--force-with-lease` (the branch was rebased). Tell the other sessions about the footer order change and the new shared components (`ContactDetails`, `PrivacyNote`, `ContactPanel`). + +## Extension compliance (plan level) +- **Security**: e-mail still assembled in the browser; `contactChannels` only yields `mailto:`/`https:` links (property-tested); new-tab links with `noopener noreferrer`; no new dependencies or endpoints — Compliant. +- **PBT**: PBT-01/03 (contactChannels invariants), PBT-07 (extended generators), PBT-08 (seed logging), PBT-10 (component examples) — Planned; PBT-02/04/05 N/A for this unit beyond the oracle-style "same as visibleSocials" property; PBT-06 compliant (reducer unchanged). diff --git a/aidlc-docs/features/contact-page/construction/plans/shared-contact-blocks-fd-questions.md b/aidlc-docs/features/contact-page/construction/plans/shared-contact-blocks-fd-questions.md new file mode 100644 index 0000000..9b50a70 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/plans/shared-contact-blocks-fd-questions.md @@ -0,0 +1,52 @@ +# Functional Design-vragen — Unit 2: Gedeelde contactblokken + +Al vastgelegd (geen vraag nodig): + +- **Nieuw tabblad**: Instagram en Facebook openen in een nieuw tabblad met `rel="noopener noreferrer"` en de voor screenreaders verborgen tekst "(opent in nieuw tabblad)", net als in de footer, de hero en het Instagram-blok. +- **E-mail**: het adres als linktekst, `mailto:` met het standaardonderwerp "Vraag via andreaslop.nl". Een ongeldig adres wordt weggelaten, en een kaart zonder geldige kanalen verschijnt niet. +- **Bedankbericht**: "Bedankt voor je bericht! Ik reageer binnen {reactietermijn}." met de termijn uit `siteContent`. +- **Homepage**: na het uitlichten van `ContactPanel` gedraagt het contactblok zich precies als nu (lazy laden, placeholder-hoogte, "Boek …" → voorselectie, URL opschonen, scrollen, focus op de kop). Het enige zichtbare verschil is de privacyregel. + +Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. + +--- + +## Vraag 1: Volgorde van de kanalen in de kaart + +In het ontwerp staat de volgorde E-mail, Instagram, Facebook. In `siteContent` staat Facebook vóór Instagram, en de footer volgt die volgorde. + +- A) **E-mail eerst, daarna de socials in de volgorde van de content**. Om op Instagram, Facebook uit te komen, draai ik de volgorde in `siteContent` om. Daardoor staat in de footer ook Instagram eerst. Eén bron, één volgorde op de hele site. (aanbevolen: Instagram is het belangrijkste kanaal voor een fotograaf) +- B) E-mail eerst, daarna de socials in de volgorde van de content, en `siteContent` laten zoals hij is (dus Facebook, Instagram) +- C) Een vaste volgorde alleen in de kaart (e-mail, Instagram, Facebook), los van de content. De footer blijft Facebook, Instagram. +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 2: Linkteksten van Instagram en Facebook + +Met het nieuwe optionele veld `label` per sociale link. + +- A) Instagram "@andreaslopfotografie", Facebook "Andrea Slop Fotografie" (de naam van de pagina, zoals Facebook hem toont) (aanbevolen) +- B) Bij allebei "@andreaslopfotografie", zoals in het ontwerp +- C) Geen labels: bij allebei de naam van het platform ("Instagram", "Facebook") +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A + +## Vraag 3: De privacyregel zolang het formulier achter de gate staat + +De privacyregel staat in het formulier, onder de verzendknop. Zolang het formulier gedimd en onbedienbaar onder de "Binnenkort"-melding staat, is de regel daar niet te lezen of aan te klikken. + +- A) Zo laten: de regel hoort bij het versturen via het formulier, en zolang dat niet kan, mailt de bezoeker zelf. Zodra het formulier aan gaat, is de regel er vanzelf. (aanbevolen) +- B) De regel ook onder de "Binnenkort"-melding tonen, zodat hij nu al zichtbaar is +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: B + +## Vraag 4: Hoe ziet een kanaal in de kaart eruit bij hover en focus? + +- A) Zoals in de mockup en de footer: de tekst kleurt naar de accentkleur bij hover, met de focusring van het thema bij toetsenbordfocus. Het icoon behoudt zijn eigen accentkleur. (aanbevolen) +- B) Bij hover ook een onderstreping, zoals bij links in lopende tekst (variant `underline`) +- X) Anders (beschrijf hieronder na de [Answer]:-tag) + +[Answer]: A diff --git a/aidlc-docs/features/contact-page/construction/plans/shared-contact-blocks-functional-design-plan.md b/aidlc-docs/features/contact-page/construction/plans/shared-contact-blocks-functional-design-plan.md new file mode 100644 index 0000000..4e7599d --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/plans/shared-contact-blocks-functional-design-plan.md @@ -0,0 +1,10 @@ +# Functional Design Plan — Unit 2: Shared contact blocks + +Depth: minimal. Scope from the execution plan: which homepage behaviour `ContactPanel` must keep, which channels `ContactDetails` shows and how, the privacy line and the shared reply time, and the PBT properties of new pure logic (PBT-01). Questions: [shared-contact-blocks-fd-questions.md](shared-contact-blocks-fd-questions.md). + +- [x] Collect and analyse the answers in `shared-contact-blocks-fd-questions.md` +- [x] `domain-entities.md` — `SocialLink.label`, `SiteContent.contactForm.replyTime`, the contact channel as derived data, `ContactPanel` inputs +- [x] `business-rules.md` — channel selection and order, labels, link behaviour (mailto subject, new tab), privacy line, reply time, behaviour `ContactPanel` must preserve from `ContactSection` +- [x] `business-logic-model.md` — from site content to the list of channels (pure function), the panel's loading and preselect flow, properties for PBT +- [x] `frontend-components.md` — component hierarchy, props, ids and test ids, accessibility per element +- [x] Validate against requirements.md, application-design.md and the extension rules 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/shared-contact-blocks/code/code-summary.md b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/code/code-summary.md new file mode 100644 index 0000000..e6ebc83 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/code/code-summary.md @@ -0,0 +1,39 @@ +# Code Summary — Unit 2: Shared contact blocks + +## Created +- `web/src/lib/contactChannels.ts` (+ `.test.ts`) — `ContactChannel` and `contactChannels(email, socials)` (BR-CD-01..05) +- `web/src/components/PrivacyNote/PrivacyNote.tsx` (+ test) — the privacy line (BR-PR-01, 04) +- `web/src/components/ContactPanel/ContactPanel.tsx` (+ test) — gate, form loading (`lazy` / `eager`), shoot options, preselect, mail subject (BR-CPN-01..06) +- `web/src/components/ContactDetails/ContactDetails.tsx` (+ test) — the "Direct contact" card (BR-CD-06..08) + +## Modified +- `web/src/content/types.ts` — `SocialLink.label?`, `SiteContent.contactForm.replyTime` +- `web/src/content/siteContent.ts` — socials Instagram first, with labels; `replyTime: '1-2 werkdagen'` +- `web/src/test/arbitraries.ts` — `socialLink` with optional label; `anySiteContent` with `replyTime` +- `web/src/components/ContactForm/ContactForm.tsx` (+ test) — `replyTime` prop for the thank-you; `PrivacyNote` under the submit button +- `web/src/components/ContactForm/ContactFormGate.tsx` (+ test) — `PrivacyNote` under the notice +- `web/src/components/home/ContactSection/ContactSection.tsx` (+ test) — uses `ContactPanel load="lazy"`; keeps heading, URL clean-up, scroll and focus +- `web/src/routes/index.tsx` — passes `replyTime` +- `web/src/components/Footer/Footer.test.tsx`, `web/src/components/Hero/Hero.test.tsx` — find socials by platform / new order instead of assuming Facebook first + +## Deviation from the functional design +- **BR-CPN-05 (eager)**: the form is always its own chunk, also when `eager`. Importing it directly in `ContactPanel` would have put it in the homepage bundle and undone the lazy split (±0.03 mobile performance). `eager` now starts loading at once and keeps the measured space with the placeholder until it arrives, so nothing shifts. This also keeps the contact route chunk small (the Lighthouse risk noted for unit 3). +- **Hero socials** also follow the new content order (Instagram first), next to the footer; not listed in the functional design. + +## Measurements +- Form height with the privacy line (production build, Chrome): 649 px below `sm` (480 px), 546.6 px from `sm` → placeholder `{ base: '649px', sm: '547px' }` (was 604 / 502). +- `ContactForm` chunk: 14.9 kB (5.6 kB gzip), still separate from the main bundle. + +## Verification +- `pnpm test`: 69 files, 354 tests passed (seed 2106747721), coverage thresholds met; run without the rtk filter. +- `pnpm lint`, `pnpm format:check`, `pnpm build`: clean (existing accepted >500 kB main chunk warning). +- `pnpm lighthouse` (mobile + desktop, port 4173 claimed and released): all assertions passed; desktop `/` 0.99/1/1/1, `/over-mij` and `/soorten-fotoshoots` 1/1/1/1. + +## Tests added +| Area | Tests | +|---|---| +| `contactChannels` | 4 examples + 6 properties (e-mail first ⇔ valid, socials = visibleSocials in order, labels, only mailto:/https:, external = social, length bound) | +| `PrivacyNote` | text, link, axe | +| `ContactForm` / gate | reply time from content, privacy line in form and outside the inert part of the gate | +| `ContactPanel` | eager, options, lazy placeholder → load near screen, lazy load on package, valid/unknown/repeated package, gate off | +| `ContactDetails` | order and labels, mailto, new tab and hint, hidden icons, nothing without channels, portrait, rendered twice | diff --git a/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/business-logic-model.md b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/business-logic-model.md new file mode 100644 index 0000000..4880790 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/business-logic-model.md @@ -0,0 +1,69 @@ +# Business Logic Model — Unit 2: Shared contact blocks + +## Pure logic + +### `contactChannels(email: EmailAddress, socials: readonly SocialLink[]): ContactChannel[]` +New, in `lib/contactChannels.ts` (100% coverage threshold applies to `lib/`). Implements BR-CD-01..04 and the `external` flag of BR-CD-05, using the existing `emailAddress`, `mailtoLink`, `mailSubject`, `visibleSocials` and the platform names. `ContactDetails` only renders what it returns (and renders nothing for an empty list, BR-CD-06). + +### Reused unchanged +`shootOptions`, `packageFromSearch`, `visiblePackages`, `mailSubject`, `contactFormReducer` (the form's state machine). + +## Flows + +### Card +```mermaid +graph TD + Content["siteContent: email, socials"] --> Fn["contactChannels()"] + Fn --> Empty{"Empty list?"} + Empty -->|"yes"| Nothing(["null"]) + Empty -->|"no"| Render["ContactDetails renders heading, list, one row per channel"] + classDef data fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + classDef logic fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000; + classDef decision fill:#FFF59D,stroke:#F57F17,stroke-width:1px,color:#000; + class Content data; + class Fn,Render,Nothing logic; + class Empty decision; +``` + +Text alternative: the site content goes through contactChannels; an empty result renders nothing, otherwise the card renders a heading and one row per channel. + +### Panel +```mermaid +graph TD + In["packages, enabled, email, replyTime, pakket, load"] --> Opts["shootOptions(packages)"] + In --> Pk{"New pakket value?"} + Pk -->|"valid id"| Pre["preselect key + 1, subject with package name"] + Pk -->|"invalid or none"| Keep["no change"] + Opts --> Gate{"enabled?"} + Pre --> Gate + Keep --> Gate + Gate -->|"no"| Notice["Gate: dimmed inert form, notice, mail button, privacy line"] + Gate -->|"yes"| FormOnly["Form only"] + Notice --> Load{"load"} + FormOnly --> Load + Load -->|"eager"| Now["Form rendered now"] + Load -->|"lazy"| Near{"Near screen or pakket?"} + Near -->|"no"| Placeholder["Placeholder of form height"] + Near -->|"yes"| Lazy["Load form chunk, keep it loaded"] + classDef data fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + classDef logic fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000; + classDef decision fill:#FFF59D,stroke:#F57F17,stroke-width:1px,color:#000; + class In data; + class Opts,Pre,Keep,Notice,FormOnly,Now,Placeholder,Lazy logic; + class Pk,Gate,Load,Near decision; +``` + +Text alternative: the panel derives the shoot options, applies a valid new package value as preselect with a matching mail subject, wraps the form in the gate when the form is off, and renders the form now (eager) or when it comes near the screen or a package value arrives (lazy), keeping a placeholder until then. + +## Properties for property-based testing (PBT-01) + +| Function | Property | Category | +|---|---|---| +| `contactChannels` | The e-mail channel is present and first ⇔ `emailAddress(email)` is not null | Invariant | +| `contactChannels` | The social channels are exactly `visibleSocials(socials)` in the same order (same platforms and hrefs) | Invariant / oracle | +| `contactChannels` | Every social channel's label is its trimmed label when non-empty, otherwise the platform name; never empty | Invariant | +| `contactChannels` | Every `href` is `mailto:` or `https:`; never `javascript:` or another scheme | Invariant (security) | +| `contactChannels` | `external` is true exactly for social channels | Invariant | +| `contactChannels` | Length ≤ 1 + `socials.length` | Invariant | + +Generators: extend `src/test/arbitraries.ts` — `socialLink` gets an optional `label` (absent, empty, whitespace, text), reuse `anyEmail` and `anyHref`. `ContactPanel` behaviour is covered by example-based component tests (it is UI wiring over already property-tested helpers). diff --git a/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/business-rules.md b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/business-rules.md new file mode 100644 index 0000000..8d6d8bd --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/business-rules.md @@ -0,0 +1,71 @@ +# Business Rules — Unit 2: Shared contact blocks + +Answers: [shared-contact-blocks-fd-questions.md](../../plans/shared-contact-blocks-fd-questions.md) (Q1 A, Q2 A, Q3 B, Q4 A). + +## Contact channels (`ContactDetails`) + +| Id | Rule | +|---|---| +| BR-CD-01 | The card lists the e-mail channel first, then the social links in the order of the content. *Q1 = A* | +| BR-CD-02 | The e-mail channel exists only when `emailAddress()` gives a valid address. Its link text is the address; its link is `mailto:` with the subject "Vraag via andreaslop.nl" (`mailSubject()`). The address is assembled in the browser only. | +| BR-CD-03 | A social channel exists only for links that `visibleSocials()` keeps (valid https). Invalid links are skipped; the order of the rest is kept. | +| BR-CD-04 | A social channel's link text is its `label` after trimming; an empty or missing label falls back to the platform name ("Instagram", "Facebook"). *Q2 = A* | +| BR-CD-05 | Social channels open in a new tab with `rel="noopener noreferrer"` and the visually hidden text "(opent in nieuw tabblad)", as in the footer. The e-mail channel opens in the same tab. | +| BR-CD-06 | No valid channel → the card is not rendered at all (no empty heading). | +| BR-CD-07 | Each channel shows its icon (platform icon or mail icon), hidden from assistive technology. | +| BR-CD-08 | Hover: the link text turns to the accent colour; the icon keeps its own colour; no underline. Keyboard focus: the theme focus ring. Each row is at least 44 px high. *Q4 = A* | + +```mermaid +graph TD + Start(["Site content"]) --> E{"Valid e-mail address?"} + E -->|"yes"| AddE["Add e-mail channel first"] + E -->|"no"| S + AddE --> S["Take social links in content order"] + S --> V{"Valid https link?"} + V -->|"no"| Skip["Skip it"] + V -->|"yes"| L{"Non-empty label?"} + L -->|"yes"| UseL["Link text = label"] + L -->|"no"| UseN["Link text = platform name"] + UseL --> Next["Next link"] + UseN --> Next + Skip --> Next + Next --> Any{"Any channel?"} + Any -->|"no"| None(["Render nothing"]) + Any -->|"yes"| Card(["Render the card"]) + classDef start fill:#CE93D8,stroke:#6A1B9A,stroke-width:1px,color:#000; + classDef decision fill:#FFF59D,stroke:#F57F17,stroke-width:1px,color:#000; + classDef step fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + class Start,None,Card start; + class E,V,L,Any decision; + class AddE,S,Skip,UseL,UseN,Next step; +``` + +Text alternative: a valid e-mail address becomes the first channel; each social link in content order is skipped when its link is invalid, otherwise it becomes a channel with its label or the platform name; the card is rendered only when at least one channel exists. + +## Privacy line + +| Id | Rule | +|---|---| +| BR-PR-01 | The text "Lees in de privacyverklaring wat ik met je gegevens doe." with "privacyverklaring" as an underlined router link to `/privacyverklaring`. | +| BR-PR-02 | Shown under the submit button inside `ContactForm` (every form that uses it). | +| BR-PR-03 | While the form is gated, the same line is also shown under the "Binnenkort" notice, so it can be read and followed now. *Q3 = B* | +| BR-PR-04 | One shared component renders the line in both places, so the text and link never drift apart. | + +## Reply time + +| Id | Rule | +|---|---| +| BR-RT-01 | The thank-you message is "Bedankt voor je bericht! Ik reageer binnen {replyTime}." with `replyTime` from `siteContent.contactForm.replyTime`. | +| BR-RT-02 | No other place hard-codes a reply time. | + +## `ContactPanel` — behaviour kept from the homepage + +| Id | Rule | +|---|---| +| BR-CPN-01 | Shoot options = the shown packages in their order, then "Overig" (`shootOptions`). | +| BR-CPN-02 | A raw `pakket` value is validated with `packageFromSearch` against the shown packages; only a known id preselects. A new valid value (also the same one again) re-applies the preselect (`key` increments); an invalid value changes nothing. | +| BR-CPN-03 | The mail subject is "Aanvraag fotoshoot: {package name}" after a valid preselect, otherwise "Vraag via andreaslop.nl". It is used by the gate's mail button and the form's failure message. | +| BR-CPN-04 | `load="lazy"`: the form loads when its spot comes near the screen (`DEFERRED_LOAD_MARGIN`) or immediately when a `pakket` value arrives; until then a placeholder keeps its height (604 px on phones, 502 px from `sm`); once loaded it stays loaded. | +| BR-CPN-05 | `load="eager"`: the form is part of the page and renders right away, without a placeholder. | +| BR-CPN-06 | The gate is shown whenever `enabled` is false, with the mail button (subject per BR-CPN-03) and the privacy line (BR-PR-03). | +| BR-CPN-07 | Not the panel's job: heading, URL clean-up, scrolling and focus. On the homepage `ContactSection` keeps doing these exactly as today. | diff --git a/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/domain-entities.md b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/domain-entities.md new file mode 100644 index 0000000..54b1585 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/domain-entities.md @@ -0,0 +1,55 @@ +# Domain Entities — Unit 2: Shared contact blocks + +## Entity relationships + +```mermaid +graph TD + Site["SiteContent"] -->|"has"| Email["EmailAddress (user, domain)"] + Site -->|"has 0..n, in display order"| Social["SocialLink (platform, href, label?)"] + Site -->|"has"| FormCfg["contactForm (enabled, replyTime)"] + Social -->|"platform refers to"| Platform["socialPlatforms entry (name, icon)"] + Email -->|"becomes 0..1"| Channel["ContactChannel"] + Social -->|"becomes 0..1 when valid"| Channel + Packages["PricingPackage list"] -->|"gives"| Options["ShootOption list (+ Overig)"] + Panel["ContactPanel input"] -->|"uses"| FormCfg + Panel -->|"uses"| Options + Panel -->|"raw pakket"| Preselect["Preselect (shoot id, key)"] + classDef content fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + classDef derived fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000; + classDef registry fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; + class Site,Email,Social,FormCfg,Packages content; + class Channel,Options,Preselect,Panel derived; + class Platform registry; +``` + +Text alternative: site content holds the e-mail address, the social links and the form settings; each valid e-mail or social link becomes one contact channel; the packages give the shoot options; the panel combines form settings, options and the preselect derived from the raw package value. + +## Content entities (API-shaped, `content/types.ts`) + +| Entity | Field | Type | Change | Notes | +|---|---|---|---|---| +| `SocialLink` | `platform` | `SocialPlatform` | — | `facebook` or `instagram` | +| | `href` | `string` | — | shown only as a valid https URL | +| | `label` | `string?` | **new** | visible link text in the contact card; without it, the platform name | +| `SiteContent` | `contactForm.enabled` | `boolean` | — | the gate switch | +| | `contactForm.replyTime` | `string` | **new** | e.g. "1-2 werkdagen"; one value for the thank-you and the contact page intro | +| | `socials` | `SocialLink[]` | **order changed** | Instagram first, then Facebook (Q1 = A); footer follows | + +### Values in `siteContent.ts` +- Instagram: `href` unchanged, `label: '@andreaslopfotografie'` +- Facebook: `href` unchanged, `label: 'Andrea Slop Fotografie'` (Q2 = A) +- `contactForm: { enabled: false, replyTime: '1-2 werkdagen' }` + +## Derived entities (pure, not stored) + +### `ContactChannel` (`lib/contactChannels.ts`) +| Field | Type | Meaning | +|---|---|---| +| `kind` | `'email' \| 'social'` | which kind of channel | +| `platform` | `SocialPlatform?` | for `social` only; selects name and icon | +| `href` | `string` | `mailto:` link with the default subject, or the profile URL | +| `label` | `string` | visible link text | +| `external` | `boolean` | `true` for socials: open in a new tab with the hidden hint | + +### `ContactPanel` input +`idPrefix`, `packages`, `enabled`, `email`, `replyTime`, raw `pakket?`, `load: 'lazy' | 'eager'` (see [component-methods.md](../../../inception/application-design/component-methods.md)). The preselect `{ shoot, key }` and the mail subject are derived inside, exactly as `ContactSection` does today. diff --git a/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/frontend-components.md b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/frontend-components.md new file mode 100644 index 0000000..9b8a059 --- /dev/null +++ b/aidlc-docs/features/contact-page/construction/shared-contact-blocks/functional-design/frontend-components.md @@ -0,0 +1,63 @@ +# Frontend Components — Unit 2: Shared contact blocks + +## Hierarchy + +```mermaid +graph TD + Home["routes/index.tsx"] --> Section["home/ContactSection (heading, URL clean-up, scroll, focus)"] + Section --> Panel["ContactPanel (load lazy)"] + Panel --> Gate["ContactFormGate"] + Gate --> Privacy1["PrivacyNote (under the notice)"] + Panel --> Form["ContactForm (lazy chunk or direct)"] + Form --> Privacy2["PrivacyNote (under the submit button)"] + Details["ContactDetails (used by the contact page in unit 3)"] --> Eyebrow["Eyebrow as h2"] + Details --> Row["channel row: icon + link"] + classDef page fill:#2196F3,stroke:#0d47a1,color:#000; + classDef shared fill:#4CAF50,stroke:#2e7d32,color:#000; + classDef small fill:#e2e8f0,stroke:#4a5568,color:#000; + class Home,Section page; + class Panel,Gate,Form,Details shared; + class Privacy1,Privacy2,Eyebrow,Row small; +``` + +Text alternative: the homepage renders ContactSection, which renders ContactPanel; the panel wraps the form in the gate; both the gate notice and the form show PrivacyNote; ContactDetails (for the contact page) renders an eyebrow-style h2 and one row per channel. + +## Components + +### `ContactPanel` (new, `components/ContactPanel/`) +- **Props**: see [component-methods.md](../../../inception/application-design/component-methods.md). +- **State**: `seenPakket`, `preselect { shoot, key }`, `chosenName` (moved from `ContactSection`); `formLoaded` for `lazy`. +- **Test ids**: keeps `contact-gate`, `contact-gate-notice`, `contact-gate-mail`, `contact-form*` from the existing components. +- **Accessibility**: unchanged (gate uses `inert`; the notice is outside the inert part). + +### `home/ContactSection` (changed) +- Keeps `TITLE_ID`, heading, `PageSection id="contact"`, the `?pakket=` clean-up effect (navigate replace, hash scroll respecting reduced motion, focus on the heading). +- Renders `` inside its `Reveal`. + +### `ContactForm` (changed) +- New prop `replyTime`; thank-you text per BR-RT-01. +- `PrivacyNote` under the submit button (BR-PR-02). + +### `ContactFormGate` (changed) +- `PrivacyNote` under the mail button in the notice (BR-PR-03), only when the gate is shown. + +### `PrivacyNote` (new, small, `components/PrivacyNote/`) +- Renders BR-PR-01: `Text` in small size, `ink.soft`, with `Link variant="underline"` + `RouterLink to="/privacyverklaring"`. +- Test id: `privacy-note`. + +### `ContactDetails` (new, `components/ContactDetails/`) +- **Props**: `titleId`, `title`, `email`, `socials`, `portrait?`, `data-testid?`. +- **Structure**: a card (`bg` white, border `line`, shadow `panel`); header: optional round portrait (decorative, `alt=""`) next to the h2 (`Eyebrow as="h2"` with `id={titleId}`); a `ul` with `aria-labelledby={titleId}`; one `li` per channel with a link containing the icon (`aria-hidden`) and the label (+ hidden new-tab hint for socials). +- **Styling**: rows `minH="44px"`, icon in `accent.deep`, text `ink.soft` → `accent.deep` on hover, theme focus ring (BR-CD-08); all from theme tokens. +- **Test ids**: `{testid}` on the card, `contact-details-{kind or platform}` on each link. +- **Portrait size and layout variants** are used in unit 3; in this unit the component supports the prop and is tested with and without it. + +## Interactions +- E-mail row: opens the mail app (`mailto:` with subject). +- Social rows: open the profile in a new tab. +- Privacy link: in-app navigation to `/privacyverklaring`. +- Homepage: unchanged flows ("Boek …" → preselect → URL clean-up → scroll → focus). + +## Visible change on existing pages +- Homepage contact section: the privacy line under the "Binnenkort" notice (and under the form once enabled). +- Footer: Instagram now listed before Facebook (content order, Q1 = A). 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..ab62540 --- /dev/null +++ b/aidlc-docs/features/contact-page/inception/requirements/requirements.md @@ -0,0 +1,199 @@ +# 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* +- **Extended at Code Generation of unit 3 (owner, 2026-10-25)**: on Soorten fotoshoots, "Stuur een berichtje" per shoot goes to `/contact?pakket=` (shoots without a shown package to `/contact`), and "Boek je shoot" to `/contact`. + +### 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) diff --git a/aidlc-docs/features/frontend-shell/operations/deployment/deployment-plan.md b/aidlc-docs/features/frontend-shell/operations/deployment/deployment-plan.md index 00cccdb..fb17e4b 100644 --- a/aidlc-docs/features/frontend-shell/operations/deployment/deployment-plan.md +++ b/aidlc-docs/features/frontend-shell/operations/deployment/deployment-plan.md @@ -34,7 +34,7 @@ Text alternative: feature branches go through a pull request with CI into master | D3 | **Environments**: test and production. | Q5 = B | | D4 | **Test deploy**: automatically on every push to `master` (incl. a merged PR), and manually from any branch with "Deploy to Test", for example to try a branch before merging. | Q6 = B, CQ1 | | D5 | **Production deploy**: manual only ("Deploy to Production"), and only from a `release/*` branch; the workflow refuses other branches. | Q6 = B, CQ1 | -| D6 | **Quality gate**: every run does lint, format, tests, build and audit (`check`) before any deploy. **Test deploys right after `check`**, and Lighthouse (mobile + desktop) runs alongside as information. **Production waits for both `check` and Lighthouse.** Branch protection on `master` requires only `check`; Lighthouse is deliberately not a merge requirement. In CI, Lighthouse **Performance is report-only** (the Pi runner gives scores 30-40 points too low); accessibility, best practices and SEO block. Performance blocks in `pnpm check` on a PC. HTML reports are attached to every run as the `lighthouse-reports` artifact. | Q7 = A; Lighthouse CI question A | +| D6 | **Quality gate**: every run does lint, format, tests, build and audit (`check`) before any deploy. **Test deploys right after `check`**, and Lighthouse (mobile + desktop) runs alongside as information. **Production waits for both `check` and Lighthouse.** Branch protection on `master` requires both `check` and `lighthouse` (the owner added `lighthouse` as a required check on 2026-10-19; it was first deliberately left out). In CI, Lighthouse **Performance is report-only** (the Pi runner gives scores 30-40 points too low); accessibility, best practices and SEO block. Performance blocks in `pnpm check` on a PC. HTML reports are attached to every run as the `lighthouse-reports` artifact. | Q7 = A; Lighthouse CI question A; owner 2026-10-19 | | D7 | **Chrome for Lighthouse**: Playwright's Chromium (supports linux-arm64), installed in the job with a pinned Playwright version. Not the browser on the host: jobs run in containers and cannot see it. | CQ5 | | D8 | **Test target**: Raspberry Pi with nginx behind the reverse-proxy Pi, **next to the current WordPress site**. Deploy over SSH (`sshpass` + `scp`, same secrets as your other projects). Simple: empty the test folder, then copy the new build in; no old versions are kept. The step refuses an empty path, `/`, or a folder containing WordPress (`wp-config.php` / `wp-content`). The nginx block has its own `server_name` and never `default_server`. | CQ4 = B; owner: simpler than other apps, must not conflict with WordPress | | D9 | **Test is never indexed**: `X-Robots-Tag: noindex, nofollow` and a `robots.txt` that disallows everything. | Derived | diff --git a/web/lighthouserc.cjs b/web/lighthouserc.cjs index 8289d2b..f301d5c 100644 --- a/web/lighthouserc.cjs +++ b/web/lighthouserc.cjs @@ -6,8 +6,8 @@ const origin = 'http://localhost:4173'; // Moet gelijk lopen met src/sitePages.ts (een test bewaakt dat) -const indexedPaths = ['/', '/over-mij', '/soorten-fotoshoots']; -const noindexPaths = ['/portfolio', '/contact', '/privacyverklaring']; +const indexedPaths = ['/', '/over-mij', '/soorten-fotoshoots', '/contact']; +const noindexPaths = ['/portfolio', '/privacyverklaring']; const notFoundPath = '/bestaat-niet'; // Homepage mobiel voorlopig 0,8: de foto's zijn nog niet responsive en de diff --git a/web/public/og-contact.jpg b/web/public/og-contact.jpg new file mode 100644 index 0000000..17733d5 Binary files /dev/null and b/web/public/og-contact.jpg differ diff --git a/web/src/app.test.tsx b/web/src/app.test.tsx index 6103fa3..240872d 100644 --- a/web/src/app.test.tsx +++ b/web/src/app.test.tsx @@ -144,10 +144,10 @@ describe('app', () => { ).toHaveAttribute('href', '/portfolio'); expect( screen.getByRole('link', { name: 'neem contact op' }), - ).toHaveAttribute('href', '/#contact'); + ).toHaveAttribute('href', '/contact'); expect( screen.getByRole('link', { name: 'Boek je shoot' }), - ).toHaveAttribute('href', '/#contact'); + ).toHaveAttribute('href', '/contact'); expect( screen.getByRole('list', { name: "Foto's" }), ).toBeInTheDocument(); @@ -163,6 +163,71 @@ describe('app', () => { expect(await axeResults(container)).toHaveNoViolations(); }); + it('shows the contact page with its outline, cards and structured data', async () => { + const { container } = await renderApp('/contact'); + await screen.findByRole('heading', { level: 1, name: 'Contact' }); + const main = within(screen.getByRole('main')); + // Both cards are in the page; jsdom has no screen width, so the + // headings are listed regardless of which layout is visible + expect( + main + .getAllByRole('heading', { hidden: true }) + .map((h) => `${h.tagName} ${h.textContent}`), + ).toEqual([ + 'H1 Contact', + 'H2 Direct contact', + 'H2 Stuur me een bericht', + 'H2 Direct contact', + ]); + expect( + screen.getByText(/ik reageer binnen 1-2 werkdagen\./), + ).toBeInTheDocument(); + expect( + screen.getByRole('region', { name: 'Stuur me een bericht' }), + ).toBeInTheDocument(); + expect( + screen.getByTestId('contact-details-narrow'), + ).toBeInTheDocument(); + expect(screen.getByTestId('contact-details-wide')).toBeInTheDocument(); + expect( + await screen.findByTestId('contact-form-shoot', undefined, { + timeout: 10_000, + }), + ).toBeInTheDocument(); + + expect(document.title).toBe( + 'Contact – fotoshoot boeken in Huizen | Andrea Slop Fotografie', + ); + expect(document.head.querySelector('meta[name="robots"]')).toBeNull(); + const types = [ + ...document.querySelectorAll('script[type="application/ld+json"]'), + ].map((script) => JSON.parse(script.textContent!)['@type']); + expect(types.sort()).toEqual(['ContactPage', 'ProfessionalService']); + expect(await axeResults(container)).toHaveNoViolations(); + }); + + it('takes over ?pakket= on the contact page and tidies the URL without moving focus', async () => { + const { router } = await renderApp('/contact?pakket=newborn'); + expect( + await screen.findByTestId('contact-form-shoot', undefined, { + timeout: 10_000, + }), + ).toHaveValue('newborn'); + await waitFor(() => expect(router.state.location.searchStr).toBe('')); + expect(router.state.location.pathname).toBe('/contact'); + expect(document.activeElement).toBe(document.body); + }); + + it('drops an unknown ?pakket= on the contact page', async () => { + const { router } = await renderApp('/contact?pakket=bruiloft'); + expect( + await screen.findByTestId('contact-form-shoot', undefined, { + timeout: 10_000, + }), + ).toHaveValue(''); + await waitFor(() => expect(router.state.location.searchStr).toBe('')); + }); + it('shows the shoot types page with its outline, links and structured data', async () => { const { container } = await renderApp('/soorten-fotoshoots'); await screen.findByRole('heading', { @@ -193,11 +258,11 @@ describe('app', () => { .getAllByRole('link', { name: /^Stuur een berichtje/ }) .map((link) => link.getAttribute('href')), ).toEqual([ - '/?pakket=newborn#contact', - '/?pakket=zwangerschap#contact', - '/?pakket=gezin#contact', - '/#contact', - '/#contact', + '/contact?pakket=newborn', + '/contact?pakket=zwangerschap', + '/contact?pakket=gezin', + '/contact', + '/contact', ]); // Links to the filtered portfolio only once that page is live // (indexed); they switch on by themselves when it is @@ -221,7 +286,7 @@ describe('app', () => { ).toHaveAttribute('href', '/#prijzen'); expect( screen.getByRole('link', { name: 'Boek je shoot' }), - ).toHaveAttribute('href', '/#contact'); + ).toHaveAttribute('href', '/contact'); expect(document.title).toBe( 'Soorten fotoshoots | Andrea Slop Fotografie', diff --git a/web/src/assets/contact/contact-portret.jpg b/web/src/assets/contact/contact-portret.jpg new file mode 100644 index 0000000..dfa0595 Binary files /dev/null and b/web/src/assets/contact/contact-portret.jpg differ diff --git a/web/src/assets/contact/contact.jpg b/web/src/assets/contact/contact.jpg new file mode 100644 index 0000000..0568965 Binary files /dev/null and b/web/src/assets/contact/contact.jpg differ diff --git a/web/src/components/ContactDetails/ContactDetails.test.tsx b/web/src/components/ContactDetails/ContactDetails.test.tsx new file mode 100644 index 0000000..8b0cb8b --- /dev/null +++ b/web/src/components/ContactDetails/ContactDetails.test.tsx @@ -0,0 +1,106 @@ +import { screen, within } from '@testing-library/react'; +import { describe, expect, it } from 'vitest'; +import siteContent from '@/content/siteContent'; +import { axeResults } from '@/test/axe'; +import { renderWithProviders } from '@/test/renderWithProviders'; +import ContactDetails from './ContactDetails'; + +type Props = Partial>; + +const card = (props: Props = {}) => ( + +); + +const portrait = { + src: '/portret.jpg', + alt: 'Andrea', + width: 144, + height: 144, +}; + +describe('ContactDetails', () => { + it('lists e-mail, Instagram and Facebook under a named heading', async () => { + const { container } = await renderWithProviders(card()); + expect( + screen.getByRole('heading', { level: 2, name: 'Direct contact' }), + ).toHaveAttribute('id', 'details-title'); + const list = screen.getByRole('list', { name: 'Direct contact' }); + const names = within(list) + .getAllByRole('link') + .map((link) => link.textContent); + expect(names).toEqual([ + 'info@andreaslop.nl', + '@andreaslopfotografie (opent in nieuw tabblad)', + 'Andrea Slop Fotografie (opent in nieuw tabblad)', + ]); + expect(await axeResults(container)).toHaveNoViolations(); + }); + + it('mails with the default subject in the same tab', async () => { + await renderWithProviders(card()); + const mail = screen.getByTestId('contact-details-email'); + expect(mail).toHaveAttribute( + 'href', + 'mailto:info@andreaslop.nl?subject=Vraag%20via%20andreaslop.nl', + ); + expect(mail).not.toHaveAttribute('target'); + }); + + it('opens the socials safely in a new tab and says so', async () => { + await renderWithProviders(card()); + const instagram = screen.getByRole('link', { + name: '@andreaslopfotografie (opent in nieuw tabblad)', + }); + expect(instagram).toHaveAttribute('target', '_blank'); + expect(instagram).toHaveAttribute('rel', 'noopener noreferrer'); + expect(instagram).toHaveAttribute( + 'href', + 'https://www.instagram.com/andreaslopfotografie/', + ); + }); + + it('hides the icons from assistive technology', async () => { + await renderWithProviders(card()); + const icons = screen.getByTestId('details').querySelectorAll('svg'); + expect(icons).toHaveLength(3); + icons.forEach((icon) => + expect(icon).toHaveAttribute('aria-hidden', 'true'), + ); + }); + + it('renders nothing without a valid channel', async () => { + const { container } = await renderWithProviders( + card({ email: { user: '', domain: '' }, socials: [] }), + ); + expect(screen.queryByTestId('details')).toBeNull(); + expect(container.querySelector('h2')).toBeNull(); + }); + + it('shows the portrait as decoration next to the heading', async () => { + const { container } = await renderWithProviders(card({ portrait })); + const photo = screen.getByTestId('contact-details-portrait'); + expect(photo).toHaveAttribute('src', '/portret.jpg'); + expect(photo).toHaveAttribute('alt', ''); + expect(await axeResults(container)).toHaveNoViolations(); + }); + + it('can appear twice on a page with its own heading ids', async () => { + const { container } = await renderWithProviders( + <> + {card({ titleId: 'details-a', 'data-testid': 'a' })} + {card({ titleId: 'details-b', 'data-testid': 'b' })} + , + ); + expect( + screen.getAllByRole('list', { name: 'Direct contact' }), + ).toHaveLength(2); + expect(await axeResults(container)).toHaveNoViolations(); + }); +}); diff --git a/web/src/components/ContactDetails/ContactDetails.tsx b/web/src/components/ContactDetails/ContactDetails.tsx new file mode 100644 index 0000000..b551bee --- /dev/null +++ b/web/src/components/ContactDetails/ContactDetails.tsx @@ -0,0 +1,118 @@ +import { + Box, + chakra, + Flex, + Image, + Link, + VisuallyHidden, +} from '@chakra-ui/react'; +import mailFilled from '@iconify-icons/ant-design/mail-filled'; +import { Icon } from '@iconify/react/offline'; +import Eyebrow from '@/components/Eyebrow/Eyebrow'; +import socialPlatforms from '@/content/socialPlatforms'; +import type { ContentImage, EmailAddress, SocialLink } from '@/content/types'; +import { contactChannels, type ContactChannel } from '@/lib/contactChannels'; + +type ContactDetailsProps = { + // Id of the h2, unique on the page: the card can appear twice + titleId: string; + title: string; + email: EmailAddress; + socials: SocialLink[]; + // Small round photo next to the heading; decorative, the heading and + // the page already say whose card it is + portrait?: ContentImage; + 'data-testid'?: string; +}; + +const iconOf = (channel: ContactChannel) => + channel.kind === 'email' + ? mailFilled + : socialPlatforms[channel.platform].icon; + +// "Direct contact": a card with the ways to reach Andrea, each an icon and a +// link (BR-CD-01..08). Renders nothing when no channel is valid. +export default function ContactDetails({ + titleId, + title, + email, + socials, + portrait, + 'data-testid': testId, +}: ContactDetailsProps) { + const channels = contactChannels(email, socials); + if (channels.length === 0) return null; + + return ( + + + {portrait && ( + + )} + + {title} + + + + {channels.map((channel) => ( + + + + + + {/* Space outside the hidden text, or it drops out + of the announced name */} + {channel.label} + {channel.external && ( + <> + {' '} + + (opent in nieuw tabblad) + + + )} + + + ))} + + + ); +} diff --git a/web/src/components/ContactForm/ContactForm.test.tsx b/web/src/components/ContactForm/ContactForm.test.tsx index c3004f8..11121e4 100644 --- a/web/src/components/ContactForm/ContactForm.test.tsx +++ b/web/src/components/ContactForm/ContactForm.test.tsx @@ -26,6 +26,7 @@ const renderForm = ( options={options} mailSubject="Vraag via andreaslop.nl" email={siteContent.email} + replyTime="1-2 werkdagen" submit={vi.fn().mockResolvedValue(undefined)} {...props} />, @@ -117,6 +118,24 @@ describe('ContactForm', () => { expect(screen.queryByTestId('contact-form')).toBeNull(); }); + it('takes the reply time for the thank-you from the content', async () => { + await renderForm({ replyTime: '3 werkdagen' }); + fillIn(); + send(); + expect( + await screen.findByTestId('contact-form-sent'), + ).toHaveTextContent('Ik reageer binnen 3 werkdagen.'); + }); + + it('shows the privacy line under the submit button', async () => { + await renderForm(); + const form = screen.getByTestId('contact-form'); + expect(form).toContainElement(screen.getByTestId('privacy-note')); + expect( + screen.getByRole('link', { name: 'privacyverklaring' }), + ).toHaveAttribute('href', '/privacyverklaring'); + }); + it('keeps the input and offers the mail link when sending fails', async () => { await renderForm({ submit: vi.fn().mockRejectedValue(new Error('x')) }); fillIn(); @@ -194,6 +213,7 @@ describe('ContactForm', () => { preselect={preselect} mailSubject="Vraag via andreaslop.nl" email={siteContent.email} + replyTime="1-2 werkdagen" /> ); diff --git a/web/src/components/ContactForm/ContactForm.tsx b/web/src/components/ContactForm/ContactForm.tsx index 7a235c1..40097d7 100644 --- a/web/src/components/ContactForm/ContactForm.tsx +++ b/web/src/components/ContactForm/ContactForm.tsx @@ -12,6 +12,7 @@ import { Textarea, useRecipe, } from '@chakra-ui/react'; +import PrivacyNote from '@/components/PrivacyNote/PrivacyNote'; import { submitContactForm } from '@/contact/submitContactForm'; import { CONTACT_LIMITS, @@ -39,12 +40,11 @@ type ContactFormProps = { preselect?: { shoot: string; key: number }; mailSubject: string; email: EmailAddress; + // How soon Andrea answers, e.g. '1-2 werkdagen' (siteContent) + replyTime: string; submit?: (payload: ContactPayload) => Promise; }; -const SENT_MESSAGE = - 'Bedankt voor je bericht! Ik reageer binnen 1-2 werkdagen.'; - // The contact form (design .form): name and e-mail, the shoot, the question, // and the browser-side anti-spam. Its behaviour is the pure // contactFormReducer; this component wires it to the fields. @@ -54,6 +54,7 @@ export default function ContactForm({ preselect, mailSubject, email, + replyTime, submit = submitContactForm, }: ContactFormProps) { const reduce = ( @@ -106,7 +107,7 @@ export default function ContactForm({ borderStartColor="accent" bg="paper.alt" > - {SENT_MESSAGE} + {`Bedankt voor je bericht! Ik reageer binnen ${replyTime}.`} ); } @@ -291,13 +292,15 @@ export default function ContactForm({ {disabled ? 'Versturen…' : '(Aan)vraag versturen'} + {/* Under the submit button, aligned with it */} + ); diff --git a/web/src/components/ContactForm/ContactFormGate.test.tsx b/web/src/components/ContactForm/ContactFormGate.test.tsx index c32f81e..39b3e79 100644 --- a/web/src/components/ContactForm/ContactFormGate.test.tsx +++ b/web/src/components/ContactForm/ContactFormGate.test.tsx @@ -44,7 +44,21 @@ describe('ContactFormGate', () => { expect(screen.getByTestId('contact-gate-notice')).toHaveTextContent( 'Het contactformulier komt binnenkort.', ); - expect(screen.queryByRole('link')).toBeNull(); + // Only the privacy link is left; no mail link without an address + expect( + screen.getAllByRole('link').map((link) => link.textContent), + ).toEqual(['privacyverklaring']); + }); + + it('shows the privacy line under the notice, outside the inert form', async () => { + await renderGate(false); + const notice = screen.getByTestId('contact-gate-notice'); + const note = screen.getByTestId('privacy-note'); + expect(notice).toContainElement(note); + expect(note.closest('[inert]')).toBeNull(); + expect( + screen.getByRole('link', { name: 'privacyverklaring' }), + ).toHaveAttribute('href', '/privacyverklaring'); }); it('shows just the form when switched on', async () => { diff --git a/web/src/components/ContactForm/ContactFormGate.tsx b/web/src/components/ContactForm/ContactFormGate.tsx index ee338c8..41b3f10 100644 --- a/web/src/components/ContactForm/ContactFormGate.tsx +++ b/web/src/components/ContactForm/ContactFormGate.tsx @@ -1,6 +1,7 @@ import type { ReactNode } from 'react'; import { Box, chakra, Link, Text, useRecipe } from '@chakra-ui/react'; import Eyebrow from '@/components/Eyebrow/Eyebrow'; +import PrivacyNote from '@/components/PrivacyNote/PrivacyNote'; import type { EmailAddress } from '@/content/types'; import { emailAddress } from '@/lib/emailAddress'; import { mailtoLink } from '@/lib/mailLink'; @@ -68,6 +69,8 @@ export default function ContactFormGate({ Stuur een e-mail )} + {/* Readable now, while the form's own line is inert (BR-PR-03) */} + ); diff --git a/web/src/components/ContactPanel/ContactPanel.test.tsx b/web/src/components/ContactPanel/ContactPanel.test.tsx new file mode 100644 index 0000000..df309ca --- /dev/null +++ b/web/src/components/ContactPanel/ContactPanel.test.tsx @@ -0,0 +1,124 @@ +import { useState } from 'react'; +import { act, fireEvent, screen } from '@testing-library/react'; +import { describe, expect, it, vi } from 'vitest'; +import packages from '@/content/packages'; +import siteContent from '@/content/siteContent'; +import { axeResults } from '@/test/axe'; +import { FakeIntersectionObserver } from '@/test/fakeIntersectionObserver'; +import { renderWithProviders } from '@/test/renderWithProviders'; +import ContactPanel from './ContactPanel'; + +type Props = Partial>; + +const panel = (props: Props = {}) => ( + +); + +// The form is a lazy chunk; its first import can take over a second under +// the full suite with coverage +const LAZY_LOAD = { timeout: 10_000 }; +const shoot = () => + screen.findByTestId('contact-form-shoot', undefined, LAZY_LOAD); +const mailButton = () => screen.getByRole('link', { name: 'Stuur een e-mail' }); + +describe('ContactPanel', () => { + it('loads the form right away when eager, behind the gate', async () => { + const { container } = await renderWithProviders(panel()); + expect(await shoot()).toHaveValue(''); + expect(screen.getByTestId('contact-gate-notice')).toBeInTheDocument(); + expect(mailButton()).toHaveAttribute( + 'href', + 'mailto:info@andreaslop.nl?subject=Vraag%20via%20andreaslop.nl', + ); + expect(await axeResults(container)).toHaveNoViolations(); + }); + + it('offers the shown packages and Overig as shoots', async () => { + await renderWithProviders(panel({ enabled: true })); + const options = [...(await shoot()).querySelectorAll('option')].map( + (option) => option.textContent, + ); + expect(options).toEqual([ + 'Kies een optie...', + ...packages.map((pkg) => pkg.name), + 'Overig', + ]); + }); + + it('waits with a placeholder until the form comes near the screen when lazy', async () => { + vi.stubGlobal('IntersectionObserver', FakeIntersectionObserver); + FakeIntersectionObserver.reset(); + await renderWithProviders(panel({ load: 'lazy' })); + expect(screen.queryByTestId('contact-form')).toBeNull(); + // The notice is already in place over the reserved space + expect(screen.getByTestId('contact-gate-notice')).toBeInTheDocument(); + + act(() => + FakeIntersectionObserver.instances.forEach((observer) => + observer.trigger(true), + ), + ); + expect(await shoot()).toBeInTheDocument(); + }); + + it('loads a lazy form at once when a package is chosen', async () => { + vi.stubGlobal('IntersectionObserver', FakeIntersectionObserver); + FakeIntersectionObserver.reset(); + await renderWithProviders(panel({ load: 'lazy', pakket: 'newborn' })); + expect(await shoot()).toHaveValue('newborn'); + }); + + it('preselects a known package and puts it in the mail subject', async () => { + await renderWithProviders(panel({ pakket: ' NEWBORN ' })); + expect(await shoot()).toHaveValue('newborn'); + expect(mailButton()).toHaveAttribute( + 'href', + 'mailto:info@andreaslop.nl?subject=Aanvraag%20fotoshoot%3A%20Newborn', + ); + }); + + it('ignores an unknown package', async () => { + await renderWithProviders(panel({ pakket: 'bruiloft' })); + expect(await shoot()).toHaveValue(''); + expect(mailButton()).toHaveAttribute( + 'href', + 'mailto:info@andreaslop.nl?subject=Vraag%20via%20andreaslop.nl', + ); + }); + + it('applies the same package again after the visitor changed it', async () => { + // The page clears ?pakket= after taking it over; a second "Boek" + // click on the same package brings it back + function Harness() { + const [pakket, setPakket] = useState('newborn'); + return ( + <> + + + {panel({ enabled: true, pakket })} + + ); + } + await renderWithProviders(); + fireEvent.change(await shoot(), { target: { value: 'gezin' } }); + fireEvent.click(screen.getByRole('button', { name: 'wis' })); + expect(await shoot()).toHaveValue('gezin'); + fireEvent.click(screen.getByRole('button', { name: 'boek' })); + expect(await shoot()).toHaveValue('newborn'); + }); + + it('shows just the form when switched on', async () => { + await renderWithProviders(panel({ enabled: true })); + await shoot(); + expect(screen.queryByTestId('contact-gate-notice')).toBeNull(); + expect(screen.getByTestId('privacy-note')).toBeInTheDocument(); + }); +}); diff --git a/web/src/components/ContactPanel/ContactPanel.tsx b/web/src/components/ContactPanel/ContactPanel.tsx new file mode 100644 index 0000000..95d9c82 --- /dev/null +++ b/web/src/components/ContactPanel/ContactPanel.tsx @@ -0,0 +1,100 @@ +import { lazy, Suspense, useMemo, useState } from 'react'; +import { Box } from '@chakra-ui/react'; +import { DEFERRED_LOAD_MARGIN } from '@/components/DeferredImage/DeferredImage'; +import ContactFormGate from '@/components/ContactForm/ContactFormGate'; +import type { EmailAddress, PricingPackage } from '@/content/types'; +import useInView from '@/hooks/useInView'; +import { mailSubject } from '@/lib/mailLink'; +import { packageFromSearch } from '@/lib/packageFromSearch'; +import { shootOptions } from '@/lib/shootOptions'; +import { visiblePackages } from '@/lib/visiblePackages'; + +// The form (Chakra fields, validation, reducer) is its own chunk, so a page +// only pays for it when the form is about to be used. On the homepage that +// saved ±0.03 Lighthouse performance on mobile. +const ContactForm = lazy(() => import('@/components/ContactForm/ContactForm')); + +// Keeps the form's space while it loads, so the notice sits where it will +// stay and the page below does not jump (measured with the privacy line: +// 649px on phones, where name and e-mail are stacked, 547px from sm) +const FORM_PLACEHOLDER_HEIGHT = { base: '649px', sm: '547px' }; + +type ContactPanelProps = { + // Prefix for the form's field ids, unique per page + idPrefix: string; + packages: PricingPackage[]; + enabled: boolean; + email: EmailAddress; + replyTime: string; + // Raw ?pakket= value from the page; checked against the shown packages + pakket?: string; + // lazy: load the form when it comes near the screen or a package is + // chosen (homepage); eager: start loading it with the page (contact page) + load: 'lazy' | 'eager'; +}; + +// The contact form, ready to place on a page: the coming-soon gate, the +// shoot options from the packages and a package chosen via ?pakket=, with +// the mail subject that goes with it (BR-CPN-01..06). Heading, URL clean-up, +// scrolling and focus stay with the page. +export default function ContactPanel({ + idPrefix, + packages, + enabled, + email, + replyTime, + pakket, + load, +}: ContactPanelProps) { + const shown = useMemo(() => visiblePackages(packages), [packages]); + const options = useMemo(() => shootOptions(packages), [packages]); + + // Take over a new ?pakket= while rendering (React's pattern for a + // changed prop); the last "Boek" click wins (BR-PARAM-03) + const [seenPakket, setSeenPakket] = useState(); + const [preselect, setPreselect] = useState<{ + shoot: string; + key: number; + }>(); + const [chosenName, setChosenName] = useState(); + if (pakket !== seenPakket) { + setSeenPakket(pakket); + const id = + pakket === undefined ? undefined : packageFromSearch(pakket, shown); + if (id) { + setPreselect({ shoot: id, key: (preselect?.key ?? 0) + 1 }); + setChosenName(shown.find((pkg) => pkg.id === id)?.name); + } + } + const subject = mailSubject(chosenName); + + const { ref, inView } = useInView({ + rootMargin: DEFERRED_LOAD_MARGIN, + }); + // Once loaded the form stays, also after ?pakket= is removed from the + // URL; otherwise it would be recreated and lose what was typed + const [formLoaded, setFormLoaded] = useState(load === 'eager'); + if (!formLoaded && (inView || pakket !== undefined)) setFormLoaded(true); + const placeholder = ; + + return ( + + + {formLoaded ? ( + + + + ) : ( + placeholder + )} + + + ); +} diff --git a/web/src/components/Footer/Footer.test.tsx b/web/src/components/Footer/Footer.test.tsx index 5f153df..c44cb88 100644 --- a/web/src/components/Footer/Footer.test.tsx +++ b/web/src/components/Footer/Footer.test.tsx @@ -41,7 +41,10 @@ describe('Footer', () => { }); expect(link).toHaveAttribute('target', '_blank'); expect(link).toHaveAttribute('rel', 'noopener noreferrer'); - expect(link).toHaveAttribute('href', siteContent.socials[0].href); + expect(link).toHaveAttribute( + 'href', + siteContent.socials.find((s) => s.platform === 'facebook')?.href, + ); }); it('voegt het e-mailadres pas bij het tonen samen', async () => { diff --git a/web/src/components/Hero/Hero.test.tsx b/web/src/components/Hero/Hero.test.tsx index e19484f..c3f6923 100644 --- a/web/src/components/Hero/Hero.test.tsx +++ b/web/src/components/Hero/Hero.test.tsx @@ -21,8 +21,12 @@ describe('Hero', () => { const links = screen.getAllByRole('link', { name: /opent in nieuw tabblad/, }); + // In content order: Instagram, then Facebook expect(links).toHaveLength(2); expect(links[0]).toHaveAccessibleName( + 'Instagram (opent in nieuw tabblad)', + ); + expect(links[1]).toHaveAccessibleName( 'Facebook (opent in nieuw tabblad)', ); expect(links[0]).toHaveAttribute('rel', 'noopener noreferrer'); diff --git a/web/src/components/PrivacyNote/PrivacyNote.test.tsx b/web/src/components/PrivacyNote/PrivacyNote.test.tsx new file mode 100644 index 0000000..84be488 --- /dev/null +++ b/web/src/components/PrivacyNote/PrivacyNote.test.tsx @@ -0,0 +1,18 @@ +import { screen } from '@testing-library/react'; +import { describe, expect, it } from 'vitest'; +import { axeResults } from '@/test/axe'; +import { renderWithProviders } from '@/test/renderWithProviders'; +import PrivacyNote from './PrivacyNote'; + +describe('PrivacyNote', () => { + it('links to the privacy statement', async () => { + const { container } = await renderWithProviders(); + expect(screen.getByTestId('privacy-note')).toHaveTextContent( + 'Lees in de privacyverklaring wat ik met je gegevens doe.', + ); + expect( + screen.getByRole('link', { name: 'privacyverklaring' }), + ).toHaveAttribute('href', '/privacyverklaring'); + expect(await axeResults(container)).toHaveNoViolations(); + }); +}); diff --git a/web/src/components/PrivacyNote/PrivacyNote.tsx b/web/src/components/PrivacyNote/PrivacyNote.tsx new file mode 100644 index 0000000..94240e8 --- /dev/null +++ b/web/src/components/PrivacyNote/PrivacyNote.tsx @@ -0,0 +1,24 @@ +import { Link, Text, type TextProps } from '@chakra-ui/react'; +import RouterLink from '@/components/RouterLink'; + +// The line under a contact form (and under its "coming soon" notice) that +// tells visitors where to read what happens with their details (BR-PR-01). +// One component, so the text and the link never differ between places. +export default function PrivacyNote(props: TextProps) { + return ( + + Lees in de{' '} + + + privacyverklaring + + {' '} + wat ik met je gegevens doe. + + ); +} diff --git a/web/src/components/about/AboutIntro/AboutIntro.test.tsx b/web/src/components/about/AboutIntro/AboutIntro.test.tsx index 822ce5b..7448d82 100644 --- a/web/src/components/about/AboutIntro/AboutIntro.test.tsx +++ b/web/src/components/about/AboutIntro/AboutIntro.test.tsx @@ -28,7 +28,7 @@ describe('AboutIntro', () => { ).toHaveAttribute('href', '/portfolio'); expect( within(section).getByRole('link', { name: 'neem contact op' }), - ).toHaveAttribute('href', '/#contact'); + ).toHaveAttribute('href', '/contact'); expect(await axeResults(container)).toHaveNoViolations(); }); }); diff --git a/web/src/components/contact/ContactAside/ContactAside.test.tsx b/web/src/components/contact/ContactAside/ContactAside.test.tsx new file mode 100644 index 0000000..49622fa --- /dev/null +++ b/web/src/components/contact/ContactAside/ContactAside.test.tsx @@ -0,0 +1,48 @@ +import { screen } from '@testing-library/react'; +import { describe, expect, it } from 'vitest'; +import { axeResults } from '@/test/axe'; +import { renderWithProviders } from '@/test/renderWithProviders'; +import ContactAside, { ASIDE_MEDIA } from './ContactAside'; + +const image = { + src: '/contact.jpg', + alt: 'Andrea met haar camera', + width: 840, + height: 1050, +}; + +describe('ContactAside', () => { + it('offers the photo only to wide screens, with priority', async () => { + const { container } = await renderWithProviders( + +

Kaart

+
, + ); + const source = container.querySelector('picture source'); + expect(source).toHaveAttribute('media', ASIDE_MEDIA); + expect(source).toHaveAttribute('srcset', '/contact.jpg'); + + // Hidden in jsdom: it has no screen width, so the base display wins + const photo = screen.getByRole('img', { + name: image.alt, + hidden: true, + }); + // Phones get a tiny inline image, never the photo itself + expect(photo.getAttribute('src')).toMatch(/^data:image\/gif/); + expect(photo).toHaveAttribute('fetchpriority', 'high'); + expect(photo).toHaveAttribute('width', '840'); + expect(photo).toHaveAttribute('height', '1050'); + expect(await axeResults(container)).toHaveNoViolations(); + }); + + it('lays the card over the photo', async () => { + await renderWithProviders( + +

Kaart

+
, + ); + expect(screen.getByTestId('contact-aside')).toContainElement( + screen.getByText('Kaart'), + ); + }); +}); diff --git a/web/src/components/contact/ContactAside/ContactAside.tsx b/web/src/components/contact/ContactAside/ContactAside.tsx new file mode 100644 index 0000000..6bc10ff --- /dev/null +++ b/web/src/components/contact/ContactAside/ContactAside.tsx @@ -0,0 +1,56 @@ +import type { ReactNode } from 'react'; +import { Box, chakra, Image } from '@chakra-ui/react'; +import type { ContentImage } from '@/content/types'; + +// The media query from where the aside shows (theme breakpoint lg) +export const ASIDE_MEDIA = '(min-width: 64em)'; + +// A transparent 1×1 GIF: what phones get instead of the photo +const NO_PHOTO = + 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; + +type ContactAsideProps = { + image: ContentImage; + // The contact card, laid over the bottom of the photo + children: ReactNode; +}; + +// The right column of the contact page on wide screens: the photo with the +// contact card overlapping its bottom edge (mockup 1a, BR-CP-06..09). +// Hidden below lg; there the picture's source does not apply, so phones +// never download the photo. On wide screens it is the largest paint, so it +// loads straight away with high priority. +export default function ContactAside({ image, children }: ContactAsideProps) { + return ( + + + + {image.alt} + + + {children} + + + ); +} diff --git a/web/src/components/home/ContactSection/ContactSection.test.tsx b/web/src/components/home/ContactSection/ContactSection.test.tsx index 6a1e554..fbbfa76 100644 --- a/web/src/components/home/ContactSection/ContactSection.test.tsx +++ b/web/src/components/home/ContactSection/ContactSection.test.tsx @@ -14,6 +14,7 @@ const renderSection = (pakket?: string, path = '/') => packages={packages} enabled={false} email={siteContent.email} + replyTime={siteContent.contactForm.replyTime} pakket={pakket} />, { path }, diff --git a/web/src/components/home/ContactSection/ContactSection.tsx b/web/src/components/home/ContactSection/ContactSection.tsx index 34a6dde..aaae4c7 100644 --- a/web/src/components/home/ContactSection/ContactSection.tsx +++ b/web/src/components/home/ContactSection/ContactSection.tsx @@ -1,8 +1,7 @@ -import { lazy, Suspense, useEffect, useMemo, useState } from 'react'; -import { Box, useMediaQuery } from '@chakra-ui/react'; +import { useEffect } from 'react'; +import { useMediaQuery } from '@chakra-ui/react'; import { useNavigate } from '@tanstack/react-router'; -import { DEFERRED_LOAD_MARGIN } from '@/components/DeferredImage/DeferredImage'; -import ContactFormGate from '@/components/ContactForm/ContactFormGate'; +import ContactPanel from '@/components/ContactPanel/ContactPanel'; import PageSection from '@/components/PageSection/PageSection'; import Reveal from '@/components/Reveal/Reveal'; import SectionHeading from '@/components/SectionHeading/SectionHeading'; @@ -11,68 +10,34 @@ import type { HomeContent, PricingPackage, } from '@/content/types'; -import useInView from '@/hooks/useInView'; -import { mailSubject } from '@/lib/mailLink'; -import { packageFromSearch } from '@/lib/packageFromSearch'; -import { shootOptions } from '@/lib/shootOptions'; -import { visiblePackages } from '@/lib/visiblePackages'; - -// The form (Chakra fields, validation, reducer) sits far below the hero. -// Loading it with the page cost ±0.03 Lighthouse performance on mobile, so -// it loads when the section comes near the screen, or straight away when -// the visitor arrives via "Boek ...". -const ContactForm = lazy(() => import('@/components/ContactForm/ContactForm')); const TITLE_ID = 'contact-title'; -// Keeps the form's space while it loads, so the notice sits where it will -// stay and the page below does not jump (measured: 604px on phones, where -// name and e-mail are stacked, 502px from sm) -const FORM_PLACEHOLDER_HEIGHT = { base: '604px', sm: '502px' }; - type ContactSectionProps = { content: HomeContent['contact']; packages: PricingPackage[]; enabled: boolean; email: EmailAddress; + replyTime: string; // ?pakket= from a "Boek ..." link on a price card pakket?: string; }; // "Contact" on the homepage (design #contact): heading and lead, and the -// contact form behind the coming-soon gate. Takes over a package chosen via -// "Boek ...", then tidies the URL and moves focus here (BR-PARAM-02, -// BR-FOCUS-01). +// contact form, which sits far below the hero and so loads lazily. After a +// "Boek ..." click it tidies the URL and moves focus here (BR-PARAM-02, +// BR-FOCUS-01); the panel takes over the package itself. export default function ContactSection({ content, packages, enabled, email, + replyTime, pakket, }: ContactSectionProps) { const navigate = useNavigate(); - const shown = useMemo(() => visiblePackages(packages), [packages]); - const options = useMemo(() => shootOptions(packages), [packages]); - // Take over a new ?pakket= while rendering (React's pattern for a - // changed prop); the last "Boek" click wins (BR-PARAM-03) - const [seenPakket, setSeenPakket] = useState(); - const [preselect, setPreselect] = useState<{ - shoot: string; - key: number; - }>(); - const [chosenName, setChosenName] = useState(); - if (pakket !== seenPakket) { - setSeenPakket(pakket); - const id = - pakket === undefined ? undefined : packageFromSearch(pakket, shown); - if (id) { - setPreselect({ shoot: id, key: (preselect?.key ?? 0) + 1 }); - setChosenName(shown.find((pkg) => pkg.id === id)?.name); - } - } - - // Then remove ?pakket= from the address bar (no extra history entry) and + // Remove ?pakket= from the address bar (no extra history entry) and // continue keyboard and screen reader users here. This navigation // replaces the "Boek" click's before the router has scrolled for it, so // it must ask the router to scroll to #contact itself. @@ -98,16 +63,6 @@ export default function ContactSection({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [pakket, navigate]); - const subject = mailSubject(chosenName); - const { ref, inView } = useInView({ - rootMargin: DEFERRED_LOAD_MARGIN, - }); - // Once loaded the form stays, also after ?pakket= is removed from the - // URL; otherwise it would be recreated and lose what was typed - const [formLoaded, setFormLoaded] = useState(false); - if (!formLoaded && (inView || pakket !== undefined)) setFormLoaded(true); - const placeholder = ; - return ( - - - {formLoaded ? ( - - - - ) : ( - placeholder - )} - - + replyTime={replyTime} + pakket={pakket} + load="lazy" + /> ); diff --git a/web/src/components/shoots/ShootBlock/ShootBlock.test.tsx b/web/src/components/shoots/ShootBlock/ShootBlock.test.tsx index 23fd41d..bcadc4b 100644 --- a/web/src/components/shoots/ShootBlock/ShootBlock.test.tsx +++ b/web/src/components/shoots/ShootBlock/ShootBlock.test.tsx @@ -49,7 +49,7 @@ describe('ShootBlock', () => { const link = screen.getByRole('link', { name: 'Stuur een berichtje over een zwangerschapsshoot', }); - expect(link).toHaveAttribute('href', '/?pakket=zwangerschap#contact'); + expect(link).toHaveAttribute('href', '/contact?pakket=zwangerschap'); }); it('links to the contact form without a package when the shoot has none', async () => { @@ -58,7 +58,7 @@ describe('ShootBlock', () => { screen.getByRole('link', { name: 'Stuur een berichtje over een loveshoot', }), - ).toHaveAttribute('href', '/#contact'); + ).toHaveAttribute('href', '/contact'); }); it('only links to the portfolio once it is live', async () => { diff --git a/web/src/content/aboutContent.ts b/web/src/content/aboutContent.ts index 6db9a0a..1541f16 100644 --- a/web/src/content/aboutContent.ts +++ b/web/src/content/aboutContent.ts @@ -26,8 +26,7 @@ const aboutContent: AboutPageContent = { 'Nieuwsgierig naar mijn werk? Bekijk ', { text: 'mijn portfolio', to: '/portfolio' }, ' of ', - // The homepage contact section until /contact exists - { text: 'neem contact op', to: '/', hash: 'contact' }, + { text: 'neem contact op', to: '/contact' }, ' voor een fotoshoot!', ], ], @@ -65,7 +64,7 @@ const aboutContent: AboutPageContent = { 'Wanneer ik niet achter de camera sta ben ik bezig met tekenen, schilderen of lezen.', ], }, - booking: { label: 'Boek je shoot', to: '/', hash: 'contact' }, + booking: { label: 'Boek je shoot', to: '/contact' }, person: { name: 'Andrea Slop', jobTitle: 'Lifestyle fotograaf', diff --git a/web/src/content/contactContent.ts b/web/src/content/contactContent.ts new file mode 100644 index 0000000..ee1c5d0 --- /dev/null +++ b/web/src/content/contactContent.ts @@ -0,0 +1,32 @@ +import type { ContactPageContent } from './types'; + +// Images +import photo from '../assets/contact/contact.jpg'; +import portrait from '../assets/contact/contact-portret.jpg'; + +// Static content of the contact page until the CMS API exists (FR-CP-01, +// FR-CP-04, FR-CP-05) +const contactContent: ContactPageContent = { + head: { + eyebrow: 'Neem contact op', + title: 'Contact', + intro: 'Wil je een fotoshoot boeken of meer informatie ontvangen? Stuur me een berichtje, ik reageer binnen {reactietermijn}.', + }, + formTitle: 'Stuur me een bericht', + detailsTitle: 'Direct contact', + image: { + src: photo, + alt: 'Andrea Slop kijkt lachend over haar schouder, met haar camera in de hand, op een bospad', + width: 840, + height: 1050, + }, + portrait: { + src: portrait, + // Decorative next to the heading; the card does not use this text + alt: 'Andrea Slop', + width: 144, + height: 144, + }, +}; + +export default contactContent; diff --git a/web/src/content/shootTypesPageContent.ts b/web/src/content/shootTypesPageContent.ts index e3848d1..89cc2b9 100644 --- a/web/src/content/shootTypesPageContent.ts +++ b/web/src/content/shootTypesPageContent.ts @@ -16,7 +16,7 @@ const shootTypesPageContent: ShootTypesPageContent = { ' op de homepage of stel je vraag via het contactformulier.', ], // The homepage contact section until /contact exists - booking: { label: 'Boek je shoot', to: '/', hash: 'contact' }, + booking: { label: 'Boek je shoot', to: '/contact' }, }, }; diff --git a/web/src/content/siteContent.ts b/web/src/content/siteContent.ts index 96e5382..8a86fbc 100644 --- a/web/src/content/siteContent.ts +++ b/web/src/content/siteContent.ts @@ -5,19 +5,22 @@ const siteContent: SiteContent = { // Elke zin op een eigen regel; de footer toont de regelafbreking footerIntro: 'Lifestyle fotograaf uit Huizen.\nIk leg jouw mooiste momenten vast.', + // In display order: Instagram first, her main channel socials: [ - { - platform: 'facebook', - href: 'https://www.facebook.com/andreaslopfotografie/', - }, { platform: 'instagram', href: 'https://www.instagram.com/andreaslopfotografie/', + label: '@andreaslopfotografie', + }, + { + platform: 'facebook', + href: 'https://www.facebook.com/andreaslopfotografie/', + label: 'Andrea Slop Fotografie', }, ], email: { user: 'info', domain: 'andreaslop.nl' }, // Switched on once the API can receive the form - contactForm: { enabled: false }, + contactForm: { enabled: false, replyTime: '1-2 werkdagen' }, // Huizen and the region around it (Bussum, Hilversum, …), as the pages // say; not the whole country, which would weaken the local signal serviceArea: [ diff --git a/web/src/content/types.ts b/web/src/content/types.ts index c52e799..67be125 100644 --- a/web/src/content/types.ts +++ b/web/src/content/types.ts @@ -7,6 +7,9 @@ import type { SocialPlatform } from './socialPlatforms.ts'; export interface SocialLink { platform: SocialPlatform; href: string; // alleen getoond als geldige https-URL (zie visibleSocials) + // Link text in the contact card, e.g. '@andreaslopfotografie'; without + // it the card shows the platform name + label?: string; } // Het e-mailadres in delen: zo staat het volledige adres nergens letterlijk @@ -21,7 +24,9 @@ export interface SiteContent { socials: SocialLink[]; email: EmailAddress; // Off: the form is shown dimmed under a "coming soon" notice (FR-HP-07) - contactForm: { enabled: boolean }; + // replyTime: how soon Andrea answers, e.g. '1-2 werkdagen'; used by the + // form's thank-you and the contact page, so they always agree + contactForm: { enabled: boolean; replyTime: string }; // Where Andrea mainly works, for the structured data of the business // and its services. Matches what the pages say, not every place she // would travel to. @@ -161,6 +166,20 @@ export interface AboutPageContent { person: { name: string; jobTitle: string; knowsAbout: string[] }; } +// Content of the contact page (/contact). The intro has one placeholder, +// {reactietermijn}, filled in with siteContent.contactForm.replyTime. +export interface ContactPageContent { + head: { eyebrow: string; title: string; intro: string }; + // Heading of the form, only for assistive technology + formTitle: string; + // Heading of the contact card + detailsTitle: string; + // 4:5 photo next to the form on wide screens + image: ContentImage; + // Small square crop for the round photo in the card on narrow screens + portrait: ContentImage; +} + // Content of the shoot types page (/soorten-fotoshoots); the shoots // themselves come from shootTypes export interface ShootTypesPageContent { diff --git a/web/src/lib/contactChannels.test.ts b/web/src/lib/contactChannels.test.ts new file mode 100644 index 0000000..a2886ef --- /dev/null +++ b/web/src/lib/contactChannels.test.ts @@ -0,0 +1,154 @@ +import fc from 'fast-check'; +import { describe, expect, it } from 'vitest'; +import siteContent from '../content/siteContent'; +import socialPlatforms from '../content/socialPlatforms'; +import { anyEmail, socialLink } from '../test/arbitraries'; +import { contactChannels } from './contactChannels'; +import { emailAddress } from './emailAddress'; +import { visibleSocials } from './visibleSocials'; + +const socialLinks = fc.array(socialLink, { maxLength: 5 }); + +describe('contactChannels', () => { + it('lists e-mail, Instagram and Facebook for the site content', () => { + expect(contactChannels(siteContent.email, siteContent.socials)).toEqual( + [ + { + kind: 'email', + href: 'mailto:info@andreaslop.nl?subject=Vraag%20via%20andreaslop.nl', + label: 'info@andreaslop.nl', + external: false, + }, + { + kind: 'social', + platform: 'instagram', + href: 'https://www.instagram.com/andreaslopfotografie/', + label: '@andreaslopfotografie', + external: true, + }, + { + kind: 'social', + platform: 'facebook', + href: 'https://www.facebook.com/andreaslopfotografie/', + label: 'Andrea Slop Fotografie', + external: true, + }, + ], + ); + }); + + it('leaves out an invalid e-mail address and invalid links', () => { + const channels = contactChannels({ user: 'info', domain: 'nodot' }, [ + { platform: 'facebook', href: 'javascript:alert(1)' }, + { platform: 'instagram', href: 'https://instagram.com/x' }, + ]); + expect(channels.map((channel) => channel.kind)).toEqual(['social']); + }); + + it('falls back to the platform name without a usable label', () => { + const channels = contactChannels({ user: '', domain: '' }, [ + { platform: 'instagram', href: 'https://instagram.com/x' }, + { + platform: 'facebook', + href: 'https://facebook.com/x', + label: ' ', + }, + ]); + expect(channels.map((channel) => channel.label)).toEqual([ + 'Instagram', + 'Facebook', + ]); + }); + + it('is empty when nothing is valid', () => { + expect(contactChannels({ user: '', domain: '' }, [])).toEqual([]); + }); + + it('puts the e-mail channel first exactly when the address is valid (invariant)', () => { + fc.assert( + fc.property(anyEmail, socialLinks, (email, socials) => { + const channels = contactChannels(email, socials); + const valid = emailAddress(email) !== null; + expect(channels[0]?.kind === 'email').toBe(valid); + expect( + channels.filter((channel) => channel.kind === 'email'), + ).toHaveLength(valid ? 1 : 0); + }), + ); + }); + + it('shows exactly the visible social links, in order (oracle)', () => { + fc.assert( + fc.property(anyEmail, socialLinks, (email, socials) => { + const shown = contactChannels(email, socials).flatMap( + (channel) => + channel.kind === 'social' + ? [ + { + platform: channel.platform, + href: channel.href, + }, + ] + : [], + ); + expect(shown).toEqual( + visibleSocials(socials).map(({ platform, href }) => ({ + platform, + href, + })), + ); + }), + ); + }); + + it('labels a social link with its trimmed label, or else the platform name (invariant)', () => { + fc.assert( + fc.property(socialLinks, (socials) => { + const channels = contactChannels( + { user: '', domain: '' }, + socials, + ); + visibleSocials(socials).forEach((link, index) => { + const expected = + link.label?.trim() || + socialPlatforms[link.platform].name; + expect(channels[index].label).toBe(expected); + expect(channels[index].label.trim()).not.toBe(''); + }); + }), + ); + }); + + it('only links to mailto: or https: (invariant)', () => { + fc.assert( + fc.property(anyEmail, socialLinks, (email, socials) => { + for (const channel of contactChannels(email, socials)) { + const scheme = new URL(channel.href).protocol; + expect( + channel.kind === 'email' ? 'mailto:' : 'https:', + ).toBe(scheme); + } + }), + ); + }); + + it('opens exactly the social channels in a new tab (invariant)', () => { + fc.assert( + fc.property(anyEmail, socialLinks, (email, socials) => { + for (const channel of contactChannels(email, socials)) { + expect(channel.external).toBe(channel.kind === 'social'); + } + }), + ); + }); + + it('has at most one channel per link plus the e-mail (invariant)', () => { + fc.assert( + fc.property(anyEmail, socialLinks, (email, socials) => { + expect( + contactChannels(email, socials).length, + ).toBeLessThanOrEqual(1 + socials.length); + }), + ); + }); +}); diff --git a/web/src/lib/contactChannels.ts b/web/src/lib/contactChannels.ts new file mode 100644 index 0000000..d237ac7 --- /dev/null +++ b/web/src/lib/contactChannels.ts @@ -0,0 +1,48 @@ +import socialPlatforms, { + type SocialPlatform, +} from '../content/socialPlatforms.ts'; +import type { EmailAddress, SocialLink } from '../content/types.ts'; +import { emailAddress } from './emailAddress.ts'; +import { mailSubject, mailtoLink } from './mailLink.ts'; +import { visibleSocials } from './visibleSocials.ts'; + +// One way to reach Andrea, as the contact card shows it +export type ContactChannel = + | { kind: 'email'; href: string; label: string; external: false } + | { + kind: 'social'; + platform: SocialPlatform; + href: string; + label: string; + // Opens in a new tab (BR-CD-05) + external: true; + }; + +// The channels of the contact card (BR-CD-01..05): the e-mail address first +// when it is valid, then the valid social links in content order, each with +// its label or else the platform name. Only mailto: and https: links come +// out, because both helpers already drop everything else. +export function contactChannels( + email: EmailAddress, + socials: readonly SocialLink[], +): ContactChannel[] { + const address = emailAddress(email); + const mail: ContactChannel[] = address + ? [ + { + kind: 'email', + href: mailtoLink(address, mailSubject()), + label: address, + external: false, + }, + ] + : []; + const social = visibleSocials(socials).map((link): ContactChannel => ({ + kind: 'social', + platform: link.platform, + href: link.href, + label: link.label?.trim() || socialPlatforms[link.platform].name, + external: true, + })); + return [...mail, ...social]; +} diff --git a/web/src/lib/shootLinks.test.ts b/web/src/lib/shootLinks.test.ts index 5ed8c0b..9f965f3 100644 --- a/web/src/lib/shootLinks.test.ts +++ b/web/src/lib/shootLinks.test.ts @@ -16,16 +16,14 @@ const shoot = (id: string) => shootTypes.find((item) => item.id === id)!; describe('shootContactLink', () => { it('preselects the package of a shoot that has one', () => { expect(shootContactLink(shoot('newborn'), packages)).toEqual({ - to: '/', + to: '/contact', search: { pakket: 'newborn' }, - hash: 'contact', }); }); it('links without a package for a shoot that has none', () => { expect(shootContactLink(shoot('loveshoot'), packages)).toEqual({ - to: '/', - hash: 'contact', + to: '/contact', }); }); @@ -35,14 +33,13 @@ describe('shootContactLink', () => { shoot('gezin'), packages.filter((pkg) => pkg.id !== 'gezin'), ), - ).toEqual({ to: '/', hash: 'contact' }); + ).toEqual({ to: '/contact' }); }); - it('always goes to the contact section (invariant)', () => { + it('always goes to the contact page (invariant)', () => { fc.assert( fc.property(shootType, fc.array(anyPackage), (item, list) => { - const link = shootContactLink(item, list); - return link.to === '/' && link.hash === 'contact'; + return shootContactLink(item, list).to === '/contact'; }), ); }); diff --git a/web/src/lib/shootLinks.ts b/web/src/lib/shootLinks.ts index 457f906..9611997 100644 --- a/web/src/lib/shootLinks.ts +++ b/web/src/lib/shootLinks.ts @@ -3,9 +3,8 @@ import type { RoutePath } from '../navigation.ts'; import type { PageMeta } from '../sitePages.ts'; import { visiblePackages } from './visiblePackages.ts'; -// Where "Stuur een berichtje" goes: the homepage contact section, with the -// shoot's package preselected when that package is shown (BR-SF-01..03). -// Once /contact exists, only this function changes. +// Where "Stuur een berichtje" goes: the contact page, with the shoot's +// package preselected when that package is shown (BR-SF-01..03, FR-CP-09) export function shootContactLink( shoot: ShootType, packages: readonly PricingPackage[], @@ -14,12 +13,8 @@ export function shootContactLink( (pkg) => pkg.id === shoot.packageId, ); return shown && shoot.packageId !== undefined - ? { - to: '/' as const, - search: { pakket: shoot.packageId }, - hash: 'contact', - } - : { to: '/' as const, hash: 'contact' }; + ? { to: '/contact' as const, search: { pakket: shoot.packageId } } + : { to: '/contact' as const }; } // "Bekijk meer …foto's": the portfolio filtered on this shoot type diff --git a/web/src/lib/withReplyTime.test.ts b/web/src/lib/withReplyTime.test.ts new file mode 100644 index 0000000..35d14cb --- /dev/null +++ b/web/src/lib/withReplyTime.test.ts @@ -0,0 +1,60 @@ +import fc from 'fast-check'; +import { describe, expect, it } from 'vitest'; +import contactContent from '../content/contactContent'; +import siteContent from '../content/siteContent'; +import { REPLY_TIME_PLACEHOLDER, withReplyTime } from './withReplyTime'; + +// Text with some placeholders in it, as an editor might write it. Plain +// pieces have no braces: half a placeholder around a real one could +// otherwise form a new one, which content never contains. +const plain = fc.string().filter((text) => !/[{}]/.test(text)); +const template = fc + .array(fc.oneof(plain, fc.constant(REPLY_TIME_PLACEHOLDER))) + .map((pieces) => pieces.join('')); +const replyTime = fc + .string() + .filter((value) => !value.includes(REPLY_TIME_PLACEHOLDER)); + +describe('withReplyTime', () => { + it('fills in the reply time of the site in the contact intro', () => { + expect( + withReplyTime( + contactContent.head.intro, + siteContent.contactForm.replyTime, + ), + ).toBe( + 'Wil je een fotoshoot boeken of meer informatie ontvangen? Stuur me een berichtje, ik reageer binnen 1-2 werkdagen.', + ); + }); + + it('leaves no placeholder behind (invariant)', () => { + fc.assert( + fc.property(template, replyTime, (text, time) => { + expect(withReplyTime(text, time)).not.toContain( + REPLY_TIME_PLACEHOLDER, + ); + }), + ); + }); + + it('returns text without the placeholder as it is (invariant)', () => { + fc.assert( + fc.property( + fc.string().filter((t) => !t.includes(REPLY_TIME_PLACEHOLDER)), + fc.string(), + (text, time) => { + expect(withReplyTime(text, time)).toBe(text); + }, + ), + ); + }); + + it('puts the reply time exactly where the placeholders were (oracle)', () => { + fc.assert( + fc.property(fc.array(plain), replyTime, (pieces, time) => { + const text = pieces.join(REPLY_TIME_PLACEHOLDER); + expect(withReplyTime(text, time)).toBe(pieces.join(time)); + }), + ); + }); +}); diff --git a/web/src/lib/withReplyTime.ts b/web/src/lib/withReplyTime.ts new file mode 100644 index 0000000..78b18bc --- /dev/null +++ b/web/src/lib/withReplyTime.ts @@ -0,0 +1,8 @@ +// The placeholder for the reply time in content texts (BR-CP-05) +export const REPLY_TIME_PLACEHOLDER = '{reactietermijn}'; + +// Fills in the reply time, so a text and the form's thank-you always name +// the same one. Text without the placeholder comes back as it is. +export function withReplyTime(text: string, replyTime: string): string { + return text.split(REPLY_TIME_PLACEHOLDER).join(replyTime); +} diff --git a/web/src/recipes/linkButton.ts b/web/src/recipes/linkButton.ts index cdc247a..3e96d73 100644 --- a/web/src/recipes/linkButton.ts +++ b/web/src/recipes/linkButton.ts @@ -28,15 +28,16 @@ const linkButtonRecipe = defineRecipe({ _hover: { bg: 'ink', color: 'paper' }, _focusVisible: { bg: 'ink', color: 'paper' }, }, - // Gevuld met het heidegroen + // Filled with the deep heidegroen: white on the design's lighter + // accent is only 3.58:1, on accent.deep about 5.7:1 (WCAG AA) accent: { - borderColor: 'accent', - bg: 'accent', + borderColor: 'accent.deep', + bg: 'accent.deep', color: 'white', - _hover: { bg: 'accent.deep', borderColor: 'accent.deep' }, + _hover: { bg: 'accent.deeper', borderColor: 'accent.deeper' }, _focusVisible: { - bg: 'accent.deep', - borderColor: 'accent.deep', + bg: 'accent.deeper', + borderColor: 'accent.deeper', }, }, // Wit, voor over foto's diff --git a/web/src/routes/contact.tsx b/web/src/routes/contact.tsx index 4b94308..ba613c1 100644 --- a/web/src/routes/contact.tsx +++ b/web/src/routes/contact.tsx @@ -1,17 +1,101 @@ -import { createFileRoute } from '@tanstack/react-router'; +import { useEffect } from 'react'; +import { Box, Grid, Heading, VisuallyHidden } from '@chakra-ui/react'; +import { createFileRoute, useNavigate } from '@tanstack/react-router'; +import ContactAside from '../components/contact/ContactAside/ContactAside'; +import ContactDetails from '../components/ContactDetails/ContactDetails'; +import ContactPanel from '../components/ContactPanel/ContactPanel'; import PageIntro from '../components/PageIntro/PageIntro'; -import { pageHead } from '../seo'; +import PageSection from '../components/PageSection/PageSection'; +import Reveal from '../components/Reveal/Reveal'; +import contactContent from '../content/contactContent'; +import packages from '../content/packages'; +import siteContent from '../content/siteContent'; +import { withReplyTime } from '../lib/withReplyTime'; +import { contactPage, pageHead, structuredDataScript } from '../seo'; + +// ?pakket= from a link elsewhere on the site. Only text is kept; the panel +// checks it against the shown packages (BR-CP-10). +type ContactSearch = { pakket?: string }; + +const FORM_TITLE_ID = 'contact-form-title'; export const Route = createFileRoute('/contact')({ - head: () => pageHead('/contact'), + validateSearch: (search: Record): ContactSearch => + typeof search.pakket === 'string' ? { pakket: search.pakket } : {}, + head: () => ({ + ...pageHead('/contact'), + scripts: [structuredDataScript(contactPage('/contact'))], + }), component: Contact, }); -// Placeholder tot de echte pagina er is (noindex via sitePages) +// The contact page (mockup 1a): the form next to the photo with the contact +// card on wide screens; below lg the card with a small portrait above the +// form (BR-CP-01..04). The card is in the page twice, one per layout, so the +// reading order always matches what is shown. function Contact() { + const { pakket } = Route.useSearch(); + const navigate = useNavigate(); + const { head, formTitle, detailsTitle, image, portrait } = contactContent; + const { email, socials, contactForm } = siteContent; + + // The panel has taken the package over; tidy the address bar without a + // history entry and without a focus move (BR-CP-12). This navigation can + // replace the one that brought the visitor here before the router has + // scrolled for it, so it keeps the reset to the top of the page. + useEffect(() => { + if (pakket === undefined) return; + void navigate({ to: '/contact', search: {}, replace: true }); + }, [pakket, navigate]); + + const details = (variant: 'narrow' | 'wide') => ( + + ); + return ( - - Deze pagina is nog in de maak. Kom snel terug! - + <> + + {withReplyTime(head.intro, contactForm.replyTime)} + + + + {details('narrow')} + + + + + + {formTitle} + + + + + {details('wide')} + + + ); } diff --git a/web/src/routes/index.tsx b/web/src/routes/index.tsx index 2869d7e..9580d6d 100644 --- a/web/src/routes/index.tsx +++ b/web/src/routes/index.tsx @@ -47,6 +47,7 @@ function Index() { packages={packages} enabled={siteContent.contactForm.enabled} email={siteContent.email} + replyTime={siteContent.contactForm.replyTime} pakket={pakket} /> {instagram && ( diff --git a/web/src/seo.test.ts b/web/src/seo.test.ts index 8c7b91d..ad35791 100644 --- a/web/src/seo.test.ts +++ b/web/src/seo.test.ts @@ -12,6 +12,7 @@ import { areaServed, businessId, canonicalUrl, + contactPage, defaultOgImage, jsonLdScript, pageHead, @@ -569,3 +570,55 @@ describe('shootServices', () => { ); }); }); + +describe('the contact page', () => { + it('is indexed, with its own title, description and preview image', () => { + const head = pageHead('/contact'); + expect(head.meta[0]).toEqual({ + title: 'Contact – fotoshoot boeken in Huizen | Andrea Slop Fotografie', + }); + expect(meta(head, 'robots')).toBeUndefined(); + expect(meta(head, 'og:image')).toMatchObject({ + content: `${siteUrl}/og-contact.jpg`, + }); + expect(head.links[0].href).toBe(`${siteUrl}/contact`); + }); + + it('keeps title and description within what search engines show', () => { + const page = sitePages['/contact']; + // 61: one over the guideline, accepted to keep "Contact" first + expect( + `${page.title} | Andrea Slop Fotografie`.length, + ).toBeLessThanOrEqual(61); + expect(page.description.length).toBeLessThanOrEqual(155); + }); + + it('describes the page as a ContactPage about the business', () => { + expect(contactPage('/contact')).toEqual({ + '@context': 'https://schema.org', + '@type': 'ContactPage', + '@id': `${siteUrl}/contact`, + url: `${siteUrl}/contact`, + name: sitePages['/contact'].title, + description: sitePages['/contact'].description, + inLanguage: 'nl-NL', + about: { '@id': businessId }, + }); + }); + + it('never contains an e-mail address and survives the script tag (invariant, round trip)', () => { + fc.assert( + fc.property( + fc.constantFrom(...(Object.keys(sitePages) as RoutePath[])), + (path) => { + const data = contactPage(path); + const script = jsonLdScript(data); + expect(script).not.toMatch(/@[a-z0-9-]+\.[a-z]/i); + expect(JSON.parse(script)).toEqual(data); + expect(data['@id']).toBe(canonicalUrl(path)); + expect(data.about).toEqual({ '@id': businessId }); + }, + ), + ); + }); +}); diff --git a/web/src/seo.ts b/web/src/seo.ts index 3ef4cfd..ea1a380 100644 --- a/web/src/seo.ts +++ b/web/src/seo.ts @@ -167,6 +167,12 @@ export function aboutPage( }); } +// The contact page, about the business (SEO-CP-03); no e-mail address, for +// the same reason as above +export function contactPage(path: RoutePath) { + return webPage('ContactPage', path, { about: { '@id': businessId } }); +} + // An image URL for structured data: bundled images have a path, which // becomes absolute on the site; an absolute URL stays as it is (BR-SF-13) export function absoluteUrl(src: string): string { diff --git a/web/src/sitePages.ts b/web/src/sitePages.ts index f4a8bf3..f9cf54c 100644 --- a/web/src/sitePages.ts +++ b/web/src/sitePages.ts @@ -56,10 +56,16 @@ const sitePages: Record = { }, }, '/contact': { - title: 'Contact', + title: 'Contact – fotoshoot boeken in Huizen', description: - 'Neem contact op met Andrea Slop Fotografie voor een fotoshoot in Huizen en omgeving. Ik denk graag met je mee over jullie wensen.', - indexed: false, + '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.', + indexed: true, + ogImage: { + path: '/og-contact.jpg', + width: 1200, + height: 630, + alt: 'Andrea Slop met haar camera op een bospad', + }, }, '/privacyverklaring': { title: 'Privacyverklaring', diff --git a/web/src/sitemap.test.ts b/web/src/sitemap.test.ts index 465e2e1..e6c69e5 100644 --- a/web/src/sitemap.test.ts +++ b/web/src/sitemap.test.ts @@ -22,6 +22,7 @@ describe('sitemapXml', () => { `${base}/`, `${base}/over-mij`, `${base}/soorten-fotoshoots`, + `${base}/contact`, ]); }); diff --git a/web/src/test/arbitraries.ts b/web/src/test/arbitraries.ts index 4601ca1..f770a86 100644 --- a/web/src/test/arbitraries.ts +++ b/web/src/test/arbitraries.ts @@ -39,10 +39,18 @@ export const anyHref = fc.oneof( fc.string(), ); -export const socialLink: fc.Arbitrary = fc.record({ - platform, - href: anyHref, -}); +export const socialLink: fc.Arbitrary = fc.record( + { + platform, + href: anyHref, + // Missing, blank, padded or ordinary, as an editor might type it + label: fc.oneof( + fc.constantFrom('', ' ', ' @andreaslopfotografie '), + fc.string({ maxLength: 30 }), + ), + }, + { requiredKeys: ['platform', 'href'] }, +); // Een geldig deel van een e-mailadres: geen spaties, geen @ const emailPart = fc.stringMatching(/^[a-z0-9._-]{1,20}$/); @@ -65,7 +73,7 @@ export const anySiteContent: fc.Arbitrary = fc.record({ footerIntro: fc.string(), socials: fc.array(socialLink, { maxLength: 4 }), email: validEmail, - contactForm: fc.record({ enabled: fc.boolean() }), + contactForm: fc.record({ enabled: fc.boolean(), replyTime: fc.string() }), serviceArea: fc.array( fc.record({ type: fc.constantFrom( diff --git a/web/src/theme.ts b/web/src/theme.ts index 94047bb..6fd81f0 100644 --- a/web/src/theme.ts +++ b/web/src/theme.ts @@ -53,7 +53,10 @@ const config = defineConfig({ line: { value: '#e2dad0' }, // hairlines accent: { DEFAULT: { value: '#7f8b76' }, // heidegroen - deep: { value: '#5f6a58' }, // accent hover + // Text and buttons in heidegroen: white on it meets 4.5:1 + deep: { value: '#5f6a58' }, + // Hover on a deep-green button (deep at 75%) + deeper: { value: '#475042' }, }, sand: { value: '#d9cdbc' }, // zachte vlakken en decoratie // Blocks behind the shoot photos, one per shoot type, taken