Adds the shared gallery building blocks

A masonry photo grid that keeps the reading order (pure CSS, no measuring
in the browser), an accessible lightbox on Chakra's Dialog with wrap-around
browsing, keys, swipe and preloading, and a filter bar of toggle buttons.
They work on generic gallery items, so other pages can use them. The swipe
logic moves out of the hero into a shared hook; the hero behaves as before.
The rules behind them live in pure helpers with property-based tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 23:22:43 +01:00
co-authored by Claude Opus 5.5
parent e013f1436b
commit 18bf0311ef
38 changed files with 2392 additions and 43 deletions
@@ -184,3 +184,87 @@ Feature "portfolio-page" may affect components also touched by active feature "o
**Context**: CONSTRUCTION - Code Generation Unit 1 (generated, awaiting approval)
---
## Code Generation — Unit 1 — Approval
**Timestamp**: 2026-10-25T07:40:00Z
**User Input**: "Ga verder"
**AI Response**: "Unit 1 approved (commits 4de0885, 996cc32). active-features.md status → 🟢 Construction. Recorded contact-page commit 790495d (webPage) for unit 3. Started Functional Design for unit 2 (gallery-blocks): created construction/plans/gallery-blocks-functional-design-plan.md and gallery-blocks-fd-questions.md (10 questions: lightbox transition, phone button layout, tap on image, swipe down, announcement, tile name, large image failure, preload count, grid on filter change, Home/End)."
**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers)
---
## Branch Update — soorten-fotoshoots-page merged
**Timestamp**: 2026-10-25T10:30:00Z
**User Input**: (none — notification from the soorten-fotoshoots session: PR #8 merged as a58bc1c)
**AI Response**: "Stashed the uncommitted docs under a named stash, rebased feature/portfolio-page (2 commits) onto origin/master a58bc1c. Conflicts: aidlc-docs/active-features.md (kept the soorten ✅ row and the portfolio row) and _shared/reverse-engineering/architecture.md (merged the shared InstagramGrid line with soorten's CallToAction/RichParagraph blocks). Popped and dropped the own stash by name (contact's stash left untouched). New hashes 236123d (plans), cce11a8 (unit 1). Verified: tsc clean, vitest 65 files / 326 tests passed (Lighthouse not run). shootTypes.ts now comes via master; the eb23536 cherry-pick is no longer needed. Soorten's session ended, so wiring the 'types with photos' helper into their ShootList/ShootBlock becomes a follow-up of this feature."
**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers)
---
## Branch Update — contact-page merged
**Timestamp**: 2026-10-25T19:00:00Z
**User Input**: (none — notification from the contact-page session: PR #9 merged as 8b70f23, test free)
**AI Response**: "Stashed docs under a named stash, rebased feature/portfolio-page onto origin/master 8b70f23 (new hashes ad567bb plans, ec48bd7 unit 1). Conflicts only in aidlc-docs/active-features.md (kept all master rows incl. contact-page as on master, portfolio row with status 🟢 Construction). Popped and dropped the own stash by name; stash list empty. Verified: tsc clean, vitest 71 files / 368 tests passed. Parallel sessions (soorten-fotoshoots, contact) have both ended; portfolio is the only active feature."
**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers)
---
## Branch Update — contact-page PR #10 merged (docs)
**Timestamp**: 2026-10-25T19:20:00Z
**User Input**: (none — notification from the contact-page session: PR #10 merged as 1bf28cb, docs only)
**AI Response**: "Rebased onto origin/master 1bf28cb. Mistake and fix: when resolving the active-features.md conflict I removed the conflict markers and kept both sides, so the old 'contact-page 🟢 Construction' row stayed next to master's '✅ Complete' row and was committed in the rebased planning commit. Cause: blindly keeping both sides of a hunk where one side replaced a line. Fixed in history (local, unpushed) with a fixup commit + autosquash; the stash conflict was then resolved from the committed file with only the portfolio status changed. Verified the restored state, audit and FD files byte-equal to the stash before dropping it by name. New hashes b35b1c2 (plans), e013f14 (unit 1); web/ unchanged by this rebase."
**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers)
---
## Functional Design — Unit 2 — Answers and Artifacts
**Timestamp**: 2026-10-25T19:40:00Z
**User Input**: "Stuur de vragen hier" — then answered in chat: Q1 Korte overvloeier, Q2 Balk onderaan op telefoon, Q3 Niets, Q4 Nee, Q5 Positie en bijschrift, Q6 Alt + (groot bekijken), Q7 Kleine foto met melding, Q8 2 aan elke kant, Q9 Direct wisselen, Q10 Ja.
**AI Response**: "Asked the 10 FD questions in chat (user request) and recorded the answers in gallery-blocks-fd-questions.md (A A A A A A B B A A). No ambiguities. Generated construction/gallery-blocks/functional-design/{domain-entities, business-rules, business-logic-model, frontend-components}.md: masonry spans K=40 rows per column width + 2 gap rows (CSS only), eager first 3, tile = link with modifier-click passthrough, lightbox rules (wrap, Home/End, swipe, phone bottom bar, crossfade 0.3 s, thumb while loading, visible error message, preload 2 each side, close on list change), filter bar rules, swipe rules, hero refactor. Added a pure lightboxReducer (not named in Application Design) so the open/close/browse state can be tested statefully (PBT-06). Properties per helper documented for PBT-01."
**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting approval)
---
## Functional Design — Unit 2 — Approval
**Timestamp**: 2026-10-25T19:50:00Z
**User Input**: "Ga verder"
**AI Response**: "Functional design of unit 2 approved. Created construction/plans/gallery-blocks-code-generation-plan.md (20 steps: types, five pure helpers with example and property-based tests incl. a stateful reducer test, arbitraries, useSwipe + hero refactor, theme token and filterControl recipe, FilterBar, PortfolioGrid, Lightbox, fixtures, pnpm check, own RE lines, summary, one local commit)."
**Context**: CONSTRUCTION - Code Generation Unit 2 (plan awaiting approval)
---
## Code Generation — Unit 2 — Plan Approval and Generation
**Timestamp**: 2026-10-25T21:30:00Z
**User Input**: "Approve plan"
**AI Response**: "Executed gallery-blocks-code-generation-plan.md steps 1–20: types, five pure helpers with example and property-based tests (incl. stateful lightboxReducer test), arbitraries, useSwipe + hero refactor (hero tests unchanged), theme token swap + filterControl recipe, FilterBar, PortfolioGrid (CSS-only masonry, verified generated CSS), Lightbox (Chakra Dialog), fixtures. ESLint set-state-in-effect errors fixed at the cause. jsdom limits handled explicitly in tests (focus trap needs layout boxes; exit needs animation events). Claimed/freed port 4173 with the remaining idle sessions. pnpm check: tests 80 files / 426 passed, desktop Lighthouse green; mobile Lighthouse failed on / (0.75, rerun 0.79 vs 0.8) and /contact (0.88 vs 0.9). Root cause checked: master on the same machine gives / 0.78 and /contact 0.88, main bundle grows 0.12 kB gzip — pre-existing budget issue, not a regression; surfaced to the user. Own RE lines updated; code summary written; committed locally (no push)."
**Context**: CONSTRUCTION - Code Generation Unit 2 (generated, awaiting approval)
---