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>
5.7 KiB
5.7 KiB
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 (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'sshootTypes.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
- 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 createweb/src/assets/portfolio/{id}.jpg(800 px wide) and{id}-groot.jpg(1600 px long side), andweb/public/og-portfolio.jpg(1200 × 630 centre crop of photo 7). Record the resulting sizes.
Content and helpers
- Step 2 —
content/types.ts:PortfolioPhoto,PortfolioContent.content/portfolioContent.ts: intro + 10 photos (domain-entities.md), images imported fromassets/portfolio/. - 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/portfolioPhotosgenerator. - Step 4 —
seo.ts:galleryImages(photos, base = siteUrl)(+ tests inseo.test.ts: oneImageObjectper photo, absolute https URLs, description = alt, creator/copyrightHolder ids, no e-mail).
Page
- Step 5 —
components/portfolio/PortfolioGallery/PortfolioGallery.tsx(+ test): section with hidden h2 "Foto's",FilterBar, count live region,PortfolioGrid, lazyLightbox(requested on intent or open),lightboxReducerstate, close on filter change, focus return to the tile of the last shown photo. Tests: options, filtering and count announcement,onShootChangevalues (incl. "Alles" →undefined), invalid/unavailable shoot → Alles, open lightbox within the filtered list with caption, filter change closes it, axe. - Step 6 —
routes/portfolio.tsx:validateSearch({ shoot?: ShootTypeId }), head (pageHead+ImageGalleryJSON-LD),PageIntro(eyebrow, h1, intro),PortfolioGallerywith replace navigation without scroll,InstagramGrid(valid Instagram link only). - Step 7 —
sitePages.ts:/portfolioindexed: true+ogImage;lighthouserc.cjs:/portfoliofromnoindexPathstoindexedPaths(not inphotoPagePaths);sitemap.test.tsand other tests that list indexed pages updated. - Step 8 —
app.test.tsx:/portfoliorenders the h1, filters, grid, Instagram;?shoot=gezinstarts filtered;?shoot=onzinand?shoot=loveshootshow Alles; head has nonoindex, canonical without parameters,og:image, theImageGalleryscript.
Soorten fotoshoots links (Q4 = A)
- Step 9 —
ShootList/ShootBlock: propportfolioLive: boolean→portfolioShoots: readonly ShootTypeId[];routes/soorten-fotoshoots.tsxpassesshootTypesWithPhotos(...)ids when/portfoliois live; tests updated (app.test.tsx: 3 links — newborn, zwangerschap, gezin).
Docs and verification
- Step 10 —
LAYOUT.md: Portfolio diagram Intro → Portfolio → Instagram (per.ai/layout-conventions.md). - Step 11 — Reverse engineering: own lines about
/portfolio(indexed, route, content,PortfolioGallery, helpers,galleryImages) and the Soorten links prop. - 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 touchingphotoPagePaths. Failures on/and/contactare compared with master as in unit 2. - 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. - Step 14 — Code summary
aidlc-docs/features/portfolio-page/construction/portfolio-page/code/code-summary.md. - 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 |