Records unit 3 of the Contact page as generated
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>
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
# 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.
|
||||
@@ -0,0 +1,36 @@
|
||||
# Functional Design-vragen — Unit 3: Contactpagina
|
||||
|
||||
Al vastgelegd (geen vraag nodig):
|
||||
|
||||
- **Opbouw**: zoals de goedgekeurde mockup 1a. Op brede schermen het formulier links (circa 3/5) en rechts de foto (4:5) met de kaart over de onderrand. Op smalle schermen de kaart met het ronde portret, daarna het formulier.
|
||||
- **De grote foto laadt niet op telefoons**. Dat regelt de browser zelf met een `<picture>`-element met een media query: alleen op brede schermen vraagt hij de foto op. Zonder JavaScript-trucs, en op desktop meteen met hoge prioriteit, want daar is de foto het grootste element (LCP). Het ronde portret is een aparte, kleine uitsnede.
|
||||
- **`?pakket=`**: het panel neemt het pakket over. Daarna haalt de pagina `?pakket=` uit de adresbalk, zonder nieuwe geschiedenisregel en zonder de focus te verplaatsen (de bezoeker komt op een nieuwe pagina binnen).
|
||||
- **Intro**: "Wil je een fotoshoot boeken of meer informatie ontvangen? Stuur me een berichtje, ik reageer binnen 1-2 werkdagen." De termijn komt uit `siteContent`. De rest van de zin staat in de content van de pagina, met een vaste plek voor de termijn.
|
||||
- **Koppen**: h1 "Contact", een h2 "Stuur me een bericht" die alleen screenreaders zien, en h2 "Direct contact" in de kaart. De kaart staat twee keer in de HTML (smal en breed), elk met een eigen id.
|
||||
- **Foto's**: het origineel van andreaslop.nl, eenmalig verkleind en gecomprimeerd, met een beschrijvende alt-tekst die Andrea kan nalezen. Daaruit ook de portretuitsnede en de preview-afbeelding van 1200×630.
|
||||
- **SEO**: geïndexeerd, titel en beschrijving uit de requirements, `ContactPage` JSON-LD over het bedrijf, en `/contact` in de sitemap-test en de Lighthouse-lijsten.
|
||||
- **Over mij**: "neem contact op" en "Boek je shoot" gaan naar `/contact`. **LAYOUT.md** krijgt de nieuwe opbouw.
|
||||
|
||||
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe.
|
||||
|
||||
---
|
||||
|
||||
## Vraag 1: Vanaf welke breedte twee kolommen?
|
||||
|
||||
Het formulier heeft genoeg ruimte nodig om naam en e-mail naast elkaar te tonen. Op een tablet staand (768px) zou het formulier in 3/5 van de breedte ongeveer 430px breed worden.
|
||||
|
||||
- A) **Twee kolommen vanaf 1024px** (laptop, tablet liggend). Daaronder dezelfde opbouw als op telefoon: kaart met portret, dan het formulier over de volle breedte. (aanbevolen: het formulier blijft ruim, en op een staande tablet is de volgorde duidelijk)
|
||||
- B) Twee kolommen vanaf 768px (ook tablet staand), met een smaller formulier
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 2: Lighthouse-drempel voor `/contact` op mobiel
|
||||
|
||||
Sinds Soorten fotoshoots geldt op mobiel een drempel van 0,85 voor pagina's waar een foto het grootste element is (`photoPagePaths`), en 0,9 voor de andere geïndexeerde pagina's. Op een telefoon toont de contactpagina geen grote foto, alleen het kleine portret. Het grootste element is daar waarschijnlijk tekst of het formulier.
|
||||
|
||||
- A) **Uitgaan van 0,9** (de gewone drempel, zoals in de requirements staat). Haalt de pagina dat niet, dan kom ik met de meting en de oorzaak bij je terug voordat ik iets aan de drempel verander. (aanbevolen)
|
||||
- B) Meteen in `photoPagePaths` zetten (0,85), net als Over mij en Soorten fotoshoots
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
# Functional Design Plan — Unit 3: Contact page
|
||||
|
||||
Depth: minimal. Scope from the execution plan: the `?pakket=` handling on this page, the responsive photo (LCP on wide screens, not downloaded on phones), the content model and its link to the shared reply time, structured data, the SEO registry and Lighthouse lists, and the Over mij link change. Questions: [contact-page-fd-questions.md](contact-page-fd-questions.md).
|
||||
|
||||
- [x] Collect and analyse the answers in `contact-page-fd-questions.md`
|
||||
- [x] `domain-entities.md` — `ContactPageContent`, images (photo, portrait crop, preview image), `ContactPage` structured data
|
||||
- [x] `business-rules.md` — layout per breakpoint, photo loading, `?pakket=` on this page, intro with reply time, headings and ids, SEO registry and Lighthouse lists, Over mij links, LAYOUT.md
|
||||
- [x] `business-logic-model.md` — route flow (search → panel → URL clean-up), head tags, pure helpers and their properties (PBT-01)
|
||||
- [x] `frontend-components.md` — page hierarchy, `ContactAside`, ids and test ids, responsive behaviour
|
||||
- [x] Validate against requirements.md, application-design.md and the extension rules
|
||||
Reference in New Issue
Block a user