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:
@@ -92,14 +92,11 @@ block-beta
|
||||
columns 2
|
||||
A["Intro"]:2
|
||||
|
||||
B["Photo"]
|
||||
C["Contact form"]
|
||||
|
||||
D["Contact details"]:2
|
||||
B["Contact form"]
|
||||
C["Photo + contact details"]
|
||||
|
||||
style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
||||
style B fill:#f4a261,stroke:#b77a49,color:#fff,font-size:16px,stroke-width:2px,height:125px
|
||||
style C fill:#2a9d8f,stroke:#20766b,color:#fff,font-size:16px,stroke-width:2px,height:125px,width:192px
|
||||
style D fill:#264653,stroke:#1d353e,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
||||
|
||||
style B fill:#f4a261,stroke:#b77a49,color:#fff,font-size:16px,stroke-width:2px,height:125px,width:192px
|
||||
style C fill:#2a9d8f,stroke:#20766b,color:#fff,font-size:16px,stroke-width:2px,height:125px
|
||||
|
||||
```
|
||||
@@ -5,7 +5,7 @@
|
||||
- **Feature Slug**: contact-page
|
||||
- **Project Type**: Brownfield
|
||||
- **Start Date**: 2026-10-24T19:35:48Z
|
||||
- **Current Stage**: CONSTRUCTION - Functional Design (Unit 3 Contact page)
|
||||
- **Current Stage**: CONSTRUCTION - Build and Test (after review on test)
|
||||
- **Branch**: feature/contact-page (rebased onto master 11a5224 after over-mij-page merge)
|
||||
|
||||
## Workspace State
|
||||
@@ -55,11 +55,11 @@
|
||||
- [x] Units Generation - SKIP
|
||||
|
||||
### 🟢 CONSTRUCTION PHASE
|
||||
- [~] Functional Design - EXECUTE (units 2, 3) / SKIP (unit 1) — Unit 2 ✅
|
||||
- [x] Functional Design - EXECUTE (units 2, 3) / SKIP (unit 1) — Unit 2 ✅, Unit 3 ✅
|
||||
- [x] NFR Requirements - SKIP
|
||||
- [x] NFR Design - SKIP
|
||||
- [x] Infrastructure Design - SKIP
|
||||
- [~] Code Generation - EXECUTE (per unit) — Unit 1 webPage helper ✅ (now 3c7d00e on master), Unit 2 Shared contact blocks ✅, Unit 3 next
|
||||
- [x] Code Generation - EXECUTE (per unit) — Unit 1 webPage helper ✅ (now 3c7d00e on master), Unit 2 Shared contact blocks ✅, Unit 3 Contact page ✅ (deploy to test for review)
|
||||
- [ ] Build and Test - EXECUTE
|
||||
|
||||
### 🟡 OPERATIONS PHASE
|
||||
|
||||
@@ -668,3 +668,123 @@ Features "portfolio-page" and "soorten-fotoshoots-page" are also active and stac
|
||||
**Context**: CONSTRUCTION - Code Generation Unit 2 (approved)
|
||||
|
||||
---
|
||||
|
||||
## Commit and Push of Unit 2; Functional Design Unit 3 Started
|
||||
|
||||
**Timestamp**: 2026-10-25T17:30:00Z
|
||||
|
||||
**User Input**: (none — continuation of "Akkoord en ga verder")
|
||||
|
||||
**AI Response**: "Committed 26a8bd9 (code), 9bb341d (D6 fix in frontend-shell deployment-plan), ad85e3f (docs); pushed with --force-with-lease (9127eba...ad85e3f). Memory project_open_doc_followups: D6 bullet now says fixed on feature/contact-page (9bb341d), drop after merge (fix is not on master yet); index line updated. Informed Portfolio-pagina. Created construction/plans/contact-page-functional-design-plan.md and contact-page-fd-questions.md (decided: layout 1a, <picture> media source for the photo, ?pakket= clean-up without focus move, intro with replyTime, headings, photos, SEO, Over mij links, LAYOUT.md; questions: two-column breakpoint, mobile Lighthouse budget)."
|
||||
|
||||
**Context**: CONSTRUCTION - Functional Design Unit 3 (awaiting answers)
|
||||
|
||||
---
|
||||
|
||||
## Functional Design — Unit 3 — Answers (in chat)
|
||||
|
||||
**Timestamp**: 2026-10-25T17:40:00Z
|
||||
|
||||
**User Input**: "Kan je de vragen hier sturen" — then answered via the chat question dialog: Q1 "Vanaf 1024px (Recommended)", Q2 "0,9 – gewone drempel (Recommended)"
|
||||
|
||||
**AI Response**: "Presented the two questions in chat at the user's request; recorded the answers as A and A in contact-page-fd-questions.md. Generating the functional design artifacts."
|
||||
|
||||
**Context**: CONSTRUCTION - Functional Design Unit 3
|
||||
|
||||
---
|
||||
|
||||
## Functional Design — Unit 3 — Artifacts
|
||||
|
||||
**Timestamp**: 2026-10-25T17:55:00Z
|
||||
|
||||
**User Input**: (none — generation after the answers)
|
||||
|
||||
**AI Response**: "Generated construction/contact-page/functional-design/: domain-entities.md (ContactPageContent with {reactietermijn} placeholder, images, ContactPage, registry/test lists), business-rules.md (BR-CP-01..20: two columns from 1024 px, <picture> with a media source so phones never fetch the photo — data: already allowed by the CSP, LCP priority on wide screens, ?pakket= clean-up without focus, headings/ids, SEO, Lighthouse 0.9 with report-back rule, Over mij links, LAYOUT.md), business-logic-model.md (route flow, contactPage(), withReplyTime() with 5 PBT properties), frontend-components.md (route, ContactAside, responsive table, accessibility). Awaiting approval."
|
||||
|
||||
**Context**: CONSTRUCTION - Functional Design Unit 3 (awaiting approval)
|
||||
|
||||
---
|
||||
|
||||
## Functional Design — Unit 3 — Approval
|
||||
|
||||
**Timestamp**: 2026-10-25T18:05:00Z
|
||||
|
||||
**User Input**: "Ga verder"
|
||||
|
||||
**AI Response**: "Functional Design unit 3 approved. Started Code Generation unit 3 Part 1 (planning)."
|
||||
|
||||
**Context**: CONSTRUCTION - Functional Design Unit 3 (approved) → Code Generation Unit 3
|
||||
|
||||
---
|
||||
|
||||
## Code Generation — Unit 3 — Plan
|
||||
|
||||
**Timestamp**: 2026-10-25T18:20:00Z
|
||||
|
||||
**User Input**: (none — Part 1 planning)
|
||||
|
||||
**AI Response**: "Found the original of the live contact photo (1600×1067; the live page and design use a 632×658 crop, too small for the desktop column); verified it differs from the Over mij preview image. Created construction/plans/contact-page-code-generation-plan.md (11 steps: images with contact sheet for approval, content, withReplyTime, SEO/registry/Lighthouse/sitemap, ContactAside, route, Over mij links, LAYOUT.md, verification incl. a network check that phones do not fetch the photo and Lighthouse with the 0.9 report-back rule, summary, commit + optional test deploy)."
|
||||
|
||||
**Context**: CONSTRUCTION - Code Generation Unit 3 (plan awaiting approval)
|
||||
|
||||
---
|
||||
|
||||
## Code Generation — Unit 3 — Plan Approval
|
||||
|
||||
**Timestamp**: 2026-10-25T18:30:00Z
|
||||
|
||||
**User Input**: "approve plan"
|
||||
|
||||
**AI Response**: "Plan approved. Started Part 2 with step 1 (image crops for approval)."
|
||||
|
||||
**Context**: CONSTRUCTION - Code Generation Unit 3 (generation)
|
||||
|
||||
---
|
||||
|
||||
## Code Generation — Unit 3 — Step 1 Images
|
||||
|
||||
**Timestamp**: 2026-10-25T18:55:00Z
|
||||
|
||||
**User Input**: "waar kan ik die controleren?" — then: "desktop en preview zijn goed. het portret rondje is misschien te ver ingezoomd. kan die wat meer uitgezomd? Sanp je wta i bedoel?" — then chose "B: verder uitgezoomd"
|
||||
|
||||
**AI Response**: "Cropped the original live photo (1600×1067) with a scratchpad PowerShell/System.Drawing script: contact.jpg 840×1050 (4:5, 80 KB), og-contact.jpg 1200×630 (60 KB), portrait first 320 px square (too tight), redone as variants A (440 px) and B (560 px) → B, 144×144 (5 KB). Sent the contact sheet and the portrait comparison to the user (portrait-variants.png kept in construction/contact-page/code/). Copied the approved crops to web/src/assets/contact/ and web/public/. Alt texts as proposed (photo: 'Andrea Slop kijkt lachend over haar schouder, met haar camera in de hand, op een bospad'; preview: 'Andrea Slop met haar camera op een bospad'; portrait decorative), for Andrea to review."
|
||||
|
||||
**Context**: CONSTRUCTION - Code Generation Unit 3 (step 1 done)
|
||||
|
||||
---
|
||||
|
||||
## Code Generation — Unit 3 — Steps 2–8 and Verification Findings
|
||||
|
||||
**Timestamp**: 2026-10-25T20:10:00Z
|
||||
|
||||
**User Input**: (none — generation)
|
||||
|
||||
**AI Response**: "Steps 2–8 done: ContactPageContent + contactContent, withReplyTime (+4 tests; tightened a generator after spotting that half placeholders around a real one could form a new one), contactPage() + 4 tests, sitePages /contact (indexed, title, description, og-contact), lighthouserc /contact indexed, sitemap test, ContactAside (fixed: chakra.img read width/height as CSS props → Chakra Image with htmlWidth/htmlHeight), route /contact with app tests (outline, cards, JSON-LD, ?pakket= preselect + clean-up without focus, unknown value dropped), Over mij links → /contact, LAYOUT.md Contact diagram. Mail icon switched to the filled variant to match the platform icons. pnpm test 367/367 (seed 1871355946), lint, format, build green. Browser check on the production build: no photo request up to 1023 px (LCP = intro text), one request with priority High from 1024 px (LCP = the photo). Screenshots at 390 and 1280 px match mockup 1a. Lighthouse mobile (port 4173 claimed and released): (1) /contact accessibility 0.96 — color-contrast of the gate's 'Stuur een e-mail' accent button: white on #7f8b76 = 3.58:1; root cause in the linkButton recipe (accent variant), site-wide; not caught before because Reveal keeps below-the-fold buttons at opacity 0 during Lighthouse and jsdom computes no colours; (2) /contact performance 0.88 then 0.90 (numberOfRuns 1), LCP ≈ 3.1–3.2 s: same client-rendering mechanism as the photo pages; (3) homepage 0.79 (threshold 0.8): measured 3× on the unit 2 build and 3× on the current build — identical (0.79–0.80, LCP 4.06 s), so pre-existing and borderline, not caused by unit 3. Stopped per BR-CP-17 to put the decisions to the user."
|
||||
|
||||
**Context**: CONSTRUCTION - Code Generation Unit 3 (step 9, awaiting decisions)
|
||||
|
||||
---
|
||||
|
||||
## Code Generation — Unit 3 — Decisions and Final Verification
|
||||
|
||||
**Timestamp**: 2026-10-25T21:00:00Z
|
||||
|
||||
**User Input**: Decisions via chat dialog: accent contrast = "Donkerder groen (Recommended)"; /contact mobile budget = "0,9 houden"; homepage 0.79–0.80 = "Apart oppakken (Recommended)"
|
||||
|
||||
**AI Response**: "Accent button now on accent.deep with hover on new token accent.deeper (#475042); typegen run. Homepage budget recorded as open follow-up in memory project_open_doc_followups.md. Re-verified with 4173 claimed/released: 367/367 tests, lint, format, build green; Lighthouse accessibility now 1 everywhere; desktop all pass (/contact 0.99/1/1/1); mobile performance still fails on '/' (0.78, pre-existing) and '/contact' (0.88; kept at 0.9 by the owner) — report-only in CI per D6. Code summary written; awaiting approval."
|
||||
|
||||
**Context**: CONSTRUCTION - Code Generation Unit 3 (awaiting approval)
|
||||
|
||||
---
|
||||
|
||||
## Code Generation — Unit 3 — Soorten Links and Approval
|
||||
|
||||
**Timestamp**: 2026-10-25T21:20:00Z
|
||||
|
||||
**User Input**: "Die punten over de metingen zijn prima. Dat kan verder zo blijven. Over get \"Stuur een berichtje\"-linkjes zouden we jusit nu oppakken toch nu het contactformulier er is. Of moeten we wahcten totdat het formulier actief wordt?" — then: "ja pak nu op, dan kan je committen, pushen en deployen naar test"
|
||||
|
||||
**AI Response**: "Measurements accepted as they are. Advised doing the links now (the contact page already handles the gate with mailto and the package in the subject; the form will preselect automatically once enabled). Changed shootContactLink (to /contact, ?pakket= only for a shown package) and the Soorten 'Boek je shoot' booking target to /contact; updated shootLinks, ShootBlock and app tests; requirements FR-CP-09 extended. 367/367 tests, lint, format, build green. Unit 3 approved; committing, pushing and deploying to test (after 'claim test')."
|
||||
|
||||
**Context**: CONSTRUCTION - Code Generation Unit 3 (approved)
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# Code Summary — Unit 3: Contact page
|
||||
|
||||
## Created
|
||||
- `web/src/routes/contact.tsx` — replaces the placeholder: page head, the narrow card, the form column (visually hidden h2 + `ContactPanel load="eager"`), `ContactAside` with the wide card; `?pakket=` validation and clean-up; head with `ContactPage` JSON-LD
|
||||
- `web/src/components/contact/ContactAside/ContactAside.tsx` (+ test) — `picture` with a `(min-width: 64em)` source and a transparent `data:` fallback, priority, intrinsic size; card slot over the bottom of the photo
|
||||
- `web/src/content/contactContent.ts` — head texts (intro with `{reactietermijn}`), headings, photo and portrait
|
||||
- `web/src/lib/withReplyTime.ts` (+ test) — fills in the reply time
|
||||
- `web/src/assets/contact/contact.jpg` (840×1050, 80 KB), `contact-portret.jpg` (144×144, 5 KB), `web/public/og-contact.jpg` (1200×630, 60 KB) — crops of the original live photo (1600×1067), approved by the owner (portrait zoomed out, variant B)
|
||||
|
||||
## Modified
|
||||
- `web/src/content/types.ts` — `ContactPageContent`
|
||||
- `web/src/seo.ts` (+ test) — `contactPage()`
|
||||
- `web/src/sitePages.ts` — `/contact`: title, description, `indexed: true`, `ogImage`
|
||||
- `web/lighthouserc.cjs` — `/contact` indexed (standard 0.9 mobile budget, owner's choice)
|
||||
- `web/src/sitemap.test.ts` — expects `/contact`
|
||||
- `web/src/content/aboutContent.ts`, `web/src/app.test.tsx`, `web/src/components/about/AboutIntro/AboutIntro.test.tsx` — Over mij links to `/contact`; contact route tests
|
||||
- `web/src/components/ContactDetails/ContactDetails.tsx` — filled mail icon, matching the filled platform icons
|
||||
- `web/src/theme.ts`, `web/src/recipes/linkButton.ts` — accent button on `accent.deep` (white ≈ 5.7:1), hover on new `accent.deeper` (#475042)
|
||||
- `LAYOUT.md` — Contact: Intro; Contact form beside Photo + contact details
|
||||
- `web/src/lib/shootLinks.ts` (+ test), `web/src/content/shootTypesPageContent.ts`, `web/src/components/shoots/ShootBlock/ShootBlock.test.tsx` — Soorten fotoshoots: "Stuur een berichtje" → `/contact?pakket=<id>` (or `/contact`), "Boek je shoot" → `/contact` (FR-CP-09 extension, owner's request)
|
||||
|
||||
## Findings fixed during verification
|
||||
- `chakra.img` treated `width`/`height` as CSS props, so the intrinsic size was missing; now Chakra `Image` with `htmlWidth`/`htmlHeight`.
|
||||
- A property test of `withReplyTime` passed by chance: half placeholders around a real one could form a new one; generator restricted to brace-free text.
|
||||
- **Accent button contrast** (site-wide, pre-existing): white on `#7f8b76` = 3.58:1. Lighthouse only caught it here because the button is in the first screen; elsewhere `Reveal` keeps it at opacity 0 during the measurement, and jsdom computes no colours. Fixed in the recipe (owner's choice: darker green).
|
||||
|
||||
## Verification
|
||||
- `pnpm test`: 71 files, 367 tests passed (seed 1926155072; after the Soorten link change again 367/367, seed 1607463937); lint, format, build clean. Lighthouse not re-run for the link change (href-only change, no effect on performance or accessibility).
|
||||
- Production build in Chrome: no request for `contact.jpg` up to 1023 px (LCP = intro text); one request with priority **High** from 1024 px (LCP = the photo). Screenshots at 390 and 1280 px match mockup 1a.
|
||||
- Lighthouse desktop: all pass; `/contact` 0.99 / 1 / 1 / 1.
|
||||
- Lighthouse mobile: accessibility, best practices and SEO pass everywhere. **Performance fails on two pages:**
|
||||
- `/` 0.78–0.80 vs 0.8 — pre-existing: identical on the unit 2 build (3 runs each); owner chose to handle it separately (recorded as an open follow-up).
|
||||
- `/contact` 0.88 / 0.90 / 0.88 vs 0.9 — same client-rendering cause as the photo pages (text appears after the JavaScript); owner chose to keep 0.9.
|
||||
- In CI, performance is report-only (D6), so these do not block a merge; locally `pnpm check` fails on them.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 128 KiB |
+43
@@ -0,0 +1,43 @@
|
||||
# Business Logic Model — Unit 3: Contact page
|
||||
|
||||
## Route flow
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
box rgba(99,179,237,0.4) Routing
|
||||
participant R as Router
|
||||
participant P as ContactRoute
|
||||
end
|
||||
box rgba(255,167,38,0.4) Components
|
||||
participant Pn as ContactPanel
|
||||
end
|
||||
R->>P: render with validated search
|
||||
P->>Pn: pakket and load eager
|
||||
Pn->>Pn: preselect when the package is known
|
||||
P->>R: navigate to contact page with empty search, replace, no scroll
|
||||
```
|
||||
|
||||
Text alternative: the router renders the contact route with the validated search parameter; the route passes the package to the panel, which preselects a known package; the route then replaces the URL without the parameter, without scrolling.
|
||||
|
||||
## Head
|
||||
`pageHead('/contact')` (title, description, canonical, Open Graph incl. the page's preview image, no `noindex`) plus `structuredDataScript(contactPage('/contact'))`.
|
||||
|
||||
## Pure helpers
|
||||
|
||||
### `contactPage(path: RoutePath)` in `seo.ts`
|
||||
`webPage('ContactPage', path, { about: { '@id': businessId } })`.
|
||||
|
||||
### `withReplyTime(text: string, replyTime: string): string` in `lib/withReplyTime.ts`
|
||||
Replaces every `{reactietermijn}` in `text` with `replyTime`; text without the placeholder comes back unchanged.
|
||||
|
||||
## Properties for property-based testing (PBT-01)
|
||||
|
||||
| Function | Property | Category |
|
||||
|---|---|---|
|
||||
| `withReplyTime` | No `{reactietermijn}` is left (when `replyTime` itself does not contain it) | Invariant |
|
||||
| `withReplyTime` | Text without the placeholder is returned unchanged | Invariant |
|
||||
| `withReplyTime` | Splitting the template on the placeholder and joining with `replyTime` gives the result | Oracle |
|
||||
| `contactPage` | `@type` = `ContactPage`, `@id` = `url` = canonical URL, `about` = business id, never an e-mail address | Invariant |
|
||||
| `contactPage` | Survives `jsonLdScript` unchanged | Round trip |
|
||||
|
||||
The layout, the photo loading and the URL clean-up are covered by component and route tests (they are rendering over helpers that are already property-tested).
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
# Business Rules — Unit 3: Contact page
|
||||
|
||||
Answers: [contact-page-fd-questions.md](../../plans/contact-page-fd-questions.md) (Q1 A, Q2 A).
|
||||
|
||||
## Layout
|
||||
|
||||
| Id | Rule |
|
||||
|---|---|
|
||||
| BR-CP-01 | From **1024 px** (`lg`): two columns, the form column (≈ 3/5) left and `ContactAside` (≈ 2/5) right, aligned at the top. *Q1 = A* |
|
||||
| BR-CP-02 | Below 1024 px: one column — the narrow card (with the round portrait) above the form, both full width; `ContactAside` is not shown. |
|
||||
| BR-CP-03 | DOM order = visual order on every width: narrow card, form column, aside. The narrow card is hidden from 1024 px, the aside below it (`display: none`, so also hidden from assistive technology). |
|
||||
| BR-CP-04 | The section sits directly under the page head (`PageSection spacing="flushTop"`), as in the design. Both columns fade in with `Reveal`. |
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
W{"Viewport at least 1024 px?"}
|
||||
W -->|"yes"| Wide["Form left; photo with card right; narrow card hidden"]
|
||||
W -->|"no"| Narrow["Card with portrait, then form; aside hidden and photo not fetched"]
|
||||
classDef decision fill:#FFF59D,stroke:#F57F17,stroke-width:1px,color:#000;
|
||||
classDef result fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
class W decision;
|
||||
class Wide,Narrow result;
|
||||
```
|
||||
|
||||
Text alternative: from 1024 px the page shows the form with the photo and card beside it; below that it shows the card with the portrait above the form and does not fetch the large photo.
|
||||
|
||||
## Photo
|
||||
|
||||
| Id | Rule |
|
||||
|---|---|
|
||||
| BR-CP-06 | The large photo is a `<picture>` whose source only applies from 1024 px; below that the `img` falls back to a tiny inline transparent image, so phones and portrait tablets never download the photo. (`data:` is already allowed by the CSP.) |
|
||||
| BR-CP-07 | On wide screens the photo is the largest paint: no deferral, `fetchpriority="high"`, intrinsic width and height to reserve space. |
|
||||
| BR-CP-08 | The portrait is a separate small crop, decorative (`alt=""`), only in the narrow card. |
|
||||
| BR-CP-09 | The card overlaps the bottom edge of the photo (as in mockup 1a); the aside reserves room below the photo so the card never covers the next content. |
|
||||
|
||||
## `?pakket=` on this page
|
||||
|
||||
| Id | Rule |
|
||||
|---|---|
|
||||
| BR-CP-10 | The route keeps `pakket` from the search only when it is text (same `validateSearch` as the homepage). |
|
||||
| BR-CP-11 | `ContactPanel load="eager"` receives it and applies the preselect per BR-CPN-02 (unit 2). |
|
||||
| BR-CP-12 | After it was applied, the route replaces the URL with `/contact` without search, no history entry, no scroll, no focus move. An invalid value is removed the same way. |
|
||||
|
||||
## Texts and headings
|
||||
|
||||
| Id | Rule |
|
||||
|---|---|
|
||||
| BR-CP-05 | The intro is `head.intro` with `{reactietermijn}` replaced by the reply time; without the placeholder the text is used as is. |
|
||||
| BR-CP-13 | One h1 "Contact" (`PageIntro`); h2 "Stuur me een bericht" visually hidden, labelling the form section; h2 "Direct contact" in each card with its own id (`contact-details-narrow`, `contact-details-wide`). |
|
||||
| BR-CP-14 | The contact section is a landmark named by the form heading. |
|
||||
|
||||
## SEO and checks
|
||||
|
||||
| Id | Rule |
|
||||
|---|---|
|
||||
| BR-CP-15 | `sitePages['/contact']` gets the approved title and description, `indexed: true` and the preview image; head tags via `pageHead('/contact')`. |
|
||||
| BR-CP-16 | The route adds the `ContactPage` JSON-LD via `structuredDataScript(contactPage('/contact'))`. |
|
||||
| BR-CP-17 | `/contact` becomes an indexed path in Lighthouse CI with the standard mobile budget 0.9 (not a photo page). If it does not reach 0.9, report the measurement and cause to the owner before changing any budget. *Q2 = A* |
|
||||
| BR-CP-18 | The sitemap test expects `/contact`. |
|
||||
|
||||
## Other pages
|
||||
|
||||
| Id | Rule |
|
||||
|---|---|
|
||||
| BR-CP-19 | Over mij: "neem contact op" and "Boek je shoot" link to `/contact` (no hash). The homepage "Boek …" links stay on the homepage form. |
|
||||
| BR-CP-20 | LAYOUT.md "Contact": Intro over the full width, then Contact form beside Photo with contact details, per `.ai/layout-conventions.md`. |
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
# Domain Entities — Unit 3: Contact page
|
||||
|
||||
## Entity relationships
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Page["ContactPageContent"] -->|"has"| Head["head: eyebrow, title, intro template"]
|
||||
Page -->|"has"| Titles["formTitle, detailsTitle"]
|
||||
Page -->|"has"| Photo["image: ContentImage 4:5"]
|
||||
Page -->|"has"| Portrait["portrait: ContentImage face crop"]
|
||||
Site["SiteContent"] -->|"replyTime fills"| Head
|
||||
Site -->|"email, socials"| Card["ContactDetails (twice)"]
|
||||
Registry["sitePages /contact"] -->|"title, description, ogImage"| Head2["head tags + ContactPage JSON-LD"]
|
||||
Business["ProfessionalService @id"] -->|"about"| Head2
|
||||
classDef content fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
classDef derived fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000;
|
||||
classDef registry fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||
class Page,Head,Titles,Photo,Portrait,Site content;
|
||||
class Card,Head2 derived;
|
||||
class Registry,Business registry;
|
||||
```
|
||||
|
||||
Text alternative: the page content holds the head texts, the two section titles, the photo and the portrait; the site content fills in the reply time and feeds the contact card; the page registry and the business id produce the head tags and the ContactPage structured data.
|
||||
|
||||
## `ContactPageContent` (`content/types.ts`, values in `content/contactContent.ts`)
|
||||
|
||||
| Field | Type | Value |
|
||||
|---|---|---|
|
||||
| `head.eyebrow` | `string` | "Neem contact op" |
|
||||
| `head.title` | `string` | "Contact" |
|
||||
| `head.intro` | `string` | "Wil je een fotoshoot boeken of meer informatie ontvangen? Stuur me een berichtje, ik reageer binnen {reactietermijn}." |
|
||||
| `formTitle` | `string` | "Stuur me een bericht" (visually hidden h2) |
|
||||
| `detailsTitle` | `string` | "Direct contact" |
|
||||
| `image` | `ContentImage` | the contact photo, 4:5, descriptive alt text |
|
||||
| `portrait` | `ContentImage` | square face crop from the same photo, `alt: ''` is set by the card (decorative) |
|
||||
|
||||
`{reactietermijn}` is the one placeholder in the intro; it is replaced by `siteContent.contactForm.replyTime` (BR-CP-05). Plain strings, so the API can deliver the same shape.
|
||||
|
||||
## Images
|
||||
| Image | Location | Size | Notes |
|
||||
|---|---|---|---|
|
||||
| Contact photo | `web/src/assets/contact/contact.jpg` | about 900×1125 (4:5), compressed | original from andreaslop.nl/contact, resized once |
|
||||
| Portrait crop | `web/src/assets/contact/contact-portret.jpg` | 144×144 (72 px at 2×) | face crop, a few kB |
|
||||
| Preview image | `web/public/og-contact.jpg` | 1200×630 | crop of the same photo, own alt text in `sitePages` |
|
||||
|
||||
## Structured data
|
||||
`ContactPage` = `webPage('ContactPage', '/contact', { about: { '@id': businessId } })` — name and description from the registry, no e-mail address.
|
||||
|
||||
## Registry and test lists
|
||||
- `sitePages['/contact']`: title "Contact – fotoshoot boeken in Huizen", description from SEO-CP-02, `indexed: true`, `ogImage` the preview image.
|
||||
- `lighthouserc.cjs`: `/contact` moves from `noindexPaths` to `indexedPaths` (not in `photoPagePaths`, Q2 = A); `sitemap.test.ts`: `/contact` in the expected list.
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
# Frontend Components — Unit 3: Contact page
|
||||
|
||||
## Hierarchy
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Route["routes/contact.tsx"] --> Intro["PageIntro: eyebrow, h1, intro"]
|
||||
Route --> Section["PageSection flushTop, labelled by the form heading"]
|
||||
Section --> NarrowCard["ContactDetails with portrait (below lg)"]
|
||||
Section --> Grid["Grid: one column, two from lg"]
|
||||
Grid --> FormCol["Form column: hidden h2 + ContactPanel eager"]
|
||||
Grid --> Aside["contact/ContactAside (from lg)"]
|
||||
Aside --> Photo["picture: photo from lg only"]
|
||||
Aside --> WideCard["ContactDetails (overlapping the photo)"]
|
||||
classDef page fill:#2196F3,stroke:#0d47a1,color:#000;
|
||||
classDef shared fill:#4CAF50,stroke:#2e7d32,color:#000;
|
||||
classDef small fill:#e2e8f0,stroke:#4a5568,color:#000;
|
||||
class Route,Section,Grid,FormCol page;
|
||||
class Intro,NarrowCard,WideCard,Aside shared;
|
||||
class Photo small;
|
||||
```
|
||||
|
||||
Text alternative: the contact route renders PageIntro and one PageSection; inside it the narrow-screen card, then a grid with the form column and, from lg, ContactAside with the photo and the wide-screen card.
|
||||
|
||||
## `routes/contact.tsx`
|
||||
- `validateSearch` keeps `pakket` when it is a string; `head` per the business logic model.
|
||||
- Effect: when `pakket` is defined, `navigate({ to: '/contact', search: {}, replace: true, resetScroll: false })`.
|
||||
- Renders `PageIntro` with `withReplyTime(head.intro, replyTime)`, then the section.
|
||||
- **Section**: `PageSection labelledBy="contact-form-title" spacing="flushTop" data-testid="contact-page"`.
|
||||
- **Narrow card**: wrapper `display={{ base: 'block', lg: 'none' }}`, `ContactDetails titleId="contact-details-narrow" portrait={portrait} data-testid="contact-details-narrow"`, margin below it.
|
||||
- **Grid**: `templateColumns={{ base: '1fr', lg: '3fr 2fr' }}`, gap as `MediaText` (`clamp(2rem, 6vw, 5.5rem)`), `alignItems="start"`.
|
||||
- **Form column**: `VisuallyHidden` `h2` with `id="contact-form-title"`, then `ContactPanel idPrefix="contact" load="eager"` with the route's `pakket`.
|
||||
- Test ids: `contact-page`, `contact-details-narrow`, `contact-details-wide`, `contact-aside`, `contact-aside-photo`.
|
||||
|
||||
## `components/contact/ContactAside`
|
||||
- Props: `image: ContentImage`, `children: ReactNode` (the card).
|
||||
- Wrapper `display={{ base: 'none', lg: 'block' }}`, `position="relative"`, padding below the photo for the overlapping card.
|
||||
- `chakra.picture` with `<source media="(min-width: 64em)" srcSet={image.src}>` and an `img` with a 1×1 transparent `data:` GIF as `src`, `alt={image.alt}`, intrinsic `width`/`height`, `fetchPriority="high"`, `decoding="async"`, aspect ratio 4:5, `objectFit="cover"`, background `paper.deep` while loading.
|
||||
- Card position: absolutely placed over the bottom of the photo with side insets (`left`/`right` ≈ 1.5rem, `bottom` 0), as in the mockup.
|
||||
|
||||
## Responsive behaviour
|
||||
| Width | What shows |
|
||||
|---|---|
|
||||
| < 480 px | intro, card with portrait, form (name and e-mail stacked) |
|
||||
| 480–1023 px | same, name and e-mail side by side |
|
||||
| ≥ 1024 px | intro, form left, photo with card right |
|
||||
|
||||
## Accessibility
|
||||
- Reading and tab order: intro → (narrow card) → form → (wide card); hidden variants are `display: none`.
|
||||
- The visually hidden form heading names the section; the cards each have a labelled list.
|
||||
- Photo alt text describes the photo; portrait decorative.
|
||||
+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
|
||||
@@ -69,6 +69,7 @@ Shell header → **Intro** (page head, h1) → **Contact** section: **Contact fo
|
||||
|
||||
### FR-CP-09 Links to the contact page
|
||||
- On Over mij, "neem contact op" and "Boek je shoot" change from `/#contact` to **`/contact`**. The "Boek …" links on the homepage price cards keep going to the homepage form (`/?pakket=…#contact`). *Source: Q12 = A*
|
||||
- **Extended at Code Generation of unit 3 (owner, 2026-10-25)**: on Soorten fotoshoots, "Stuur een berichtje" per shoot goes to `/contact?pakket=<packageId>` (shoots without a shown package to `/contact`), and "Boek je shoot" to `/contact`.
|
||||
|
||||
### FR-CP-10 Content
|
||||
- All page texts and images live as API-shaped static data in `web/src/content/` (a new content object with an interface in `content/types.ts`), passed into the components from the route, as for the other pages.
|
||||
|
||||
Reference in New Issue
Block a user