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:
@@ -0,0 +1,68 @@
|
||||
# Application Design — Portfolio Page
|
||||
|
||||
Consolidated view of [components.md](components.md), [component-methods.md](component-methods.md), [services.md](services.md) and [component-dependency.md](component-dependency.md). Decisions: [application-design-plan.md](../plans/application-design-plan.md).
|
||||
|
||||
## Decisions
|
||||
| # | Decision |
|
||||
|---|---|
|
||||
| Q1 | Three independent shared pieces (`PortfolioGrid`, `Lightbox`, `FilterBar`) connected by a page-specific `PortfolioGallery` in `components/portfolio/` |
|
||||
| Q2 | Filter bar = group of toggle buttons with `aria-pressed`, one tab stop per button |
|
||||
| Q3 | Filter style = text links in eyebrow style, active underlined in `accent.deep` (new recipe) |
|
||||
| Q4 | Filter changes replace the URL (no history entry per change) |
|
||||
| Q5 | Swipe logic extracted from the hero into `useSwipe` + `lib/swipeDirection`; hero behaviour unchanged |
|
||||
| Q6 + 6a | CSS-only masonry in row order (row spans from the aspect ratio, container units); no preparation for JS measuring — rebuild later if ever needed |
|
||||
| Q7 | `Lightbox` loaded lazily on first open or on tile hover/focus |
|
||||
| — | Names as agreed with the parallel sessions; generic APIs; generic `GalleryItem` so shared components never see shoot types |
|
||||
|
||||
## Component Overview
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Route["routes/portfolio.tsx"] --> Intro["PageIntro"]
|
||||
Route --> Gallery["portfolio/PortfolioGallery"]
|
||||
Route --> Insta["InstagramGrid (shared)"]
|
||||
Gallery --> Section["PageSection"]
|
||||
Gallery --> Filter["FilterBar"]
|
||||
Gallery --> Grid["PortfolioGrid"]
|
||||
Gallery --> Box["Lightbox (lazy)"]
|
||||
Grid --> Deferred["DeferredImage + Reveal"]
|
||||
Box --> Dialog["Chakra Dialog"]
|
||||
Box --> Swipe["useSwipe"]
|
||||
Hero["Hero / useHeroSlider"] --> Swipe
|
||||
Home["routes/index.tsx"] --> Insta
|
||||
classDef newpart fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000;
|
||||
classDef changed fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||
classDef existing fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||
class Gallery,Filter,Grid,Box,Swipe newpart;
|
||||
class Route,Insta,Hero,Home changed;
|
||||
class Intro,Section,Deferred,Dialog existing;
|
||||
```
|
||||
|
||||
Text alternative: the portfolio route renders PageIntro, the page-specific PortfolioGallery and the shared InstagramGrid; the gallery composes PageSection, FilterBar, PortfolioGrid and the lazily loaded Lightbox; the grid reuses DeferredImage and Reveal, the lightbox builds on Chakra Dialog and the new useSwipe hook, which the hero also adopts; the homepage uses the moved InstagramGrid.
|
||||
|
||||
## Per Unit
|
||||
| Unit | New | Changed |
|
||||
|---|---|---|
|
||||
| 1 Shared Instagram block | `content/instagramContent.ts`, `InstagramContent` | `InstagramGrid` moved, `homeContent` (instagram removed), homepage route |
|
||||
| 2 Gallery building blocks | `PortfolioGrid`, `Lightbox`, `FilterBar`, `useSwipe`, recipe `filterControl`, `GalleryItem`/`ImageSource`, `lib/{wrapIndex, swipeDirection, masonryRowSpan, neighbourIndexes}`, arbitraries, possibly a `zIndex.lightbox` token | `useHeroSlider` (uses `useSwipe` and `wrapIndex`) |
|
||||
| 3 Portfolio page | `PortfolioGallery`, `portfolioContent.ts`, `PortfolioPhoto`/`PortfolioContent`, `lib/{shootTypesWithPhotos, shootFromSearch, filterPhotos, filterOptions, toGalleryItems, photoCountLabel}`, `galleryImages` in `seo.ts`, 10 photos ×2, `og-portfolio.jpg` | portfolio route, `sitePages.ts`, `lighthouserc*.cjs`, LAYOUT.md, RE lines about `/portfolio` |
|
||||
|
||||
## State and Data Flow (summary)
|
||||
- The **URL** owns the active filter (`?shoot=`, typed and allowlisted, replace navigation); **`PortfolioGallery`** owns which photo is open; everything else is derived by pure helpers.
|
||||
- Shared components get data and report events through props; none import page content.
|
||||
- See [services.md](services.md) and [component-dependency.md](component-dependency.md) for the flow diagram and the peer dependencies.
|
||||
|
||||
## Extension Compliance — Application Design
|
||||
| Rule | Status | Note |
|
||||
|---|---|---|
|
||||
| SECURITY-04 headers | Compliant | No CSP change; no external resources |
|
||||
| SECURITY-05 input validation | Compliant | `?shoot=` allowlisted in `validateSearch` and `shootFromSearch`; never rendered |
|
||||
| SECURITY-10 supply chain | Compliant | No new dependency (Chakra `Dialog` is already in `@chakra-ui/react`) |
|
||||
| SECURITY-11 secure design | Compliant | Misuse case (crafted parameter) handled by allowlist + fallback |
|
||||
| SECURITY-13 integrity | Compliant | Lazy chunk is our own bundle; no CDN |
|
||||
| Other SECURITY rules | N/A | No data stores, auth, server or infrastructure |
|
||||
| PBT-01 | Planned | Every pure helper above is listed for property identification in Functional Design (units 2 and 3) |
|
||||
| PBT-06 | Planned | Open-index state in `PortfolioGallery` + `Lightbox` navigation modelled in Functional Design |
|
||||
| PBT-07 | Planned | Generators for `GalleryItem`, `PortfolioPhoto`, `ShootType` in `src/test/arbitraries.ts` |
|
||||
| PBT-08 / 09 | Compliant | Existing seed logging and fast-check |
|
||||
| Other PBT rules | Planned at Functional Design / Code Generation | |
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
# Component Dependencies — Portfolio Page
|
||||
|
||||
## Dependency Matrix
|
||||
|
||||
| Component | Depends on | Used by |
|
||||
|---|---|---|
|
||||
| `routes/portfolio.tsx` | `PageIntro`, `PortfolioGallery`, `InstagramGrid`, `portfolioContent`, `instagramContent`, `shootTypes`*, `siteContent`, `seo.ts` (`pageHead`, `webPage`*, `galleryImages`), `lib/visibleSocials`, `lib/shootFromSearch` | router |
|
||||
| `routes/index.tsx` | … + `InstagramGrid` (new path), `instagramContent` | router |
|
||||
| `PortfolioGallery` | `PageSection`, `FilterBar`, `PortfolioGrid`, `Lightbox` (lazy), `lib/` (filter/gallery helpers) | portfolio route |
|
||||
| `PortfolioGrid` | `DeferredImage`, `Reveal`, `lib/masonryRowSpan`, theme tokens | `PortfolioGallery` (any page later) |
|
||||
| `Lightbox` | Chakra `Dialog`, `useSwipe`, `lib/wrapIndex`, `lib/neighbourIndexes`, recipes `iconControl`/`carouselControl` | `PortfolioGallery` (any page later) |
|
||||
| `FilterBar` | recipe `filterControl` (new) | `PortfolioGallery` |
|
||||
| `useSwipe` | `lib/swipeDirection` | `useHeroSlider`, `Lightbox` |
|
||||
| `useHeroSlider` | `useSwipe`, `lib/wrapIndex` (refactor, same behaviour) | `Hero` |
|
||||
| `InstagramGrid` | `PageSection`, `SectionHeading`, `Reveal`, `DeferredImage` | home and portfolio routes |
|
||||
| `seo.ts` `galleryImages` | `siteUrl`, `personId`, `businessId` | portfolio route |
|
||||
|
||||
\* delivered by a parallel feature (see below)
|
||||
|
||||
## Data Flow
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
Url["URL ?shoot="] --> Route["routes/portfolio.tsx"]
|
||||
Content["portfolioContent + shootTypes"] --> Route
|
||||
Route -->|"shoot, photos, shootTypes"| Gallery["PortfolioGallery"]
|
||||
Gallery -->|"options, value"| Filter["FilterBar"]
|
||||
Filter -->|"onChange(id)"| Gallery
|
||||
Gallery -->|"onShootChange"| Route
|
||||
Route -->|"navigate replace"| Url
|
||||
Gallery -->|"items"| Grid["PortfolioGrid"]
|
||||
Grid -->|"onOpen(index), onIntent"| Gallery
|
||||
Gallery -->|"items, index"| Box["Lightbox (lazy)"]
|
||||
Box -->|"onIndexChange, onClose"| Gallery
|
||||
Lib["lib/ pure helpers"] -.-> Gallery
|
||||
Lib -.-> Grid
|
||||
Lib -.-> Box
|
||||
classDef state fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
||||
classDef comp fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||
classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||
class Url,Content state;
|
||||
class Route,Gallery,Filter,Grid,Box comp;
|
||||
class Lib support;
|
||||
```
|
||||
|
||||
Text alternative: the route reads the `?shoot=` parameter and the content and passes the active filter, photos and shoot types to PortfolioGallery; the filter bar reports a choice back up to the route, which updates the URL with replace; the gallery gives the filtered items to the grid and the lightbox and keeps which item is open; pure helpers in lib support all three.
|
||||
|
||||
## Communication Patterns
|
||||
- **Props down, callbacks up**; no context or global store. The URL is the source of truth for the filter, `PortfolioGallery` for the open item
|
||||
- **Lazy boundary**: `Lightbox` behind `React.lazy` + `Suspense`; the chunk is requested on first `onIntent` or `onOpen`
|
||||
- **No cross-page coupling**: `PortfolioGrid`, `Lightbox`, `FilterBar` and `useSwipe` import nothing page-specific
|
||||
|
||||
## Parallel-Feature Dependencies
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Contact["contact-page commit: webPage() + WebPageType"] --> U3["Unit 3 Portfolio page"]
|
||||
Soorten["soorten-fotoshoots commit: ShootType, ShootTypeId, shootTypes.ts"] --> U3
|
||||
U1["Unit 1 Shared Instagram block"] --> U3
|
||||
U2["Unit 2 Gallery building blocks"] --> U3
|
||||
U3 -.->|"?shoot= URL, shootTypesWithPhotos"| SoortenPage["Soorten fotoshoots links"]
|
||||
classDef peer fill:#CE93D8,stroke:#6A1B9A,stroke-width:1px,color:#000;
|
||||
classDef unit fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000;
|
||||
class Contact,Soorten,SoortenPage peer;
|
||||
class U1,U2,U3 unit;
|
||||
```
|
||||
|
||||
Text alternative: units 1 and 2 have no outside dependency; unit 3 needs units 1 and 2 plus the cherry-picked commits from contact-page (webPage) and soorten-fotoshoots (shoot types); in return the portfolio offers the ?shoot= URL and a helper the Soorten fotoshoots page can link with.
|
||||
|
||||
- Unit 3 starts by cherry-picking both peer commits; if either is missing it stops and reports (no parallel copy)
|
||||
- `useHeroSlider` is touched by unit 2 (swipe extraction); no other feature has claimed the hero
|
||||
@@ -0,0 +1,120 @@
|
||||
# Component Methods — Portfolio Page
|
||||
|
||||
Signatures only; the rules behind them (edge cases, invariants, properties) follow in Functional Design for units 2 and 3. Types are TypeScript; names are working names.
|
||||
|
||||
## Types
|
||||
|
||||
```ts
|
||||
// content/types.ts (unit 2: GalleryItem lives next to ContentImage)
|
||||
interface ImageSource { src: string; width: number; height: number }
|
||||
|
||||
// What the generic components show
|
||||
interface GalleryItem {
|
||||
id: string;
|
||||
thumb: ContentImage; // grid size (~800 px), alt text included
|
||||
full: ImageSource; // lightbox size (~1600–2000 px), same alt as thumb
|
||||
caption?: string; // visible caption in the lightbox
|
||||
}
|
||||
|
||||
// unit 3
|
||||
interface PortfolioPhoto {
|
||||
id: string;
|
||||
shootType: ShootTypeId; // from the soorten-fotoshoots commit
|
||||
thumb: ContentImage;
|
||||
full: ImageSource;
|
||||
}
|
||||
interface PortfolioContent {
|
||||
intro: { eyebrow: string; title: string; text: string };
|
||||
photos: PortfolioPhoto[];
|
||||
}
|
||||
|
||||
// unit 1
|
||||
interface InstagramContent {
|
||||
title: string;
|
||||
handle: string;
|
||||
photos: ContentImage[];
|
||||
}
|
||||
|
||||
interface FilterOption { id: string; label: string }
|
||||
```
|
||||
|
||||
## Components (props)
|
||||
|
||||
```ts
|
||||
// unit 1
|
||||
InstagramGrid({ content: InstagramContent; profileUrl: string })
|
||||
|
||||
// unit 2
|
||||
PortfolioGrid({
|
||||
items: readonly GalleryItem[];
|
||||
eagerCount?: number; // default 3
|
||||
onOpen: (index: number) => void;
|
||||
onIntent?: () => void; // hover/focus: preload the lightbox code
|
||||
'data-testid'?: string;
|
||||
})
|
||||
|
||||
Lightbox({
|
||||
items: readonly GalleryItem[];
|
||||
index: number | null; // null = closed
|
||||
onIndexChange: (index: number) => void;
|
||||
onClose: () => void;
|
||||
label?: string; // dialog name, default "Foto groot bekijken"
|
||||
finalFocusRef?: RefObject<HTMLElement> // or a getter for the tile to return to
|
||||
})
|
||||
|
||||
FilterBar({
|
||||
options: readonly FilterOption[];
|
||||
value: string;
|
||||
onChange: (id: string) => void;
|
||||
label: string; // group name, e.g. "Filter op soort shoot"
|
||||
})
|
||||
|
||||
// unit 3
|
||||
PortfolioGallery({
|
||||
photos: readonly PortfolioPhoto[];
|
||||
shootTypes: readonly ShootType[];
|
||||
shoot: ShootTypeId | undefined; // active filter from the route
|
||||
onShootChange: (shoot: ShootTypeId | undefined) => void;
|
||||
})
|
||||
```
|
||||
|
||||
## Hooks
|
||||
|
||||
```ts
|
||||
// hooks/useSwipe.ts (unit 2)
|
||||
useSwipe(options: { onPrev: () => void; onNext: () => void; enabled?: boolean }):
|
||||
{ onTouchStart: TouchEventHandler; onTouchEnd: TouchEventHandler }
|
||||
```
|
||||
|
||||
## Pure helpers (`lib/`, 100% coverage threshold, example + property-based tests)
|
||||
|
||||
```ts
|
||||
// unit 2
|
||||
wrapIndex(index: number, count: number): number
|
||||
// position within 0..count-1, wrapping both ways (also used by useHeroSlider)
|
||||
swipeDirection(start: Point, end: Point, threshold?: number): 'prev' | 'next' | null
|
||||
masonryRowSpan(image: { width: number; height: number }, rowsPerColumnWidth: number): number
|
||||
// number of implicit rows an item spans, from its aspect ratio
|
||||
neighbourIndexes(index: number, count: number): number[]
|
||||
// which large images to preload around the current one
|
||||
|
||||
// unit 3
|
||||
shootTypesWithPhotos(shootTypes: readonly ShootType[], photos: readonly PortfolioPhoto[]): ShootType[]
|
||||
// in list order; also offered to soorten-fotoshoots
|
||||
shootFromSearch(value: unknown, available: readonly ShootTypeId[]): ShootTypeId | undefined
|
||||
// allowlist check for ?shoot= (like packageFromSearch)
|
||||
filterPhotos(photos: readonly PortfolioPhoto[], shoot: ShootTypeId | undefined): PortfolioPhoto[]
|
||||
filterOptions(shootTypes: readonly ShootType[], allLabel: string): FilterOption[]
|
||||
// "Alles" first, then one option per shoot type (label = name)
|
||||
toGalleryItems(photos: readonly PortfolioPhoto[], shootTypes: readonly ShootType[]): GalleryItem[]
|
||||
// caption = shootLabel
|
||||
photoCountLabel(count: number): string // "1 foto" / "4 foto's"
|
||||
```
|
||||
|
||||
## SEO (`seo.ts`, unit 3)
|
||||
|
||||
```ts
|
||||
galleryImages(photos: readonly PortfolioPhoto[], base?: string): ImageObject[]
|
||||
// contentUrl/thumbnailUrl absolute https, description = alt, creator → personId, copyrightHolder → businessId
|
||||
// head: structuredDataScript(webPage('ImageGallery', '/portfolio', { associatedMedia: galleryImages(...) }))
|
||||
```
|
||||
@@ -0,0 +1,74 @@
|
||||
# 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 `eagerCount` images load immediately with `fetchPriority="high"`; the rest via `DeferredImage`
|
||||
- hover/focus effect (zoom + overlay, zoom off under reduced motion), focus ring above neighbours, `Reveal` fade-in
|
||||
- click / Enter on a tile: `preventDefault` and 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)
|
||||
- **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` (controlled `open`), 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`/`carouselControl` recipes, ≥ 44 px), ←/→ keys, swipe via `useSwipe`; 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
|
||||
- **Loaded**: with `React.lazy` on 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 button `aria-pressed`, one tab stop per button), labels in eyebrow style, active one underlined in `accent.deep`; reports the chosen id; renders nothing for fewer than two options. *Source: Q2 = A, Q3 = A*
|
||||
- **Styling**: a new recipe `filterControl` (or a `filter` variant on the `link` recipe — 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**: `useHeroSlider` uses `useSwipe` instead 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) with `FilterBar`, `PortfolioGrid` and the lazily loaded `Lightbox`
|
||||
|
||||
### Route `routes/portfolio.tsx` (rewritten)
|
||||
- `validateSearch` → `{ shoot?: ShootTypeId }` (typed, allowlist check; agreed with soorten-fotoshoots)
|
||||
- `head()` → `pageHead('/portfolio')` + `ImageGallery` structured data
|
||||
- component: `PageIntro` → `PortfolioGallery` → `InstagramGrid`; changing the filter navigates with `replace: true`. *Source: Q4 = A*
|
||||
|
||||
### Content and types
|
||||
- `content/portfolioContent.ts` — intro texts and the 10 photos (`PortfolioContent`, `PortfolioPhoto`)
|
||||
- `content/instagramContent.ts` (unit 1) — `InstagramContent`
|
||||
- `content/types.ts` — the types above; `ShootTypeId` / `ShootType` arrive with the soorten-fotoshoots commit
|
||||
|
||||
### SEO
|
||||
- `seo.ts` — `galleryImages(...)` builder for the `ImageObject` list; uses `webPage()` from the contact-page commit
|
||||
- `sitePages.ts` — `/portfolio`: `indexed: true`, `ogImage`
|
||||
- `lighthouserc*.cjs` — `/portfolio` to the indexed paths
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user