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>
1.7 KiB
1.7 KiB
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:
validateSearchturns?shoot=into{ shoot?: ShootTypeId }(allowlist). The component re-checks it against the shoot types that actually have photos (shootFromSearchwithshootTypesWithPhotos), 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; gridonIntent→ start loading the lightbox chunk; lightboxonIndexChange/onClose; filteronChange→ 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/portfoliocan returnPortfolioContent1-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.