Functional design, code generation plan and summary of the contact page, the updated LAYOUT.md diagram and the extended link requirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
4.2 KiB
Markdown
32 lines
4.2 KiB
Markdown
# Code Generation Plan — Unit 3: Contact page
|
||
|
||
Single source of truth for generating unit 3. Workspace: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-contact\web`, branch `feature/contact-page` (on master a58bc1c + units 1–2).
|
||
|
||
## Unit context
|
||
- **Requirements**: FR-CP-01..05, FR-CP-09..11, SEO-CP-01..05, NFR-CP-01, 03..06.
|
||
- **Design**: [functional design](../contact-page/functional-design/) (BR-CP-01..20); shared blocks from unit 2 (`ContactPanel`, `ContactDetails`, `PrivacyNote`); `webPage()` from unit 1.
|
||
- **Source photo**: the original of the live contact photo, `https://andreaslop.nl/wp-content/uploads/2024/10/WhatsApp-Image-2024-10-27-at-14.31.42.jpeg` (1600×1067, landscape). The live page and the design use a 632×658 crop of it, too small for the desktop column.
|
||
- **Shared resources**: "claim 4173" / "4173 free" with Portfolio-pagina around Lighthouse; no deploy to test without "claim test".
|
||
|
||
## Steps
|
||
|
||
- [x] **Step 1 — Images** (one-off scratchpad script, PowerShell/System.Drawing with EXIF orientation, as in earlier features; not a build dependency):
|
||
- `web/src/assets/contact/contact.jpg` — 4:5 cover crop around Andrea, 840×1050, JPEG quality 80;
|
||
- `web/src/assets/contact/contact-portret.jpg` — square face crop, 144×144;
|
||
- `web/public/og-contact.jpg` — 1200×630 crop with her face in the upper third.
|
||
- Show the three crops on one contact sheet for approval before they are fixed; draft the alt texts (photo: descriptive Dutch; preview: own alt in `sitePages`).
|
||
- [x] **Step 2 — Content**: `ContactPageContent` in `content/types.ts`; `content/contactContent.ts` with the head texts (intro with `{reactietermijn}`), `formTitle`, `detailsTitle`, `image`, `portrait`.
|
||
- [x] **Step 3 — `lib/withReplyTime.ts` + test**: examples and the 3 properties (BR-CP-05).
|
||
- [x] **Step 4 — SEO**: `contactPage()` in `seo.ts` + tests (examples, invariants, round trip); `sitePages['/contact']` (title, description, `indexed: true`, `ogImage`); `lighthouserc.cjs` `/contact` → `indexedPaths` (not a photo page); `sitemap.test.ts` expects `/contact`.
|
||
- [x] **Step 5 — `components/contact/ContactAside` + test**: `picture` with the `lg` media source and the transparent fallback, priority, intrinsic size, overlapping card slot; tests for the source/fallback markup, alt text, priority and the card slot, axe.
|
||
- [x] **Step 6 — Route `routes/contact.tsx`**: `validateSearch`, head (page head + JSON-LD), intro with the reply time, the section per the component design, URL clean-up of `?pakket=`. Route tests (in `app.test.tsx` or a route test file): head tags (title, description, no noindex, canonical, `og:image`, JSON-LD), heading outline, both cards present with their own ids, form section named, `/contact?pakket=newborn` preselects and cleans the URL without moving focus, invalid value removed, axe.
|
||
- [x] **Step 7 — Over mij links**: `aboutContent.ts` "neem contact op" and "Boek je shoot" → `/contact`; update the Over mij tests that expect `/#contact`.
|
||
- [x] **Step 8 — LAYOUT.md**: the "Contact" diagram per `.ai/layout-conventions.md` (Intro full width; Contact form beside Photo with contact details).
|
||
- [x] **Step 9 — Verify (Step 13.5)**: `pnpm test` (no rtk filter), `pnpm lint`, `pnpm format:check`, `pnpm build`; a browser check on the production build that a 390 px viewport does not request `contact.jpg` and a 1280 px viewport does (with high priority); then "claim 4173" → `pnpm lighthouse` → "4173 free". `/contact` mobile must reach 0.9; if not, stop and report the measurement and cause (BR-CP-17).
|
||
- [x] **Step 10 — Code summary**: `aidlc-docs/features/contact-page/construction/contact-page/code/code-summary.md`.
|
||
- [x] **Step 11 — Commit** (after approval): code commit and docs commit; push. Offer a deploy to test for your review (only after "claim test" to Portfolio-pagina).
|
||
|
||
## Extension compliance (plan level)
|
||
- **Security**: no new endpoints, scripts or CSP changes (`data:` images already allowed); JSON-LD through `jsonLdScript`, no e-mail; `?pakket=` validated and never rendered; external links `noopener noreferrer` — Compliant.
|
||
- **PBT**: PBT-01/03/05 for `withReplyTime` and `contactPage`, PBT-02 round trip, PBT-07/08/10 as before — Planned.
|