Files
SluijsensandClaude Opus 5.5 ad85e3fe5b 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>
2026-10-25 18:26:48 +01:00

32 lines
5.3 KiB
Markdown

# 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).