Plans the portfolio page

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>
This commit is contained in:
2026-10-25 21:32:48 +01:00
co-authored by Claude Opus 5.5
parent 1bf28cb569
commit b35b1c2404
11 changed files with 1100 additions and 0 deletions
@@ -0,0 +1,19 @@
# Services — Portfolio Page
There is no service layer in this SPA (no back-end yet). "Orchestration" happens in the route and one page-specific component; everything that decides what is shown is a pure helper in `lib/`.
## Route as orchestrator (`routes/portfolio.tsx`)
- **Reads**: `portfolioContent`, `instagramContent`, `shootTypes`, `siteContent.socials`
- **URL state**: `validateSearch` turns `?shoot=` into `{ shoot?: ShootTypeId }` (allowlist). The component re-checks it against the shoot types that actually have photos (`shootFromSearch` with `shootTypesWithPhotos`), so a valid id without photos falls back to "Alles"
- **Changes**: `navigate({ search: shoot ? { shoot } : {}, replace: true, resetScroll: false })` — no history entry per filter (Q4 = A), no scroll jump
- **Head**: `pageHead('/portfolio')` + gallery JSON-LD
- **Renders**: `PageIntro` → `PortfolioGallery` → `InstagramGrid` (only with a valid Instagram link, as on the homepage)
## PortfolioGallery as page controller
- **Derives** (pure, memoised on input): filter options, filtered photos, gallery items
- **Holds** the only UI state of the page: `openIndex: number | null`; closes the lightbox when the filter changes
- **Coordinates**: grid `onOpen` → `openIndex`; grid `onIntent` → start loading the lightbox chunk; lightbox `onIndexChange` / `onClose`; filter `onChange` → route callback + polite count announcement
- **Focus return**: on close, focus goes to the tile of the item shown last (requirements FR-PF-06)
## Future API
- `GET /api/portfolio` can return `PortfolioContent` 1-to-1; the route then loads it instead of importing the module. Shoot types come from the same API as the Soorten fotoshoots page. Nothing else changes.