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>
5.3 KiB
5.3 KiB
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; functional design in ../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
- 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-pageonto 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. - 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:socialLinkwith an optional label (absent, empty, whitespace, text);anySiteContentwithreplyTime. Fix tests that assume the old footer order. - Step 3 —
lib/contactChannels.ts(BR-CD-01..05):ContactChanneltype andcontactChannels(email, socials), built onemailAddress,mailtoLink,mailSubject,visibleSocials,socialPlatforms. - 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. - Step 5 —
PrivacyNote(components/PrivacyNote/, BR-PR-01): component + test (text, link target, axe). - Step 6 —
ContactForm: propreplyTime, thank-you text (BR-RT-01),PrivacyNoteunder the submit button (BR-PR-02); update its tests. - Step 7 —
ContactFormGate:PrivacyNoteunder the mail button in the notice (BR-PR-03); update its tests. - Step 8 —
ContactPanel(components/ContactPanel/, BR-CPN-01..06): move gate, lazy/eager loading with placeholder, options, preselect and mail subject out ofContactSection; tests for eager, lazy (placeholder, load near screen, load onpakket), preselect (valid, invalid, same value again), subject, gate on/off, axe. - Step 9 —
home/ContactSection(BR-CPN-07): renderContactPanel load="lazy"; keep heading, URL clean-up, scroll and focus; passreplyTimefromroutes/index.tsx. ExistingContactSectionandapp.test.tsxtests must pass unchanged in intent (only additions for the privacy line). - Step 10 —
ContactDetails(components/ContactDetails/, BR-CD-06..08): card, eyebrow h2 withtitleId, labelled list, icon rows (mail icon from@iconify-icons/ant-design, platform icons fromsocialPlatforms), 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. - 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. - Step 12 — Code summary:
aidlc-docs/features/contact-page/construction/shared-contact-blocks/code/code-summary.md. - 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/—lighthouseis a required check on master since 2026-10-19; separate docs commit; then remove that bullet from the memory note. - 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;
contactChannelsonly yieldsmailto:/https:links (property-tested); new-tab links withnoopener 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).