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>
3.3 KiB
3.3 KiB
Code Summary — Unit 2: Shared contact blocks
Created
web/src/lib/contactChannels.ts(+.test.ts) —ContactChannelandcontactChannels(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.replyTimeweb/src/content/siteContent.ts— socials Instagram first, with labels;replyTime: '1-2 werkdagen'web/src/test/arbitraries.ts—socialLinkwith optional label;anySiteContentwithreplyTimeweb/src/components/ContactForm/ContactForm.tsx(+ test) —replyTimeprop for the thank-you;PrivacyNoteunder the submit buttonweb/src/components/ContactForm/ContactFormGate.tsx(+ test) —PrivacyNoteunder the noticeweb/src/components/home/ContactSection/ContactSection.tsx(+ test) — usesContactPanel load="lazy"; keeps heading, URL clean-up, scroll and focusweb/src/routes/index.tsx— passesreplyTimeweb/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 inContactPanelwould have put it in the homepage bundle and undone the lazy split (±0.03 mobile performance).eagernow 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 fromsm→ placeholder{ base: '649px', sm: '547px' }(was 604 / 502). ContactFormchunk: 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-mijand/soorten-fotoshoots1/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 |