Adds the Over mij page
Replaces the placeholder with the page from the design and the texts from the live site: Andrea's introduction with her portrait, how it started, two photos, life outside photography and a booking button. The page is now indexed, with its own title, description, preview image and AboutPage data about Andrea. The portrait loads straight away instead of after the page, since on phones it is the largest paint. Lighthouse no longer lets every indexed page use the homepage's lower mobile performance target; it now only applies to the homepage itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
# Code Summary — Unit 2: Over mij page
|
||||
|
||||
Plan: [over-mij-page-code-generation-plan.md](../../plans/over-mij-page-code-generation-plan.md). Functional design: [../functional-design/](../functional-design/business-rules.md).
|
||||
|
||||
## Created
|
||||
- `web/src/routes/over-mij.tsx` — replaced the placeholder: head (`pageHead` + `AboutPage` JSON-LD) and the page composition
|
||||
- `web/src/content/aboutContent.ts` — live texts, photos, booking link, person data
|
||||
- `web/src/components/about/AboutIntro/*`, `about/StorySection/*`, `about/RichParagraph/*` (+ tests)
|
||||
- `web/src/components/PhotoDuo/*` (+ test)
|
||||
- `web/src/lib/knowsAboutList.ts` (+ test, PBT invariants and idempotency)
|
||||
- `web/src/assets/about/andrea-portret.jpg` (1200×800, 83 KB), `about-1.jpg` (1200×798, 97 KB), `about-2.jpg` (1200×800, 86 KB)
|
||||
- `web/public/og-over-mij.jpg` (1200×630, 68 KB, crop of the portrait)
|
||||
|
||||
## Modified
|
||||
- `web/src/content/types.ts` — `LinkTarget`, `InlineLink`, `RichText`, `AboutPageContent`
|
||||
- `web/src/seo.ts` — `businessId`, `personId`; `professionalService` gains `@id` and `founder`; new `person`, `aboutPage`, `structuredDataScript` (also used by `siteHead`)
|
||||
- `web/src/sitePages.ts` — `/over-mij`: new title/description, `indexed: true`, `ogImage`
|
||||
- `web/lighthouserc.cjs` — `/over-mij` indexed; the home page's lower mobile performance target (0.8) now applies to `/` only, other indexed pages need 0.9 (before, it applied to every indexed page)
|
||||
- `web/src/components/PageSection/PageSection.tsx` — `labelledBy` optional (+ test)
|
||||
- `web/src/components/FramedImage/FramedImage.tsx`, `MediaText/MediaText.tsx` — `priority` option: load at once with `fetchpriority="high"` instead of deferred (+ test); used for the portrait at the top of the page
|
||||
- `web/src/seo.test.ts`, `web/src/sitemap.test.ts`, `web/src/app.test.tsx`, `web/src/test/arbitraries.ts` — new and updated tests, `anySiteContent` and `knowsAboutEntries` generators
|
||||
- `LAYOUT.md` — About me: Intro → About Me → Background → Photos → Personal
|
||||
- `aidlc-docs/_shared/reverse-engineering/*.md` — routes, components, content model, SEO functions, debt
|
||||
|
||||
## Image script
|
||||
One-off, outside the project (`scratchpad/resize-image.ps1`): the homepage-sections script extended with EXIF orientation and an optional cover crop (`-Height`, `-FocusY`). Commands:
|
||||
|
||||
```powershell
|
||||
& .\resize-image.ps1 -Source portret.jpg -Target web\src\assets\about\andrea-portret.jpg -Width 1200
|
||||
& .\resize-image.ps1 -Source about-1.jpg -Target web\src\assets\about\about-1.jpg -Width 1200
|
||||
& .\resize-image.ps1 -Source about-2.jpg -Target web\src\assets\about\about-2.jpg -Width 1200
|
||||
& .\resize-image.ps1 -Source portret.jpg -Target web\public\og-over-mij.jpg -Width 1200 -Height 630 -FocusY 0.4
|
||||
```
|
||||
|
||||
Originals from andreaslop.nl: `2024/10/WhatsApp-Image-2024-10-27-at-14.31.41.jpeg` (1600×1067), `2025/08/slide-1.jpg` (1920×1277), `2025/08/IMG_1718.jpg` (6000×4000).
|
||||
|
||||
## Alt texts (for Andrea to review)
|
||||
- Portrait: "Andrea Slop in een groene trui met haar camera in de handen, glimlachend in het bos"
|
||||
- Concert: "Concert vanaf het podium: de zanger steekt zijn microfoon omhoog voor een volle zaal in blauw licht"
|
||||
- Cat: "Een grijze langharige kat slaapt met een uitgestrekte poot op de bank"
|
||||
- Preview image: "Andrea Slop met haar camera in het bos"
|
||||
|
||||
## Verification
|
||||
- **`pnpm check`**: lint, format, 60 test files / 273 tests (coverage thresholds met), build, `audit:deps` clean, Lighthouse passed. Two earlier runs stopped on an outdated sitemap expectation ("only the homepage") and on Prettier formatting of that fix; both corrected.
|
||||
- **Lighthouse `/over-mij`**: mobile performance 0.90, accessibility 1, best practices 1, SEO 1; desktop 1 everywhere. Home unchanged (mobile 0.82, desktop 1).
|
||||
- **LCP on mobile**: the portrait, 3.2 s. Breakdown: 2.1 s before the request can start, because the page is rendered by JavaScript (FCP 2.3 s, same as the placeholders), and 0.5 s render delay from the design's fade-in (`Reveal`). `priority` shortened the request delay by 0.3 s. Not changed further: removing the fade-in on the first block would deviate from the design; prerendering is the known fix for the JavaScript-first paint.
|
||||
- **Homepage unchanged**: layout comparison against master at 1440/768/390 px — identical except React's generated carousel ids, which also differ between two runs of master.
|
||||
- **Visual**: `/over-mij` compared with `design/andreaslop-static/over-mij.html` at 1440, 820 and 390 px — same structure, order, backgrounds, frame and button; differences are agreed ones (30 px section heading, wider content column as on the homepage, live texts).
|
||||
|
||||
## Extension Compliance
|
||||
| Rule | Status | Rationale |
|
||||
|---|---|---|
|
||||
| SECURITY-04 | Compliant | CSP unchanged; only self-hosted images |
|
||||
| SECURITY-10 | Compliant | No new dependencies |
|
||||
| SECURITY-11 | Compliant | JSON-LD via `jsonLdScript`; e-mail never in output (PBT) |
|
||||
| SECURITY-13 | Compliant | No external resources |
|
||||
| Other SECURITY rules | N/A | No data stores, endpoints, auth or infrastructure |
|
||||
| PBT-01 | Compliant | Properties from business-logic-model.md implemented |
|
||||
| PBT-02 | Compliant | `jsonLdScript` round-trip (existing) + `structuredDataScript` example |
|
||||
| PBT-03 | Compliant | Two-way ids, sameAs = valid socials, no e-mail, registry match, knowsAbout invariants |
|
||||
| PBT-04 | Compliant | `knowsAboutList` idempotency |
|
||||
| PBT-05, PBT-06 | N/A | No oracle, no stateful logic |
|
||||
| PBT-07 | Compliant | `anySiteContent`, `knowsAboutEntries` generators |
|
||||
| PBT-08, PBT-09 | Compliant | Existing seed logging, fast-check |
|
||||
| PBT-10 | Compliant | Example-based component and route tests alongside PBT |
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
# Code Generation Plan — Unit 2: Over mij page
|
||||
|
||||
Single source of truth for code generation of this unit. Workspace root: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie`; code in `web/`. Branch `feature/over-mij-page`.
|
||||
|
||||
## Unit Context
|
||||
- **Requirements**: FR-OM-01..08, SEO-OM-01..05, NFR-OM-01, 03..06
|
||||
- **Design**: [application-design.md](../../inception/application-design/application-design.md); functional design in [construction/over-mij-page/functional-design/](../over-mij-page/functional-design/) (BR-OM-*, BR-SD-*, BR-SEO-OM-*)
|
||||
- **Depends on**: unit 1 (`PageSection`, `MediaText`, `Eyebrow`) — done
|
||||
- **Behavioural contract for existing pages**: the homepage and other pages only change in their head: the business JSON-LD gains `@id` and `founder`
|
||||
|
||||
## Steps
|
||||
|
||||
### Images
|
||||
- [x] **Step 1** — Download the originals from andreaslop.nl: portrait `2024/10/WhatsApp-Image-2024-10-27-at-14.31.41.jpeg`, `2025/08/slide-1.jpg`, `2025/08/IMG_1718.jpg` (into the scratchpad, not the repo).
|
||||
- [x] **Step 2** — Resize once with the same one-off PowerShell/System.Drawing approach as homepage-sections (quality 80): portrait and duo photos to 1200 px wide → `web/src/assets/about/andrea-portret.jpg`, `about-1.jpg`, `about-2.jpg`; a 1200×630 centre-weighted crop of the portrait → `web/public/og-over-mij.jpg`. Record exact sizes for `width`/`height`.
|
||||
- [x] **Step 3** — Look at each photo and write descriptive Dutch alt texts (BR-OM-04), plus the preview image alt.
|
||||
|
||||
### Content
|
||||
- [x] **Step 4** — `content/types.ts`: add `LinkTarget`, `InlineLink`, `RichText`, `AboutPageContent` (domain-entities.md).
|
||||
- [x] **Step 5** — Create `content/aboutContent.ts` with the live texts, photos, booking link and person data.
|
||||
|
||||
### SEO and pure helpers
|
||||
- [x] **Step 6** — `lib/knowsAboutList.ts` + test: trim, drop empties, dedupe keeping first (example + PBT: invariants, idempotency).
|
||||
- [x] **Step 7** — `seo.ts`: `businessId`, `personId`; `professionalService` gains `@id` + `founder`; new `person(...)`, `aboutPage(...)`, `structuredDataScript(...)`; `siteHead` uses `structuredDataScript`. Comments in English for new code.
|
||||
- [x] **Step 8** — `seo.test.ts`: example tests for the real content and PBT properties from business-logic-model.md (ids, sameAs, no e-mail, registry match); add a `siteContent` and `knowsAbout` arbitrary to `test/arbitraries.ts`.
|
||||
- [x] **Step 9** — `sitePages.ts`: `/over-mij` title, description, `indexed: true`, `ogImage`. `lighthouserc.cjs`: move `/over-mij` to `indexedPaths` (desktop config builds on it). Existing sync and sitemap tests updated where they list noindex pages.
|
||||
|
||||
### Components
|
||||
- [x] **Step 10** — `PageSection`: `labelledBy` optional (BR-OM-11) + test case (no region role without it).
|
||||
- [x] **Step 11** — `components/PhotoDuo/PhotoDuo.tsx` + test (two images with alt, list named by `label`, axe).
|
||||
- [x] **Step 12** — `components/about/RichParagraph.tsx` + test (text and links in order, link targets incl. hash).
|
||||
- [x] **Step 13** — `components/about/AboutIntro.tsx` + test (h2, eyebrow, paragraphs, two links, portrait, region name, axe).
|
||||
- [x] **Step 14** — `components/about/StorySection.tsx` + test (h3 label names the region, paragraphs, children, tone, axe).
|
||||
|
||||
### Route
|
||||
- [x] **Step 15** — `routes/over-mij.tsx`: head (`pageHead` + AboutPage script) and composition (PageIntro → AboutIntro → StorySection background → PhotoDuo in an unnamed PageSection → StorySection personal with `LinkButton accent`).
|
||||
- [x] **Step 16** — Route tests in `app.test.tsx`: `/over-mij` renders in the shell with the heading outline h1/h2/h3/h3, links `/portfolio`, `/#contact` (×2), no `noindex`, the AboutPage script; axe on the whole page.
|
||||
|
||||
### Documentation
|
||||
- [x] **Step 17** — `LAYOUT.md`: About me diagram → Intro, About Me, Background, Photos, Personal (letters/colours A–E per `.ai/layout-conventions.md`).
|
||||
- [x] **Step 18** — Update the shared reverse engineering docs (routes table, new components, content model, `/over-mij` indexed, debt item about Over mij images resolved).
|
||||
|
||||
### Verification and summary
|
||||
- [x] **Step 19** — `pnpm check` (lint, format, tests incl. coverage thresholds, build, audits, Lighthouse incl. `/over-mij` as indexed page) — nothing else running on the machine during Lighthouse.
|
||||
- [x] **Step 20** — Visual check of `/over-mij` against `design/andreaslop-static/over-mij.html` in the browser at desktop, tablet and phone widths (screenshots); homepage layout comparison against the unit 1 build (only head changes expected).
|
||||
- [x] **Step 21** — Write `construction/over-mij-page/code/code-summary.md` incl. the resize command and image sizes.
|
||||
- [x] **Step 22** — Commit on `feature/over-mij-page` (push/deploy only when asked).
|
||||
|
||||
## Extension Compliance (unit 2)
|
||||
| Rule | Status | Rationale |
|
||||
|---|---|---|
|
||||
| SECURITY-04 | Compliant | CSP unchanged; only self-hosted images |
|
||||
| SECURITY-10 | Compliant | No new dependencies; image resizing is a one-off local step |
|
||||
| SECURITY-11 | Compliant | JSON-LD through `jsonLdScript`; e-mail excluded (BR-SD-01, PBT) |
|
||||
| SECURITY-13 | Compliant | No external resources at runtime |
|
||||
| Other SECURITY rules | N/A | No data stores, endpoints, auth or infrastructure |
|
||||
| PBT-01 | Compliant | Properties identified in business-logic-model.md |
|
||||
| PBT-02 | Compliant | `jsonLdScript` round-trip already tested |
|
||||
| PBT-03 | Planned | Invariants for ids, sameAs, no e-mail, knowsAbout (Steps 6, 8) |
|
||||
| PBT-04 | Planned | `knowsAboutList` idempotency (Step 6) |
|
||||
| PBT-05, PBT-06 | N/A | No oracle, no stateful logic |
|
||||
| PBT-07 | Planned | `siteContent` and `knowsAbout` arbitraries (Step 8) |
|
||||
| PBT-08, PBT-09 | Compliant | Existing seed logging and fast-check setup |
|
||||
| PBT-10 | Planned | Example-based component and route tests alongside PBT |
|
||||
Reference in New Issue
Block a user