Adds the portfolio page
The ten live photos in a filterable masonry grid with an accessible lightbox, filters per shoot type kept in the URL (?shoot=), the shared Instagram block, and an indexed page with image gallery structured data and its own preview image. Soorten fotoshoots now only links to the portfolio for shoot types that have photos there. The filter bar stays on one row, so the web font loading no longer shifts the photos below it, and no photo loads before the page has: the grid fades in, so loading its photos early only delayed the fonts and the intro text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
# Code Generation Plan — Unit 3: Portfolio page
|
||||
|
||||
Single source of truth for code generation of this unit. Workspace root: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie-portfolio` (worktree); all code in `web/src/` unless stated. Branch `feature/portfolio-page` (on master 1bf28cb, which already contains `webPage()` and `shootTypes.ts`).
|
||||
|
||||
## Unit Context
|
||||
- **Requirements**: FR-PF-01, 02, 04, 08 (on this page), 09; SEO-PF-01..05; NFR-PF-01, 03..06
|
||||
- **Design**: [functional design](../portfolio-page/functional-design/) (photos table, rules BR-PH/FL/SP/CP/SEO/SL/LY, helpers and properties, components)
|
||||
- **Dependencies**: units 1 (`InstagramGrid`) and 2 (`PortfolioGrid`, `Lightbox`, `FilterBar`, `lightboxReducer`); master's `shootTypes.ts`, `webPage()`, `lib/shootLinks.ts` (`isPortfolioLive`)
|
||||
- **Touches code of the finished Soorten fotoshoots feature**: `ShootList`, `ShootBlock`, `routes/soorten-fotoshoots.tsx`, `app.test.tsx` (agreed follow-up, Q4 = A)
|
||||
|
||||
## Steps
|
||||
|
||||
### Photos
|
||||
- [x] **Step 1** — One-off PowerShell script in the scratchpad (.NET `System.Drawing`, high-quality bicubic, JPEG quality ~80, same approach as earlier features; not part of the project): from the 10 downloaded originals create `web/src/assets/portfolio/{id}.jpg` (800 px wide) and `{id}-groot.jpg` (1600 px long side), and `web/public/og-portfolio.jpg` (1200 × 630 centre crop of photo 7). Record the resulting sizes.
|
||||
|
||||
### Content and helpers
|
||||
- [x] **Step 2** — `content/types.ts`: `PortfolioPhoto`, `PortfolioContent`. `content/portfolioContent.ts`: intro + 10 photos (domain-entities.md), images imported from `assets/portfolio/`.
|
||||
- [x] **Step 3** — `lib/portfolioFilters.ts` (+ test): `isShootTypeId`, `shootTypesWithPhotos`, `shootFromSearch`, `filterPhotos`, `filterOptions` (`ALL_FILTER = 'alles'`), `toGalleryItems`, `photoCountLabel` — example tests and the properties in business-logic-model.md. `test/arbitraries.ts`: `portfolioPhoto` / `portfolioPhotos` generator.
|
||||
- [x] **Step 4** — `seo.ts`: `galleryImages(photos, base = siteUrl)` (+ tests in `seo.test.ts`: one `ImageObject` per photo, absolute https URLs, description = alt, creator/copyrightHolder ids, no e-mail).
|
||||
|
||||
### Page
|
||||
- [x] **Step 5** — `components/portfolio/PortfolioGallery/PortfolioGallery.tsx` (+ test): section with hidden h2 "Foto's", `FilterBar`, count live region, `PortfolioGrid`, lazy `Lightbox` (requested on intent or open), `lightboxReducer` state, close on filter change, focus return to the tile of the last shown photo. Tests: options, filtering and count announcement, `onShootChange` values (incl. "Alles" → `undefined`), invalid/unavailable shoot → Alles, open lightbox within the filtered list with caption, filter change closes it, axe.
|
||||
- [x] **Step 6** — `routes/portfolio.tsx`: `validateSearch` (`{ shoot?: ShootTypeId }`), head (`pageHead` + `ImageGallery` JSON-LD), `PageIntro` (eyebrow, h1, intro), `PortfolioGallery` with replace navigation without scroll, `InstagramGrid` (valid Instagram link only).
|
||||
- [x] **Step 7** — `sitePages.ts`: `/portfolio` `indexed: true` + `ogImage`; `lighthouserc.cjs`: `/portfolio` from `noindexPaths` to `indexedPaths` (not in `photoPagePaths`); `sitemap.test.ts` and other tests that list indexed pages updated.
|
||||
- [x] **Step 8** — `app.test.tsx`: `/portfolio` renders the h1, filters, grid, Instagram; `?shoot=gezin` starts filtered; `?shoot=onzin` and `?shoot=loveshoot` show Alles; head has no `noindex`, canonical without parameters, `og:image`, the `ImageGallery` script.
|
||||
|
||||
### Soorten fotoshoots links (Q4 = A)
|
||||
- [x] **Step 9** — `ShootList`/`ShootBlock`: prop `portfolioLive: boolean` → `portfolioShoots: readonly ShootTypeId[]`; `routes/soorten-fotoshoots.tsx` passes `shootTypesWithPhotos(...)` ids when `/portfolio` is live; tests updated (`app.test.tsx`: 3 links — newborn, zwangerschap, gezin).
|
||||
|
||||
### Docs and verification
|
||||
- [x] **Step 10** — `LAYOUT.md`: Portfolio diagram Intro → Portfolio → Instagram (per `.ai/layout-conventions.md`).
|
||||
- [x] **Step 11** — Reverse engineering: own lines about `/portfolio` (indexed, route, content, `PortfolioGallery`, helpers, `galleryImages`) and the Soorten links prop.
|
||||
- [x] **Step 12** — `tsc`, ESLint, Prettier; ListAgents + "claim 4173"; `pnpm check`. Mobile Lighthouse for `/portfolio`: if below 0.9, stop and ask the user (0.85 photo-page budget or not) before touching `photoPagePaths`. Failures on `/` and `/contact` are compared with master as in unit 2.
|
||||
- [x] **Step 13** — Visual check: no browser in this session. Offer a `deploy_test` (after "claim test") so the user can check the page on test, desktop and phone; do it only when the user asks. *Outcome: offered in the completion message.*
|
||||
- [x] **Step 14** — Code summary `aidlc-docs/features/portfolio-page/construction/portfolio-page/code/code-summary.md`.
|
||||
- [x] **Step 15** — Commit on `feature/portfolio-page` ("Adds the portfolio page"), with the unit 3 design docs. Push only when the user asks.
|
||||
|
||||
## Extension Compliance (unit 3)
|
||||
| Rule | Status | Rationale |
|
||||
|---|---|---|
|
||||
| SECURITY-04 | Compliant | No CSP change; images self-hosted |
|
||||
| SECURITY-05 | Compliant | `?shoot=` allowlisted (`isShootTypeId`), then checked against types with photos; never rendered |
|
||||
| SECURITY-10 | Compliant | No new dependency; image processing is a one-off local script |
|
||||
| SECURITY-11 | Compliant | Misuse case (crafted `?shoot=`) tested |
|
||||
| SECURITY-13 | Compliant | No external resources; JSON-LD through `jsonLdScript` |
|
||||
| Other SECURITY rules | N/A | No data stores, auth, server or infrastructure |
|
||||
| PBT-01..07, 10 | Planned | Steps 3–4 (properties from business-logic-model.md, `portfolioPhoto` generator, example tests alongside) |
|
||||
| PBT-08 / 09 | Compliant | Existing seed logging and fast-check |
|
||||
@@ -0,0 +1,70 @@
|
||||
# Functional Design-vragen — Unit 3: Portfoliopagina
|
||||
|
||||
Al vastgelegd (geen vraag nodig):
|
||||
|
||||
- **Volgorde**: zoals op de live site (1–10 hieronder).
|
||||
- **Formaten**: raster 800 px breed; groot 1600 px aan de lange kant (foto 8 is nu 2560 px en wordt ook 1600). Hele foto, niet bijgesneden. Opgeslagen in `web/src/assets/portfolio/`.
|
||||
- **Bijschrift in de lightbox** = de volledige naam van het shoottype uit `shootTypes.ts`: "Newbornshoot", "Zwangerschapsshoot", "Gezinsshoot". **Filterlabels** = de korte naam: "Newborn", "Zwangerschap", "Gezin".
|
||||
- **Filters**: met deze 10 foto's zijn dat Alles, Newborn, Zwangerschap en Gezin. Loveshoot en Portret hebben geen foto en krijgen geen filter (verduidelijking 7). `?shoot=loveshoot` toont dus "Alles".
|
||||
- **Kop boven het raster**: een h2 "Foto's" die alleen screenreaders horen (het ontwerp toont geen kop); de sectie is daarmee een benoemd landmark.
|
||||
- **Titel en beschrijving**: blijven zoals ze zijn (vraag 11).
|
||||
|
||||
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe.
|
||||
|
||||
---
|
||||
|
||||
## Voorstel: shoottype en alt-tekst per foto
|
||||
|
||||
| # | Bestand (live) | Wat er te zien is | Shoottype | Alt-tekst (voorstel) |
|
||||
| --- | -------------- | ----------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------- |
|
||||
| 1 | F41A1916 | Baby in wit pakje ligt op de onderarm van een ouder, kijkt in de camera | Newborn | Pasgeboren baby in een wit pakje ligt op de onderarm van een ouder en kijkt in de camera |
|
||||
| 2 | F41A1922 | Vader kust zijn baby op het hoofd | Newborn | Vader kust zijn pasgeboren baby op het hoofd |
|
||||
| 3 | F41A7883 | Man omarmt zijn zwangere partner van achteren, zandvlakte bij avondzon | Zwangerschap | Aanstaande vader omarmt zijn zwangere partner op een zandvlakte in de avondzon |
|
||||
| 4 | F41A7176 | Moeder drukt haar gezicht tegen het hoofdje van haar baby | Newborn | Moeder drukt haar gezicht tegen het hoofdje van haar pasgeboren baby |
|
||||
| 5 | F41A8700 | Close-up van een slapende baby in een gestreept pakje | Newborn | Slapende pasgeboren baby in een bruin-wit gestreept pakje |
|
||||
| 6 | F41A8206 | Zwangere buik in zwarte kleding, twee handen eromheen | Zwangerschap | Zwangere buik in een zwarte jurk, omarmd door twee handen |
|
||||
| 7 | F41A1579 | Grote broer kust de baby op bed | Gezin | Grote broer kust zijn pasgeboren broertje of zusje op een wit bed |
|
||||
| 8 | 5-F41A4650 | Babyvuistje tussen gebreide deken en geruite doek | Newborn | Babyvuistje tussen een gebreide deken en een geruite doek |
|
||||
| 9 | F41A7138 | Vader en moeder kijken naar hun slapende baby | Gezin | Jonge ouders kijken samen naar hun slapende pasgeboren baby |
|
||||
| 10 | F41A7284 | Blote voetjes in een gestreept gebreid broekje | Newborn | Blote babyvoetjes in een gestreept gebreid broekje |
|
||||
|
||||
Telling: Newborn 6, Zwangerschap 2, Gezin 2.
|
||||
|
||||
## Vraag 1: Klopt het voorstel hierboven?
|
||||
|
||||
- A) Ja, alle shoottypes en alt-teksten zoals voorgesteld (Andrea kan de alt-teksten later nog nalezen) (aanbevolen)
|
||||
- B) Ja, maar met aanpassingen (beschrijf per nummer hieronder)
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 2: Foto 2 en 4 (ouder met baby): Newborn of Gezin?
|
||||
|
||||
Op beide staat één ouder met een pasgeboren baby, binnen, in de stijl van de newbornshoots.
|
||||
|
||||
- A) **Newborn** (zoals voorgesteld): het zijn foto's uit een newbornshoot; Gezin houdt de foto's met meer gezinsleden (aanbevolen)
|
||||
- B) **Gezin**: dan worden het 4 newborn- en 4 gezinsfoto's
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 3: Preview-afbeelding bij delen (1200×630)
|
||||
|
||||
Liggende foto's passen het best in het brede formaat.
|
||||
|
||||
- A) **Foto 7** (grote broer kust de baby): warm, vertelt een verhaal, past bij "lifestyle" (aanbevolen)
|
||||
- B) **Foto 5** (slapende baby, close-up)
|
||||
- C) **Foto 6** (zwangere buik)
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
|
||||
## Vraag 4: Links "Bekijk meer …foto's" op Soorten fotoshoots
|
||||
|
||||
Die pagina toont straks bij elk shoottype een link naar het portfolio, ook bij Loveshoot en Portret. Daar zijn geen portfoliofoto's van, dus die links tonen "Alles". De sessie van Soorten fotoshoots is gestopt; het aansluiten van de helper ligt bij deze feature.
|
||||
|
||||
- A) **In deze unit**: de helper `shootTypesWithPhotos` in `ShootList`/`ShootBlock` aansluiten, zodat alleen Newborn, Zwangerschap en Gezin een link krijgen; de routetest gaat van 5 naar 3 links (aanbevolen)
|
||||
- B) **Later, apart**: nu niets aan Soorten fotoshoots veranderen; tot die tijd linken Loveshoot en Portret naar "Alles"
|
||||
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||
|
||||
[Answer]: A
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
# Functional Design Plan — Unit 3: Portfolio page
|
||||
|
||||
Depth: standard. Scope from the execution plan: the photo data (shoot type and alt text per photo, approved by the user — clarification 4), the preview image, the `?shoot=` rules, the filter/caption mapping onto the unit 2 blocks, the `ImageGallery` structured data, the follow-up for the Soorten fotoshoots links, and the testable properties of the new helpers (PBT-01). Questions: [portfolio-page-fd-questions.md](portfolio-page-fd-questions.md).
|
||||
|
||||
- [x] Collect and analyse the answers in `portfolio-page-fd-questions.md`
|
||||
- [x] `domain-entities.md` — `PortfolioPhoto`, `PortfolioContent`, the 10 photos with shoot type, alt text, sizes; relation to `ShootType`, `GalleryItem`, `ImageObject`
|
||||
- [x] `business-rules.md` — photo and image rules (sizes, order), filter rules (options, `?shoot=` parsing and fallback, canonical), caption, lightbox scope, SEO (indexed, title/description unchanged, `ogImage`, `ImageGallery`), Soorten links rule, LAYOUT.md
|
||||
- [x] `business-logic-model.md` — route → gallery → grid/lightbox flow; pure helpers and their properties (PBT-01)
|
||||
- [x] `frontend-components.md` — `PortfolioGallery` and the route: hierarchy, props, state, accessibility, test ids
|
||||
- [x] Validate against requirements.md, application-design.md, unit 2 design and the extension rules
|
||||
Reference in New Issue
Block a user