Records the requirements, execution plan and application design for the portfolio page: the ten live photos in a filterable masonry grid with an accessible lightbox, filters per shoot type in the URL, the Instagram block shared with the homepage, and an indexed page with image gallery structured data. Built alongside the contact and shoot type pages, with shared pieces split between them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5.5 KiB
5.5 KiB
Components — Portfolio Page
New and changed components, grouped by unit. Shared building blocks live in their own folder directly under web/src/components/; page-specific parts under components/portfolio/ (same pattern as components/home/ and components/about/). Source: plan Q1 = A
Unit 1 — Shared Instagram block
InstagramGrid (moved)
- From → to:
components/home/InstagramGrid/→components/InstagramGrid/ - Purpose: the Instagram section (design
.instagram): heading with the handle as link, full-width row of square tiles linking to the profile - Change: props type
HomeContent['instagram']→InstagramContent(own content module). Markup, styling, test ids and behaviour unchanged - Used by: homepage route, portfolio route
Unit 2 — Gallery building blocks (generic, no shoot types)
PortfolioGrid (new, shared)
- Purpose: masonry grid of photos in row order (design
.portfolio-grid/.portfolio-item); every photo is a link to its large image that asks the page to open the lightbox instead - Responsibilities:
- list semantics (
ul/li) in the given order - CSS-only masonry: tiny implicit rows whose height scales with the column width (container units); each item spans the number of rows derived from its intrinsic width/height by a pure helper. Source: Q6 = A, 6a = B (no hook for JS measuring)
- 3 / 2 / 1 columns on the theme breakpoints, gap
gridGap - the first
eagerCountimages load immediately withfetchPriority="high"; the rest viaDeferredImage - hover/focus effect (zoom + overlay, zoom off under reduced motion), focus ring above neighbours,
Revealfade-in - click / Enter on a tile:
preventDefaultand report the index; without JavaScript the link opens the large image - pointer enter / focus on a tile: report "intent" so the page can preload the lightbox code (Q7)
- list semantics (
- Knows nothing about: shoot types, filters, URL
Lightbox (new, shared, lazily loaded)
- Purpose: modal viewer over a list of gallery items (design
.lightbox) - Responsibilities:
- Chakra
Dialog(controlledopen), dark backdrop, accessible name; focus trap, Escape, inert background, scroll lock and focus return come from Chakra/Ark - shows the current item's large image (
object-fit: contain), visible caption (if given), counter "n / total" - previous / next buttons (
iconControl/carouselControlrecipes, ≥ 44 px), ←/→ keys, swipe viauseSwipe; wrap-around via a pure helper - polite announcement of the position when browsing
- preloads the neighbouring large images; shows the (cached) thumb until the large image has loaded
- hides prev/next/counter when there is one item
- Chakra
- Loaded: with
React.lazyon first open or on tile intent. Source: Q7 = A - Knows nothing about: grids, filters, shoot types
FilterBar (new, shared)
- Purpose: a row of single-choice filter controls
- Responsibilities: group of toggle buttons (
role="group"with an accessible name, each buttonaria-pressed, one tab stop per button), labels in eyebrow style, active one underlined inaccent.deep; reports the chosen id; renders nothing for fewer than two options. Source: Q2 = A, Q3 = A - Styling: a new recipe
filterControl(or afiltervariant on thelinkrecipe — decided in Code Generation, whichever keeps the eyebrow tokens in one place) - Knows nothing about: what is filtered
useSwipe (new hook, extracted)
- Purpose: horizontal swipe detection on touch devices, shared by the hero and the lightbox. Source: Q5 = A
- Responsibilities: touch start/end handlers; decides via a pure helper (threshold 50 px, horizontal movement larger than vertical); calls
onPrev/onNext - Change to the hero:
useHeroSliderusesuseSwipeinstead of its inline handlers; behaviour identical (same threshold, same direction rules)
Unit 3 — Portfolio page
PortfolioGallery (new, page-specific, components/portfolio/)
- Purpose: connects filter bar, grid and lightbox for the portfolio. Source: Q1 = A
- Responsibilities:
- receives the photos, the shoot types and the active filter (from the route) plus a callback to change it
- derives the visible filters and the filtered photo list with pure helpers; maps photos to generic gallery items (caption =
shootLabel) - holds the open state (which item, or closed) and resets it when the filter changes
- announces the number of shown photos after a filter change
- renders the section frame (
PageSection, visually hidden h2) withFilterBar,PortfolioGridand the lazily loadedLightbox
Route routes/portfolio.tsx (rewritten)
validateSearch→{ shoot?: ShootTypeId }(typed, allowlist check; agreed with soorten-fotoshoots)head()→pageHead('/portfolio')+ImageGallerystructured data- component:
PageIntro→PortfolioGallery→InstagramGrid; changing the filter navigates withreplace: true. Source: Q4 = A
Content and types
content/portfolioContent.ts— intro texts and the 10 photos (PortfolioContent,PortfolioPhoto)content/instagramContent.ts(unit 1) —InstagramContentcontent/types.ts— the types above;ShootTypeId/ShootTypearrive with the soorten-fotoshoots commit
SEO
seo.ts—galleryImages(...)builder for theImageObjectlist; useswebPage()from the contact-page commitsitePages.ts—/portfolio:indexed: true,ogImagelighthouserc*.cjs—/portfolioto the indexed paths