Records unit 2 of the Contact page as generated

Functional design, code generation plan and summary of the shared
contact blocks, plus the coordination with the parallel features.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 18:26:48 +01:00
co-authored by Claude Opus 5.5
parent 9bb341dae7
commit ad85e3fe5b
10 changed files with 621 additions and 3 deletions
@@ -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).
@@ -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
@@ -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
@@ -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 |
@@ -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).
@@ -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. |
@@ -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.
@@ -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 `<ContactPanel idPrefix="home-contact" load="lazy" ... />` 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).