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:
+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
|
||||
Reference in New Issue
Block a user