Adds the shoot page layout and the shoot-type submenu
Shoot pages follow design E: breadcrumb, story blocks, process timeline with icons, photo mosaic, FAQ, package block and booking call to action, with per-shoot OG images. The navigation gets a "Soorten fotoshoots" submenu (desktop panel, mobile group) built from shootTypes, with exact current-page matching in menu, footer and breadcrumb. A 404 under /soorten-fotoshoots/ also offers a link back to the overview. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,7 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
||||
|
||||
### Components (props)
|
||||
- `AppShell()`, `NavigationBar()`, `BackToTop()`, `NotFound()` — no props
|
||||
- `MobileNav({ id, open, onClose })`, `NavLink(RouterLink props)`
|
||||
- `MobileNav({ id, open, groupOpen, pathname, dispatch })`, `NavLink(RouterLink props & { sectionCurrent? })`, `NavSubmenu({ item, id, open, pathname, transparent, toggleRef, dispatch })` (desktop panel), `MobileNavGroup({ item, id, open, pathname, dispatch })`, `ChevronIcon()`
|
||||
- `Footer({ content: SiteContent })`, `FooterColumn({ title, children })`, `FooterLink(LinkProps)`
|
||||
- `Hero({ content: HeroContent, socials: SocialLink[] })`, `HeroArrows({ onPrev, onNext })`, `HeroPauseButton({ stopped, onToggle })`, `HeroSocials({ socials })`
|
||||
- `PageIntro({ title, eyebrow?, children? })` — renders the page's only h1
|
||||
@@ -55,6 +55,7 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
||||
- `useSwipe({ onPrev, onNext, enabled? })` → `{ onTouchStart, onTouchEnd }` (threshold and direction from `lib/swipeDirection`)
|
||||
- `useScrolledPast(getThreshold)` → boolean (stable `getThreshold` required)
|
||||
- `useRouteFocus()` — focuses `<main>` after navigation
|
||||
- `useDismiss(ref, active, onDismiss(reason: 'escape' | 'outside'))` — document-level Escape and outside pointer down, listeners only while `active` (unit 3)
|
||||
- `useInView({ rootMargin, skip })` → `{ ref, inView }`; `usePageLoaded()` → boolean; `useReveal()` → `{ ref, visible }`
|
||||
|
||||
### Pure helpers (`lib/`)
|
||||
@@ -67,6 +68,7 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
||||
- Portfolio (`lib/portfolioFilters.ts`): `isShootTypeId`, `shootTypesWithPhotos(shootTypes, photos)`, `shootFromSearch(value, available)`, `filterPhotos(photos, shoot)`, `filterOptions(shootTypes, allLabel)`, `toGalleryItems(photos, shootTypes)`, `photoCountLabel(n)`; `seo.ts`: `galleryImages(photos)`
|
||||
- Gallery (portfolio-page): `wrapIndex(index, count)`, `swipeDirection(start, end, threshold = 50)`, `masonryRowSpan({ width, height }, K = 40, gapRows = 2)`, `neighbourIndexes(index, count, radius = 2)`, `lightboxReducer(state, event)` (+ `LightboxState`, `LightboxEvent`)
|
||||
- Shoot pages (unit 1): `shootPagePath(id)`, `shootIdFromSlug(slug)`, `shootIdFromPath(pathname)` (`lib/shootPages.ts`); `shootPackage(shoot, packages)` (`lib/shootPackage.ts`); `fillPlaceholders(text, values)`, `fillRichText(rich, values)` (`lib/fillPlaceholders.ts`); `richTextToPlain(text)` (`lib/richTextToPlain.ts`); `shootPageView(id, page, sources)` (`lib/shootPageView.ts`)
|
||||
- Navigation (unit 3): `shootNavItems(shoots): NavItem[]` (`lib/shootNavItems.ts`); `isItemCurrent(item, pathname)`, `isSectionCurrent(item, pathname)` (`lib/navCurrent.ts`); `navMenuReducer(state, event)` with `NavMenuState`, `NavMenuEvent`, `initialNavMenuState`, `FocusRequest` (`lib/navMenuState.ts`)
|
||||
|
||||
### Monitoring
|
||||
- `monitoringFor(hostname): Monitoring | null`, `startSentry(hostname?)`, `reportError(error)`
|
||||
@@ -98,6 +100,6 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
||||
### HeroContent
|
||||
- **Fields**: `title`, `tagline`, `cta: { label, to }`, `slides: { id, src, alt }[]`
|
||||
### NavItem (`navigation.ts`)
|
||||
- **Fields**: `to: RoutePath`, `label: string`
|
||||
- **Fields**: `to: RoutePath`, `label: string`, `children?: readonly NavItem[]` (one level; `hasChildren(item)` is true only for a non-empty list; the shoot pages are the children of `/soorten-fotoshoots`)
|
||||
### PageMeta (`sitePages.ts`)
|
||||
- **Fields**: `title`, `description`, `indexed`, `ogImage?`
|
||||
|
||||
@@ -62,6 +62,7 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r
|
||||
### components/NavigationBar/
|
||||
- **Purpose**: Site header and navigation
|
||||
- **Responsibilities**: Fixed header, transparent over the hero on desktop until scrolled; shrinks after scroll; logo links home; desktop links and full-screen mobile menu from `mainNav`
|
||||
- **Menu state**: one `useReducer(navMenuReducer)` (`lib/navMenuState.ts`) holds the mobile menu, its group, the desktop submenu and the focus request, so the hamburger, the panels and the route listener cannot disagree; `routeChanged` closes everything (also on browser back)
|
||||
- **Type**: Application
|
||||
|
||||
### components/Footer/
|
||||
@@ -98,6 +99,7 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r
|
||||
- **Purpose**: Static content until the CMS API exists
|
||||
- **Responsibilities**: `types.ts` (API-shaped interfaces incl. `ContentImage`, `HomeContent`, `PricingPackage`, `Testimonial`), `siteContent.ts` (footer intro, socials, e-mail parts, contact form switch), `heroContent.ts`, `homeContent.ts` (texts and photos of the homepage sections), `packages.ts`, `testimonials.ts`, `socialPlatforms.ts`
|
||||
- **Type**: Application (data)
|
||||
- **D5 (unit 3)**: `navigation.ts` imports `shootTypes` (the submenu is built from it), so the shoot type data is in the main bundle instead of its own chunk. Measured in the Step 16 build: main chunk 150.69 → 152.58 kB gzip (+1.89 kB, limit 2.5 kB; raw 528.98 → 536.68 kB)
|
||||
|
||||
### lib/
|
||||
- **Purpose**: Pure, fully tested helpers
|
||||
|
||||
@@ -24,6 +24,8 @@ graph TD
|
||||
NavigationBar --> MobileNav["NavigationBar/MobileNav.tsx"]
|
||||
NavigationBar --> navigation["navigation.ts"]
|
||||
Footer --> navigation
|
||||
navigation --> shootNavItems["lib/shootNavItems.ts"]
|
||||
navigation --> shootTypes["content/shootTypes.ts"]
|
||||
Index["routes/index.tsx"] --> Hero["Hero/Hero.tsx"]
|
||||
Hero --> HeroArrows["Hero/HeroArrows.tsx"]
|
||||
Hero --> HeroPause["Hero/HeroPauseButton.tsx"]
|
||||
@@ -44,7 +46,7 @@ graph TD
|
||||
classDef util fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||
class Root,AppShell,NavigationBar,Footer,BackToTop,Umami,NavLink,MobileNav shell;
|
||||
class Index,Hero,HeroArrows,HeroPause,HeroSocials,Placeholder,PageIntro,HomeParts page;
|
||||
class navigation,useHeroSlider,LinkButton,RouterLink,PageSection,SectionHeading,Reveal,FramedImage,DeferredImage util;
|
||||
class navigation,shootNavItems,shootTypes,useHeroSlider,LinkButton,RouterLink,PageSection,SectionHeading,Reveal,FramedImage,DeferredImage util;
|
||||
```
|
||||
|
||||
Text alternative: the root route renders AppShell (NavigationBar, Footer, BackToTop, Umami); NavigationBar and Footer read navigation.ts; the index route renders the Hero and the six home sections, which are built from the shared PageSection, SectionHeading, Reveal, FramedImage and DeferredImage blocks; placeholder routes render PageIntro.
|
||||
@@ -65,6 +67,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||
- `web/src/content/{shootTypes,shootTypesPageContent}.ts` — shoot types (also used by the portfolio filters) and page texts; `web/src/assets/shoots/` — 4:5 shoot photos
|
||||
- `web/src/lib/shootLinks.ts` — contact and portfolio link targets per shoot type
|
||||
- `web/src/lib/{shootPages,shootPackage,fillPlaceholders,richTextToPlain,shootPageView}.ts` — shoot page helpers (ids and paths, package, placeholders, plain text, view), each with a test
|
||||
- `web/src/lib/{shootNavItems,navCurrent,navMenuState}.ts` — navigation helpers (unit 3), each with a test: submenu items from the shoot types (`shootNavItems`), current-page and section-current matching (`isItemCurrent`, `isSectionCurrent`), menu state reducer (`navMenuReducer`, `NavMenuState`, `NavMenuEvent`; `navMenuState.ts` at 100 % coverage)
|
||||
- `web/src/components/PhotoDuo/PhotoDuo.tsx` — two photos side by side
|
||||
- `web/src/content/aboutContent.ts` — about page content; `web/src/assets/about/*` — portrait and duo photos; `web/public/og-over-mij.jpg` — preview image
|
||||
- `web/src/routes/soorten-fotoshoots/index.tsx` — the shoot types page (moved from `routes/soorten-fotoshoots.tsx`); `newborn.tsx`, `zwangerschap.tsx`, `gezin.tsx`, `loveshoot.tsx`, `portret.tsx` — one route per shoot page (`/soorten-fotoshoots/<id>`); `-shootPageSources.ts` — the sources the shoot routes share
|
||||
@@ -73,7 +76,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||
- `web/src/routes/portfolio.tsx` — the portfolio (indexed; `?shoot=` filter; `ImageGallery` JSON-LD); `web/src/components/portfolio/PortfolioGallery/`, `web/src/content/portfolioContent.ts`, `web/src/lib/portfolioFilters.ts`, `web/src/assets/portfolio/*` (10 photos × 2 sizes), `web/public/og-portfolio.jpg`
|
||||
- `web/src/routes/{contact,privacyverklaring}.tsx` — placeholders with `PageIntro`
|
||||
- `web/src/components/AppShell.tsx` — shell
|
||||
- `web/src/components/NavigationBar/*` — header, NavLink, MobileNav
|
||||
- `web/src/components/NavigationBar/*` — header, NavLink (`sectionCurrent` underline for the parent of an open section), MobileNav (scrolls; Escape returns focus to the hamburger), NavSubmenu (desktop disclosure panel), MobileNavGroup (expandable shoot list on mobile), ChevronIcon
|
||||
- `web/src/components/Footer/*` — footer, FooterColumn, FooterLink
|
||||
- `web/src/components/Hero/*` — hero slider, arrows, pause button, socials, slider hook
|
||||
- `web/src/components/home/*` — five homepage sections (AboutBlock is the closest relative of the Over mij page's first block)
|
||||
@@ -92,14 +95,16 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||
- ★ `web/src/content/*.ts` — static content (`siteContent`, `heroContent`, `homeContent` (exports `introPhotos`), `instagramContent`, `packages`, `testimonials`, `socialPlatforms`)
|
||||
- `web/src/contact/*` — contact form types and placeholder submit
|
||||
- `web/src/hooks/*` — `useRouteFocus`, `useScrolledPast`, `useInView`, `usePageLoaded`, `useReveal`, `useSwipe` (shared by the hero and the lightbox)
|
||||
- `web/src/hooks/useDismiss.ts` — Escape and outside pointer down while active (`useDismiss(ref, active, onDismiss)`), used by NavSubmenu and MobileNav (unit 3)
|
||||
- `web/src/components/{PortfolioGrid,Lightbox,FilterBar}/` — gallery building blocks (portfolio-page unit 2): masonry grid in reading order (CSS only), lightbox on Chakra `Dialog` (lazy-loadable default export), single-choice toggle buttons; generic over `GalleryItem` / `FilterOption`
|
||||
- `web/src/lib/*.ts` — pure helpers with tests
|
||||
- `web/src/monitoring/*` — Sentry/Umami config and loader
|
||||
- `web/src/navigation.ts` — `RoutePath`, `mainNav`, `footerNav`
|
||||
- `web/src/navigation.ts` — `RoutePath`, `NavItem` (with `children`, one level), `hasChildren`, `mainNav` (the shoot submenu comes from `shootTypes` via `shootNavItems`), `footerNav`
|
||||
- ★ `web/src/seo.ts`, `sitePages.ts`, `sitemap.ts` — SEO (`/over-mij` is `indexed: false` today)
|
||||
- ★ `web/lighthouserc.cjs` / `.desktop.cjs` — own list of indexed/noindex paths, guarded by a test
|
||||
- `web/src/theme.ts`, `web/src/recipes/*.ts` — design system
|
||||
- `web/src/test/*` — `renderWithProviders`, axe matcher, fast-check arbitraries, `fakeIntersectionObserver`, setup
|
||||
- `web/src/test/navArbitraries.ts` — navigation generators (menu events, menu states, pathnames; unit 3, not in `lib/` so the 100 % threshold does not apply); `web/src/test/navViewport.ts` — viewport helper (`matchMedia` stub and the `lg` display rules, because jsdom ignores `@media`)
|
||||
- `web/src/assets/*` — hero photos (8), `home/` (intro 1–4, andrea, deco 1–2, two review photos), light/dark logos
|
||||
- `web/config/securityHeaders.ts` — CSP
|
||||
- `web/config/serverConfig.ts`, `writeServerConfig.ts`, `sitemapPlugin.ts`, `testSeed.ts`
|
||||
|
||||
@@ -327,3 +327,55 @@
|
||||
**Context**: CONSTRUCTION - Code Generation Part 2
|
||||
|
||||
---
|
||||
|
||||
## Code Generation — Commit, push and test deploy authorised
|
||||
**Timestamp**: 2026-10-30T12:32:38Z
|
||||
**User Input**: "je mag wel meteen committen, pushen en deployen naar test. Ik zit nu niet thuis dus dan kan ik het via de testomgeving bekijken. dat is prima"
|
||||
**AI Response**: Committed unit 1 as e5f4348 (OG crops of unit 2 left out, awaiting approval), pushed feature/shoot-type-pages, dispatched CI run 585 with deploy_test=true. Units 2 and 3 will be committed and deployed to test the same way once each reaches a green, coherent state. No merge to master (DRAFT gate still open).
|
||||
**Context**: CONSTRUCTION - Code Generation Part 2
|
||||
|
||||
---
|
||||
|
||||
## Code Generation (unit 2) — OG crops approved
|
||||
**Timestamp**: 2026-10-30T12:49:25Z
|
||||
**User Input**: "akkoord op alle 5 de deelafbeeldingen. De volgende deploy naar test hoef je pas te doen als beide units klaar zijn. Tussendoor hoeft niet"
|
||||
**AI Response**: All five OG crops approved as produced (contact sheet in scratchpad og-crops). Unit 2 resumes at Step 3. Next commit, push and test deploy only once units 2 and 3 are both complete. CI run 585 (unit 1, e5f4348): check and deploy-test succeeded.
|
||||
**Context**: CONSTRUCTION - Code Generation Part 2
|
||||
|
||||
---
|
||||
|
||||
## Code Generation — Requirement added: FR-ST-14 (404 inside the shoot section)
|
||||
**Timestamp**: 2026-10-30T12:58:10Z
|
||||
**User Input**: "oh ik weet niet of dit goed te fixen is. Ik zou het hier wel bij willen doen namelijk. Maar als je naar /soorten-fotohoots/niet-bestaande-shoot gaat dan krijg je een 404 met \"Terug naar home\". Kan hier iets komen van \"Terug naar Soorten Fotoshoots of Terug naar Home\"?"
|
||||
**AI Response**: Root cause: unmatched paths fall to the root notFoundComponent (no soorten-fotoshoots layout route), and StatusPage defaults to one home button. Added FR-ST-14: NotFound reads the pathname and, under /soorten-fotoshoots/, shows "Terug naar Soorten fotoshoots" (accent) + "Terug naar home" (outline), same pattern as ErrorPage. No layout route, so unit 3 matching and the bundle are unaffected. Delegated to a Sonnet agent; files (components/StatusPage/*) are disjoint from units 2 and 3; no builds (unit 3 owns them).
|
||||
**Context**: CONSTRUCTION - Code Generation Part 2
|
||||
|
||||
---
|
||||
|
||||
## Code Generation — FR-ST-14 implemented
|
||||
**Timestamp**: 2026-10-30T13:00:55Z
|
||||
**AI Response**: NotFound reads the pathname via useRouterState (same as NavigationBar) and uses new pure helper lib/isShootSectionPath.ts (case-insensitive prefix '/soorten-fotoshoots/'); unit + PBT tests and 3 StatusPage tests (two links in order + axe, mixed case, single link elsewhere). Scoped vitest 18/18, tsc and lint clean on these files. Reviewed by orchestrator. Full verification runs with the unit 2/3 gates.
|
||||
**Context**: CONSTRUCTION - Code Generation Part 2
|
||||
|
||||
---
|
||||
|
||||
## Code Generation (unit 3) — Steps 1–16 complete
|
||||
**Timestamp**: 2026-10-30T13:01:52Z
|
||||
**AI Response**: Unit 3 Steps 1–16 done; D5 bundle gate passed (main chunk gzip 150.69 → 152.58 kB, +1.89 kB, limit 2.5 kB); lint/format/tsc green; 801 tests passing. Its reported coverage failure on lib/isShootSectionPath.ts was a mid-run race with the FR-ST-14 agent (source written 13:59:04, test 13:59:05); re-run alone gives 9 tests and 100% coverage. Steps 19–20 (docs) delegated to Haiku. Steps 17–18 (real browser, Lighthouse on port 4173) deferred until unit 2 finishes Step 21, so they measure a coherent build.
|
||||
**Context**: CONSTRUCTION - Code Generation Part 2
|
||||
|
||||
---
|
||||
|
||||
## Code Generation (unit 2) — Steps 3–21 complete; cross-unit test fix
|
||||
**Timestamp**: 2026-10-30T13:17:14Z
|
||||
**AI Response**: Unit 2 Steps 3–21 done (113 files / 883 tests, 1 failing). Root cause of the failure: unit 3's case-variant test counted every aria-current on the page; unit 2's breadcrumb legitimately marks its last item aria-current="page" (BR-SP-01), and the router renders the page on /soorten-fotoshoots/Newborn. Orchestrator narrowed the assertion: exactly one mark, a non-link inside the "Kruimelpad" nav (no nav/footer link marked). navSubmenu.test.tsx 18/18. LAYOUT.md Prettier warnings are pre-existing on HEAD and outside web/'s format check; left as is. Sequential gates delegated to one Sonnet agent: unit 2 Step 22 → unit 3 Step 17 → unit 3 Step 18 → unit 2 Step 23 → unit 2 Step 26 (sole owner of port 4173).
|
||||
**Context**: CONSTRUCTION - Code Generation Part 2
|
||||
|
||||
---
|
||||
|
||||
## Code Generation (units 2 and 3) — Sequential gates
|
||||
**Timestamp**: 2026-10-30T13:43:43Z
|
||||
**AI Response**: Unit 2 Step 22 pass (lint, format, tsc, build, audit:deps with seroval 1.7.3, 113 files / 883 tests, main gzip 152.56 kB = +1.87 kB vs unit 1, DRAFT markers 98). Unit 3 Step 17 pass (110/110 browser checks, 1024/1100/1280 fit, keyboard, reduced motion, short phones). Unit 3 Step 18 pass (mobile / pooled median 0.77 vs baseline 0.77). Unit 2 Step 26 done (exactly three aria-current per shoot page: breadcrumb, header submenu link, mobile sub-link; 888 tests). Unit 2 Step 23 NOT green: mobile gezin 0.84–0.85 and loveshoot 0.83 below the 0.85 budget (unit 1 shell-only 0.90); LCP render delay ~2.9 s after the main bundle, photo itself fast; / and /contact below budget as on master. Desktop 0.99–1.00. Decision on mitigation goes to the user. Per the user's instruction (deploy when both units are done; CI deploy-test does not wait on Lighthouse) units 2 and 3 plus FR-ST-14 are committed, pushed and deployed to test now.
|
||||
**Context**: CONSTRUCTION - Code Generation Part 2
|
||||
|
||||
---
|
||||
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
# Code Summary — Unit 3: Navigation submenu
|
||||
|
||||
Plan: [navigation-submenu-code-generation-plan.md](../../plans/navigation-submenu-code-generation-plan.md). Branch `feature/shoot-type-pages` (from master `18e81d0`), worktree `AndreaSlopFotografie-shoot-type-pages`. Unit 2 (shoot page UI) is built in the same worktree; its files are not described here.
|
||||
|
||||
## Status
|
||||
- Steps 1–16 and 19–20 done (checked in the plan).
|
||||
- Step 17 (real-browser check: 1024 px fit, transparent header, short phone): **pending — run by orchestrator after unit 2's build**.
|
||||
- Step 18 (Lighthouse, needs the port 4173 claim): **pending — run by orchestrator after unit 2's build**.
|
||||
- Gates (Step 15): lint, format:check and `tsc` green. `pnpm test`: 106 files, 801 tests passing, fast-check seed 1525740974. The coverage failure reported at that moment came from a file written mid-run by another task. `lib/isShootSectionPath.ts` has 100 % coverage when run on its own, and a full re-run happens at the joint verification.
|
||||
|
||||
## Commits
|
||||
None. The unit is uncommitted in the worktree. A commit (and a push) is made only when the user asks.
|
||||
|
||||
## Files
|
||||
|
||||
### Created (unit 3)
|
||||
- `web/src/lib/shootNavItems.ts` (+ `.test.ts`): submenu items from the shoot types
|
||||
- `web/src/lib/navCurrent.ts` (+ `.test.ts`): `isItemCurrent`, `isSectionCurrent`
|
||||
- `web/src/lib/navMenuState.ts` (+ `.test.ts`): `navMenuReducer`, `NavMenuState`, `NavMenuEvent`, `initialNavMenuState`, `FocusRequest`
|
||||
- `web/src/hooks/useDismiss.ts` (+ `useDismiss.test.tsx`)
|
||||
- `web/src/components/NavigationBar/NavSubmenu.tsx` (desktop disclosure panel), `MobileNavGroup.tsx` (expandable shoot list), `ChevronIcon.tsx` (inline SVG)
|
||||
- `web/src/components/NavigationBar/NavSubmenu.test.tsx`, `MobileNav.test.tsx`, `NavLink.test.tsx`, `activeOptions.test.tsx` (the exact-matching probe of Step 2, kept as a regression test)
|
||||
- `web/src/navSubmenu.test.tsx` (real app, `renderApp`)
|
||||
- `web/src/test/navArbitraries.ts` (unit 3's own fast-check generators; in `test/`, not `lib/`, so the 100 % threshold does not apply to them)
|
||||
- `web/src/test/navViewport.ts` (test helper: `matchMedia` stub plus the `lg` display rules, because jsdom ignores `@media`)
|
||||
|
||||
### Modified (unit 3)
|
||||
- `web/src/navigation.ts`: `NavItem.children`, `hasChildren`, `mainNav` parent gets `children: shootNavItems(shootTypes)`; `footerNav` unchanged
|
||||
- `web/src/navigation.test.ts` (6 tests added, 10 in total)
|
||||
- `web/src/components/NavigationBar/NavigationBar.tsx`: `useReducer(navMenuReducer)`, effects for `viewport`, `routeChanged` and `focusRequest`
|
||||
- `web/src/components/NavigationBar/NavigationBar.test.tsx` (extended; the "vaste volgorde" test now asserts the top level and the five children separately)
|
||||
- `web/src/components/NavigationBar/NavLink.tsx`: `sectionCurrent` prop (`data-section-current`, underline)
|
||||
- `web/src/components/NavigationBar/MobileNav.tsx`: props `{ id, open, groupOpen, pathname, dispatch }`, scrolls (`overflowY="auto"`), centring wrapper, reduced-motion reveal
|
||||
- `web/src/components/Footer/Footer.tsx` (exact matching), `Footer.test.tsx` (5 tests added, 11 in total)
|
||||
|
||||
### Not touched by unit 3
|
||||
`components/shoots/*`, the page section components, `MediaText`, `CallToAction`, `routes/soorten-fotoshoots/*`, `content/*`, `sitePages.ts`, `LAYOUT.md`, `.ai/`, `test/arbitraries.ts`, `theme.ts`, `package.json`, `pnpm-lock.yaml`.
|
||||
|
||||
## Interfaces
|
||||
- `NavItem.children?: readonly NavItem[]` (one level; an empty array counts as none); `hasChildren(item)` (`navigation.ts`)
|
||||
- `shootNavItems(shoots: readonly ShootType[]): NavItem[]` (`lib/shootNavItems.ts`): `{ to: shootPagePath(id), label: name }` in input order
|
||||
- `isItemCurrent(item, pathname)`, `isSectionCurrent(item, pathname)` (`lib/navCurrent.ts`): lower case, one trailing slash ignored (not for `/`); pure string comparison
|
||||
- `NavMenuState { isDesktop, menuOpen, groupOpen, submenuOpen, focusRequest }`, `NavMenuEvent` (`viewport`, `toggleMenu`, `toggleGroup`, `toggleSubmenu`, `escape`, `outside`, `focusLeave`, `linkChosen`, `routeChanged`, `focusHandled`), `navMenuReducer(state, event)`, `initialNavMenuState` (`lib/navMenuState.ts`). Invariants I1–I4: `submenuOpen` implies desktop; `menuOpen` implies mobile; `groupOpen` implies `menuOpen`; a focus request fits the width. An event that does not apply returns the same object.
|
||||
- `useDismiss(ref, active, onDismiss(reason: 'escape' | 'outside'))` (default export, `hooks/useDismiss.ts`)
|
||||
- Component props:
|
||||
- `NavSubmenu({ item, id, open, pathname, transparent, toggleRef, dispatch })`
|
||||
- `MobileNavGroup({ item, id, open, pathname, dispatch })`
|
||||
- `MobileNav({ id, open, groupOpen, pathname, dispatch })` (`onClose` removed)
|
||||
- `NavLink(RouterLink props & { sectionCurrent?: boolean })`
|
||||
- `ChevronIcon()`
|
||||
- Footer links: `activeOptions={{ exact: true, includeSearch: false }}` (see the truth table below)
|
||||
|
||||
## Requirement and rule traceability
|
||||
| Requirement / rule | Where | Tests |
|
||||
|---|---|---|
|
||||
| FR-ST-10 Navigation submenu | `navigation.ts`, `shootNavItems.ts`, `NavigationBar/*`, `Footer.tsx`, `navMenuState.ts` | `navigation.test.ts`, `shootNavItems.test.ts`, `navMenuState.test.ts`, `NavigationBar.test.tsx`, `NavSubmenu.test.tsx`, `MobileNav.test.tsx`, `navSubmenu.test.tsx`, `Footer.test.tsx` |
|
||||
| NFR-ST-01 Accessibility (disclosure pattern, keyboard, focus, 44 px, reduced motion, axe) | `NavSubmenu`, `MobileNavGroup`, `MobileNav`, `NavLink`, `ChevronIcon`, `useDismiss` | `NavigationBar.test.tsx` and `MobileNav.test.tsx` (axe open and closed, focus, Escape, keyboard), `useDismiss.test.tsx`, `NavLink.test.tsx`; the visual part is Step 17 (pending) |
|
||||
| NFR-ST-03 Performance (D5 gate) | `navigation.ts` imports `shootTypes` | Step 16 bundle check; Steps 17–18 pending |
|
||||
| NFR-ST-06 Testing (PBT + example + registry consistency) | `test/navArbitraries.ts`, `test/navViewport.ts` | PBT in `shootNavItems`, `navCurrent`, `navMenuState` (model-based stateful run); registry "a nav child per shoot" in `navigation.test.ts`; example tests as listed |
|
||||
| D4 current state | `navCurrent.ts`, `NavLink` (`sectionCurrent`), exact `activeOptions` in every nav and footer link | `activeOptions.test.tsx` (12 tests), `navCurrent.test.ts` (20), `navSubmenu.test.tsx` (18), `Footer.test.tsx` |
|
||||
| D5 nav source | `navigation.ts` → `shootNavItems(shootTypes)` (single source) | `navigation.test.ts`, `navSubmenu.test.tsx` (every panel name matches `shootTypes`) |
|
||||
| BR-NAV-01..05 current state, exact matching, case, query, hash | `navCurrent.ts`, `activeOptions` (Step 2) | `activeOptions.test.tsx`, `navCurrent.test.ts`, `navSubmenu.test.tsx` |
|
||||
| BR-NAV-10..12 content | `shootNavItems.ts`, `navigation.ts` | `shootNavItems.test.ts`, `navigation.test.ts` |
|
||||
| BR-NAV-20..29 desktop submenu (click, Escape, outside, Tab out, no hover, no arrow keys, closed panel not reachable) | `NavSubmenu.tsx`, `useDismiss.ts`, `navMenuState.ts` | `NavSubmenu.test.tsx` (13), `NavigationBar.test.tsx` (27), `useDismiss.test.tsx` (9), `navMenuState.test.ts` (27) |
|
||||
| BR-NAV-30..36 mobile menu (group state, collapse, close on choice, Escape to hamburger, scroll, scroll lock) | `MobileNav.tsx`, `MobileNavGroup.tsx`, `navMenuState.ts` | `MobileNav.test.tsx` (18), `navSubmenu.test.tsx` (back navigation, group expanded on a shoot page) |
|
||||
| BR-NAV-40..43 layout, touch targets, motion, focus ring | `NavSubmenu`, `MobileNavGroup`, `MobileNav` (`_motionReduce`) | `NavigationBar.test.tsx` and `MobileNav.test.tsx` (reduced-motion rules via `cssRulesFor`); the browser measurements are Step 17 (pending) |
|
||||
| BR-NAV-50 bundle and Lighthouse | Step 16, Step 18 | Step 16 done; Step 18 pending |
|
||||
|
||||
## Test results
|
||||
- Step 15 gate: lint, format:check, tsc green; `pnpm test` 106 files, 801 tests, seed 1525740974 (see Status for the coverage remark).
|
||||
- New and extended unit 3 test files, with the counts from their steps: `activeOptions.test.tsx` 12; `shootNavItems.test.ts` 7 (5 properties); `navCurrent.test.ts` 20; `navMenuState.test.ts` 27 (incl. the model-based stateful run); `navigation.test.ts` 10 in total; `useDismiss.test.tsx` 9; `NavLink.test.tsx` 4; `NavigationBar.test.tsx` 27; `NavSubmenu.test.tsx` 13; `MobileNav.test.tsx` 18; `navSubmenu.test.tsx` 18; `Footer.test.tsx` 11 in total.
|
||||
|
||||
## Coverage of the new lib files
|
||||
- `lib/shootNavItems.ts`, `lib/navCurrent.ts`, `lib/navMenuState.ts`: 100 % (statements, branches, functions, lines), in the Step 15 run.
|
||||
- `hooks/` and components are only reported, not thresholded.
|
||||
- `test/navArbitraries.ts` and `test/navViewport.ts` are test code (excluded from coverage).
|
||||
|
||||
## Router truth table (Step 2, router 1.170)
|
||||
Verified by `activeOptions.test.tsx`:
|
||||
- Trailing slash is ignored: `/soorten-fotoshoots/` is active with plain `exact` and with `exact` plus `includeSearch: false`.
|
||||
- Case is not ignored: `/Soorten-Fotoshoots/Newborn` is not active in either variant.
|
||||
- A query breaks plain `exact`: on `/soorten-fotoshoots?x=1` the link loses `aria-current` with `{ exact: true }` (`includeSearch` defaults to `true`). `{ exact: true, includeSearch: false }` keeps it.
|
||||
- The parent is never active on a child path (`/soorten-fotoshoots/newborn`).
|
||||
|
||||
Decision: every nav and footer link that gets `exact` also gets `includeSearch: false`. This deviates from the FD text (`{ exact: true }` only, BR-NAV-01, BR-NAV-04) and keeps today's behaviour for `/portfolio?shoot=…`, where the footer's Portfolio link is active.
|
||||
|
||||
Consequence for the case variant: on `/soorten-fotoshoots/Newborn` the page renders (the route matches case-insensitively, unit 1 summary), no link has `aria-current`, and the parent keeps `data-section-current` through `isSectionCurrent` (case-insensitive). Accepted: `aria-current` is the router's output and the canonical URL is lowercase.
|
||||
|
||||
## Bundle check (Step 16, D5 gate)
|
||||
- Baseline (unit 1, Step 1): `index-D0huvRmx.js` 528.98 kB raw / 150.69 kB gzip.
|
||||
- After unit 3 (Step 16): `index-Dtz2mqhH.js` 536.68 kB raw / 152.58 kB gzip.
|
||||
- Delta: +7.70 kB raw, **+1.89 kB gzip** against the 2.5 kB limit. The delta may include small unit 2 changes made since Step 1.
|
||||
- Shoot photos still emitted as files: 50 `.jpg` (same as Step 1), 0 `.webp`. `data:image` count in the index 1 (same as Step 1).
|
||||
- The Newborn-only string ("Uit eerdere newbornshoots") is only in `newborn-*.js`; the five shoot page chunks are still separate files.
|
||||
- The separate `shootTypes` chunk is gone (now in the main chunk); `dist/assets` has 119 files (121 at baseline).
|
||||
|
||||
## Browser check (Step 17) — pending
|
||||
Pending — run by orchestrator after unit 2's build. The checklist is in the plan: widths at 1024, 1100 and 1280 px (no wrapping, no overlap, real widths against the FD estimate of about 715 px of 848 px), open panel (visibility, bounding box, solid background, white chevron on the transparent header), keyboard run, reduced motion, mobile at 375 × 480 and 360 × 560. The `mx` fallback on `NavLink` is not applied unless the 1024 px check needs it (record it then).
|
||||
|
||||
## Lighthouse (Step 18) — pending
|
||||
Pending — run by orchestrator after unit 2's build (needs the port 4173 claim). Plan: median mobile performance of `/` after the unit, against the same-session baseline of the unit-1 build; unit-1 measurement was 0.76 on `/` (budget 0.8). Full set and failing budgets to be recorded then.
|
||||
|
||||
## Deviations from the design
|
||||
- **Exact matching:** `{ exact: true, includeSearch: false }` instead of `{ exact: true }` (router truth table above).
|
||||
- **Test helper:** `src/test/navViewport.ts` (new, not in the plan's file list): a `matchMedia` stub and a style element with the `lg` display rules, because jsdom ignores `@media`.
|
||||
- **Hamburger lookup:** `MobileNav` finds the hamburger by `aria-controls` (the id `mobile-nav`) for the Escape focus return, not by a test id in production code.
|
||||
- **Focus request:** `linkChosen` and `routeChanged` also clear a pending `focusRequest`.
|
||||
- **Pathname normalisation:** `navCurrent` treats `'//'` as `'/'` (one trailing slash removed). Harmless: the pathname is never rendered.
|
||||
- **Real-app case-variant check:** moved to `navSubmenu.test.tsx` (the pre-Step-9 app still prefix-matched, so the check could not run in Step 2).
|
||||
|
||||
## Open points for the orchestrator
|
||||
1. **No focus trap in the mobile menu** (BR-NAV-35): not added in this unit; the menu is a full-screen overlay with Escape and the hamburger return.
|
||||
2. **Desktop `NavLink` box height:** the existing desktop `NavLink` boxes are about 35 px high. Outside this unit (existing styling of the header).
|
||||
3. **Case-insensitive route vs exact `aria-current`:** see the consequence above; the router matches case-insensitively but `aria-current` is exact, so `/soorten-fotoshoots/Newborn` shows the page with no `aria-current` on the links. Decision for the orchestrator together with the unit-1 open decision on `caseSensitive`.
|
||||
4. Steps 17 and 18 (browser check, Lighthouse) are pending, see above.
|
||||
|
||||
## Security and PBT compliance (final)
|
||||
| Rule | Status | Evidence |
|
||||
|---|---|---|
|
||||
| SECURITY-04 HTTP headers | Compliant | `config/securityHeaders.ts` untouched; no inline script or handler string; no new external resource |
|
||||
| SECURITY-05 Input validation | Compliant | The pathname is only compared (`navCurrent`, never throws on hostile strings, property-tested), never rendered; link targets are typed `RoutePath`s; labels are React text |
|
||||
| SECURITY-09 Hardening | Compliant | No debug output or placeholders; Step 15 greps `console.` and `debugger` in the unit 3 files: none |
|
||||
| SECURITY-10 Supply chain | Compliant | No dependency added; `package.json` and `pnpm-lock.yaml` unchanged (Step 15); the browser check (Step 17) uses a transitive `puppeteer-core` only from a script outside the repo |
|
||||
| SECURITY-11 Secure design | Compliant | Menu logic in a pure, invariant-tested reducer; no `dangerouslySetInnerHTML`, no new `target="_blank"` (Step 15 greps) |
|
||||
| SECURITY-13 Integrity | Compliant | Inline SVG chevron, no CDN or external asset |
|
||||
| SECURITY-15 Fail-safe | Compliant | Impossible events return the same state; the reducer never opens a menu that cannot exist at the width; empty `children` renders a plain link; exhaustive `switch` with a `never` check; null refs and non-Node targets ignored |
|
||||
| SECURITY-01, -02, -03, -06, -07, -08, -12, -14 | N/A | Front-end navigation only: no data store, intermediary, server code, IAM, network, auth or alerting |
|
||||
| PBT-01 Identification | Compliant | Properties per function in the FD, mapped to Steps 3–5 |
|
||||
| PBT-02 Round trip | Compliant | `shootIdFromPath(shootNavItems(...)[i].to)` equals the shoot id (Step 3) |
|
||||
| PBT-03 Invariants | Compliant | Order, labels, known routes (Step 3); exactness, section implication, no look-alikes, normalisation (Step 4); I1–I4 (Step 5) |
|
||||
| PBT-04 Idempotency | Compliant | `routeChanged`, `linkChosen`, `escape`, `outside` applied twice equal once; trailing slash (Steps 4, 5) |
|
||||
| PBT-05 Oracle | N/A | No reference implementation (the Step 5 model is a second check of the transition table, not an oracle for a different algorithm) |
|
||||
| PBT-06 Stateful | Compliant | Model-based event sequences on `navMenuReducer`, invariants after every step (Step 5) |
|
||||
| PBT-07 Generators | Compliant | `navMenuEvent(s)`, `navMenuState`, `pathname` in `test/navArbitraries.ts`; domain generators reused from `test/arbitraries.ts` (import only) |
|
||||
| PBT-08 Shrinking/reproducibility | Compliant | Seed from `config/testSeed.ts`, logged each run (seed 1525740974 at Step 15); shrinking untouched |
|
||||
| PBT-09 Framework | Compliant | fast-check already a dependency |
|
||||
| PBT-10 Complementary | Compliant | Example tests for keyboard, focus, outside click, route change, axe, real-app `aria-current`, named apart from the PBT |
|
||||
+38
-20
@@ -43,30 +43,34 @@ This plan is the **single source of truth** for code generation of unit 3. Steps
|
||||
|
||||
### Setup and probes
|
||||
|
||||
- [ ] **Step 1 — Baseline and unit-1 bundle number** [haiku] — *NFR-ST-03, BR-NAV-50, NFR-ST-06*
|
||||
- [x] **Step 1 — Baseline and unit-1 bundle number** [haiku] — *NFR-ST-03, BR-NAV-50, NFR-ST-06*
|
||||
- In `web/` (worktree): confirm `node_modules` exists (`pnpm install --frozen-lockfile` if not; lockfile must stay unchanged). Run `pnpm lint`, `pnpm format:check`, `pnpm exec tsc`, `pnpm test`; note test count and the logged fast-check seed. All must be green before any change; if not, report and stop.
|
||||
- Build the **unit-1 baseline** before touching code: `pnpm exec vite build`; record from the build output the line for `dist/assets/index-*.js` (expected 528.98 kB raw / **150.69 kB gzip**, from the unit-1 code summary); also record the list of `dist/assets/*` with sizes and the number of `.jpg`/`.webp` files, and `grep -c "data:image" dist/assets/index-*.js` (inlined images). Copy the folder to `<scratchpad>\dist-baseline` (outside the repo; used by Step 18). `dist/` is git-ignored.
|
||||
- Hand-back: numbers only. If the main chunk differs from 150.69 kB by more than 0.3 kB, report it: the D5 limit is then measured against the new number, which is the one that counts.
|
||||
- Result: lint, format:check, tsc green; 90 files / 595 tests pass, seed 907726089. Baseline index-D0huvRmx.js 528.98 kB raw / 150.69 kB gzip (equal to expected); 50 .jpg files, 0 .webp, `data:image` count in index = 1 (pre-existing), 121 files in dist/assets, "Uit eerdere newbornshoots" only in newborn-*.js. Baseline copied to scratchpad dist-baseline.
|
||||
|
||||
- [ ] **Step 2 — Probe and pin the router's exact matching** [sonnet] — *BR-NAV-01, BR-NAV-04, D4 (risk 1)*
|
||||
- [x] **Step 2 — Probe and pin the router's exact matching** [sonnet] — *BR-NAV-01, BR-NAV-04, D4 (risk 1)*
|
||||
- Why: the FD asks to verify `activeOptions={{ exact: true }}` "with trailing slash and case". Reading `@tanstack/router-core` `resolveIsActive` (node_modules, react-router 1.170): `exact` compares `removeTrailingSlash(location.pathname) !== removeTrailingSlash(next.pathname)` as plain strings, so **trailing slash is ignored but case is not**, and `includeSearch` defaults to `true`, so with `exact` a link is **not** active as soon as the location has a query string (`deepEqual` of `search` without partial matching). Both differ from BR-NAV-04 ("ignores case, query and hash"). This step proves it and fixes the plan for the later steps.
|
||||
- New `web/src/components/NavigationBar/activeOptions.test.tsx`: with `renderWithProviders` (splat route, memory history) render a `RouterLink` (`../RouterLink`) to `/soorten-fotoshoots` and to `/soorten-fotoshoots/newborn` with `activeOptions={{ exact: true }}` and with `activeOptions={{ exact: true, includeSearch: false }}`, at these locations: exact path; trailing slash; `/Soorten-Fotoshoots/Newborn` (case); `/soorten-fotoshoots?x=1` and `/portfolio?shoot=newborn` (search); `/soorten-fotoshoots/newborn` (parent must not be active). Assert `aria-current` present/absent for each. Also one case through `renderApp('/soorten-fotoshoots/Newborn')` (the real route tree renders the Newborn page there, unit-1 summary) to record what the router reports.
|
||||
- Expected result and consequence (the test pins whatever is true; if it differs, record the facts and adapt): (a) trailing slash is active in both variants; (b) the case variant is **not** active in either variant, so on `/soorten-fotoshoots/Newborn` the page shows but no link has `aria-current`, while `isSectionCurrent` (case-insensitive, Step 4) underlines the parent; accepted, because `aria-current` is the router's output and the canonical URL is lowercase (record in the code summary, not a bug to fix here); (c) with plain `exact` a query string removes `aria-current`, therefore **every nav and footer link that gets `exact` also gets `includeSearch: false`** (Steps 9, 10, 12): `activeOptions={{ exact: true, includeSearch: false }}`. This is a deliberate deviation from the FD text (`{ exact: true }` only); it keeps today's behaviour for `/portfolio?shoot=…` where the footer's Portfolio link is currently active.
|
||||
- Hand-back: the observed truth table, and whether (b) and (c) hold.
|
||||
- Result: Truth table with router 1.170, verified by activeOptions.test.tsx (12 tests): trailing slash is active in both variants; case variant /Soorten-Fotoshoots/Newborn is NOT active in either; plain exact loses aria-current when the URL has a query (/soorten-fotoshoots?x=1), includeSearch false keeps it; parent never active on a child path. So (b) and (c) hold: every nav and footer link gets exact + includeSearch false. Real-app case-variant assertion on aria-current is pinned in navSubmenu.test.tsx (Step 14), because the pre-Step-9 app still prefix-matches.
|
||||
|
||||
### Pure logic (lib)
|
||||
|
||||
- [ ] **Step 3 — `shootNavItems`** [sonnet] — *FR-ST-10, BR-NAV-10, BR-NAV-12, PBT-01/02/03*
|
||||
- [x] **Step 3 — `shootNavItems`** [sonnet] — *FR-ST-10, BR-NAV-10, BR-NAV-12, PBT-01/02/03*
|
||||
- New `web/src/lib/shootNavItems.ts`: `export function shootNavItems(shoots: readonly ShootType[]): NavItem[]` returning `{ to: shootPagePath(s.id), label: s.name }` per shoot in input order (no overview entry, no extra fields). `import type { NavItem } from '../navigation.ts'`, `import type { ShootType }`, value import of `shootPagePath` from `./shootPages.ts`. Short English comment.
|
||||
- New `web/src/lib/shootNavItems.test.ts`: properties with `uniqueShootTypes` — length equals input length; order preserved (invariant); `label === name` for each; round trip `shootIdFromPath(item.to) === shoot.id`; every `to` equals `shootPagePath(id)` and starts with `SHOOT_TYPES_PATH + '/'`. Example: the real `shootTypes` give the five labels in order, the fifth being the name ("Portretten") and not the id; empty input gives `[]`.
|
||||
- Coverage of the file 100 %.
|
||||
- Result: shootNavItems.ts + 7 tests (5 properties), 100% coverage.
|
||||
|
||||
- [ ] **Step 4 — `navCurrent`** [sonnet] — *D4, BR-NAV-01..04, PBT-03/04*
|
||||
- [x] **Step 4 — `navCurrent`** [sonnet] — *D4, BR-NAV-01..04, PBT-03/04*
|
||||
- New `web/src/lib/navCurrent.ts`: `isItemCurrent(item: NavItem, pathname: string): boolean` and `isSectionCurrent(item: NavItem, pathname: string): boolean`; private `normalise(path)`: lower-case and remove one trailing slash unless the path is `/`. `isItemCurrent` = `normalise(item.to) === normalise(pathname)`; `isSectionCurrent` = `isItemCurrent(item)` or `item.children?.some(child => isItemCurrent(child, pathname))`. Pure string comparison, never throws on any input (SECURITY-05, SECURITY-15); the pathname is never rendered.
|
||||
- New `web/src/lib/navCurrent.test.ts`, using `knownRoutePath`, `shootTypeId` and `uniqueShootTypes` from `test/arbitraries.ts` and the `pathname` generator of Step 5's `test/navArbitraries.ts` only if Step 5 is done; otherwise define the hostile-string generator locally and move it in Step 5. Properties from the FD: `isItemCurrent` true iff normalised paths equal (invariant); adding one trailing slash or changing letter case does not change the result (invariant/idempotency); false for any path outside the item (a path that normalises differently); `isSectionCurrent` is implied by `isItemCurrent`; implied by any child being exact; false for unrelated paths including the prefix look-alikes `/soorten-fotoshoots-extra` and `/soorten-fotoshootsX`; `/` is not a section of `/soorten-fotoshoots`; empty and hostile strings (`''`, `'//'`, spaces, `%2F`, very long) return a boolean and do not throw. Examples: `/soorten-fotoshoots/newborn/` marks the parent as section and the newborn child as item.
|
||||
- 100 % coverage.
|
||||
- Result: navCurrent.ts + 20 tests, 100% coverage. Note: '//' normalises to '/' (one trailing slash removed), so it counts as the home page; harmless, pathname is never rendered.
|
||||
|
||||
- [ ] **Step 5 — `navMenuReducer` and unit 3 generators** [sonnet] — *FR-ST-10, BR-NAV-20..36, domain-entities invariants I1–I4, PBT-01/03/04/06/07/08*
|
||||
- [x] **Step 5 — `navMenuReducer` and unit 3 generators** [sonnet] — *FR-ST-10, BR-NAV-20..36, domain-entities invariants I1–I4, PBT-01/03/04/06/07/08*
|
||||
- New `web/src/lib/navMenuState.ts` exactly as in business-logic-model.md and domain-entities.md: types `FocusRequest = 'menuToggle' | 'submenuToggle' | null`, `NavMenuState` (`isDesktop`, `menuOpen`, `groupOpen`, `submenuOpen`, `focusRequest`), the discriminated union `NavMenuEvent` (`viewport{isDesktop}`, `toggleMenu{inSection}`, `toggleGroup`, `toggleSubmenu`, `escape{focusInside}`, `outside`, `focusLeave`, `linkChosen`, `routeChanged`, `focusHandled`), `initialNavMenuState` (all `false`/`null`; `isDesktop` false until the first `viewport` event) and `navMenuReducer(state, event)` implementing the transition table. A condition that is not met returns the **same state object** (referential equality, so `useReducer` skips the re-render). `viewport(d)` also clears a `focusRequest` that no longer satisfies I4. `escape` closes the mobile menu first when it is open, otherwise the submenu; `focusRequest` is set only when `focusInside`. No default-case fallthrough that opens something (SECURITY-15); use an exhaustive `switch` with a `never` check.
|
||||
- New `web/src/test/navArbitraries.ts` (excluded from coverage by `src/test/**`; unit 3's own file, unit 2 never edits it): `navMenuEvent` (all events with random payloads, weighted so `viewport`, toggles and `escape` are frequent), `navMenuEvents` (arrays up to ~40), `navMenuState` (any state that satisfies I1–I4, plus a helper to build an arbitrary start state by folding random events from the initial state), `pathname` (known shoot paths, parent and other routes, with/without trailing slash, case variants, prefix look-alikes, hostile strings). Document each generator in one line. Do **not** edit `test/arbitraries.ts`; the FD note "appended to arbitraries.ts" (PBT-07) is superseded by the parallel-work constraint.
|
||||
- New `web/src/lib/navMenuState.test.ts`:
|
||||
@@ -75,66 +79,79 @@ This plan is the **single source of truth** for code generation of unit 3. Steps
|
||||
- (invariant) `toggleSubmenu` twice on desktop returns the original state; after `viewport(true)` no mobile state is open; after `viewport(false)` no submenu is open; `toggleMenu(inSection)` from closed opens with `groupOpen === inSection`, and closing sets `groupOpen = false`.
|
||||
- Examples (PBT-10): each row of the transition table once, including "ignored on the wrong viewport returns the same object" (`toggleSubmenu` on mobile, `toggleMenu` on desktop, `toggleGroup` while closed, `escape` with nothing open, `outside` with the submenu closed).
|
||||
- 100 % coverage of `navMenuState.ts` (every `case`, both branches of each condition).
|
||||
- Result: navMenuState.ts, test/navArbitraries.ts, navMenuState.test.ts (27 tests incl. model-based stateful run), 100% coverage. Decisions: outside/focusLeave keep an existing focusRequest; linkChosen/routeChanged also clear it; unknown event returns the same state (default branch tested with a cast).
|
||||
|
||||
### Data
|
||||
|
||||
- [ ] **Step 6 — `navigation.ts` children** [sonnet] — *FR-ST-10, BR-NAV-10, BR-NAV-11, D5*
|
||||
- [x] **Step 6 — `navigation.ts` children** [sonnet] — *FR-ST-10, BR-NAV-10, BR-NAV-11, D5*
|
||||
- `web/src/navigation.ts`: add `children?: readonly NavItem[]` to `NavItem` (comment: one level only, empty array counts as none). Export `hasChildren(item): item is NavItem & { children: readonly NavItem[] }` (`(item.children?.length ?? 0) > 0`). `mainNav`'s `/soorten-fotoshoots` entry gets `children: shootNavItems(shootTypes)`; `footerNav` unchanged. Value imports: `shootNavItems` from `./lib/shootNavItems.ts` and `shootTypes` from `./content/shootTypes.ts` (D5: single source). Check that this creates no runtime cycle (`content/shootTypes.ts` and `lib/shootPages.ts` must only import types from `navigation.ts`); if one appears, report instead of working around it.
|
||||
- `web/src/navigation.test.ts` (extend; keep the existing four tests): the parent has exactly the five children in `shootTypes` order with labels = names and `to = shootPagePath(id)`; **a nav child exists for every `SHOOT_TYPE_IDS` entry and nothing extra** (the registry consistency left open by unit 1); all other main items and all of `footerNav` have no children and children have none (one level); `hasChildren` true only for the parent and false for `children: []`; no duplicate `to` across the parent and its children; every child `to` is in `sitePages` with `indexed: true` (import `sitePages` read-only) so the menu never links to an unregistered page.
|
||||
- Result: navigation.ts has children + hasChildren; mainNav parent uses shootNavItems(shootTypes). No runtime cycle (content/shootTypes.ts, content/types.ts, lib/shootPages.ts, lib/shootNavItems.ts only import types from navigation.ts). navigation.test.ts has 6 new tests (10 total).
|
||||
|
||||
### UI building blocks
|
||||
|
||||
- [ ] **Step 7 — `useDismiss`** [sonnet] — *FR-ST-10, BR-NAV-23, BR-NAV-24, NFR-ST-01*
|
||||
- [x] **Step 7 — `useDismiss`** [sonnet] — *FR-ST-10, BR-NAV-23, BR-NAV-24, NFR-ST-01*
|
||||
- New `web/src/hooks/useDismiss.ts`: `export default function useDismiss(ref: RefObject<HTMLElement | null>, active: boolean, onDismiss: (reason: 'escape' | 'outside') => void): void`. While `active`: `document` `keydown` with `key === 'Escape'` calls `onDismiss('escape')`; `document` `pointerdown` whose `event.target` is a Node not contained in `ref.current` calls `onDismiss('outside')`. Listeners are added only while active and removed on deactivation and unmount. Keep `onDismiss` in a ref (updated in an effect) so a new callback identity does not re-subscribe. No menu logic. A `null` ref or a non-Node target is ignored (fail-safe).
|
||||
- New `web/src/hooks/useDismiss.test.tsx` (harness component, `@testing-library/user-event`): Escape and an outside pointer down call back only while active; inside pointer down does not; nothing fires when inactive; listeners removed on unmount (spy on `document.removeEventListener` or assert no call after unmount); changing the callback does not double-call.
|
||||
- Result: useDismiss.ts + 9 tests.
|
||||
|
||||
- [ ] **Step 8 — `ChevronIcon` and `NavLink.sectionCurrent`** [sonnet] — *D4, BR-NAV-02, BR-NAV-42, NFR-ST-01*
|
||||
- [x] **Step 8 — `ChevronIcon` and `NavLink.sectionCurrent`** [sonnet] — *D4, BR-NAV-02, BR-NAV-42, NFR-ST-01*
|
||||
- New `web/src/components/NavigationBar/ChevronIcon.tsx`: inline SVG, 12 x 12, `aria-hidden="true"`, `focusable="false"`, `stroke="currentColor"`, no fill, no external asset. Rotation (180 degrees) is driven by a `data-open` attribute on the parent button (CSS on the button in the consumers) with `transition: transform 0.3s`, and `_motionReduce: { transition: 'none' }` (state still shows via the rotated end position; BR-NAV-42).
|
||||
- `web/src/components/NavigationBar/NavLink.tsx`: prop type `React.ComponentProps<typeof RouterLink> & { sectionCurrent?: boolean }`; `sectionCurrent` sets `data-section-current` (omitted when false) and the existing underline selector list gains `&[data-section-current]::after`. Existing callers unchanged; `sectionCurrent` is not forwarded to the DOM as an unknown prop.
|
||||
- Small test `NavLink.test.tsx` (new, †): with `sectionCurrent` the `data-section-current` attribute is set and there is **no** `aria-current`; without the prop nothing changes; the underline rule list contains the attribute selector (use `test/cssRules.ts` if it fits).
|
||||
- Result: ChevronIcon.tsx, NavLink.sectionCurrent, NavLink.test.tsx (4 tests).
|
||||
|
||||
- [ ] **Step 9 — `NavSubmenu` (desktop)** [sonnet] — *FR-ST-10, BR-NAV-20..29, BR-NAV-40, BR-NAV-42, BR-NAV-43, NFR-ST-01*
|
||||
- [x] **Step 9 — `NavSubmenu` (desktop)** [sonnet] — *FR-ST-10, BR-NAV-20..29, BR-NAV-40, BR-NAV-42, BR-NAV-43, NFR-ST-01*
|
||||
- New `web/src/components/NavigationBar/NavSubmenu.tsx` with the props of the FD (`item`, `id`, `open`, `pathname`, `transparent`, `toggleRef`, `dispatch`). Structure: wrapper `Box` (`position: relative; display: flex; align-items: center`, `ref` for `useDismiss`, `onBlur` → `focusLeave` when `event.relatedTarget` is a Node outside the wrapper, otherwise ignored, BR-NAV-25) containing: parent `NavLink to={item.to} activeOptions={{ exact: true, includeSearch: false }} sectionCurrent={isSectionCurrent(item, pathname)} mr={0}`; toggle `chakra.button type="button"` 44 x 44 px, `aria-expanded`, `aria-controls={id}`, `aria-label={`Submenu ${item.label}`}`, `color: currentColor`, `data-open`, `ChevronIcon`, white `--focus-ring-color` while `transparent`, `onClick → dispatch({type:'toggleSubmenu'})`; panel `div#id` (`id = submenu-${item.to.slice(1)}` is built by the caller) with `ul` of `li > RouterLink` (`PanelLink`: `textStyle="eyebrow"`, explicit `color="fg"`, `min-height 44px`, flex centred, `px 5`, `_hover bg paper.alt`, `_currentPage` colour `accent.deep` plus a 2 px accent bar on the left, `activeOptions={{ exact: true, includeSearch: false }}`, `onClick → dispatch({type:'linkChosen'})`). Panel: `position: absolute; top: calc(100% + 0.75rem); left: 1rem; min-width: 15rem`, `bg="bg" color="fg"`, 1 px `line` border, `shadow="panel"`, `zIndex` above the header content. Closed: `visibility: hidden; opacity: 0; transform: translateY(-6px); pointer-events: none`; open: visible, opacity 1, no translate; transition `opacity, transform, visibility` 0.3 s `smooth`; `_motionReduce: { transition: 'none' }`. The panel stays in the DOM (BR-NAV-28). `useDismiss(ref, open, reason => dispatch(reason === 'escape' ? { type: 'escape', focusInside: ref.current?.contains(document.activeElement) ?? false } : { type: 'outside' }))`. No hover handlers (BR-NAV-21), no arrow-key handlers (BR-NAV-27), no `role="menu"`/`menuitem`.
|
||||
- Test file `NavSubmenu.test.tsx` is written in Step 13. Self-check here: renders with the real `mainNav` item in `renderWithProviders` without errors.
|
||||
- Result: NavSubmenu.tsx as specified; renders with the real mainNav item (NavSubmenu.test.tsx, Step 13).
|
||||
|
||||
- [ ] **Step 10 — `MobileNavGroup` and `MobileNav`** [sonnet] — *FR-ST-10, BR-NAV-30..36, BR-NAV-40, BR-NAV-42, risk 6*
|
||||
- [x] **Step 10 — `MobileNavGroup` and `MobileNav`** [sonnet] — *FR-ST-10, BR-NAV-30..36, BR-NAV-40, BR-NAV-42, risk 6*
|
||||
- New `web/src/components/NavigationBar/MobileNavGroup.tsx` (props per FD: `item`, `id` = `mobile-group-${slug}`, `open`, `pathname`, `dispatch`): `Flex` row with the parent `RouterLink` (heading font 1.9rem, `activeOptions={{ exact: true, includeSearch: false }}`, `color="ink"`, accent colour when `isSectionCurrent`, `onClick → linkChosen`) and a 44 x 44 px chevron `button` (`aria-expanded`, `aria-controls`, `aria-label="Submenu …"`, `data-open`); sub-list wrapper as a grid with `gridTemplateRows: open ? '1fr' : '0fr'`, inner `overflow: hidden`, `visibility: open ? 'visible' : 'hidden'` (on close the visibility transition is delayed by the duration so the collapse is seen; BR-NAV-36), `_motionReduce: { transition: 'none' }`; `ul` indented 1.25rem; sub-links heading font 1.4rem, `min-height 44px`, `color="ink"`, `_currentPage={{ color: 'accent.deep' }}`, `activeOptions` as above, `onClick → linkChosen`.
|
||||
- `web/src/components/NavigationBar/MobileNav.tsx`: props become `{ id; open; groupOpen; pathname; dispatch }` (the `onClose` prop is removed). Outer box: add `overflowY="auto"` and `overscrollBehavior="contain"`, drop `justifyContent="center"`; inner `Box` with `marginBlock="auto"` around the `nav` (centres short content, scrolls tall content from the top, BR-NAV-34); `pb` unchanged. Keep the body scroll lock effect. The keydown effect now calls `dispatch({ type: 'escape', focusInside })` with `focusInside` = the active element is inside the menu box or is the hamburger (`[data-testid="nav-menu-toggle"]` or an optional `toggleRef`; pick one and note it). `_motionReduce: { transition: 'none' }` on the clip-path reveal (BR-NAV-42). Plain items: `onClick → linkChosen`; items with `hasChildren` render `MobileNavGroup`.
|
||||
- Result: MobileNavGroup.tsx new; MobileNav.tsx changed. Hamburger recognised for the Escape focus return by aria-controls === menu id (no test id in production code).
|
||||
|
||||
- [ ] **Step 11 — `NavigationBar` wiring** [sonnet] — *FR-ST-10, BR-NAV-02, 22, 23, 26, 30..33, domain-entities (events), I1–I4*
|
||||
- [x] **Step 11 — `NavigationBar` wiring** [sonnet] — *FR-ST-10, BR-NAV-02, 22, 23, 26, 30..33, domain-entities (events), I1–I4*
|
||||
- `web/src/components/NavigationBar/NavigationBar.tsx`: replace `useState(open)`/`closeMenu` by `useReducer(navMenuReducer, initialNavMenuState)`. `isDesktop` stays from `useBreakpointValue({ base: false, lg: true }, { ssr: false })` (may be `undefined` on the first render; treat as `false`); an effect dispatches `viewport` when it changes. `pathname` from `useRouterState({ select: s => s.location.pathname })` (extend the existing `isHome` selector: `isHome = pathname === '/'`). Effect: dispatch `routeChanged` when `pathname` changes after the first render (ref with the previous value; do not close on mount). Focus effect: when `state.focusRequest` is set, focus `hamburgerRef` or `submenuToggleRef` and dispatch `focusHandled`.
|
||||
- Desktop list: `chakra.li` per item; `hasChildren(item) ? <NavSubmenu …/> : <NavLink …/>`. Pass `transparent={!isSolid}`. Hamburger: `onClick → dispatch({ type: 'toggleMenu', inSection: isSectionCurrent(parentItem, pathname) })` where `parentItem` is the `mainNav` entry with children; `aria-expanded={state.menuOpen}`, names "Menu openen"/"Menu sluiten" and `data-testid="nav-menu-toggle"` unchanged; add the ref. `<MobileNav id="mobile-nav" open={state.menuOpen} groupOpen={state.groupOpen} pathname={pathname} dispatch={dispatch} />`. Ids: `submenu-soorten-fotoshoots` and `mobile-group-soorten-fotoshoots` derived from `item.to.slice(1)`. No context. Keep all existing header styling.
|
||||
- Check: the hamburger's `aria-controls="mobile-nav"` stays valid.
|
||||
- Result: NavigationBar uses useReducer; effects for viewport, routeChanged (skips first render) and focusRequest. hamburger aria-controls='mobile-nav' unchanged.
|
||||
|
||||
- [ ] **Step 12 — Footer exact matching** [sonnet] — *D4, BR-NAV-01, FR-ST-10 (footer menu unchanged)*
|
||||
- [x] **Step 12 — Footer exact matching** [sonnet] — *D4, BR-NAV-01, FR-ST-10 (footer menu unchanged)*
|
||||
- `web/src/components/Footer/Footer.tsx`: in the `footerNav.map`, the `RouterLink` gets `activeOptions={{ exact: true, includeSearch: false }}`. No visible change.
|
||||
- `web/src/components/Footer/Footer.test.tsx`: add (existing tests stay): on `/soorten-fotoshoots/newborn` the footer's "Soorten fotoshoots" link has no `aria-current` and the other links neither; on `/soorten-fotoshoots` and `/soorten-fotoshoots/` it has `aria-current="page"`; on `/portfolio?shoot=newborn` the Portfolio link still has `aria-current="page"` (regression of the `includeSearch: false` choice); axe still clean.
|
||||
- Result: Footer links use exact + includeSearch false; Footer.test.tsx +5 tests (11 total).
|
||||
|
||||
### Tests (components and real app)
|
||||
|
||||
- [ ] **Step 13 — Component tests** [sonnet] — *NFR-ST-01, NFR-ST-06 (PBT-10), BR-NAV-20..36, BR-NAV-40..43*
|
||||
- [x] **Step 13 — Component tests** [sonnet] — *NFR-ST-01, NFR-ST-06 (PBT-10), BR-NAV-20..36, BR-NAV-40..43*
|
||||
- `web/src/components/NavigationBar/NavigationBar.test.tsx` (extend; **update** the existing "toont het hoofdmenu in de vaste volgorde" test: the `Hoofdmenu` nav now also holds the five panel links, so assert the top-level order and, separately, the five children; keep the logo and hamburger tests): toggle has accessible name "Submenu Soorten fotoshoots", `aria-expanded` false then true, `aria-controls` points to an existing element; click, Enter and Space open it (`userEvent`); **hover does not open it** (BR-NAV-21); Escape closes it and focus is on the toggle when focus was inside, and not moved when focus was elsewhere (BR-NAV-23); a pointer down outside closes without moving focus; Tab from the last panel link closes it (BR-NAV-25); window blur without `relatedTarget` does not close; closed panel links are not reachable by role query nor by Tab (BR-NAV-28), open ones are; choosing a link closes it; toggling twice returns to closed with focus on the toggle; no element with `role="menu"`; axe with the panel closed and open (`axeResults`); at `/` the toggle uses `currentColor` and the panel has an own `bg` (computed or recipe check as far as jsdom allows; the visual part is Step 17); on `/soorten-fotoshoots/newborn` the newborn panel link has `aria-current="page"`, the parent link has none but `data-section-current`; on `/soorten-fotoshoots` the parent has both.
|
||||
- New `NavSubmenu.test.tsx`: the component alone with a fake `dispatch` (events emitted for toggle click, escape with `focusInside` true/false, outside pointer down, focusout to outside, link click → `linkChosen`; nothing emitted for hover and arrow keys).
|
||||
- New `MobileNav.test.tsx` (mount `NavigationBar` with the breakpoint forced below `lg`: mock `useBreakpointValue` or set `window.matchMedia` as the existing tests do; check how `NavigationBar.test.tsx`/`setup.ts` handle it first): hamburger opens the menu; the group starts collapsed on `/contact` and expanded on `/soorten-fotoshoots` and `/soorten-fotoshoots/gezin` (BR-NAV-31); the chevron flips `aria-expanded` and the visibility of the sub-links (BR-NAV-36); a collapsed sub-link is not found by role; choosing a link (parent or sub) closes the whole menu; Escape closes it and focus goes to the hamburger (BR-NAV-33); the box has `overflow-y: auto` and the inner centring wrapper exists (BR-NAV-34, as far as jsdom reports styles); body overflow locked while open and restored after; axe open (group collapsed and expanded); reduced-motion rule present via `test/cssRules.ts` if it can read emotion rules, otherwise leave to Step 17.
|
||||
- Reduced motion (BR-NAV-42): assert the generated rules contain a `prefers-reduced-motion: reduce` block with `transition: none` for panel, mobile group and mobile reveal where the helper allows; otherwise record "verified in the browser, Step 17".
|
||||
- Result: NavigationBar.test.tsx 27 tests, NavSubmenu.test.tsx 13, MobileNav.test.tsx 18. Reduced-motion rules verified via cssRulesFor (panel, chevron, mobile box, group). Added test helper src/test/navViewport.ts (matchMedia stub plus a style element that applies the lg display rules, because jsdom ignores @media).
|
||||
|
||||
- [ ] **Step 14 — Real-app test** [sonnet] — *D4, BR-NAV-01..04, BR-NAV-26, BR-NAV-32, FR-ST-10*
|
||||
- [x] **Step 14 — Real-app test** [sonnet] — *D4, BR-NAV-01..04, BR-NAV-26, BR-NAV-32, FR-ST-10*
|
||||
- New `web/src/navSubmenu.test.tsx` using `renderApp(path)` (real route tree, so the shoot routes exist; unit 1's `renderApp.tsx` is read only): on each of the five shoot pages the matching panel link has `aria-current="page"`, the parent "Soorten fotoshoots" in the header has none but `data-section-current`, the footer link has none (the breadcrumb is unit 2 and is not asserted here); on `/soorten-fotoshoots` parent and footer have `aria-current="page"` and no panel link has; on `/portfolio` no panel link and no section mark; trailing slash path behaves like the plain path as pinned in Step 2; the case variant `/soorten-fotoshoots/Newborn` behaves as recorded in Step 2.
|
||||
- Route change closes an open submenu: open it, `router.navigate({ to: '/portfolio' })` → closed. Click a panel link → page changes, panel closed, focus on `main#main` (`useRouteFocus`, BR-NAV-26). Mobile: open the menu, `router.history.back()` / navigate → menu closed (BR-NAV-32, the fixed browser-back gap); opening on a shoot page expands the group. Resize across `lg` (mock the breakpoint) closes the menu that no longer exists. Every shoot name in the panel matches `shootTypes` (single source).
|
||||
- Check the whole suite for new name collisions: panel/sub-list links (e.g. "Newborn") may now match `getByRole('link', { name })` queries in other test files. Fix collisions in **unit 3 files** only; a collision in a unit 2 or unit 1 test is reported to the orchestrator with file and line, not edited.
|
||||
- Result: navSubmenu.test.tsx 18 tests (real app). Case variant /soorten-fotoshoots/Newborn: page renders, no link has aria-current, parent keeps data-section-current. Needs FakeIntersectionObserver stub as in app.test.tsx.
|
||||
|
||||
### Verification
|
||||
|
||||
- [ ] **Step 15 — Unit verification gate** [haiku] — *NFR-ST-06, NFR-ST-05 (SECURITY-10/11/15), NFR-ST-01*
|
||||
- [x] **Step 15 — Unit verification gate** [haiku] — *NFR-ST-06, NFR-ST-05 (SECURITY-10/11/15), NFR-ST-01*
|
||||
- In `web/`, in this order, stopping at the first failure and reporting the output: `pnpm lint`; `pnpm format:check`; `pnpm exec tsc`; `pnpm test` (this runs `vitest run --coverage`: all green, the 100 % thresholds for `src/lib/**` pass, note test count, seed and coverage of the new files); `git diff --stat -- package.json pnpm-lock.yaml` is empty.
|
||||
- Greps (report matches): `dangerouslySetInnerHTML`, `target="_blank"`, `role="menu"`, `menuitem`, `onMouseEnter`/`onHover`/`_hover` opening logic, `console.` and `debugger` in the unit 3 files (expected: none).
|
||||
- File boundary check: `git status --short` shows no change in `src/components/shoots`, `src/content`, `src/sitePages.ts`, `src/routes`, `src/test/arbitraries.ts`, `src/theme.ts`, `LAYOUT.md` made by this unit (compare with the list from Step 1; unit 2's own changes are not unit 3's concern but must not be edited here).
|
||||
- Result: lint, format:check, tsc green; pnpm test: 106 files / 801 tests pass, seed 1525740974; all unit 3 lib files 100% (shootNavItems, navCurrent, navMenuState). The only coverage threshold failure is a unit 2 file in src/lib with 0% coverage (…ectionPath.ts, no test yet), not unit 3. package.json and pnpm-lock.yaml unchanged. Greps: no dangerouslySetInnerHTML, role=menu (only in a comment), menuitem, hover handlers, console, debugger in unit 3 files; target=_blank only in the pre-existing Footer socials; _hover only styles a background. No changes by unit 3 to the forbidden files.
|
||||
|
||||
- [ ] **Step 16 — Bundle check (D5 gate)** [haiku] — *NFR-ST-03, BR-NAV-50, D5*
|
||||
- [x] **Step 16 — Bundle check (D5 gate)** [haiku] — *NFR-ST-03, BR-NAV-50, D5*
|
||||
- `pnpm build` (runs `tsc && vite build`). Record the `dist/assets/index-*.js` line (raw / gzip) and compare with Step 1: **gzip increase must be at most 2.5 kB** (expected about 1.7 kB). Verify: the ten shoot photos are still emitted as files (`.jpg`/`.webp` count equals Step 1's; `grep -c "data:image" dist/assets/index-*.js` not higher than Step 1); a Newborn-only page string ("Uit eerdere newbornshoots") is still only in the `newborn-*.js` chunk; the shoot page chunks are still separate files.
|
||||
- **STOP rule**: if the gzip increase exceeds 2.5 kB, or images got inlined, stop the unit, do not switch to the D5 alternative (a separate `{ id, name }` list), and report the numbers to the orchestrator; that alternative changes the content model and needs the user.
|
||||
- Result: pnpm build green. index-Dtz2mqhH.js 536.68 kB raw / 152.58 kB gzip vs baseline 528.98 / 150.69: +7.70 kB raw, +1.89 kB gzip (limit 2.5 kB). 50 .jpg (same as Step 1), 0 .webp, data:image count 1 (same as Step 1), Newborn-only string only in newborn-*.js, five shoot chunks separate; the separate shootTypes chunk is gone (now in main), dist/assets 119 files vs 121. Delta may include small unit 2 changes made since Step 1.
|
||||
|
||||
- [ ] **Step 17 — Real-browser check: 1024 px fit, transparent header, short phone** [sonnet] — *BR-NAV-41, BR-NAV-29, BR-NAV-34, BR-NAV-42, BR-NAV-43, risk 7*
|
||||
- [x] **Step 17 — Real-browser check: 1024 px fit, transparent header, short phone** [sonnet] — *BR-NAV-41, BR-NAV-29, BR-NAV-34, BR-NAV-42, BR-NAV-43, risk 7*
|
||||
- **Result (110/110 checks pass, no `mx` fallback needed)**: script `scratchpad/nav-browser-check/navCheck.mjs` (puppeteer-core 24.43.1 + Chrome headless, vite preview on 4173 of the unit-2 Step 22 build; PNGs in the same folder; server stopped, port free). Desktop at 1024/1100/1280 on `/`, `/portfolio`, `/soorten-fotoshoots/newborn`: the five top-level items sit in one row (vertical centres within 1 px; the submenu `li` is 44 px high and the others ~35 px, so their `top` differs by 5 px by design), real item span 711 px (180..890 at 1024; ul client width 848/918/1090), `scrollWidth == clientWidth`, logo right edge 87-94 px well left of the first item, no hamburger, no horizontal page overflow. Open panel: visible, opacity 1, inside viewport (e.g. 553..793 x 80..318 at 1024), background `rgb(250, 247, 242)` (solid); on `/` unscrolled the chevron is white `rgb(255,255,255)` over the transparent header, after scrolling 200 px the header is solid and the open panel is unchanged. Keyboard: Tab reaches toggle, Enter opens, Tab walks Newborn, Zwangerschap, Gezin, Loveshoot, Portretten, Escape returns focus to the toggle and closes, Tab out of the last link closes. Reduced motion: panel, mobile box and group `transition-duration` 0s. Mobile 375x480 and 360x560 (touch): collapsed group on `/` fits without scrolling (scrollHeight == clientHeight, 414/494 px; first link not cut off, Contact fully visible); expanded on `/soorten-fotoshoots/newborn` the box scrolls (632 px content in 414/494 px), first link below the box top at scroll 0, scrolling reaches Contact, hamburger stays topmost at its centre, Escape closes with focus on the hamburger, browser back closes the menu. Note: two script criteria were corrected to match the intent (same row = vertical centres, not `top`; collapsed group is expected to fit, not scroll).
|
||||
- Tooling: Playwright is **not** in `node_modules` and no dependency may be added. `puppeteer-core` 24.43.1 is present as a transitive dependency of `@lhci/cli` (`web/node_modules/.pnpm/puppeteer-core@24.43.1_*/node_modules/puppeteer-core`) and Chrome is installed at `C:\Program Files\Google\Chrome\Application\chrome.exe` (Edge also at `C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe`). Write a throwaway script **outside the repo** (`<scratchpad>\navCheck.mjs`, run with `node`), loading puppeteer-core via `createRequire` from that pnpm path and launching Chrome headless with `executablePath` (no `--no-sandbox` unless needed). Do not commit the script and do not touch `package.json`.
|
||||
- Serve the Step 16 build with `pnpm preview` on a **free port that is not 4173** (e.g. `pnpm exec vite preview --port 4180 --strictPort`), because port 4173 is shared and claimed by the orchestrator for Lighthouse; stop the server afterwards.
|
||||
- Measurements (print numbers, save PNGs to the scratchpad): at viewport widths 1024, 1100 and 1280 (height 800): on `/`, `/portfolio` and `/soorten-fotoshoots/newborn`, for the `nav[aria-label="Hoofdmenu"] > ul`: the five top-level `li` all share the same `getBoundingClientRect().top` (no wrapping), `scrollWidth <= clientWidth`, the rightmost nav item's right edge is below the hamburger/right container's left edge and the logo's right edge is below the first item's left edge (no overlap); record the real widths against the FD estimate (about 715 px of 848 px). Then open the submenu by clicking the toggle: panel `visibility: visible`, panel bounding box inside the viewport, panel `getComputedStyle` background is not transparent; on `/` before scrolling (transparent header) the screenshot shows a readable solid panel, and the toggle chevron is white; after scrolling 200 px the header is solid and the open panel is unchanged. Keyboard run: focus the toggle with Tab, Enter opens, Tab walks five links, Escape returns to the toggle, Tab out of the last link closes. Emulated `prefers-reduced-motion: reduce` (`page.emulateMediaFeatures`): the panel `transition-duration` is `0s` and the mobile reveal too.
|
||||
@@ -142,7 +159,8 @@ This plan is the **single source of truth** for code generation of unit 3. Steps
|
||||
- **Fallback if the nav does not fit at 1024 px (no wrapping allowed, BR-NAV-41)**: reduce the `NavLink` margin from `mx="4"` to `mx={{ base: '4', lg: '3' }}`-style at `lg` only (change in `NavLink.tsx`, unit 3 file; the desktop-only hamburger is hidden at `lg` anyway), rebuild, re-measure and record both numbers. If it still does not fit, stop and report; do not change the labels or the layout structure.
|
||||
- If this script cannot run on the machine (Chrome missing, launch failure), hand the same checklist to the orchestrator as a manual check at 1024 and 1100 px and record that in the summary; do not install anything.
|
||||
|
||||
- [ ] **Step 18 — Lighthouse (needs the orchestrator's port 4173 claim)** [haiku] — *NFR-ST-03, BR-NAV-50, D5, NFR-ST-01*
|
||||
- [x] **Step 18 — Lighthouse (needs the orchestrator's port 4173 claim)** [haiku] — *NFR-ST-03, BR-NAV-50, D5, NFR-ST-01*
|
||||
- **Result (regression gate passed; absolute mobile `/` still below 0.8, orchestrator decision as foreseen)**: build = unit-2 Step 22 build (units 1+2+3, `index-C65n6UdK.js` 536.65 kB / 152.56 kB gzip; +7.67 kB raw / +1.87 kB gzip vs baseline 528.98 / 150.69, limit 2.5 kB). Command: `pnpm exec vite preview --port 4173 --strictPort` (baseline: `--outDir <scratchpad>/dist-baseline`) and `pnpm exec lhci collect --config=<scratchpad>/lh-home/lhci-home.cjs` (`/` only, mobile preset, 3 runs, filesystem upload), run twice per build, alternating (current, baseline, current, baseline) in one session. Mobile `/` performance: current batch 1 = 0.69, 0.78, 0.78 (median 0.78; 0.69 is a TBT 496 ms outlier), batch 2 = 0.78, 0.75, 0.76 (median 0.76); baseline batch 1 = 0.77, 0.75, 0.77 (median 0.77), batch 2 = 0.77, 0.77, 0.75 (median 0.77). Pooled medians (six runs each): current 0.77, baseline 0.77, so no regression above 0.02; all below the 0.8 budget, as on master (0.78). LCP 4.3 s both. Accessibility, best practices, SEO 1.0 on every run. Full set (`lhci autorun`, mobile and desktop, one run per URL, same build): see Step 23 of the unit-2 plan; a11y/BP/SEO 1.0 on all indexed pages, mobile and desktop; the closed panel causes no axe failure. Preview server stopped, port 4173 free.
|
||||
- **Precondition**: the orchestrator has claimed port 4173 for this worktree (the port is shared with the other session). Do not start before that confirmation; do not kill other processes on the port.
|
||||
- In `web/` with the Step 16 build: `pnpm preview` (port 4173), then run the mobile config three times for `/` only (e.g. `pnpm exec lhci collect --url=http://localhost:4173/ --numberOfRuns=3 --config=lighthouserc.cjs` or the repo's usual `lhci autorun`; report the exact command used) and take the **median performance score**. In the same session run the **baseline** `<scratchpad>\dist-baseline` from Step 1 the same way (`pnpm exec vite preview --outDir <scratchpad>\dist-baseline --port 4173 --strictPort` after stopping the first server) so the two numbers are comparable; machine noise is about 0.01–0.02.
|
||||
- Then the full set as `pnpm lighthouse` does (mobile and desktop config, all indexed paths and the 404): report per page performance and the accessibility/best-practices/SEO values (all must stay 1.0 on every indexed page; the nav is on every page, and the closed panel must not create an axe-type failure), and which budgets fail. Known baseline failures from the unit-1 summary: mobile `/` 0.76 (budget 0.8; master 0.78) and `/contact` 0.85 (budget 0.9).
|
||||
@@ -150,10 +168,10 @@ This plan is the **single source of truth** for code generation of unit 3. Steps
|
||||
|
||||
### Documentation
|
||||
|
||||
- [ ] **Step 19 — Code summary** [haiku] — *traceability for FR-ST-10, NFR-ST-01/03/06*
|
||||
- [x] **Step 19 — Code summary** [haiku] — *traceability for FR-ST-10, NFR-ST-01/03/06*
|
||||
- New `aidlc-docs/features/shoot-type-pages/construction/navigation-submenu/code/code-summary.md`, in the structure of unit 1's summary: status of the steps; files created/modified (paths); interfaces (`NavItem.children`, `hasChildren`, `shootNavItems`, `isItemCurrent`/`isSectionCurrent`, `NavMenuState`/`NavMenuEvent`/`navMenuReducer`, `useDismiss`, component props); requirement and business-rule traceability table (FR-ST-10, NFR-ST-01/03/06, BR-NAV-01..50, D4, D5 → files and tests); test counts and coverage of the new `lib` files; the seed; the Step 2 truth table (trailing slash, case, query) and the `includeSearch: false` decision; the Step 16 bundle numbers (before/after/delta against the 2.5 kB limit); the Step 17 measured widths at 1024/1100/1280 px, panel and mobile findings, and whether the `mx` fallback was needed; the Step 18 Lighthouse numbers (median `/` mobile, baseline vs after, other pages, failing budgets); deviations from the design (below); open points for the orchestrator (no focus trap in the mobile menu, BR-NAV-35; existing desktop `NavLink` boxes ~35 px high, outside this unit; case-insensitive route vs exact `aria-current`); the Security Baseline and PBT compliance tables of this plan with the final status.
|
||||
|
||||
- [ ] **Step 20 — Reverse-engineering lines** [haiku] — *project convention (own route/component lines only)*
|
||||
- [x] **Step 20 — Reverse-engineering lines** [haiku] — *project convention (own route/component lines only)*
|
||||
- Edit only the lines of this unit in `aidlc-docs/_shared/reverse-engineering/`, minimal in-place edits, no rewriting of other lines (these files already carry unit 1's uncommitted edits, and unit 2 hands its lines to the orchestrator): `code-structure.md` — the `NavigationBar/*` line (add `NavSubmenu`, `MobileNavGroup`, `ChevronIcon`, `NavLink.sectionCurrent`, `MobileNav` scrolling), the `navigation.ts` line (`children`, `hasChildren`), new lines for `lib/{shootNavItems,navCurrent,navMenuState}.ts`, `hooks/useDismiss.ts`, `test/navArbitraries.ts`, and the component dependency diagram edge (`navigation` → `shootNavItems`/`shootTypes`) if the file contains one; `architecture.md` — one line on the menu state reducer in `NavigationBar` and the D5 consequence (shoot type data in the main bundle, with the measured delta); `api-documentation.md` — only if it lists `navigation.ts` or hook exports; otherwise no change and say so. Before editing, read the current text of each file and use `Edit` on exact lines; if the file has changed in a way that conflicts, stop and report instead of merging.
|
||||
|
||||
## Traceability
|
||||
|
||||
+47
-23
@@ -37,14 +37,16 @@ This plan is the **single source of truth** for code generation of unit 2. Steps
|
||||
|
||||
### Setup
|
||||
|
||||
- [ ] **Step 1 — Baseline and checks of the inputs** [haiku] — *NFR-ST-06, NFR-ST-07, BR-SP-30a, FD Q1/Q2*
|
||||
- [x] **Step 1 — Baseline and checks of the inputs** [haiku] — *NFR-ST-06, NFR-ST-07, BR-SP-30a, FD Q1/Q2*
|
||||
- **Result (done, no edits)**: tsc, lint and vitest green (90 files / 595 tests). `pnpm exec vite build`, the routeTree diff comparison and any Lighthouse number skipped on purpose (unit-3 agent owns builds and port 4173). (a) `MOSAIC_MIN_PHOTOS` = 2. (b) photo selection matches domain-entities.md § 3. (c) git status shows no unit-3 path changed yet.
|
||||
- In `web/`: `pnpm exec tsc`, `pnpm lint`, `pnpm test` (all must be green; note the test count and the logged fast-check seed). `pnpm exec vite build` and `git diff --exit-code src/routeTree.gen.ts` against the working tree before the build (record the diff state first with `git diff --stat src/routeTree.gen.ts`, then compare after: it must not change).
|
||||
- Report only, no edits unless a check fails: (a) `MOSAIC_MIN_PHOTOS` in `src/lib/shootPageView.ts` is `2` (Q2 = A: no code change); (b) the photo selection in `src/content/shootPages/*.ts` equals the table in domain-entities.md § 3 (verified at planning time: Newborn stories `shoots/newborn.jpg`, `f41a8700`, `f41a7176`, `f41a1916` and three mosaic photos; Zwangerschap/Gezin story 2 = landscape portfolio photo, story 3 = portrait portfolio photo, story 4 text only, no mosaic; Loveshoot/Portret story 1 only, no mosaic); (c) none of the unit-3 paths listed above has been changed by this unit (`git status --short`, informational: unit 3 may be changing them).
|
||||
- If (b) differs, stop and report to the orchestrator instead of editing content (the decision belongs to FD Q1).
|
||||
|
||||
### OG images (user approval required)
|
||||
|
||||
- [ ] **Step 2 — Produce the five OG crops, then STOP for user approval** [sonnet] — *SEO-ST-05, BR-SP-80, BR-SP-81, FD Q7 = A, SECURITY-10, SECURITY-13*
|
||||
- [x] **Step 2 — Produce the five OG crops, then STOP for user approval** [sonnet] — *SEO-ST-05, BR-SP-80, BR-SP-81, FD Q7 = A, SECURITY-10, SECURITY-13*
|
||||
- **Result (done; waiting for user approval of the crops)**: five JPEGs 1200 x 630 written to `web/public/` (unreferenced, uncommitted; approved by the user as produced), 91-100 KB, quality 75-90, no EXIF/ICC (re-encoded from a fresh bitmap by System.Drawing, script in the scratchpad `og-crops/make-crops.ps1`). Contact sheet: scratchpad `og-crops/og-contact-sheet.png`. Gezin has no baby in the crop (faces prioritised); Loveshoot and Portret are upscaled 1.415x.
|
||||
- **No image tool is installed** (no Pillow, no ImageMagick; `convert` on the PATH is Windows' own `convert.exe`; no `sharp` in the repo). Use a throw-away PowerShell script with `System.Drawing` (or Pillow installed with `pip install --target <scratchpad dir> Pillow`), kept **outside the repository** (scratchpad). **No new dependency in `web/`.**
|
||||
- Produce `web/public/og-newborn.jpg`, `og-zwangerschap.jpg`, `og-gezin.jpg`, `og-loveshoot.jpg`, `og-portret.jpg`: JPEG, exactly **1200 × 630**, at most about 100 KB (the existing ones are 54–92 KB; lower the quality in steps from about 85 until it fits), sRGB, progressive not required. Sources (domain-entities.md § 5, corrected where the planning check found a conflict):
|
||||
| Shoot | Source | Source size | Crop |
|
||||
@@ -61,80 +63,95 @@ This plan is the **single source of truth** for code generation of unit 2. Steps
|
||||
|
||||
### Generators and pure logic
|
||||
|
||||
- [ ] **Step 3 — Generators (append only)** [sonnet] — *NFR-ST-06, PBT-07*
|
||||
- [x] **Step 3 — Generators (append only)** [sonnet] — *NFR-ST-06, PBT-07*
|
||||
- **Result**: Four generators appended to `src/test/arbitraries.ts` (plus one import line at the top for `shootPageView`); smoke-checked by the tests of Steps 4-7, 11, 12.
|
||||
- `src/test/arbitraries.ts`, appended at the end, no existing definition changed: `imageWithOrientation` (a `ContentImage` whose width and height are drawn around the 1.2 threshold, including exactly 1.2 and values just below and above), `mosaicCount` (integers −3 to 12), `timelineSteps` (1 to 8 steps `{ id, title, text }` with hostile strings: `</script>`, `<`, `>`, `&`, very long words, empty-looking whitespace), and `shootPageViewArb` (a `ShootPageView` built by `shootPageView` from `shootPageContent(id, reuse)`, `shootPageShared`, a unique list of shoot types and packages, so stories 0–6, photos present or not and FAQ present or not all occur; it must never return `undefined`).
|
||||
- Reuse `shootPageContent`, `shootPageShared`, `contentImage`, `storyBlock`, `faqItem`, `richText`, `uniqueShootTypes`, `anyPackage`; no duplicated generators. Smoke-check each new generator inside the tests of Steps 4–7 (no separate test file).
|
||||
|
||||
- [ ] **Step 4 — headingId and readMoreLabel** [sonnet] — *BR-SP-72, BR-SP-64, FR-ST-09, SECURITY-15, PBT-03*
|
||||
- [x] **Step 4 — headingId and readMoreLabel** [sonnet] — *BR-SP-72, BR-SP-64, FR-ST-09, SECURITY-15, PBT-03*
|
||||
- **Result**: `headingId.ts`, `readMoreLabel.ts` + tests, 100 % coverage.
|
||||
- Depends on: Step 3.
|
||||
- New `src/lib/headingId.ts`: `headingId(prefix: string, id: string): string` = `${prefix}-${id}` with the whole result lower-cased and every character outside `a-z 0-9 - _` replaced by `-` (BR-SP-72); pure, never throws for any string. The caller adds `-title` where needed.
|
||||
- New `src/lib/readMoreLabel.ts`: `readMoreLabel(shoot: ShootType): string` = ``Lees meer over de ${shoot.shootLabel.toLowerCase()}`` (domain-entities.md § 6).
|
||||
- Tests `headingId.test.ts`, `readMoreLabel.test.ts`: examples (the five real ids, spaces, uppercase, `</script>`, empty string, non-ASCII); the five real labels ("Lees meer over de newbornshoot", "… zwangerschapsshoot", "… gezinsshoot", "… loveshoot", "… portretshoot") are unique; PBT per business-rules.md § 3: `headingId` output only `a-z0-9-_`, deterministic, never throws for arbitrary and hostile strings (invariant); `readMoreLabel` starts with "Lees meer over de " and is unique for any `uniqueShootTypes` list with unique `shootLabel` (invariant). 100 % coverage.
|
||||
|
||||
- [ ] **Step 5 — mosaicLayout** [sonnet] — *FR-ST-05, BR-SP-30b, BR-SP-31, BR-SP-35, PBT-03*
|
||||
- [x] **Step 5 — mosaicLayout** [sonnet] — *FR-ST-05, BR-SP-30b, BR-SP-31, BR-SP-35, PBT-03*
|
||||
- **Result**: `mosaicLayout.ts` + test, 100 % coverage. The first tile is `1 / 3` x `1 / 3` for counts 2 to 4 only; the table gives count 1 (never shown) `1 / 5`, which the property respects.
|
||||
- Depends on: Step 3.
|
||||
- New `src/lib/mosaicLayout.ts`: `MOSAIC_MAX_PHOTOS = 4`, `MosaicTile` (`column`, `row`, `wide`, `phoneRatio`) and `mosaicLayout(count: number): MosaicTile[]` exactly per the table in domain-entities.md § 2 (0 or below none; 1 total-but-unused; 2, 3, 4; 5 or more = the layout for 4). Non-integer or `NaN` input: treat as no tiles (fail safe).
|
||||
- Test `mosaicLayout.test.ts`: examples for 0, 1, 2, 3, 4, 5, −1; PBT over `mosaicCount` per business-rules.md § 3: `[]` for ≤ 0; exactly `min(count, 4)` tiles; desktop cells pairwise disjoint and, for 2 to 4, covering all eight cells of the 4 × 2 grid (compute cells from the `column`/`row` strings in the test); first tile always `1 / 3` × `1 / 3`; number of non-wide tiles even; pure (same output twice) (invariant). 100 % coverage.
|
||||
|
||||
- [ ] **Step 6 — storyLayout** [sonnet] — *FR-ST-03, BR-SP-11, BR-SP-12, BR-SP-13, BR-SP-14, BR-SP-40, PBT-03*
|
||||
- [x] **Step 6 — storyLayout** [sonnet] — *FR-ST-03, BR-SP-11, BR-SP-12, BR-SP-13, BR-SP-14, BR-SP-40, PBT-03*
|
||||
- **Result**: `storyLayout.ts` + test, 100 % coverage.
|
||||
- Depends on: Step 3.
|
||||
- New `src/lib/storyLayout.ts`: `StoryLayout` (`tone`, `spacing`, `reverse`, `priority`, `media?: { aspectRatio: '3 / 2' | '4 / 5'; mediaSize: 'half' | 'medium' }`) and `storyLayout(stories: readonly StoryBlock[]): StoryLayout[]` (domain-entities.md § 2): tone `paper` for even index and `alt` for odd, spacing `flushTop` for index 0, `reverse` for odd index, `priority` only for index 0 and only with an image, `media` absent without an image; orientation: `width >= 1.2 * height` → `3 / 2` and `half`, otherwise `4 / 5` and `medium`. Export the threshold as a named constant.
|
||||
- Test `storyLayout.test.ts`: examples with the real Newborn stories (4/5 + medium for the portrait photos, 3/2 + half for `f41a8700`) and a text-only list (Loveshoot); boundary examples (exactly 1.2, 1.19); empty list; PBT over `storyBlock`/`imageWithOrientation` per business-rules.md § 3: tone and `reverse` alternate with the index; `priority` only at index 0 and only with an image; no image means no `media`; ratio `3 / 2` exactly when width ≥ 1.2 × height and `mediaSize` matches (invariant). 100 % coverage.
|
||||
|
||||
- [ ] **Step 7 — shootPageBands** [sonnet] — *BR-SP-70, BR-SP-71, BR-SP-73, FR-ST-02..08, PBT-03*
|
||||
- [x] **Step 7 — shootPageBands** [sonnet] — *BR-SP-70, BR-SP-71, BR-SP-73, FR-ST-02..08, PBT-03*
|
||||
- **Result**: `shootPageBands.ts` + test, 100 % coverage.
|
||||
- Depends on: Steps 3, 6.
|
||||
- New `src/lib/shootPageBands.ts`: `SectionBand` (`id`: `` `story-${string}` `` | `'process'` | `'photos'` | `'faq'` | `'offer'` | `'closing'`, `tone`, `position`) and `shootPageBands(view: ShootPageView): SectionBand[]`: stories in index order, then process, `photos` iff `view.photos`, `faq` iff `view.faq`, offer, closing; positions consecutive from 0, tone `paper` at even and `alt` at odd positions (the intro is not a band, it is `paper`). Story tones must equal `storyLayout(...)[i].tone` (the same rule; a test pins it).
|
||||
- Test `shootPageBands.test.ts`: examples with the real views (Newborn: 4 stories + process + photos + faq + offer + closing = 9 bands; Loveshoot: no photos = 8) and a view without FAQ; PBT over `shootPageViewArb` per business-rules.md § 3: tones alternate strictly starting with `paper`; ids in canonical order; length = stories + 1 + [photos] + [faq] + 2; no id twice; story band tone equals `storyLayout` tone (invariant). 100 % coverage.
|
||||
|
||||
### Shared components
|
||||
|
||||
- [ ] **Step 8 — Additive changes: PageIntro, MediaText, CallToAction** [sonnet] — *BR-SP-05, BR-SP-12, BR-SP-63, FR-ST-02, FR-ST-03, FR-ST-08, NFR-ST-02*
|
||||
- [x] **Step 8 — Additive changes: PageIntro, MediaText, CallToAction** [sonnet] — *BR-SP-05, BR-SP-12, BR-SP-63, FR-ST-02, FR-ST-03, FR-ST-08, NFR-ST-02*
|
||||
- **Result**: `PageIntro` (`titleId`, `breadcrumb`), `MediaText` (`medium`), `CallToAction` (`tone`) with tests; existing tests unchanged and green.
|
||||
- `src/components/PageIntro/PageIntro.tsx`: new optional `titleId?: string` (id of the h1; the section gets `aria-labelledby={titleId}`) and `breadcrumb?: ReactNode` (rendered above the eyebrow with `mb` 6 on phones and 7 from `md`). Existing callers render byte-identically (no `aria-labelledby`, no wrapper). Test: one test pins the existing markup (`container.innerHTML` equal to the output without the new props, e.g. with a stored expected structure), one for `titleId`/`breadcrumb`.
|
||||
- `src/components/MediaText/MediaText.tsx`: `mediaSize` accepts `'medium'` in addition to `'half'` and `'small'`: photo column up to 30rem (480 px), text up to 36rem centred in the rest, laid out exactly as `small` does (reuse its branch; add a `MEDIUM_MEDIA = '30rem'` constant next to `SMALL_MEDIA`). Detail-image behaviour unchanged. Add the `medium` test to `MediaText.test.tsx`; existing tests unchanged and green.
|
||||
- `src/components/CallToAction/CallToAction.tsx`: new optional `tone?: 'paper' | 'alt'`, default `'alt'`, passed to `PageSection`. Add one test; existing tests green. The overview page keeps its current output.
|
||||
- Update the doc comments of the three components. Touch no other file.
|
||||
|
||||
- [ ] **Step 9 — Breadcrumb** [sonnet] — *FR-ST-02, BR-SP-01..04, NFR-ST-01, SEO-ST-04*
|
||||
- [x] **Step 9 — Breadcrumb** [sonnet] — *FR-ST-02, BR-SP-01..04, NFR-ST-01, SEO-ST-04*
|
||||
- **Result**: `Breadcrumb` + test (separators are `li[aria-hidden]` as in BR-SP-02). Tests render at the page's own path: at `/` the Home link is correctly current.
|
||||
- New `src/components/Breadcrumb/Breadcrumb.tsx` (+ test): props `label: string`, `items: readonly BreadcrumbItem[]` (type import from `@/lib/shootPageView`), optional `data-testid`. Markup per frontend-components.md § 2: `nav[aria-label]` > `ol` > `li` per item; links through the router `Link` (`RouterLink`) with `activeOptions={{ exact: true }}` (so only the page itself can carry `aria-current`), accent.deep text, permanent underline, `minH` 44 px, inline-flex centred; the last item a `span[aria-current="page"]` in `ink`; between items a decorative `li[aria-hidden="true"]` "/"; `fontSize` 0.875rem, `color` `ink.soft`, centred, wrap, gap 2. No items: renders nothing; one item: only the current page.
|
||||
- Tests: examples (3 items, 1 item, none); PBT for 1 to 5 generated items per business-rules.md § 3: exactly the last item is a non-link with `aria-current="page"`, the others are links in order, separators number items − 1 and are `aria-hidden` (component property, few runs); axe.
|
||||
|
||||
- [ ] **Step 10 — ProcessIcons** [sonnet] — *FR-ST-04, BR-SP-23, BR-SP-74, NFR-ST-01*
|
||||
- [x] **Step 10 — ProcessIcons** [sonnet] — *FR-ST-04, BR-SP-23, BR-SP-74, NFR-ST-01*
|
||||
- **Result**: `ProcessIcons` + test.
|
||||
- New `src/components/shoots/ProcessIcons/ProcessIcons.tsx` (+ test): `processIcons: Record<ProcessStepId, () => JSX.Element>` with the six SVGs from domain-entities.md § 4 (envelope, calendar with heart, coin, camera, sliders, picture): `viewBox="0 0 24 24"`, `fill="none"`, `stroke="currentColor"`, `stroke-width="1.5"`, round caps and joins, `aria-hidden="true"`, `focusable="false"`, 24 × 24; shapes verbatim from design E (also in the domain-entities table). The `Record` type makes a missing id a compile error.
|
||||
- Test: one icon per `PROCESS_STEP_ORDER` id, each `svg` is `aria-hidden`, not focusable, has no `<title>`; axe.
|
||||
|
||||
- [ ] **Step 11 — ProcessTimeline** [sonnet] — *FR-ST-04, BR-SP-20..26, NFR-ST-01, NFR-ST-02*
|
||||
- [x] **Step 11 — ProcessTimeline** [sonnet] — *FR-ST-04, BR-SP-20..26, NFR-ST-01, NFR-ST-02*
|
||||
- **Result**: `ProcessTimeline` + test. Deviation: the subgrid fallback is not expressible through Chakra style props (a nested `@supports` rule is dropped), so `gridTemplateRows: subgrid` from `lg` stands without a fallback (all current browsers support subgrid).
|
||||
- Depends on: Step 10 (only for the page test; the component takes icons as props).
|
||||
- New `src/components/ProcessTimeline/ProcessTimeline.tsx` (+ test): props `steps: readonly { id: string; title: string; text: string; icon?: ReactNode }[]`, `tone?: 'paper' | 'alt'` (default `paper`), `data-testid`. `Reveal` > `ol[role="list"]` > `li` per step (marker `div[aria-hidden]` with the icon, line segments `span[aria-hidden]`, text block with `h3` and `p`), layout exactly as frontend-components.md § 2 (below `lg`: grid `3.5rem | 1fr`, column gap 5, vertical line, list capped at `34rem` centred; from `lg`: grid of `repeat(<n>, minmax(0, 1fr))` by `auto 3.5rem auto` rows with `subgridRows` and fallback, text above for even indexes and below for odd, horizontal line through the markers from the first to the last centre). Markers hide the line with the band colour (`tone`); last marker filled (`accent.deep`, white icon), others outlined; no numbers; DOM order = `steps` order. Zero steps: renders nothing. Breakpoints via responsive props (`lg`), no pixel literals.
|
||||
- If a CSS feature is not expressible with Chakra style props (subgrid with fallback), use a style prop `gridTemplateRows` with the `@supports`-free fallback in the same value list (`1fr 3.5rem 1fr` as the base, `subgrid` from `lg`); report if impossible.
|
||||
- Tests: examples (6 steps; 1 step; 0 steps; last marker filled; an alternation check that does not depend on class names, e.g. a `data-text-position="above|below"` attribute set from the index parity); PBT for 1 to 8 `timelineSteps` per business-rules.md § 3: one `li` per step in input order, one h3 per `li`, every icon wrapper `aria-hidden`, no digit-only text added by the component (component property, few runs); axe.
|
||||
|
||||
- [ ] **Step 12 — PhotoMosaic** [sonnet] — *FR-ST-05, BR-SP-30b..35, BR-SP-41, BR-SP-42, NFR-ST-03*
|
||||
- [x] **Step 12 — PhotoMosaic** [sonnet] — *FR-ST-05, BR-SP-30b..35, BR-SP-41, BR-SP-42, NFR-ST-03*
|
||||
- **Result**: `PhotoMosaic` + test.
|
||||
- Depends on: Step 5.
|
||||
- New `src/components/PhotoMosaic/PhotoMosaic.tsx` (+ test): props `images: readonly ContentImage[]`, `data-testid`. Takes the first `MOSAIC_MAX_PHOTOS`; `ul[role="list"]` as a grid (below `md` two columns; from `md` four columns by two rows of `clamp(12rem, 22vw, 18.75rem)`; gap `gridGap`) with `Reveal as li` (delay `index * 0.08`) per tile with the tile's `column`/`row` (from `md`) or span 2 when `wide` (below `md`), `aspectRatio` = `phoneRatio` below `md` and `auto` from `md`, `position: relative`, `overflow: hidden`, `bg paper.deep`, and a `DeferredImage` absolutely filling the cell (`objectFit: cover`, intrinsic width/height attributes kept by `DeferredImage`). Not interactive (Q3 = A): no link, no button, no hover effect. Empty list: renders nothing.
|
||||
- Tests: examples with 2, 3, 4, 5 and 0 photos (tile counts 2, 3, 4, 4, none; alt texts present; no `a`/`button` inside); PBT for 2 to 6 generated images per business-rules.md § 3: `min(n, 4)` `img` elements with the given alt texts in order (component property); axe.
|
||||
|
||||
- [ ] **Step 13 — FaqList** [sonnet] — *FR-ST-06, BR-SP-50..53, NFR-ST-01, SECURITY-11*
|
||||
- [x] **Step 13 — FaqList** [sonnet] — *FR-ST-06, BR-SP-50..53, NFR-ST-01, SECURITY-11*
|
||||
- **Result**: `FaqList` + test. jsdom and user-event do not turn Enter/Space on a `summary` into the click that toggles `details` (the browser does); the test checks focusability, `summary` as first child, and the toggle on activation (click) instead.
|
||||
- New `src/components/FaqList/FaqList.tsx` (+ test): props `items: readonly FaqItem[]`, `data-testid`. `Box` with a top hairline (`sand`) > per item one native `details` (bottom hairline) > `summary` (flex, space-between, `minH` 44 px, `py` 5, heading font 1.25rem, `ink`, `cursor pointer`, `listStyle none`, WebKit marker hidden, visible focus ring from the theme `focusRing` token with offset) holding the question and a decorative `svg[aria-hidden]` plus icon whose vertical stroke is hidden by CSS under `details[open]` (Chakra `css`/`_open`-style selector; no state), followed by `RichParagraph` for the answer with `mb` 6 and `maxW` 680 px. **No item has the `open` attribute** (Q5 = C); no React state, no JavaScript handler. Answers stay in the DOM when closed. Question text is the disclosure label, not a heading. Zero items: renders nothing.
|
||||
- Tests: examples (3 items all closed at load, answers in the DOM, answer links present as links); keyboard: focus the `summary`, press Enter and Space with `userEvent` and check `open`; if jsdom does not toggle `details` on activation, diagnose the cause first (do not skip the assertion silently) and test the attribute through the documented jsdom behaviour or report; PBT for 0 to 6 `faqItem`s per business-rules.md § 3: one `details` per item, every answer text present in the DOM, no `details` with `open` (component property); axe.
|
||||
|
||||
- [ ] **Step 14 — PackageBlock** [sonnet] — *FR-ST-07, BR-SP-60..62, NFR-ST-01, SECURITY-11*
|
||||
- [x] **Step 14 — PackageBlock** [sonnet] — *FR-ST-07, BR-SP-60..62, NFR-ST-01, SECURITY-11*
|
||||
- **Result**: `PackageBlock` + test.
|
||||
- Depends on: Step 8 (`MediaText` `small` already exists; no `medium` needed here).
|
||||
- New `src/components/PackageBlock/PackageBlock.tsx` (+ test): props `titleId`, `eyebrow`, `title`, `image: ContentImage`, `frameColor?`, `pkg?: PricingPackage`, `onRequest: { price: string; text: string }`, `note?: string`, `children` (the actions), `data-testid`. `MediaText mediaSize="small"` (aspect `1 / 1`, deferred image, `frameColor`; **no priority**); text column: `Eyebrow`, `h2#titleId` (`sectionTitle`), price paragraph (heading font, 2.25rem, `accent.deep`, `formatPrice(pkg.price)` or `onRequest.price`), then the features `ul` (rows with a `sand` top border, the last also a bottom border; `role="list"`) when `pkg` exists or the `onRequest.text` paragraph (`ink.soft`) otherwise, the actions row (flex, wrap, gap 3 / 7, centred) with `children`, and the `note` paragraph (0.875rem, `mt` 5) when given. The variant is decided by `pkg` presence only, never by a shoot id.
|
||||
- Tests: Newborn-style package (price `€ 185` with the non-breaking space from `formatPrice`, all features listed, note shown), on-request variant (price text and text paragraph, no list), no note, extra actions rendered; axe.
|
||||
|
||||
### Shoot page parts
|
||||
|
||||
- [ ] **Step 15 — StoryBlocks** [sonnet] — *FR-ST-03, BR-SP-10..14, BR-SP-40, BR-SP-41, NFR-ST-03*
|
||||
- [x] **Step 15 — StoryBlocks** [sonnet] — *FR-ST-03, BR-SP-10..14, BR-SP-40, BR-SP-41, NFR-ST-03*
|
||||
- **Result**: `StoryBlocks` + test.
|
||||
- Depends on: Steps 4, 6, 8.
|
||||
- New `src/components/shoots/StoryBlocks/StoryBlocks.tsx` (+ test): props `stories`, `frameColor`, `idPrefix`. One band per story, tone, spacing and media from `storyLayout`. With media: `PageSection` (`labelledBy`) > `MediaText` (`image`, `aspectRatio`, `mediaSize`, `reverse`, `priority`, `frameColor`) whose text column holds `Eyebrow`, `h2` (`sectionTitle`, id `headingId(idPrefix, story.id) + '-title'`) and a stack of `RichParagraph`s (gap 4, `ink.soft`). Without media (Q4 = A): the same `PageSection` (width `narrow`, tone and spacing from the layout) with the same text column inside a `Reveal`, `maxW` 36rem, centred; no `MediaText`, no frame, no empty column. `data-testid="story-<id>"`. Only index 0 may be a priority image; all other photos are deferred (BR-SP-40/41). Empty list: renders nothing.
|
||||
- Tests: Newborn stories (4 sections, each named by its h2, first image is not lazy and carries `fetchpriority="high"`, the others lazy and deferred, tones alternate), Loveshoot stories (1 photo, 3 text-only bands), hostile story ids (spaces, uppercase) give valid `aria-labelledby` targets that exist in the DOM; axe.
|
||||
|
||||
- [ ] **Step 16 — ShootBlock "Lees meer"** [sonnet] — *FR-ST-09, BR-SP-64, Q6 = A, NFR-ST-01*
|
||||
- [x] **Step 16 — ShootBlock "Lees meer"** [sonnet] — *FR-ST-09, BR-SP-64, Q6 = A, NFR-ST-01*
|
||||
- **Result**: `ShootBlock` link first in the row; `ShootBlock.test` and `ShootList.test` extended; `app.test.tsx` overview tests green.
|
||||
- Depends on: Step 4.
|
||||
- `src/components/shoots/ShootBlock/ShootBlock.tsx`: new first link in the links row: `Link variant="underline" asChild` with `linkStyle` > `RouterLink to={shootPagePath(shoot.id)}` with the visible text `readMoreLabel(shoot)` and `data-testid={`shoot-${shoot.id}-readmore`}`; no `aria-label` (the visible text already differs per shoot). Props unchanged; `article` id, the other two links and their `aria-label`/test ids unchanged. Update the file comment.
|
||||
- `ShootBlock.test.tsx` and `ShootList.test.tsx`: link text and `href` per shoot (all five), the link comes first, unique accessible names across the list, existing anchors and links still present, axe. Existing assertions stay unchanged and green; check the overview tests in `app.test.tsx` still pass.
|
||||
|
||||
- [ ] **Step 17 — ShootPage assembly** [sonnet] — *FR-ST-02..08, BR-SP-70, BR-SP-71, BR-SP-73, BR-SP-74, NFR-ST-01, NFR-ST-03, SEO-ST-04*
|
||||
- [x] **Step 17 — ShootPage assembly** [sonnet] — *FR-ST-02..08, BR-SP-70, BR-SP-71, BR-SP-73, BR-SP-74, NFR-ST-01, NFR-ST-03, SEO-ST-04*
|
||||
- **Result**: `ShootPage` assembled; test extended. The primary buttons use `Box asChild css={linkButton recipe}` around the router's own `Link` (as `PriceCard`), because `LinkButton` loses the typed `search`. The intro and the first story are both paper on purpose (the story is `flushTop`); from the first story on the bands alternate. Cross-check with design E (by reading): section order, eyebrows and tone alternation match; the five-section order intro, 4 stories, process, photos, FAQ, offer, closing is the same.
|
||||
- Depends on: Steps 7, 8, 9, 10, 11, 12, 13, 14, 15.
|
||||
- `src/components/shoots/ShootPage/ShootPage.tsx`: props `{ view }` unchanged; no content imports; no state. Composition in the order of `shootPageBands(view)` (frontend-components.md § 3): (1) `PageIntro` with `eyebrow`, `title`, `titleId="intro-title"`, `breadcrumb=<Breadcrumb label items/>`, text `view.intro.text`; (2) `StoryBlocks` (`frameColor = view.shoot.frameColor`, `idPrefix="story"`); (3) `PageSection id="zo-werkt-het" labelledBy="process-title" tone` with `SectionHeading` (eyebrow, h2 id `process-title`, lead) and `ProcessTimeline` (steps mapped with `processIcons[step.id]`, `tone` passed; an id without an icon yields none); (4) if `view.photos`: `PageSection id="impressie" labelledBy="photos-title" tone` with a head (eyebrow, h2 `photos-title`, "Bekijk meer {photosLabel}" link when `portfolioLink`, at least 44 px high, wrapping below the heading on narrow screens) and `PhotoMosaic`; (5) if `view.faq`: `PageSection id="vragen" labelledBy="faq-title" tone` in two columns from `lg` (eyebrow, h2 `faq-title`, `RichParagraph` of the lead | `FaqList`), stacked below; (6) `PageSection id="pakket" labelledBy="offer-title" tone` with `PackageBlock` (`titleId="offer-title"`, `view.offer` data, `note = depositNote`, actions: package variant "Boek dit pakket" (`bookLink`, accent `LinkButton`) + "Eerst een vraag stellen" (`askLink`, underline link); on-request variant one primary button `onRequest.linkLabel` to `bookLink`); (7) `CallToAction` (`titleId="closing-title"`, `tone` = next band tone, rich-text lead via `RichParagraph`, accent `LinkButton` to `closing.link`). `data-testid`s: `shoot-page`, `shoot-breadcrumb`, `story-<id>`, `process-timeline`, `photo-mosaic`, `faq-list`, `package-block`, `shoot-closing`. The portfolio link uses the same `shootPortfolioLink` data from the view.
|
||||
- Update `ShootPage.test.tsx` (the unit-1 test stays valid; extend it): one h1, h2 per section, h3 per step, no level skipped (heading outline for Newborn with mosaic and FAQ, Loveshoot without mosaic, and a view without FAQ built by clearing `faq` in a copy of the content), every `aria-labelledby` target exists, section anchors `zo-werkt-het`, `impressie`, `vragen`, `pakket` exist when the section does, adjacent bands never share a tone (read from the `PageSection` backgrounds or a `data-tone` attribute added for the test), axe.
|
||||
@@ -142,7 +159,8 @@ This plan is the **single source of truth** for code generation of unit 2. Steps
|
||||
|
||||
### Route-level tests
|
||||
|
||||
- [ ] **Step 18 — `src/shootPages.test.tsx` (page structure and links)** [sonnet] — *FR-ST-02..09, NFR-ST-01, NFR-ST-06, SEO-ST-04, PBT-10*
|
||||
- [x] **Step 18 — `src/shootPages.test.tsx` (page structure and links)** [sonnet] — *FR-ST-02..09, NFR-ST-01, NFR-ST-06, SEO-ST-04, PBT-10*
|
||||
- **Result**: `src/shootPages.test.tsx` (23 tests at this step): outline, sections, breadcrumb, `aria-current` in `main` only, offer variants, priority photo, overview links and anchors, one-link-per-shoot facet.
|
||||
- Depends on: Steps 16, 17.
|
||||
- New `src/shootPages.test.tsx` using `renderApp` and `expectShell` from `src/test/renderApp.tsx` (copy the `vi.mock` and `beforeEach`/`afterEach` stubs that `app.test.tsx` needs for the same pages; mocks are per test file). Per shoot (`it.each` over `shootTypes`): heading outline (one h1; h2 per section; h3 = six steps), sections present or omitted as the data says (Newborn: mosaic with 3 tiles; Zwangerschap, Gezin, Loveshoot, Portret: no `#impressie`, no mosaic heading; FAQ and process always), the breadcrumb ("Kruimelpad", Home, Soorten fotoshoots, current page with `aria-current="page"`, three items), no `aria-current` anywhere in `main` other than the breadcrumb's last item (see the integration note in Step 26), package variant for Newborn/Zwangerschap/Gezin ("Boek dit pakket" `href` `/contact?pakket=<id>`, price from `formatPrice`) and "Prijs op aanvraag" for Loveshoot/Portret (no price, one primary button, `href` `/contact`), deposit note under the actions in both variants, closing band different tone from the package band, the first story photo is not lazy (priority) and no other photo has `loading="eager"`, axe on each of the five pages.
|
||||
- Overview page: for every shoot a "Lees meer over de … " link to `/soorten-fotoshoots/<id>` that is first in the row and has a unique accessible name; the `article` anchors (`#newborn` … `#portret`) and the old links are still there (FR-ST-09).
|
||||
@@ -151,26 +169,30 @@ This plan is the **single source of truth** for code generation of unit 2. Steps
|
||||
|
||||
### OG wiring (only after the user approved the crops in Step 2)
|
||||
|
||||
- [ ] **Step 19 — Wire the OG images into the registry** [haiku] — *SEO-ST-05, BR-SP-80, BR-SP-81, FR-ST-12*
|
||||
- [x] **Step 19 — Wire the OG images into the registry** [haiku] — *SEO-ST-05, BR-SP-80, BR-SP-81, FR-ST-12*
|
||||
- **Result**: Done after the user approved the crops. Five `ogImage` entries in `sitePages.ts`; `app.test.tsx`: one assertion now reads `sitePages[path].ogImage!.path`.
|
||||
- **Blocked until the orchestrator confirms the user approved the five crops from Step 2.** Do not start without that confirmation in the hand-over text.
|
||||
- `src/sitePages.ts`: add to each of the five shoot entries, directly after `indexed: true`, `ogImage: { path: '/og-<id>.jpg', width: 1200, height: 630, alt: '<alt of the source photo, Dutch>' }` (alts as listed in Step 2, as approved). Existing entries and the `PageMeta` type unchanged.
|
||||
- `src/app.test.tsx` (**not in unit 2's ownership table; one assertion**): the shoot-page head test currently expects `${siteUrl}/og-image.jpg` with the comment "The default image until unit 2 gives the pages their own" (around lines 519–522). Change it to `${siteUrl}${sitePages[path].ogImage!.path}` (or the equivalent that does not hardcode five names) and update the comment. Nothing else in the file; unit 3 does not edit this file (its tests live in `navSubmenu.test.tsx`).
|
||||
- Run `pnpm exec tsc`, `pnpm lint`, `pnpm exec vitest run src/app.test.tsx src/seo.test.ts src/sitemap.test.ts`.
|
||||
|
||||
- [ ] **Step 20 — OG registry consistency test** [sonnet] — *SEO-ST-05, BR-SP-80, FR-ST-12, PBT-10*
|
||||
- [x] **Step 20 — OG registry consistency test** [sonnet] — *SEO-ST-05, BR-SP-80, FR-ST-12, PBT-10*
|
||||
- **Result**: OG registry consistency added to `src/shootPages.test.tsx` (file read via `import.meta.dirname`, SOF marker parsed from the bytes). The `og:image` meta facet is covered by the changed `app.test.tsx` assertion (not duplicated).
|
||||
- Depends on: Step 19.
|
||||
- In `src/shootPages.test.tsx`: for every `ShootTypeId` (finite set, example-based): `sitePages[shootPagePath(id)].ogImage` is defined, `path` is `/og-<id>.jpg`, width 1200, height 630, alt non-blank, and `web/public/og-<id>.jpg` exists (read with `node:fs`, resolved from the test file location); no two `ogImage.path` values in `sitePages` are equal across the whole registry; the file is a JPEG of 1200 × 630 (read the SOF0/SOF2 marker from the bytes in a small test helper, no image dependency) and at most 150 KB. Also assert the `og:image` meta of each shoot page in the app equals `siteUrl + ogImage.path` (one `renderApp` per shoot, or reuse the facet of `app.test.tsx` if it is enough; do not duplicate it).
|
||||
|
||||
### Documentation
|
||||
|
||||
- [ ] **Step 21 — LAYOUT.md and layout conventions** [haiku] — *FR-ST-13, BR-SP-90*
|
||||
- [x] **Step 21 — LAYOUT.md and layout conventions** [haiku] — *FR-ST-13, BR-SP-90*
|
||||
- **Result**: `LAYOUT.md` section and `.ai/layout-conventions.md` updated. Root files are outside `web/`'s `prettier --check .`; a direct check flags LAYOUT.md (not checked for a pre-existing baseline).
|
||||
- `LAYOUT.md`: new section **"Shoot page"** placed directly after "Types of shoots" (before "Contact"), the `block-beta` diagram from frontend-components.md § 9 (A Intro, B–E Story 1–4, F Process timeline, G Photos, H FAQ, I Package, J Book; style lines A–G as in the template, H `#9b6bb5`/`#745088`, I `#4cc3e0`/`#3992a8`, J `#8cb83f`/`#698a2f`, same `color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px`). Add a one-line note under the diagram that Photos is left out below the minimum number of photos. "Types of shoots", Shell and the other sections stay unchanged.
|
||||
- `.ai/layout-conventions.md`: append the three `style` lines H, I, J to the template list and change the sentence "extend with a new letter using the same formula if an 8th block is ever needed" to name the ten letters (A–J) ("if an 11th block is ever needed"). No other change.
|
||||
- Check the new colours: stroke = fill × 0.75 (H 155,107,181 → 116,80,136; I 76,195,224 → 57,146,168; J 140,184,63 → 105,138,47), all three distinct from A–G. Run `pnpm exec prettier --check` on the two files if prettier covers them (repo root files may be outside `web/`; if not, skip).
|
||||
|
||||
### Verification
|
||||
|
||||
- [ ] **Step 22 — Unit verification** [haiku] — *NFR-ST-01, NFR-ST-03, NFR-ST-05, NFR-ST-06, NFR-ST-07*
|
||||
- [x] **Step 22 — Unit verification** [haiku] — *NFR-ST-01, NFR-ST-03, NFR-ST-05, NFR-ST-06, NFR-ST-07*
|
||||
- **Result (all green)**: lint, format:check, tsc clean; `pnpm test` 113 files / 883 tests pass, seed 1191455385, coverage thresholds pass (incl. `isShootSectionPath.ts`); `pnpm build` clean; `audit:deps` passes (seroval@1.7.3 in lockfile), `audit:dev` exit 0 (22 dev advisories, non-blocking by NFR-SEC-05, as on master). `package.json`, lockfile, `securityHeaders.ts`, `routeTree.gen.ts`: no diff. Bundle: `index-C65n6UdK.js` 536.65 kB / 152.56 kB gzip vs unit 1 528.98 / 150.69 (+7.67 kB raw, +1.87 kB gzip; the shoot-nav data now sits in main via unit 3 D5). "Kruimelpad", "Zo werkt het", `process-title`, `faq-title`, `offer-title` only in `-shootPageSources-*.js` (route chunk, not in main); "Uit eerdere newbornshoots" only in `newborn-*.js`. Five OG JPEGs in `dist/` (91-100 KB each). Greps: `dangerouslySetInnerHTML` only in `StructuredData`; the one `console.error` is the pre-existing `ErrorPage.tsx`; no new e-mail/mailto; no placeholders; no hex/rgb in new components; `DRAFT(CON-ST-03)` count 98 (unchanged).
|
||||
- Depends on: Steps 1–21 (Step 20 only if the user approved the crops; otherwise run it without 19/20 and **run Steps 19, 20 and this step's test, build and bundle items again** after the approval).
|
||||
- In `web/`, each on its own and all green: `pnpm lint`; `pnpm format:check`; `pnpm exec tsc`; `pnpm test` (coverage thresholds 100 % for `src/lib/**`, `src/seo.ts`, `src/sitemap.ts`; note test count, files and the fast-check seed; the unit-1 baseline is 90 files / 595 tests); `pnpm build`; `pnpm audit:deps` and `pnpm audit:dev` (the branch was fast-forwarded to master 1416497, which contains the seroval patch from PR #12 — lockfile resolves `seroval@1.7.3` — so `audit:deps` must pass; a failure is reported). Lighthouse is Step 23, not part of this step.
|
||||
- `git diff --exit-code web/pnpm-lock.yaml web/package.json web/config/securityHeaders.ts` (no new dependency, headers unchanged; SECURITY-04/10). `git diff --stat web/src/routeTree.gen.ts` must show no change from unit 2's work (`pnpm exec vite build` regenerates it; no route files added).
|
||||
@@ -179,6 +201,7 @@ This plan is the **single source of truth** for code generation of unit 2. Steps
|
||||
- If any item fails: diagnose the root cause, fix it (or hand a [sonnet] fix step to the orchestrator), re-run. Do not weaken a test or threshold.
|
||||
|
||||
- [ ] **Step 23 — Lighthouse (mobile and desktop)** [haiku] — *NFR-ST-01, NFR-ST-03, FR-ST-12, SEO-ST-04*
|
||||
- **Result (2026-10-30), NOT green (left unchecked): mobile performance budgets fail on four pages; everything else passes.** Build = Step 22 build with units 1+2+3; `pnpm lighthouse` equivalent (`lhci autorun`, then `lhci autorun --config=lighthouserc.desktop.cjs`, 1 run per URL; the mobile command exits 1 on the assertions, desktop exits 0). Accessibility, best practices 1.0 on all 12 URLs mobile and desktop; SEO 1.0 on all indexed pages (0.58 `/bestaat-niet`, 0.69 `/privacyverklaring` are the expected noindex values). Mobile performance (unit-1 Step 24 in brackets): `/` 0.75 (0.76) FAIL budget 0.8; `/contact` 0.87 (0.85) FAIL budget 0.9; `/over-mij` 0.87; `/portfolio` 0.91; `/soorten-fotoshoots` 0.85; newborn 0.86 (0.90); zwangerschap 0.85 (0.90); gezin 0.84 (0.90) FAIL budget 0.85; loveshoot 0.83 (0.90) FAIL budget 0.85; portret 0.85 (0.90); `/privacyverklaring` 0.90; `/bestaat-niet` 0.92. Re-measure of the two failing shoot pages, 3 runs each: gezin 0.85, 0.85, 0.85 (passes, borderline), loveshoot 0.83, 0.83, 0.83 (fails consistently). Desktop performance 0.99-1.00 on every page (shoot pages 0.99; budget 0.9). `/` and `/contact` fail on master too (0.78 / 0.87). Diagnosis (loveshoot, gezin): the first story photo is not the bottleneck (153 / 117 KB, load time 15-24 ms); LCP is 3.8 / 3.7 s with a render delay of ~2.9-3.0 s, FCP is 2.6 s on every page, i.e. the image is only painted after the main bundle (536 kB, +1.9 kB gzip from unit 3) has run, which matches the `photoPagePaths` comment in `lighthouserc.cjs`; the shoot pages dropped 0.05-0.07 from the shell-only unit-1 numbers because the page now renders the first story through `MediaText`/`Reveal` inside the lazy route chunk. Mitigations for the orchestrator, in the plan's order, none applied: (1) first story without the fade-in (`Reveal` removed for story 0), (2) fewer pixels for the first photo by capping its column, (3) report and keep the known limit. Preview port 4173 released (the lhci server stopped itself; free).
|
||||
- Depends on: Step 22 green. **Needs the orchestrator's claim of port 4173** (`pnpm preview --port 4173 --strictPort`; `--strictPort` fails fast when taken: then wait, never change the port) and a quiet machine (performance is blocking locally). Do not start without the orchestrator's go.
|
||||
- In `web/`: `pnpm lighthouse` (runs `lhci autorun` for mobile and then `lhci autorun --config=lighthouserc.desktop.cjs`; indexed pages incl. the five shoot pages). Run it **after Step 19** so the OG images and final markup are measured (if the crops are still unapproved, run now and re-run later).
|
||||
- Expected: accessibility, best practices and SEO **1.0** on every page, mobile and desktop; the five shoot pages performance ≥ **0.85 mobile** (goal 0.9) and ≥ **0.9 desktop**. Unit 1 left the shoot pages at 0.90 mobile / 100 desktop with the shell only and the baseline failures `/` 0.76 (budget 0.8) and `/contact` 0.85 (budget 0.9) that also fail on master; report current numbers for all pages next to those.
|
||||
@@ -195,7 +218,8 @@ This plan is the **single source of truth** for code generation of unit 2. Steps
|
||||
- `architecture.md`: one line on the shoot page composition (`shootPageBands` → sections) next to unit 1's Outlet line; no diagram restructure.
|
||||
- No timestamp refresh. **Note**: the application design says the orchestrator writes both units' lines after both are done; this step follows the instruction for this plan (unit 2 writes its own lines). If the orchestrator prefers to write them, hand the lines over instead via the code summary and skip the edit.
|
||||
|
||||
- [ ] **Step 26 — Integration facet after unit 3 (orchestrator, conditional)** [sonnet] — *BR-SP-03, NFR-ST-01, NFR-ST-06*
|
||||
- [x] **Step 26 — Integration facet after unit 3 (orchestrator, conditional)** [sonnet] — *BR-SP-03, NFR-ST-01, NFR-ST-06*
|
||||
- **Result**: one `it.each` test per shoot added to `src/shootPages.test.tsx` (5 tests; file now 34 tests). Decision recorded (unit 3's final markup): the mobile menu (`#mobile-nav`) is a sibling of the `header`, not inside it, and both menus carry the shoot's own link as current, so the whole page has exactly three `aria-current="page"` elements: the breadcrumb's last item (main), the header submenu link and the mobile-menu sub-link (both `href` = the shoot path; only one of the two menus is shown at a time). The rule is therefore "exactly one in main, exactly one in each menu, none in the footer, the parent 'Soorten fotoshoots' links (header and mobile menu) and the footer link never current". Full suite after the change: lint, format:check clean; 113 files / 888 tests pass, seed 1757660570. Record the decision in the code summary (Step 24).
|
||||
- **Run only when unit 3 is built in the same worktree.** Currently the header link "Soorten fotoshoots" and the footer link receive TanStack's fuzzy `aria-current="page"` on a shoot page (unit 3 fixes both, application-design D4), so a **whole-page** "exactly one `aria-current="page"`" assertion cannot pass in unit 2 alone; Step 18 therefore checks `main` only.
|
||||
- Add to `src/shootPages.test.tsx` (unit 2's file) one test per shoot: in the whole document exactly one element has `aria-current="page"` **and** it is the breadcrumb's last item or the nav's exact-page child (decide with unit 3's final markup; the intended rule is "only the exact page", D4), then re-run the unit's tests. If both header submenu child and breadcrumb mark the same page, the rule is "at most one in `main` and at most one in `header`", not one overall; record the decision in the code summary.
|
||||
|
||||
|
||||
@@ -114,6 +114,10 @@ Text alternative: each shoot page runs from the intro with breadcrumb through fo
|
||||
- New section **"Shoot page"** (one generic diagram for all five shoots) following [.ai/layout-conventions.md](../../../../../.ai/layout-conventions.md): A Intro (with breadcrumb), B–E Story 1–4, F Process timeline, G Photos, H FAQ, I Package, J Book. Letters H, I and J need new template colours (stroke = fill × 0.75), added to the template in `.ai/layout-conventions.md` as well.
|
||||
- "Types of shoots" keeps its blocks (the new links do not add a section). The Shell diagram does not show menu items, so it stays unchanged.
|
||||
|
||||
### FR-ST-14 404 inside the shoot section
|
||||
- An unknown URL under `/soorten-fotoshoots/` (e.g. `/soorten-fotoshoots/niet-bestaande-shoot`; prefix match case-insensitive, like the router) shows the normal 404 page with two actions: **"Terug naar Soorten fotoshoots"** (link to `/soorten-fotoshoots`, `accent` variant, first) and **"Terug naar home"** (link to `/`, `outline`). Every other unknown URL keeps the single "Terug naar home" button. Title, text and `noindex` stay unchanged.
|
||||
- Implemented in `NotFound` by reading the current pathname; no layout route is added (the route tree, the menu matching of unit 3 and the bundle stay unchanged). *Source: user request 2026-10-30, added during Code Generation*
|
||||
|
||||
---
|
||||
|
||||
## SEO Requirements
|
||||
|
||||
Reference in New Issue
Block a user