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:
+31
@@ -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).
|
||||
+52
@@ -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
|
||||
+10
@@ -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
|
||||
Reference in New Issue
Block a user