Merge pull request 'Adds the Over mij page' (#7) from feature/over-mij-page into master
Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
@@ -41,13 +41,17 @@ columns 1
|
|||||||
```mermaid
|
```mermaid
|
||||||
block-beta
|
block-beta
|
||||||
columns 1
|
columns 1
|
||||||
A["About Me"]
|
A["Intro"]
|
||||||
B["Background"]
|
B["About Me"]
|
||||||
C["Personal"]
|
C["Background"]
|
||||||
|
D["Photos"]
|
||||||
|
E["Personal"]
|
||||||
|
|
||||||
style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
||||||
style B fill:#f4a261,stroke:#b77a49,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
style B fill:#f4a261,stroke:#b77a49,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
||||||
style C fill:#2a9d8f,stroke:#20766b,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
style C fill:#2a9d8f,stroke:#20766b,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
||||||
|
style D fill:#264653,stroke:#1d353e,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
||||||
|
style E fill:#e9c46a,stroke:#af9350,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px
|
||||||
```
|
```
|
||||||
|
|
||||||
## Portfolio
|
## Portfolio
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
|||||||
| Path | File | Head | Component | Indexed |
|
| Path | File | Head | Component | Indexed |
|
||||||
|------|------|------|-----------|---------|
|
|------|------|------|-----------|---------|
|
||||||
| (root) | `routes/__root.tsx` | `siteHead(siteContent)` | `AppShell` | — |
|
| (root) | `routes/__root.tsx` | `siteHead(siteContent)` | `AppShell` | — |
|
||||||
| `/` | `routes/index.tsx` | `pageHead('/')` | `Hero` | yes |
|
| `/` | `routes/index.tsx` | `pageHead('/')` | `Hero` + six home sections; search `?pakket=` | yes |
|
||||||
| `/over-mij` | `routes/over-mij.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
|
| `/over-mij` | `routes/over-mij.tsx` | `pageHead('/over-mij')` + `AboutPage` JSON-LD | `PageIntro`, `AboutIntro`, `StorySection` ×2, `PhotoDuo`, `LinkButton` | yes |
|
||||||
| `/portfolio` | `routes/portfolio.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
|
| `/portfolio` | `routes/portfolio.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
|
||||||
| `/soorten-fotoshoots` | `routes/soorten-fotoshoots.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
|
| `/soorten-fotoshoots` | `routes/soorten-fotoshoots.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
|
||||||
| `/contact` | `routes/contact.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
|
| `/contact` | `routes/contact.tsx` | `pageHead(...)` | `PageIntro` placeholder | no |
|
||||||
@@ -22,7 +22,7 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
|||||||
### seo.ts / sitePages.ts / sitemap.ts
|
### seo.ts / sitePages.ts / sitemap.ts
|
||||||
- `pageHead(path: RoutePath)` → `{ meta, links }` (title, description, robots noindex if not indexed, OG tags, canonical)
|
- `pageHead(path: RoutePath)` → `{ meta, links }` (title, description, robots noindex if not indexed, OG tags, canonical)
|
||||||
- `siteHead(content: SiteContent)` → `{ meta, scripts }` (OG basics, JSON-LD ProfessionalService)
|
- `siteHead(content: SiteContent)` → `{ meta, scripts }` (OG basics, JSON-LD ProfessionalService)
|
||||||
- `canonicalUrl(path, base?)`, `jsonLdScript(data)`, `professionalService(content)`
|
- `canonicalUrl(path, base?)`, `jsonLdScript(data)`, `structuredDataScript(data)`, `professionalService(content)` (with `@id` `businessId` and `founder` → `personId`), `person(content, site, image)`, `aboutPage(path, content, site)`
|
||||||
- `sitePages: Record<RoutePath, PageMeta>`, `pageList(pages)`
|
- `sitePages: Record<RoutePath, PageMeta>`, `pageList(pages)`
|
||||||
- `sitemapXml(...)` — used by `config/sitemapPlugin.ts`
|
- `sitemapXml(...)` — used by `config/sitemapPlugin.ts`
|
||||||
|
|
||||||
@@ -32,6 +32,15 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
|||||||
- `Footer({ content: SiteContent })`, `FooterColumn({ title, children })`, `FooterLink(LinkProps)`
|
- `Footer({ content: SiteContent })`, `FooterColumn({ title, children })`, `FooterLink(LinkProps)`
|
||||||
- `Hero({ content: HeroContent, socials: SocialLink[] })`, `HeroArrows({ onPrev, onNext })`, `HeroPauseButton({ stopped, onToggle })`, `HeroSocials({ socials })`
|
- `Hero({ content: HeroContent, socials: SocialLink[] })`, `HeroArrows({ onPrev, onNext })`, `HeroPauseButton({ stopped, onToggle })`, `HeroSocials({ socials })`
|
||||||
- `PageIntro({ title, eyebrow?, children? })` — renders the page's only h1
|
- `PageIntro({ title, eyebrow?, children? })` — renders the page's only h1
|
||||||
|
- `PageSection({ labelledBy, id?, tone?: 'paper' | 'alt', width?: 'default' | 'narrow' | 'full', spacing?: 'default' | 'tight' | 'flushTop', 'data-testid'?, children })` (was `HomeSection`)
|
||||||
|
- `MediaText({ image, aspectRatio, 'data-testid'?, children })` — framed photo next to a text column
|
||||||
|
- `Eyebrow(TextProps & { as?: 'p' | 'span' | 'h2' | 'h3' | 'h4' })` — accent label, optionally a heading
|
||||||
|
- `SectionHeading({ id, title, eyebrow?, lead?, align?: 'center' | 'start', spacing?: 'default' | 'compact', focusable? })` — renders an h2
|
||||||
|
- `FramedImage({ image: ContentImage, aspectRatio })`, `DeferredImage(ImageProps & { image, near? })`, `Reveal(BoxProps & { delay? })`
|
||||||
|
- `IntroGallery({ content })`, `AboutBlock({ content })`, `Pricing({ content, packages })`, `PriceCard(...)`, `Testimonials({ content, testimonials })`, `ContactSection({ content, packages, enabled, email, pakket? })`, `InstagramGrid({ content, profileUrl })`
|
||||||
|
- `ContactForm(...)`, `ContactFormGate({ enabled, email, ... })`
|
||||||
|
- `PhotoDuo({ photos: [ContentImage, ContentImage], label, 'data-testid'? })`
|
||||||
|
- `about/AboutIntro({ content })`, `about/StorySection({ content, titleId, tone?, spacing?, children? })`, `about/RichParagraph({ paragraph: RichText })`
|
||||||
- `StatusPage({ title, children, actions? })`, `ErrorPage({ error, reset })`
|
- `StatusPage({ title, children, actions? })`, `ErrorPage({ error, reset })`
|
||||||
- `LinkButton(RouterLink props & { variant?: 'outline' | 'accent' | 'light' })`
|
- `LinkButton(RouterLink props & { variant?: 'outline' | 'accent' | 'light' })`
|
||||||
- `UmamiAnalytics({ hostname? })`
|
- `UmamiAnalytics({ hostname? })`
|
||||||
@@ -40,6 +49,7 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
|||||||
- `useHeroSlider(count)` → slider state, controls, handlers, `HeroAnnouncement`
|
- `useHeroSlider(count)` → slider state, controls, handlers, `HeroAnnouncement`
|
||||||
- `useScrolledPast(getThreshold)` → boolean (stable `getThreshold` required)
|
- `useScrolledPast(getThreshold)` → boolean (stable `getThreshold` required)
|
||||||
- `useRouteFocus()` — focuses `<main>` after navigation
|
- `useRouteFocus()` — focuses `<main>` after navigation
|
||||||
|
- `useInView({ rootMargin, skip })` → `{ ref, inView }`; `usePageLoaded()` → boolean; `useReveal()` → `{ ref, visible }`
|
||||||
|
|
||||||
### Pure helpers (`lib/`)
|
### Pure helpers (`lib/`)
|
||||||
- `emailAddress({ user, domain }): string | null`
|
- `emailAddress({ user, domain }): string | null`
|
||||||
@@ -47,13 +57,24 @@ None. There is no back-end yet (`api/` is empty). The static design README antic
|
|||||||
- `copyrightLine(year): string`
|
- `copyrightLine(year): string`
|
||||||
- `slidesToLoad(active, count): number[]`
|
- `slidesToLoad(active, count): number[]`
|
||||||
- `backToTopThreshold(viewportHeight): number`
|
- `backToTopThreshold(viewportHeight): number`
|
||||||
|
- `slideLabel`, `formatPrice`, `bookLabel`, `visiblePackages`, `visibleTestimonials`, `packageFromSearch`, `shootOptions`, `mailSubject`/`mailtoLink`, `validateField`/`validateContact`, `isLikelySpam`, `toContactPayload`, `contactFormReducer`
|
||||||
|
|
||||||
### Monitoring
|
### Monitoring
|
||||||
- `monitoringFor(hostname): Monitoring | null`, `startSentry(hostname?)`, `reportError(error)`
|
- `monitoringFor(hostname): Monitoring | null`, `startSentry(hostname?)`, `reportError(error)`
|
||||||
|
|
||||||
## Data Models
|
## Data Models
|
||||||
### SiteContent (`content/types.ts`)
|
### SiteContent (`content/types.ts`)
|
||||||
- **Fields**: `footerIntro: string`, `socials: SocialLink[]`, `email: EmailAddress`
|
- **Fields**: `footerIntro: string`, `socials: SocialLink[]`, `email: EmailAddress`, `contactForm: { enabled: boolean }`
|
||||||
|
### ContentImage
|
||||||
|
- **Fields**: `src`, `alt`, `width`, `height` (intrinsic size, reserves space)
|
||||||
|
### HomeContent
|
||||||
|
- **Fields**: `intro`, `about` (`eyebrow`, `title`, `paragraphs[]`, `image`, `link: { label, to: RoutePath }`), `pricing`, `testimonials`, `contact`, `instagram`
|
||||||
|
### LinkTarget / InlineLink / RichText
|
||||||
|
- **Fields**: `{ to: RoutePath; hash? }`; `InlineLink` adds `text`; `RichText = (string | InlineLink)[]`
|
||||||
|
### AboutPageContent
|
||||||
|
- **Fields**: `head`, `intro` (eyebrow, title, `paragraphs: RichText[]`, image), `background`, `photos`, `personal`, `booking` (label + LinkTarget), `person` (name, jobTitle, knowsAbout)
|
||||||
|
### PricingPackage / Testimonial
|
||||||
|
- **Fields**: `id`, `name`, `price`, `features[]` / `id`, `shoot`, `quote`, `author`, `image`
|
||||||
### SocialLink
|
### SocialLink
|
||||||
- **Fields**: `platform: SocialPlatform` (`facebook` | `instagram`), `href: string`
|
- **Fields**: `platform: SocialPlatform` (`facebook` | `instagram`), `href: string`
|
||||||
- **Validation**: shown only if `href` is a valid https URL
|
- **Validation**: shown only if `href` is a valid https URL
|
||||||
|
|||||||
@@ -15,10 +15,14 @@ graph TD
|
|||||||
Shell --> Footer["Footer (FooterColumn, FooterLink)"]
|
Shell --> Footer["Footer (FooterColumn, FooterLink)"]
|
||||||
Shell --> ToTop["BackToTop"]
|
Shell --> ToTop["BackToTop"]
|
||||||
Shell --> Umami["UmamiAnalytics"]
|
Shell --> Umami["UmamiAnalytics"]
|
||||||
Outlet --> Home["routes/index.tsx: Hero"]
|
Outlet --> Home["routes/index.tsx: Hero + six sections"]
|
||||||
Outlet --> Placeholders["over-mij, portfolio, soorten-fotoshoots, contact, privacyverklaring: PageIntro"]
|
Outlet --> About["routes/over-mij.tsx: about page"]
|
||||||
|
Outlet --> Placeholders["portfolio, soorten-fotoshoots, contact, privacyverklaring: PageIntro"]
|
||||||
Home --> Hero["Hero (HeroArrows, HeroPauseButton, HeroSocials, useHeroSlider)"]
|
Home --> Hero["Hero (HeroArrows, HeroPauseButton, HeroSocials, useHeroSlider)"]
|
||||||
Content["content/: siteContent, heroContent, types"] -.-> Shell
|
Home --> Sections["components/home/: IntroGallery, AboutBlock, Pricing, Testimonials, ContactSection, InstagramGrid"]
|
||||||
|
Sections --> Blocks["Shared blocks: PageSection, MediaText, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal"]
|
||||||
|
Sections --> Form["ContactForm + ContactFormGate (lazy), contact/"]
|
||||||
|
Content["content/: siteContent, heroContent, homeContent, packages, testimonials, types"] -.-> Shell
|
||||||
Content -.-> Home
|
Content -.-> Home
|
||||||
Nav --> NavData["navigation.ts: mainNav, footerNav"]
|
Nav --> NavData["navigation.ts: mainNav, footerNav"]
|
||||||
Footer --> NavData
|
Footer --> NavData
|
||||||
@@ -31,11 +35,11 @@ graph TD
|
|||||||
classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||||
class Main,Root entry;
|
class Main,Root entry;
|
||||||
class Shell,Skip,Nav,Footer,ToTop,Umami,Outlet shell;
|
class Shell,Skip,Nav,Footer,ToTop,Umami,Outlet shell;
|
||||||
class Home,Placeholders,Hero page;
|
class Home,About,Placeholders,Hero,Sections,Form page;
|
||||||
class Content,NavData,Seo,Theme support;
|
class Content,NavData,Seo,Theme,Blocks support;
|
||||||
```
|
```
|
||||||
|
|
||||||
Text alternative: main.tsx starts Sentry and mounts the router; the root route renders AppShell (skip link, NavigationBar, the page via Outlet, Footer, BackToTop, Umami); the home route renders the Hero, the other routes render placeholder PageIntros; content, navigation, SEO and theme modules support all of it.
|
Text alternative: main.tsx starts Sentry and mounts the router; the root route renders AppShell (skip link, NavigationBar, the page via Outlet, Footer, BackToTop, Umami); the home route renders the Hero and six sections built from shared blocks (one of them lazily loads the contact form); the about route renders the Over mij page; the other routes render placeholder PageIntros; content, navigation, SEO and theme modules support all of it.
|
||||||
|
|
||||||
## Component Descriptions
|
## Component Descriptions
|
||||||
### main.tsx
|
### main.tsx
|
||||||
@@ -68,21 +72,41 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r
|
|||||||
- **Responsibilities**: Crossfade slides, progress-driven autoplay, arrows, swipe, pause button, pause on hover/focus/hidden tab, reduced motion, live-region announcements, lazy loading of nearby slides, social icons
|
- **Responsibilities**: Crossfade slides, progress-driven autoplay, arrows, swipe, pause button, pause on hover/focus/hidden tab, reduced motion, live-region announcements, lazy loading of nearby slides, social icons
|
||||||
- **Type**: Application
|
- **Type**: Application
|
||||||
|
|
||||||
|
### components/home/ (homepage sections)
|
||||||
|
- **Purpose**: The six homepage blocks below the hero, in LAYOUT.md order
|
||||||
|
- **Responsibilities**: `IntroGallery` (four photos, swipeable row on phones), `AboutBlock` (framed photo of Andrea + intro + link to `/over-mij`), `Pricing` + `PriceCard` (packages with "Boek" links → `/?pakket=…#contact`), `Testimonials` (+ `TestimonialCarousel`, `TestimonialSlide`), `ContactSection` (lazy `ContactForm` behind `ContactFormGate`, mailto fallback), `InstagramGrid` (fixed tiles linking to the profile)
|
||||||
|
- **Type**: Application
|
||||||
|
|
||||||
|
### Shared section building blocks
|
||||||
|
- **Purpose**: Reusable pieces extracted during homepage-sections; `HomeSection` was renamed to `PageSection` and `MediaText`/`Eyebrow` were extracted in over-mij-page
|
||||||
|
- **Responsibilities**: `PageSection` (section frame: `aria-labelledby`, tone `paper`/`alt`, width `default`/`narrow`/`full`, spacing `default`/`tight`/`flushTop`, anchor offset), `MediaText` (framed photo next to a text column, design `.about`), `Eyebrow` (accent label, optionally a heading), `SectionHeading` (eyebrow + h2 + lead, align start/center, compact spacing), `FramedImage` (photo with sand-coloured offset block, design `.about__media`), `DeferredImage` (loads after page load and near the viewport, reserves space), `Reveal` (fade-in on scroll, content always in the DOM, reduced motion respected)
|
||||||
|
- **Type**: Application (shared UI)
|
||||||
|
|
||||||
### components/PageIntro/, StatusPage/
|
### components/PageIntro/, StatusPage/
|
||||||
- **Purpose**: Shared page building blocks
|
- **Purpose**: Shared page building blocks
|
||||||
- **Responsibilities**: `PageIntro` — eyebrow, the page's h1 and an intro (used by placeholders); `StatusPage` — layout for 404 and error pages
|
- **Responsibilities**: `PageIntro` — eyebrow, the page's h1 and an intro (used by placeholders; design `.page-head`); `StatusPage` — layout for 404 and error pages
|
||||||
|
- **Type**: Application
|
||||||
|
|
||||||
|
### components/ContactForm/ + contact/
|
||||||
|
- **Purpose**: Contact form, built ahead of the API
|
||||||
|
- **Responsibilities**: `ContactForm` (fields, validation, honeypot + minimum fill time, reducer-driven status), `ContactFormGate` (dims the form under a "coming soon" notice while `siteContent.contactForm.enabled` is false); `contact/submitContactForm.ts` (placeholder submit), `contact/types.ts` (fields, limits, payload)
|
||||||
- **Type**: Application
|
- **Type**: Application
|
||||||
|
|
||||||
### content/
|
### content/
|
||||||
- **Purpose**: Static content until the CMS API exists
|
- **Purpose**: Static content until the CMS API exists
|
||||||
- **Responsibilities**: `types.ts` (API-shaped interfaces), `siteContent.ts` (footer intro, socials, e-mail parts), `heroContent.ts` (title, tagline, CTA, slides), `socialPlatforms.ts` (platform → name + offline icon)
|
- **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)
|
- **Type**: Application (data)
|
||||||
|
|
||||||
### lib/
|
### lib/
|
||||||
- **Purpose**: Pure, fully tested helpers
|
- **Purpose**: Pure, fully tested helpers
|
||||||
- **Responsibilities**: `emailAddress`, `visibleSocials`, `copyrightLine`, `slidesToLoad`, `backToTopThreshold`
|
- **Responsibilities**: `emailAddress`, `visibleSocials`, `copyrightLine`, `slidesToLoad`, `backToTopThreshold`, `slideLabel`, `formatPrice`, `bookLabel`, `visiblePackages`, `visibleTestimonials`, `packageFromSearch`, `shootOptions`, `mailLink`, `validateContact`, `isLikelySpam`, `toContactPayload`, `contactFormReducer`
|
||||||
- **Type**: Application (utility, 100% coverage threshold)
|
- **Type**: Application (utility, 100% coverage threshold)
|
||||||
|
|
||||||
|
### hooks/
|
||||||
|
- **Purpose**: Shared behaviour
|
||||||
|
- **Responsibilities**: `useRouteFocus`, `useScrolledPast`, `useInView` (IntersectionObserver), `usePageLoaded` (after the load event), `useReveal` (reveal once, immediately with reduced motion)
|
||||||
|
- **Type**: Application
|
||||||
|
|
||||||
### seo.ts, sitePages.ts, sitemap.ts
|
### seo.ts, sitePages.ts, sitemap.ts
|
||||||
- **Purpose**: SEO
|
- **Purpose**: SEO
|
||||||
- **Responsibilities**: Page registry (title, description, `indexed`), `pageHead(path)`, canonical URLs, JSON-LD, sitemap generation at build time (via `config/sitemapPlugin.ts`)
|
- **Responsibilities**: Page registry (title, description, `indexed`), `pageHead(path)`, canonical URLs, JSON-LD, sitemap generation at build time (via `config/sitemapPlugin.ts`)
|
||||||
@@ -100,7 +124,7 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r
|
|||||||
|
|
||||||
### theme.ts / recipes/
|
### theme.ts / recipes/
|
||||||
- **Purpose**: Design system
|
- **Purpose**: Design system
|
||||||
- **Responsibilities**: Colour, font, spacing, easing, duration, z-index tokens; semantic `bg`/`fg`/`focusRing`, `header`/`content`/`pageTop` sizes; `eyebrow`/`display`/`pageTitle` text styles; recipes `container`, `link` (subtle), `linkButton` (outline/accent/light), `iconControl`, `skipNavLink`
|
- **Responsibilities**: Colour (paper/ink/accent/sand/line/error), font, spacing (`gutter`, `sectionY`, `sectionYTight`, `sectionHeadGap`, `gridGap`), easing, duration (`interaction`, `fade`, `reveal`), z-index, shadow, gradient tokens; semantic `bg`/`fg`/`focusRing`, `header`/`content`/`contentNarrow` sizes, `header`/`pageTop` spacing; text styles `eyebrow`/`display`/`sectionTitle`/`lead`/`pageTitle`; recipes `container`, `link` (subtle/underline), `linkButton` (outline/accent/light, size default/fit), `iconControl`, `carouselControl`, `formControl`, `skipNavLink`
|
||||||
- **Type**: Application (shared UI foundation)
|
- **Type**: Application (shared UI foundation)
|
||||||
|
|
||||||
## Data Flow
|
## Data Flow
|
||||||
@@ -125,7 +149,7 @@ sequenceDiagram
|
|||||||
Text alternative: a visitor navigates, the router renders the root layout (AppShell), which renders the matched page through the Outlet; the page's head() supplies title/meta from the page registry and focus moves to main.
|
Text alternative: a visitor navigates, the router renders the root layout (AppShell), which renders the matched page through the Outlet; the page's head() supplies title/meta from the page registry and focus moves to main.
|
||||||
|
|
||||||
## Integration Points
|
## Integration Points
|
||||||
- **External APIs**: None yet (planned .NET API for content and the contact form — design README: `POST /api/contact` with `{ naam, email, onderwerp, bericht }`)
|
- **External APIs**: None yet (planned .NET API for content and the contact form; the form already sends `{ naam, email, shoot, bericht }` to a placeholder `submitContactForm` and stays gated off until the API exists)
|
||||||
- **Databases**: None
|
- **Databases**: None
|
||||||
- **Third-party Services**: Sentry (errors, EU ingest), Umami at analytics.slpsoftware.nl (cookieless stats), UptimeRobot (availability, external), outbound links to Facebook/Instagram
|
- **Third-party Services**: Sentry (errors, EU ingest), Umami at analytics.slpsoftware.nl (cookieless stats), UptimeRobot (availability, external), outbound links to Facebook/Instagram
|
||||||
|
|
||||||
|
|||||||
@@ -27,14 +27,17 @@ Text alternative: visitors and crawlers use the website, which links out to soci
|
|||||||
## Business Description
|
## Business Description
|
||||||
- **Business Description**: Portfolio and marketing website for Andrea Slop Fotografie, a lifestyle photographer in Huizen (NL). It presents her work (loveshoots, family, pregnancy and newborn shoots), tells who she is, lists shoot types and prices, and gets prospective clients to make contact. It will replace the existing WordPress (Solene theme) site at andreaslop.nl; a test build runs at test.andreaslop.nl.
|
- **Business Description**: Portfolio and marketing website for Andrea Slop Fotografie, a lifestyle photographer in Huizen (NL). It presents her work (loveshoots, family, pregnancy and newborn shoots), tells who she is, lists shoot types and prices, and gets prospective clients to make contact. It will replace the existing WordPress (Solene theme) site at andreaslop.nl; a test build runs at test.andreaslop.nl.
|
||||||
- **Business Transactions** (current state — front-end only, no back-end):
|
- **Business Transactions** (current state — front-end only, no back-end):
|
||||||
- **Browse the homepage** — hero slider with featured photos (autoplay, arrows, swipe, pause button, screen reader announcements), call-to-action to "Over mij"
|
- **Browse the homepage** — hero slider with featured photos (autoplay, arrows, swipe, pause button, screen reader announcements), call-to-action to "Over mij"; below it Lifestyle fotografie (photo gallery), Over mij (intro + "Lees mijn verhaal" → `/over-mij`), Prijzen (packages), Lieve woorden (testimonials carousel), Contact and Instagram
|
||||||
|
- **Choose a package** — "Boek" on a price card scrolls to Contact with that shoot preselected (`?pakket=`)
|
||||||
|
- **Contact the photographer** — contact form (validation, anti-spam) shown dimmed under a "coming soon" notice until the API exists; mailto fallback with a subject
|
||||||
- **Navigate between pages** — header navigation (desktop), full-screen menu (mobile), footer menu, skip link, back-to-top button
|
- **Navigate between pages** — header navigation (desktop), full-screen menu (mobile), footer menu, skip link, back-to-top button
|
||||||
- **Visit social profiles** — Facebook / Instagram links in the hero and footer
|
- **Visit social profiles** — Facebook / Instagram links in the hero and footer
|
||||||
- **E-mail the photographer** — mailto link in the footer
|
- **E-mail the photographer** — mailto link in the footer
|
||||||
- **Share / discover pages** — per-page title, description, canonical URL, Open Graph tags, JSON-LD (ProfessionalService), sitemap.xml, robots.txt
|
- **Share / discover pages** — per-page title, description, canonical URL, Open Graph tags, JSON-LD (ProfessionalService), sitemap.xml, robots.txt
|
||||||
- **Recover from errors** — 404 page inside the shell, error page with retry
|
- **Recover from errors** — 404 page inside the shell, error page with retry
|
||||||
- *Placeholder pages (noindex)*: Over mij, Portfolio, Soorten fotoshoots, Contact, Privacyverklaring
|
- **Read about the photographer** — Over mij page: introduction with portrait, how it started, two photos, life outside photography, links to the portfolio and contact, "Boek je shoot"
|
||||||
- *Planned (static design only)*: homepage sections below the hero (lifestyle gallery, about, prices, contact form, Instagram), portfolio with lightbox, shoot types and pricing page, contact page
|
- *Placeholder pages (noindex)*: Portfolio, Soorten fotoshoots, Contact, Privacyverklaring
|
||||||
|
- *Planned (static design only)*: portfolio with lightbox, shoot types and pricing page, contact page
|
||||||
- **Business Dictionary**:
|
- **Business Dictionary**:
|
||||||
- **Shell** — the Header / page content / Footer frame shared by every page (see LAYOUT.md)
|
- **Shell** — the Header / page content / Footer frame shared by every page (see LAYOUT.md)
|
||||||
- **Hero** — full-screen photo slider at the top of the homepage
|
- **Hero** — full-screen photo slider at the top of the homepage
|
||||||
@@ -48,7 +51,7 @@ Text alternative: visitors and crawlers use the website, which links out to soci
|
|||||||
## Component Level Business Descriptions
|
## Component Level Business Descriptions
|
||||||
### web (React front-end)
|
### web (React front-end)
|
||||||
- **Purpose**: The public website visitors see
|
- **Purpose**: The public website visitors see
|
||||||
- **Responsibilities**: Page routing, layout shell, homepage hero, SEO, monitoring, design system, server configuration for test (nginx) and production (IIS)
|
- **Responsibilities**: Page routing, layout shell, homepage (hero + six sections, contact form behind a gate), SEO, monitoring, design system, server configuration for test (nginx) and production (IIS)
|
||||||
|
|
||||||
### .gitea/workflows (CI/CD)
|
### .gitea/workflows (CI/CD)
|
||||||
- **Purpose**: Quality gate and delivery
|
- **Purpose**: Quality gate and delivery
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
## Test Coverage
|
## Test Coverage
|
||||||
- **Overall**: Good. Vitest with v8 coverage; 100% threshold enforced for `src/lib/**`, `src/seo.ts`, `src/sitemap.ts`; other files reported
|
- **Overall**: Good. Vitest with v8 coverage; 100% threshold enforced for `src/lib/**`, `src/seo.ts`, `src/sitemap.ts`; other files reported
|
||||||
- **Unit Tests**: Pure helpers, SEO, sitemap, monitoring config, security headers, server config (incl. drift check against `deploy/`)
|
- **Unit Tests**: Pure helpers, SEO, sitemap, monitoring config, security headers, server config (incl. drift check against `deploy/`)
|
||||||
- **Component Tests**: AppShell, NavigationBar, Footer, Hero (+ slider hook), BackToTop, PageIntro, StatusPage, Umami — with axe accessibility checks
|
- **Component Tests**: AppShell, NavigationBar, Footer, Hero (+ slider hook), BackToTop, PageIntro, StatusPage, Umami, all home sections, PageSection, MediaText, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal, ContactForm(+Gate) — with axe accessibility checks; `app.test.tsx` renders whole routes
|
||||||
- **Property-based Tests**: fast-check, shared arbitraries in `src/test/arbitraries.ts`, seed logged in CI
|
- **Property-based Tests**: fast-check, shared arbitraries in `src/test/arbitraries.ts`, seed logged in CI
|
||||||
- **Integration / E2E**: No browser E2E; Lighthouse CI covers built pages (accessibility, best practices, SEO, performance)
|
- **Integration / E2E**: No browser E2E; Lighthouse CI covers built pages (accessibility, best practices, SEO, performance)
|
||||||
|
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
|
|
||||||
## Technical Debt
|
## Technical Debt
|
||||||
- Homepage mobile Lighthouse performance target is lowered to 0.8 (images not responsive, title after JavaScript); back to 0.9 is planned with responsive images from the API and prerendering
|
- Homepage mobile Lighthouse performance target is lowered to 0.8 (images not responsive, title after JavaScript); back to 0.9 is planned with responsive images from the API and prerendering
|
||||||
- Five routes are placeholders (`noindex`); `lighthouserc.cjs` keeps its own list of indexed/noindex paths, guarded by a test against `sitePages.ts`
|
- Four routes are placeholders (`noindex`); `lighthouserc.cjs` keeps its own list of indexed/noindex paths, guarded by a test against `sitePages.ts`
|
||||||
- Static design images for the homepage sections (intro gallery, about photo, pricing decorations) are not yet in `web/src/assets`
|
- No responsive image pipeline (srcset/sizes); photos are single JPEGs
|
||||||
- No responsive image pipeline (srcset/sizes); hero photos are single large JPEGs
|
- Comment language is mixed: older code is commented in Dutch, homepage-sections code in English
|
||||||
|
|
||||||
## Patterns and Anti-patterns
|
## Patterns and Anti-patterns
|
||||||
- **Good Patterns**: API-shaped content; pure, property-tested helpers; tokens and recipes as single source of truth; configuration as code for headers; strong accessibility baseline (axe in tests, Lighthouse accessibility 1.0)
|
- **Good Patterns**: API-shaped content; pure, property-tested helpers; tokens and recipes as single source of truth; configuration as code for headers; strong accessibility baseline (axe in tests, Lighthouse accessibility 1.0)
|
||||||
|
|||||||
@@ -31,45 +31,64 @@ graph TD
|
|||||||
Hero --> useHeroSlider["Hero/useHeroSlider.ts"]
|
Hero --> useHeroSlider["Hero/useHeroSlider.ts"]
|
||||||
Hero --> LinkButton["components/LinkButton.tsx"]
|
Hero --> LinkButton["components/LinkButton.tsx"]
|
||||||
LinkButton --> RouterLink["components/RouterLink.tsx"]
|
LinkButton --> RouterLink["components/RouterLink.tsx"]
|
||||||
Placeholder["routes/contact.tsx and other placeholders"] --> PageIntro["PageIntro/PageIntro.tsx"]
|
Index --> HomeParts["home/*: IntroGallery, AboutBlock, Pricing, Testimonials, ContactSection, InstagramGrid"]
|
||||||
|
HomeParts --> PageSection["PageSection/PageSection.tsx"]
|
||||||
|
HomeParts --> SectionHeading["SectionHeading/SectionHeading.tsx"]
|
||||||
|
HomeParts --> Reveal["Reveal/Reveal.tsx"]
|
||||||
|
HomeParts --> FramedImage["FramedImage/FramedImage.tsx"]
|
||||||
|
FramedImage --> DeferredImage["DeferredImage/DeferredImage.tsx"]
|
||||||
|
HomeParts --> DeferredImage
|
||||||
|
Placeholder["routes/over-mij.tsx and other placeholders"] --> PageIntro["PageIntro/PageIntro.tsx"]
|
||||||
classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||||
classDef page fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
classDef page fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||||
classDef util fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
classDef util fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||||
class Root,AppShell,NavigationBar,Footer,BackToTop,Umami,NavLink,MobileNav shell;
|
class Root,AppShell,NavigationBar,Footer,BackToTop,Umami,NavLink,MobileNav shell;
|
||||||
class Index,Hero,HeroArrows,HeroPause,HeroSocials,Placeholder,PageIntro page;
|
class Index,Hero,HeroArrows,HeroPause,HeroSocials,Placeholder,PageIntro,HomeParts page;
|
||||||
class navigation,useHeroSlider,LinkButton,RouterLink util;
|
class navigation,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 with its sub-components and LinkButton; placeholder routes render PageIntro.
|
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.
|
||||||
|
|
||||||
### Existing Files Inventory
|
### Existing Files Inventory
|
||||||
Candidates for modification are marked with ★ for the homepage-sections feature.
|
Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||||
- `web/index.html` — HTML entry; static fallback head for non-JS crawlers
|
- `web/index.html` — HTML entry; static fallback head for non-JS crawlers
|
||||||
- `web/src/main.tsx` — bootstrap
|
- `web/src/main.tsx` — bootstrap
|
||||||
- `web/src/routeTree.gen.ts` — generated (do not edit)
|
- `web/src/routeTree.gen.ts` — generated (do not edit)
|
||||||
- `web/src/routes/__root.tsx` — root layout, site head, 404/error
|
- `web/src/routes/__root.tsx` — root layout, site head, 404/error
|
||||||
- ★ `web/src/routes/index.tsx` — home (`/`), currently only the Hero
|
- `web/src/routes/index.tsx` — home (`/`): Hero + six sections, `?pakket=` search param
|
||||||
- `web/src/routes/{over-mij,portfolio,soorten-fotoshoots,contact,privacyverklaring}.tsx` — placeholders with `PageIntro`
|
- `web/src/routes/over-mij.tsx` — the about page (indexed; `AboutPage` JSON-LD)
|
||||||
|
- `web/src/components/about/*` — `AboutIntro`, `StorySection`, `RichParagraph`
|
||||||
|
- `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/{portfolio,soorten-fotoshoots,contact,privacyverklaring}.tsx` — placeholders with `PageIntro`
|
||||||
- `web/src/components/AppShell.tsx` — shell
|
- `web/src/components/AppShell.tsx` — shell
|
||||||
- `web/src/components/NavigationBar/*` — header, NavLink, MobileNav
|
- `web/src/components/NavigationBar/*` — header, NavLink, MobileNav
|
||||||
- `web/src/components/Footer/*` — footer, FooterColumn, FooterLink
|
- `web/src/components/Footer/*` — footer, FooterColumn, FooterLink
|
||||||
- `web/src/components/Hero/*` — hero slider, arrows, pause button, socials, slider hook
|
- `web/src/components/Hero/*` — hero slider, arrows, pause button, socials, slider hook
|
||||||
|
- `web/src/components/home/*` — the six homepage sections (AboutBlock is the closest relative of the Over mij page's first block)
|
||||||
|
- ★ `web/src/components/PageSection/PageSection.tsx` — section frame for any page (was `HomeSection`)
|
||||||
|
- ★ `web/src/components/MediaText/MediaText.tsx`, `Eyebrow/Eyebrow.tsx` — framed photo next to text; accent label
|
||||||
|
- ★ `web/src/components/SectionHeading/SectionHeading.tsx` — eyebrow + h2 + lead
|
||||||
|
- ★ `web/src/components/FramedImage/FramedImage.tsx`, `DeferredImage/DeferredImage.tsx`, `Reveal/Reveal.tsx` — photo blocks and fade-in
|
||||||
|
- `web/src/components/ContactForm/*` — contact form and gate
|
||||||
- `web/src/components/BackToTop/BackToTop.tsx` — back-to-top button
|
- `web/src/components/BackToTop/BackToTop.tsx` — back-to-top button
|
||||||
- `web/src/components/Analytics/UmamiAnalytics.tsx` — Umami script injection
|
- `web/src/components/Analytics/UmamiAnalytics.tsx` — Umami script injection
|
||||||
- `web/src/components/PageIntro/PageIntro.tsx` — page head block (eyebrow, h1, intro)
|
- ★ `web/src/components/PageIntro/PageIntro.tsx` — page head block (eyebrow, h1, intro)
|
||||||
- `web/src/components/StatusPage/*` — StatusPage layout, NotFound, ErrorPage
|
- `web/src/components/StatusPage/*` — StatusPage layout, NotFound, ErrorPage
|
||||||
- `web/src/components/LinkButton.tsx`, `RouterLink.tsx` — router links (button style / Chakra-wrapped)
|
- ★ `web/src/components/LinkButton.tsx`, `RouterLink.tsx` — router links (button style / Chakra-wrapped)
|
||||||
- ★ `web/src/content/types.ts` — content interfaces (API shape)
|
- ★ `web/src/content/types.ts` — content interfaces (API shape)
|
||||||
- ★ `web/src/content/siteContent.ts`, `heroContent.ts`, `socialPlatforms.ts` — static content
|
- ★ `web/src/content/*.ts` — static content (`siteContent`, `heroContent`, `homeContent`, `packages`, `testimonials`, `socialPlatforms`)
|
||||||
- `web/src/hooks/useRouteFocus.ts`, `useScrolledPast.tsx`
|
- `web/src/contact/*` — contact form types and placeholder submit
|
||||||
|
- `web/src/hooks/*` — `useRouteFocus`, `useScrolledPast`, `useInView`, `usePageLoaded`, `useReveal`
|
||||||
- `web/src/lib/*.ts` — pure helpers with tests
|
- `web/src/lib/*.ts` — pure helpers with tests
|
||||||
- `web/src/monitoring/*` — Sentry/Umami config and loader
|
- `web/src/monitoring/*` — Sentry/Umami config and loader
|
||||||
- `web/src/navigation.ts` — `RoutePath`, `mainNav`, `footerNav`
|
- `web/src/navigation.ts` — `RoutePath`, `mainNav`, `footerNav`
|
||||||
- ★ `web/src/seo.ts`, `sitePages.ts`, `sitemap.ts` — SEO (home description may change)
|
- ★ `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/theme.ts`, `web/src/recipes/*.ts` — design system
|
||||||
- `web/src/test/*` — `renderWithProviders`, axe matcher, fast-check arbitraries, setup
|
- `web/src/test/*` — `renderWithProviders`, axe matcher, fast-check arbitraries, `fakeIntersectionObserver`, setup
|
||||||
- `web/src/assets/*` — hero photos (8), light/dark logos
|
- `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 (only if the contact form posts to a third party)
|
- `web/config/securityHeaders.ts` — CSP
|
||||||
- `web/config/serverConfig.ts`, `writeServerConfig.ts`, `sitemapPlugin.ts`, `testSeed.ts`
|
- `web/config/serverConfig.ts`, `writeServerConfig.ts`, `sitemapPlugin.ts`, `testSeed.ts`
|
||||||
- `web/deploy/iis/web.config`, `web/deploy/nginx/*.conf` — generated server configs
|
- `web/deploy/iis/web.config`, `web/deploy/nginx/*.conf` — generated server configs
|
||||||
- `web/public/*` — favicon, logo, og-image, robots.txt, icons.svg
|
- `web/public/*` — favicon, logo, og-image, robots.txt, icons.svg
|
||||||
@@ -90,6 +109,15 @@ Candidates for modification are marked with ★ for the homepage-sections featur
|
|||||||
- **Purpose**: Single source for colours, fonts, spacing, motion; reusable component variants
|
- **Purpose**: Single source for colours, fonts, spacing, motion; reusable component variants
|
||||||
- **Implementation**: `defineConfig` tokens/semanticTokens/textStyles, `defineRecipe` + `useRecipe`
|
- **Implementation**: `defineConfig` tokens/semanticTokens/textStyles, `defineRecipe` + `useRecipe`
|
||||||
|
|
||||||
|
### Section composition
|
||||||
|
- **Location**: `components/home/*` on top of `PageSection`, `MediaText`, `SectionHeading`, `Reveal`, `FramedImage`, `DeferredImage`
|
||||||
|
- **Purpose**: Each section is a thin component that gets its content as a prop and composes the shared blocks; the h2 id links the section landmark (`aria-labelledby`)
|
||||||
|
- **Implementation**: One `TITLE_ID` constant per section; `data-testid` on the section root; validity filters in `lib/` (e.g. `visiblePackages`) decide what is rendered
|
||||||
|
|
||||||
|
### Deferred below-the-fold images
|
||||||
|
- **Location**: `DeferredImage`, `usePageLoaded`, `useInView`
|
||||||
|
- **Purpose**: Protect the largest contentful paint; photos load only after the load event and near the viewport, with intrinsic width/height reserving space
|
||||||
|
|
||||||
### Page registry
|
### Page registry
|
||||||
- **Location**: `sitePages.ts`, typed by `RoutePath`
|
- **Location**: `sitePages.ts`, typed by `RoutePath`
|
||||||
- **Purpose**: One source for head tags and the sitemap; `indexed: false` for placeholders
|
- **Purpose**: One source for head tags and the sitemap; `indexed: false` for placeholders
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
- `web/config/` + `web/deploy/` — security headers and generated nginx (test) / IIS (production) configuration
|
- `web/config/` + `web/deploy/` — security headers and generated nginx (test) / IIS (production) configuration
|
||||||
|
|
||||||
## Shared Packages
|
## Shared Packages
|
||||||
- None as separate packages. Inside `web`: `theme.ts`, `recipes/`, `content/`, `lib/`, `seo.ts`, `navigation.ts`, `hooks/`, `components/LinkButton.tsx`, `components/RouterLink.tsx`, `components/PageIntro/`
|
- None as separate packages. Inside `web`: `theme.ts`, `recipes/`, `content/`, `lib/`, `seo.ts`, `navigation.ts`, `hooks/`, `components/LinkButton.tsx`, `components/RouterLink.tsx`, `components/PageIntro/`, and the section blocks `PageSection`, `MediaText`, `Eyebrow`, `SectionHeading`, `FramedImage`, `DeferredImage`, `Reveal`
|
||||||
|
|
||||||
## Test Packages
|
## Test Packages
|
||||||
- None as separate packages. Tests are co-located (`*.test.ts(x)`) and run with Vitest (unit, component, property-based with fast-check, accessibility with axe-core); Lighthouse CI for quality budgets
|
- None as separate packages. Tests are co-located (`*.test.ts(x)`) and run with Vitest (unit, component, property-based with fast-check, accessibility with axe-core); Lighthouse CI for quality budgets
|
||||||
|
|||||||
@@ -14,17 +14,18 @@ graph LR
|
|||||||
components --> hooks["hooks/*"]
|
components --> hooks["hooks/*"]
|
||||||
components --> navigation["navigation.ts"]
|
components --> navigation["navigation.ts"]
|
||||||
components --> assets["assets/*"]
|
components --> assets["assets/*"]
|
||||||
|
components --> contact["contact/*"]
|
||||||
config["config/* (Node, build time)"] --> monitoring
|
config["config/* (Node, build time)"] --> monitoring
|
||||||
config --> seo
|
config --> seo
|
||||||
classDef app fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
classDef app fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||||
classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||||
classDef build fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
classDef build fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
||||||
class main,routes,components app;
|
class main,routes,components app;
|
||||||
class theme,monitoring,content,seo,lib,hooks,navigation,assets support;
|
class theme,monitoring,content,seo,lib,hooks,navigation,assets,contact support;
|
||||||
class config build;
|
class config build;
|
||||||
```
|
```
|
||||||
|
|
||||||
Text alternative: main depends on theme, routes and monitoring; routes depend on components, content and SEO; components depend on lib, hooks, navigation and assets; build-time config reads monitoring (CSP origins) and SEO (sitemap).
|
Text alternative: main depends on theme, routes and monitoring; routes depend on components, content and SEO; components depend on lib, hooks, navigation, assets and the contact form module; build-time config reads monitoring (CSP origins) and SEO (sitemap).
|
||||||
|
|
||||||
### routes depend on content and components
|
### routes depend on content and components
|
||||||
- **Type**: Compile
|
- **Type**: Compile
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# Reverse Engineering Metadata
|
# Reverse Engineering Metadata
|
||||||
|
|
||||||
**Analysis Date**: 2026-10-19T19:19:38Z (refresh; previous analysis 2026-10-14T09:58:04Z at 8f5841c)
|
**Analysis Date**: 2026-10-22T16:58:52Z (refresh; previous analysis 2026-10-19T19:19:38Z at 38c5c3e)
|
||||||
**Analyzer**: AI-DLC
|
**Analyzer**: AI-DLC
|
||||||
**Workspace**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie
|
**Workspace**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie
|
||||||
**Codebase Commit**: 38c5c3e (branch master)
|
**Codebase Commit**: 99d4610 (branch master)
|
||||||
**Total Files Analyzed**: ~95 (web/src, web/config, web/deploy, web config files, CI workflow, design/andreaslop-static pages and README)
|
**Total Files Analyzed**: ~95 changed files since the previous analysis (homepage sections, shared section blocks, contact form, lib helpers, hooks, recipes, theme) plus design/andreaslop-static/over-mij.html
|
||||||
**Refreshed for**: feature homepage-sections
|
**Refreshed for**: feature over-mij-page
|
||||||
|
|
||||||
## Artifacts Generated
|
## Artifacts Generated
|
||||||
- [x] business-overview.md
|
- [x] business-overview.md
|
||||||
@@ -13,6 +13,6 @@
|
|||||||
- [x] code-structure.md
|
- [x] code-structure.md
|
||||||
- [x] api-documentation.md
|
- [x] api-documentation.md
|
||||||
- [x] component-inventory.md
|
- [x] component-inventory.md
|
||||||
- [x] technology-stack.md
|
- [x] technology-stack.md (unchanged: no dependency changes since 38c5c3e)
|
||||||
- [x] dependencies.md
|
- [x] dependencies.md
|
||||||
- [x] code-quality-assessment.md
|
- [x] code-quality-assessment.md
|
||||||
|
|||||||
@@ -5,3 +5,4 @@
|
|||||||
| Bug | [hero-carousel-announce-and-pause](bugs/hero-carousel-announce-and-pause/bug-fix.md) | ✅ Complete | fix/hero-carousel-announce-and-pause | web/src/components/Hero (Hero, HeroArrows, useHeroSlider) | 2026-10-19 |
|
| Bug | [hero-carousel-announce-and-pause](bugs/hero-carousel-announce-and-pause/bug-fix.md) | ✅ Complete | fix/hero-carousel-announce-and-pause | web/src/components/Hero (Hero, HeroArrows, useHeroSlider) | 2026-10-19 |
|
||||||
| Feature | frontend-shell | ✅ Complete | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 |
|
| Feature | frontend-shell | ✅ Complete | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 |
|
||||||
| Feature | homepage-sections | ✅ Complete | feature/homepage-sections | web/src/routes/index.tsx, new homepage section components, web/src/content (types + static content), possibly web/config/securityHeaders.ts (contact form) | 2026-10-19 |
|
| Feature | homepage-sections | ✅ Complete | feature/homepage-sections | web/src/routes/index.tsx, new homepage section components, web/src/content (types + static content), possibly web/config/securityHeaders.ts (contact form) | 2026-10-19 |
|
||||||
|
| Feature | over-mij-page | ✅ Complete | feature/over-mij-page | web/src/routes/over-mij.tsx, web/src/content, possibly shared components (PageIntro, FramedImage, SectionHeading) and web/src/seo.ts | 2026-10-22 |
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
# AI-DLC State Tracking
|
||||||
|
|
||||||
|
## Project Information
|
||||||
|
- **Feature Name**: Over mij page (`/over-mij`)
|
||||||
|
- **Feature Slug**: over-mij-page
|
||||||
|
- **Project Type**: Brownfield
|
||||||
|
- **Start Date**: 2026-10-22T16:58:52Z
|
||||||
|
- **Current Stage**: Complete
|
||||||
|
- **Branch**: feature/over-mij-page
|
||||||
|
|
||||||
|
## Workspace State
|
||||||
|
- **Existing Code**: Yes
|
||||||
|
- **Programming Languages**: TypeScript (React/TSX)
|
||||||
|
- **Build System**: pnpm + Vite (`tsc && vite build`), Gitea Actions CI
|
||||||
|
- **Project Structure**: Single front-end SPA in `web/`; static HTML design reference in `design/andreaslop-static/`; `api/` folder present but empty (.NET back-end planned)
|
||||||
|
- **Reverse Engineering Needed**: Yes (refresh — artifacts stale since commit 38c5c3e)
|
||||||
|
- **Workspace Root**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie
|
||||||
|
|
||||||
|
## Code Location Rules
|
||||||
|
- **Application Code**: Workspace root (NEVER in aidlc-docs/) — front-end lives in `web/`
|
||||||
|
- **Feature Documentation**: aidlc-docs/features/over-mij-page/ only
|
||||||
|
- **Shared Artifacts**: aidlc-docs/_shared/
|
||||||
|
- **Structure patterns**: See code-generation.md Critical Rules
|
||||||
|
|
||||||
|
## Language Configuration
|
||||||
|
- **Documentation Language**: English
|
||||||
|
- **Conversation Language**: User Language (Dutch)
|
||||||
|
- **Source**: inherited from aidlc-docs/language-preference.md (answer A); user may override
|
||||||
|
|
||||||
|
## Extension Configuration
|
||||||
|
| Extension | Enabled | Decided At |
|
||||||
|
|---|---|---|
|
||||||
|
| Security Baseline | Yes | Requirements Analysis |
|
||||||
|
| Property-Based Testing | Yes (full enforcement) | Requirements Analysis |
|
||||||
|
|
||||||
|
## Operations Configuration
|
||||||
|
- **Include Operations Phase**: No
|
||||||
|
- **Decided At**: Requirements Analysis
|
||||||
|
|
||||||
|
## Execution Plan Summary
|
||||||
|
- **Stages to Execute**: Application Design (minimal), Functional Design (unit 2 only), Code Generation (2 units), Build and Test
|
||||||
|
- **Stages to Skip**: User Stories (single persona, concrete FRs), Units Generation (split fixed in the execution plan), Functional Design for unit 1 (behaviour-preserving refactor), NFR Requirements and NFR Design (NFRs set at requirements level, no new patterns), Infrastructure Design (static assets only), Operations (decided No)
|
||||||
|
- **Units**: 1 Shared blocks (PageSection rename, shared media+text block) → 2 Over mij page
|
||||||
|
- **Delivery**: branch feature/over-mij-page, commits per unit, full `pnpm check` (incl. Lighthouse) per unit, one PR at the end
|
||||||
|
|
||||||
|
## Stage Progress
|
||||||
|
|
||||||
|
### 🔵 INCEPTION PHASE
|
||||||
|
- [x] Workspace Detection
|
||||||
|
- [x] Reverse Engineering (refresh, approved)
|
||||||
|
- [x] Requirements Analysis (approved)
|
||||||
|
- [x] User Stories - SKIP
|
||||||
|
- [x] Workflow Planning (approved)
|
||||||
|
- [x] Application Design - EXECUTE (approved)
|
||||||
|
- [x] Units Generation - SKIP
|
||||||
|
|
||||||
|
### 🟢 CONSTRUCTION PHASE
|
||||||
|
- [x] Functional Design - EXECUTE (unit 2 ✅) / SKIP (unit 1)
|
||||||
|
- [ ] NFR Requirements - SKIP
|
||||||
|
- [ ] NFR Design - SKIP
|
||||||
|
- [ ] Infrastructure Design - SKIP
|
||||||
|
- [x] Code Generation - EXECUTE (per unit) — Unit 1 Shared blocks ✅, Unit 2 Over mij page ✅ (approved after review on test)
|
||||||
|
- [x] Build and Test - EXECUTE (273 tests, 24/24 browser checks, Lighthouse budgets met)
|
||||||
|
|
||||||
|
### 🟡 OPERATIONS PHASE
|
||||||
|
- [x] Deployment Setup, Monitoring Setup, Production Readiness Validation - SKIP (Operations = No)
|
||||||
|
|
||||||
|
## Current Status
|
||||||
|
- **Lifecycle Phase**: Complete
|
||||||
|
- **Current Stage**: Complete (Build and Test approved 2026-10-24)
|
||||||
|
- **Next Stage**: none — PR to master
|
||||||
|
|
||||||
|
## Reverse Engineering Status
|
||||||
|
- [x] Reverse Engineering - Artifacts refreshed on 2026-10-22T17:10:00Z at commit 99d4610 (approved 2026-10-22T17:19:39Z)
|
||||||
|
- **Artifacts Location**: aidlc-docs/_shared/reverse-engineering/
|
||||||
@@ -0,0 +1,399 @@
|
|||||||
|
# AI-DLC Audit Log — over-mij-page
|
||||||
|
|
||||||
|
## Initial User Request
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T16:58:52Z
|
||||||
|
|
||||||
|
**User Input**: "Ik wil met aidlc de volgende pagina gaan toevoegen aan de front end. De over mij pagina. Denk ook hier weer aan de seo, accessibility en hergebruik van code en styling met bijvoorbeeld chakra en de theme"
|
||||||
|
|
||||||
|
**AI Response**: "Started AI-DLC workflow (existing multi-feature workspace, no welcome message). Began Workspace Detection."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Workspace Detection (start)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Workspace Detection
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T16:58:52Z
|
||||||
|
|
||||||
|
**User Input**: (none — automatic stage)
|
||||||
|
|
||||||
|
**AI Response**: "Feature resolution: all existing items (frontend-shell, homepage-sections, hero-carousel-announce-and-pause) are ✅ Complete and the request is clearly new work, so a new feature was started without a feature-selection prompt. Classification: Feature (new page, no defect). Slug: over-mij-page. Branch feature/over-mij-page created from master (99d4610). Brownfield (React SPA in web/, placeholder route web/src/routes/over-mij.tsx and design reference design/andreaslop-static/over-mij.html exist). Language configuration inherited from aidlc-docs/language-preference.md (answer A: English docs, Dutch conversation), stated to the user for correction instead of re-asking, as in the previous feature. Reverse engineering artifacts in _shared/ are stale: generated at commit 38c5c3e, before homepage-sections landed (95 files changed under web/ and design/ up to 99d4610). Next: refresh Reverse Engineering."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Workspace Detection (complete). Parallel features: none active. Conflicts: none.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Reverse Engineering (refresh)
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T17:10:00Z
|
||||||
|
|
||||||
|
**User Input**: (none — automatic stage)
|
||||||
|
|
||||||
|
**AI Response**: "Refreshed the shared reverse engineering artifacts for commit 99d4610: architecture (home sections, shared section blocks, contact form, hooks, theme tokens/recipes), code structure (new diagram, inventory with ★ candidates for this feature, section composition and deferred image patterns), API documentation (new component props, hooks, helpers, content models), business overview (homepage transactions; Over mij page still planned), dependencies (contact/), code quality (new debt items: HomeSection name, mixed comment language, Over mij images not yet in web/src/assets), timestamp. technology-stack.md unchanged (no dependency changes). Presented completion message and asked for approval."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Reverse Engineering (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Reverse Engineering — Approval
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T17:19:39Z
|
||||||
|
|
||||||
|
**User Input**: "Ga verder"
|
||||||
|
|
||||||
|
**AI Response**: "Reverse Engineering refresh approved. Started Requirements Analysis."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Reverse Engineering (approved)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Requirements Analysis — Clarifying Questions
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T17:30:00Z
|
||||||
|
|
||||||
|
**User Input**: (none)
|
||||||
|
|
||||||
|
**AI Response**: "Intent: new feature, clear request, single component (web/) plus design/LAYOUT.md, simple-to-moderate complexity; standard depth. Compared the live page andreaslop.nl/over-mij with design/andreaslop-static/over-mij.html (differences in headings, two extra live sentences, the cat remark, the booking button, missing alt texts). Created inception/requirements/requirement-verification-questions.md with 12 content questions (text source, sub-headings, links to placeholder pages, booking button target, indexing, title/description, JSON-LD, OG image, HomeSection rename, shared media+text block, photos/alt texts, LAYOUT.md) plus the Security Baseline, PBT and Operations questions."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Requirements Analysis (awaiting answers)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Requirements Analysis — Answers Received
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T18:05:00Z
|
||||||
|
|
||||||
|
**User Input**: "Ik heb de vragen beantwoord" — answers in requirement-verification-questions.md: Q1 B, Q2 "X, Net als A, maar dan met h3. Het valt uiteindelijk allemaal onder het \"Over mij\" deel wat een H2 is. Dus ik denk dat h3 dan logischer is. in de stijl van het design. Als jij wat anders denkt laat me dat dan weten. Misschien mis ik iets.", Q3 B, Q4 A, Q5 A, Q6 A, Q7 A, Q8 A, Q9 A, Q10 A, Q11 A, Q12 A, Security Baseline A, PBT A, Operations B
|
||||||
|
|
||||||
|
**AI Response**: "All answers consistent except Q2: the rationale assumes 'Over mij' is an h2, but on this page it is the h1 (PageIntro); with h3 the two sections would nest under 'Hoi! Ik ben Andrea' instead of being siblings. The user invited a counter-view, so created requirement-clarification-questions.md with one question (h2 vs h3, both styled as the design's eyebrow)."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Requirements Analysis (awaiting clarification)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Requirements Analysis — Clarification Answer
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T20:57:23Z
|
||||||
|
|
||||||
|
**User Input**: "ik heb de vraag beantwoord" — answer in requirement-clarification-questions.md: "ah ja dat bedoelde ik ook. ze staan onder hoi ik ben andrea en zijn een vervolg op haar verhaal daar. dus daarom zou ik zeggen h3 wat ook het verschil in styling zou kunnen verklaren. als we h2 doen denk ik dat de styling hetzelfde als de andere h2's moet worden"
|
||||||
|
|
||||||
|
**AI Response**: "Accepted h3 (option B): the two sections continue the story under 'Hoi! Ik ben Andrea', and the smaller eyebrow styling matches the lower heading level — a consistent visual hierarchy. No remaining contradictions. Wrote inception/requirements/requirements.md (FR-OM-01..10, SEO-OM-01..05, NFR-OM-01..06, extension compliance). Recorded Security Baseline = Yes, PBT = Yes (full), Operations = No in aidlc-state.md. Proposed title 'Over mij – fotograaf in Huizen' and a 143-character description. Added 'Intro' to the LAYOUT.md diagram for consistency with the other page diagrams. User Stories proposed to be skipped (single visitor persona, concrete FRs). Presented completion message and asked for approval."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Requirements Analysis (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Requirements Analysis — Change Request
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:05:00Z
|
||||||
|
|
||||||
|
**User Input**: "SEO-OM-02 Title and description: De beschrijving mag worden: \"Hoi! Ik ben Andrea, lifestyle fotograaf uit Huizen. Ik maak warme, spontane foto's die een verhaal vertellen: newborn-, zwangerschaps- en gezinsshoots.\"
|
||||||
|
De tweede zin di ejij had bedacht lijkt namelijk midden in een zin te beginnen."
|
||||||
|
|
||||||
|
**AI Response**: "Updated SEO-OM-02 with the user's description (151 characters, within the ~155 guideline). Presented the completion message again."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Requirements Analysis (change applied, awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Requirements Analysis — Approval
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:07:49Z
|
||||||
|
|
||||||
|
**User Input**: "ga verder"
|
||||||
|
|
||||||
|
**AI Response**: "Requirements approved, User Stories skipped. Started Workflow Planning."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Requirements Analysis (approved)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Workflow Planning
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:15:00Z
|
||||||
|
|
||||||
|
**User Input**: (none)
|
||||||
|
|
||||||
|
**AI Response**: "Created inception/plans/execution-plan.md: low risk, single package. Execute Application Design (minimal), Functional Design for unit 2 only, Code Generation for two units (1 Shared blocks: PageSection rename + shared media+text block; 2 Over mij page incl. SEO, photos, LAYOUT.md), Build and Test. Skip User Stories, Units Generation, NFR Requirements, NFR Design, Infrastructure Design, Operations. Asked for approval."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Workflow Planning (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Workflow Planning — Approval
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:09:36Z
|
||||||
|
|
||||||
|
**AI Prompt**: "Ready to proceed with this plan?"
|
||||||
|
|
||||||
|
**User Input**: "goedgekeurd, ga verder"
|
||||||
|
|
||||||
|
**Status**: Approved
|
||||||
|
|
||||||
|
**Context**: Workflow plan with Application Design, Functional Design (unit 2), Code Generation (2 units) and Build and Test
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Application Design — Plan and Questions
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:20:00Z
|
||||||
|
|
||||||
|
**User Input**: (none)
|
||||||
|
|
||||||
|
**AI Response**: "Created inception/plans/application-design-plan.md with recorded decisions (PageSection = renamed HomeSection plus a flush-top spacing option; SEO builders in seo.ts combined in the route head; aboutContent.ts; LinkButton accent and Link underline) and 4 questions: MediaText interface, eyebrow-style h3 headings (shared Eyebrow component), photo duo component, folder layout for page-specific components."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Application Design (awaiting answers)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Application Design — Answers and Artifacts
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:13:49Z
|
||||||
|
|
||||||
|
**User Input**: "ik heb de vragen beantwoord" — answers in application-design-plan.md: Q1 A, Q2 A, Q3 A, Q4 A
|
||||||
|
|
||||||
|
**AI Response**: "No ambiguities. Generated inception/application-design/ components.md, component-methods.md, services.md, component-dependency.md and application-design.md: layout-only MediaText (children), shared Eyebrow with an `as` prop replacing four identical inline labels, new PhotoDuo, page components in components/about/ (AboutIntro, StorySection, RichParagraph), PageSection rename with spacing flushTop, SEO builders in seo.ts with a business @id. RichText and structured data rules left to Functional Design (unit 2). Presented completion message."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Application Design (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Application Design — Approval
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:16:03Z
|
||||||
|
|
||||||
|
**User Input**: "continue to next stage"
|
||||||
|
|
||||||
|
**AI Response**: "Application Design approved; Units Generation stays skipped. Started CONSTRUCTION with Code Generation for unit 1 (Shared blocks); Functional Design is skipped for this unit per the execution plan."
|
||||||
|
|
||||||
|
**Context**: INCEPTION - Application Design (approved) → CONSTRUCTION
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Code Generation — Unit 1 Shared blocks — Plan
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:25:00Z
|
||||||
|
|
||||||
|
**User Input**: (none)
|
||||||
|
|
||||||
|
**AI Response**: "Created construction/plans/shared-blocks-code-generation-plan.md (16 steps: Eyebrow + switch of four identical labels, HomeSection → PageSection rename with flushTop, MediaText + AboutBlock switch, leftover search, pnpm check, visual check, RE doc names, code summary, local commit). Asked for plan approval."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation Unit 1 (awaiting plan approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Code Generation — Unit 1 Shared blocks — Plan Approval
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:20:00Z
|
||||||
|
|
||||||
|
**User Input**: "approve plan"
|
||||||
|
|
||||||
|
**AI Response**: "Plan approved. Started Part 2 (generation)."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation Unit 1 (generation)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Code Generation — Unit 1 Shared blocks — Generated
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T21:45:00Z
|
||||||
|
|
||||||
|
**User Input**: (none)
|
||||||
|
|
||||||
|
**AI Response**: "Executed all 16 plan steps: Eyebrow (+ four labels switched), HomeSection → PageSection with flushTop, MediaText (+ AboutBlock switched), RE doc names, code summary. pnpm check: lint, format, build, 250 tests, audits passed; Lighthouse mobile performance failed in the first run (/ 0.71, /over-mij 0.87) because a master build ran concurrently on the same machine; Lighthouse rerun alone passed (mobile / 0.82, others 0.94–0.95; desktop 0.99–1; accessibility 1). Homepage unchanged: layout comparison (233 elements, 21 computed styles, 3 widths) master vs branch identical; master vs master also identical. Commits 26106f2 (planning docs) and 01e849c (unit 1) on feature/over-mij-page, not pushed. Presented completion message."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation Unit 1 (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Code Generation — Unit 1 Shared blocks — Commit and Push Request
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-23T07:00:00Z
|
||||||
|
|
||||||
|
**User Input**: "Je mag de wijzigingen committed en pushen . Kan je ook 'pnpm typegen:watch' en 'pnpm dev --host' starten zodat ik via kan kan testen?"
|
||||||
|
|
||||||
|
**AI Response**: "Committed the remaining state/audit updates, pushed feature/over-mij-page, started `pnpm typegen:watch` and `pnpm dev --host` in the background. Unit 1 approval still pending."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation Unit 1 (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Code Generation — Unit 1 Shared blocks — Approval, Push and Deploy
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T22:41:05Z
|
||||||
|
|
||||||
|
**User Input**: "key weer toegevoegd. ga verder. push en deploy naar test"
|
||||||
|
|
||||||
|
**AI Response**: "Unit 1 approved. Pushed feature/over-mij-page (first push failed earlier because the ssh-agent had been started with -t 4h, which expired the owner's key; agent restarted without a default lifetime). Dispatched CI run 563 on feature/over-mij-page with deploy_test=true. Feature status in active-features.md → 🟢 Construction. Started Functional Design for unit 2."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation Unit 1 (approved) → Functional Design Unit 2
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Functional Design — Unit 2 Over mij page — Questions
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T22:50:00Z
|
||||||
|
|
||||||
|
**User Input**: (none)
|
||||||
|
|
||||||
|
**AI Response**: "Created construction/plans/over-mij-page-functional-design-plan.md and over-mij-page-fd-questions.md (4 questions: inline link model, link target type, Person fields, Person–business linking; recorded decisions on sameAs source, no e-mail, Person image, /#contact targets, alt texts)."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting answers)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Functional Design — Unit 2 Over mij page — Answers and Artifacts
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T22:54:37Z
|
||||||
|
|
||||||
|
**User Input**: "1a, 2a, 3b, 4b"
|
||||||
|
|
||||||
|
**AI Response**: "Recorded answers in over-mij-page-fd-questions.md (Q1 A segments, Q2 A route + hash, Q3 B Person with knowsAbout, Q4 B two-way link business.founder ↔ Person.worksFor). No ambiguities. Wrote construction/over-mij-page/functional-design/ domain-entities.md, business-rules.md, business-logic-model.md, frontend-components.md. Added decisions: person data lives in AboutPageContent.person; the photo block is not a named region (PageSection.labelledBy becomes optional); knowsAbout cleaned by a pure lib helper. CI run 563 (feature/over-mij-page, deploy_test): check success, deploy-test success; test.andreaslop.nl serves the branch build (verified flushTop in the routes chunk). Presented completion message."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Functional Design Unit 2 (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Functional Design — Unit 2 — Approval
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T22:57:45Z
|
||||||
|
|
||||||
|
**User Input**: "Ga verder"
|
||||||
|
|
||||||
|
**AI Response**: "Functional design approved. Created construction/plans/over-mij-page-code-generation-plan.md (22 steps: images, content, SEO + PBT, components, route, LAYOUT.md, RE docs, pnpm check, visual check, summary, commit). Asked for plan approval."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation Unit 2 (awaiting plan approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Code Generation — Unit 2 — Plan Approval
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T23:00:00Z
|
||||||
|
|
||||||
|
**User Input**: "Approve plan. Zodra je klaar bent mag je de changes comitten, pushen en een deploy naar test doen. Ik test het daarna eerst op test"
|
||||||
|
|
||||||
|
**AI Response**: "Plan approved; generation started. Commit, push and deploy to test authorised for when unit 2 is done."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation Unit 2 (generation)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Code Generation — Unit 2 Over mij page — Generated
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T23:55:00Z
|
||||||
|
|
||||||
|
**User Input**: (none)
|
||||||
|
|
||||||
|
**AI Response**: "Executed all 22 plan steps. Extra changes found necessary while generating: lighthouserc home exception (0.8) narrowed to '/' so /over-mij is held to 0.9; FramedImage/MediaText `priority` for the portrait (it is the mobile LCP). pnpm check passed (273 tests; Lighthouse /over-mij mobile perf 0.90, a11y/bp/SEO 1; desktop 1). Mobile LCP 3.2 s explained (client-side rendering 2.1 s + Reveal fade 0.5 s); design kept, option reported to the user. Homepage layout unchanged vs master; visual check against the static design at 3 widths. Committing, pushing and dispatching a deploy to test as authorised by the user."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation Unit 2 (review on test)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Code Generation — Unit 2 — Pushed and Deployed to Test
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-22T23:31:00Z
|
||||||
|
|
||||||
|
**User Input**: (none)
|
||||||
|
|
||||||
|
**AI Response**: "Commits 9399371 (functional design) and e152153 (unit 2) pushed to feature/over-mij-page. CI run 564 (deploy_test): check success, deploy-test success; test.andreaslop.nl serves the new build (sitemap lists /over-mij, /og-over-mij.jpg is a 69 KB JPEG). Lighthouse job still running in CI. Awaiting the user's review on test."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation Unit 2 (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Session Resume
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-24T00:00:00Z
|
||||||
|
|
||||||
|
**User Input**: "Top, ik wil dan nu verder met de openstaande aidlc feature"
|
||||||
|
|
||||||
|
**AI Response**: "Resumed over-mij-page at Code Generation Unit 2 (awaiting the user's review on test). active-features.md consistent with aidlc-state.md. Verified CI run 564 (e152153): check, deploy-test and lighthouse all success. Asked the user for their review result: approve unit 2 or request changes."
|
||||||
|
|
||||||
|
**Context**: Session resumed; CONSTRUCTION - Code Generation Unit 2 (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Code Generation — Unit 2 — Approval
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-24T00:05:00Z
|
||||||
|
|
||||||
|
**User Input**: "ga verder"
|
||||||
|
|
||||||
|
**AI Response**: "Unit 2 approved after review on test. Code Generation complete for both units. Started Build and Test: full pnpm check on the branch, then cross-unit browser checks."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Code Generation (complete) → Build and Test
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Feature Resolution — New Request While Build and Test Open
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-24T10:00:00Z
|
||||||
|
|
||||||
|
**User Input**: "Ik wil een nieuwe feature starten voor het bouwen van de \"Soorten Fotoshoots\" pagina. Wederom met aandacht voor SEO, accessibility en reusability van code elementen, chakra en theming. Net zoals voorgaande feature."
|
||||||
|
|
||||||
|
**AI Response**: "Classified as Feature. over-mij-page is still in Build and Test and unmerged; its shared blocks are likely needed by the new page. Saved aidlc-docs/feature-selection.md with options: finish over-mij-page first (recommended), stack on feature/over-mij-page, or start from master."
|
||||||
|
|
||||||
|
**Context**: Feature Resolution (Workspace Detection Step 1b) — awaiting user choice
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Worktree Move
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-24T21:40:00Z
|
||||||
|
|
||||||
|
**User Input**: (none)
|
||||||
|
|
||||||
|
**AI Response**: "Another session switched the shared working tree to feature/contact-page (same commit ae769cb, no changes under web/, so the Build and Test results apply unchanged). To keep over-mij-page documentation off that branch, created worktree K:/Development/SlpSoftware/Projects/AndreaSlopFotografie-over-mij for feature/over-mij-page, moved the three uncommitted audit entries (Session Resume, Unit 2 Approval, Feature Resolution by the other session) there and restored the file in the shared tree."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Build and Test (workspace hygiene)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Build and Test Stage
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-24T21:50:00Z
|
||||||
|
|
||||||
|
**Build Status**: Success
|
||||||
|
|
||||||
|
**Test Status**: Pass
|
||||||
|
|
||||||
|
**Files Generated**:
|
||||||
|
- build-instructions.md
|
||||||
|
- unit-test-instructions.md
|
||||||
|
- integration-test-instructions.md
|
||||||
|
- performance-test-instructions.md
|
||||||
|
- build-and-test-summary.md
|
||||||
|
|
||||||
|
**Operations Phase Decision**: No (Decided At: Requirements Analysis)
|
||||||
|
|
||||||
|
**AI Response**: "pnpm check at ae769cb passed (273 tests, coverage thresholds, build, prod audit clean, Lighthouse budgets met: /over-mij mobile 0.90, desktop 1). Browser integration against the production build: 24/24 checks across 8 scenarios. The e-mail scenario first failed because it scanned the rendered DOM, where the footer assembles the address on purpose; corrected to the actual rule (not in served HTML or JSON-LD), which passes. active-features.md set to Complete (Operations = No). Presented the completion message (Variant B)."
|
||||||
|
|
||||||
|
**Context**: CONSTRUCTION - Build and Test (awaiting approval)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Build and Test — Approval and Workflow Complete
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-24T22:00:00Z
|
||||||
|
|
||||||
|
**User Input**: "Continue to Next Stage"
|
||||||
|
|
||||||
|
**AI Response**: "Build and Test approved. Operations = No, so the workflow is complete: aidlc-state.md set to Complete (active-features.md already ✅ Complete). Presented the Workflow Complete summary and asked for permission to commit, push and open the PR to master."
|
||||||
|
|
||||||
|
**Context**: Workflow Complete (without Operations)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Alt Texts — Review Result
|
||||||
|
|
||||||
|
**Timestamp**: 2026-10-24T22:20:00Z
|
||||||
|
|
||||||
|
**User Input**: "Ik heb ondertussen de alt-teksten laten controleren en die zijn goed bevonden." / "en je mag een kleine docs commit doen doen op de PR branch"
|
||||||
|
|
||||||
|
**AI Response**: "Recorded the approval of the alt texts in the unit 2 code summary and in the PR #7 description. Committed as a docs-only commit on feature/over-mij-page."
|
||||||
|
|
||||||
|
**Context**: Workflow Complete — follow-up on the open alt-text review
|
||||||
|
|
||||||
|
---
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
# Build and Test Summary — over-mij-page
|
||||||
|
|
||||||
|
Tested commit: `ae769cb` (unit 1 shared blocks + unit 2 Over mij page), locally on Windows, 2026-10-24.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
- **Tool**: pnpm + Vite (`tsc && vite build`)
|
||||||
|
- **Status**: ✅ Success (3.5 s locally). CI run 564 on the same code (e152153): `check`, `deploy-test` and `lighthouse` ✅
|
||||||
|
- **Artifacts**: `web/dist/`
|
||||||
|
|
||||||
|
## Unit tests
|
||||||
|
- **Total**: 273 in 60 files. **Passed**: 273. **Failed**: 0.
|
||||||
|
- **Coverage**: thresholds met; overall 92% of statements
|
||||||
|
- **Status**: ✅ Pass
|
||||||
|
|
||||||
|
## Integration (browser, production build)
|
||||||
|
24 checks across the 8 scenarios in `integration-test-instructions.md`, all ✅:
|
||||||
|
|
||||||
|
| Scenario | Result |
|
||||||
|
|---|---|
|
||||||
|
| "neem contact op" / "Boek je shoot" → homepage Contact, 1440 and 390 px | ✅ Contact top = header bottom (68 / 66 px) |
|
||||||
|
| Homepage "Lees meer" / "Lees mijn verhaal" → `/over-mij` | ✅ top of page, h1 and title correct |
|
||||||
|
| Heading outline and section names | ✅ |
|
||||||
|
| JSON-LD AboutPage ↔ Person ↔ business, head tags | ✅ |
|
||||||
|
| No e-mail in served HTML or JSON-LD | ✅ |
|
||||||
|
| Layout shift while scrolling, photos loaded | ✅ CLS 0.0006 (1440) / 0 (390) |
|
||||||
|
| No horizontal overflow, 2 pages × 5 widths | ✅ |
|
||||||
|
| Keyboard focus on the links and the button | ✅ button 53 px high |
|
||||||
|
|
||||||
|
### Found in this stage
|
||||||
|
- **The e-mail scenario first failed, but the test was wrong, not the page.** The check scanned the rendered DOM and found `info@andreaslop.nl` in the footer. The footer assembles that address in the browser on purpose and has done so since frontend-shell. The real rule is that the address is not in the served HTML or in the structured data, and that check passes. NFR-OM-04 says "no e-mail address in markup". It means the served markup, not the footer that is rendered in the browser.
|
||||||
|
|
||||||
|
## Performance (Lighthouse CI, production build)
|
||||||
|
| Page | Mobile | Desktop |
|
||||||
|
|---|---|---|
|
||||||
|
| Homepage | 0.82 (budget 0.8) | 1.0 |
|
||||||
|
| Over mij | 0.90 (budget 0.9), LCP 3.2 s | 1.0 |
|
||||||
|
| Other pages | 0.94–0.95 (budget 0.9) | 1.0 |
|
||||||
|
|
||||||
|
Accessibility and best practices are 1.0 on every page. SEO is 1.0 on the indexed pages (`/`, `/over-mij`); the noindex pages only miss `is-crawlable`, as intended. The `/over-mij` mobile score is exactly at its budget; see `performance-test-instructions.md` for where the LCP goes.
|
||||||
|
|
||||||
|
## Additional
|
||||||
|
- **Security**: `pnpm audit --prod --audit-level high` clean. The full `pnpm audit` reports 17 issues (8 high), all in development tools (`@lhci/cli`, `vitest`'s own `vite`, `@chakra-ui/cli`). They do not reach the site and do not block (NFR-SEC-05). This feature adds no dependencies, so the list is the same as on master. No new external resources; CSP unchanged.
|
||||||
|
- **Contract / E2E suite**: N/A (static front end without an API). The browser checks above cover the user flows.
|
||||||
|
|
||||||
|
## Overall
|
||||||
|
- **Build**: ✅ **Tests**: ✅ **Performance budgets**: ✅
|
||||||
|
- **Test environment**: test.andreaslop.nl runs this code (run 564) and was reviewed and approved by the owner
|
||||||
|
- **Operations phase**: declined at Requirements Analysis. The next step is the PR to master.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# Build Instructions — over-mij-page
|
||||||
|
|
||||||
|
Unchanged from homepage-sections: this feature adds no dependencies, build steps or environment variables.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
- **Node.js** 24 and **pnpm** (version pinned in `web/package.json`)
|
||||||
|
- **Environment variables**: none for the build. `LIGHTHOUSE_PERFORMANCE=warn` only in CI.
|
||||||
|
|
||||||
|
## Build steps
|
||||||
|
```bash
|
||||||
|
cd web
|
||||||
|
pnpm install # also runs `chakra typegen` (postinstall)
|
||||||
|
pnpm build # tsc && vite build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Verify
|
||||||
|
- **Expected output**: `✓ built in …s` and no TypeScript errors (3.5 s locally at ae769cb)
|
||||||
|
- **Artifacts**: `web/dist/`. New in this feature: the three page photos under `dist/assets/` (hashed names) and `dist/og-over-mij.jpg` (copied from `public/`, stable URL for the preview image)
|
||||||
|
- **Accepted warning**: Vite's chunk-size warning for the main bundle (known, NFR-P-01)
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
- **Lighthouse or preview fails with "port in use"**: a preview server or the CI Lighthouse job on the PC runner is using port 4173. Stop it first.
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
# Integration Test Instructions — over-mij-page
|
||||||
|
|
||||||
|
Unit 1 (shared blocks) and unit 2 (the page) meet in two places: the homepage, which now uses `PageSection` and `MediaText`, and `/over-mij`, which uses the same blocks and links back to the homepage contact section.
|
||||||
|
|
||||||
|
## Automated (in `pnpm test`)
|
||||||
|
- `src/app.test.tsx`: the homepage section order and axe check (unchanged by unit 1), `/over-mij` through the real route tree
|
||||||
|
- `src/sitemap.test.ts` and the Lighthouse sync test: `/over-mij` is indexed in `sitePages.ts`, in the sitemap and in the Lighthouse indexed paths
|
||||||
|
|
||||||
|
## In a real browser (production build)
|
||||||
|
Run against `pnpm build && pnpm preview --port 4173`, with headless Chrome via the puppeteer-core and chrome-launcher that Lighthouse already installs. Use a desktop viewport of 1440 × 900 and a phone emulation of 390 × 844.
|
||||||
|
|
||||||
|
| # | Scenario | Expected |
|
||||||
|
|---|---|---|
|
||||||
|
| 1 | On `/over-mij`, click "neem contact op" and "Boek je shoot" (1440 and 390 px) | URL `/#contact`; Contact's top edge lines up with the bottom of the sticky header |
|
||||||
|
| 2 | On `/`, click "Lees meer" (hero) and "Lees mijn verhaal" (about block) | `/over-mij` at scroll position 0, h1 "Over mij", page title "Over mij – fotograaf in Huizen \| Andrea Slop Fotografie" |
|
||||||
|
| 3 | Rendered DOM of `/over-mij` | Headings h1 Over mij → h2 Hoi! Ik ben Andrea → h3 Hoe het begon, h3 Buiten de camera om; sections named by their heading (the page head and the photos are not named regions) |
|
||||||
|
| 4 | Structured data and head | `AboutPage.mainEntity` is the Person; `business.founder` and `Person.worksFor` point at each other by `@id`; no robots meta; canonical `https://andreaslop.nl/over-mij`; `og:image` `/og-over-mij.jpg` |
|
||||||
|
| 5 | E-mail address | Not in the served HTML and not in the JSON-LD. The footer assembles it in the browser on purpose (since frontend-shell), so it does show in the rendered DOM. |
|
||||||
|
| 6 | Scroll `/over-mij` top to bottom (1440 and 390 px) | Cumulative layout shift < 0.1; all three photos loaded, each with width, height and alt |
|
||||||
|
| 7 | `/` and `/over-mij` at 320, 390, 768, 1024 and 1440 px | `scrollWidth === innerWidth`: no horizontal overflow |
|
||||||
|
| 8 | Tab through `/over-mij` | "mijn portfolio", "neem contact op" and "Boek je shoot" are reached in that order with a ≥ 2 px focus ring; the button is ≥ 44 px high |
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
# Performance Test Instructions — over-mij-page
|
||||||
|
|
||||||
|
A static site, so there is no load testing. Performance means page-load performance, measured with Lighthouse CI on the production build.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd web
|
||||||
|
pnpm build
|
||||||
|
pnpm lighthouse # mobile (lighthouserc.cjs) then desktop (lighthouserc.desktop.cjs)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Budgets
|
||||||
|
- **Performance**: homepage on mobile ≥ 0.8 (temporary, NFR-P-01). Since this feature, that exception applies to `/` only; before, it applied to every indexed page. Every other page, `/over-mij` included, needs ≥ 0.9 on mobile, and every page needs ≥ 0.9 on desktop.
|
||||||
|
- **Accessibility and best practices**: 1.0 on every page
|
||||||
|
- **SEO**: the basic audits everywhere; `is-crawlable` only on indexed pages (`/` and `/over-mij`)
|
||||||
|
|
||||||
|
## Measuring reliably
|
||||||
|
See homepage-sections `performance-test-instructions.md`: measure the production build on a quiet machine and check that `environment.benchmarkIndex` is around 3500–4200. On the Pi in CI, performance is reported but does not block.
|
||||||
|
|
||||||
|
## Known: mobile LCP of `/over-mij`
|
||||||
|
The portrait is the largest contentful paint, at 3.2 s with mobile throttling. About 2.1 s of that passes before the request can start, because the page is rendered by JavaScript (the placeholder pages have the same first paint). Another 0.5 s comes from the design's fade-in (`Reveal`). The portrait already loads at once with `fetchpriority="high"`. Prerendering (NFR-P-01) is the structural fix.
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
# Unit Test Execution — over-mij-page
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd web
|
||||||
|
pnpm test # vitest run --coverage
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Expected**: 60 files, 273 tests, 0 failures (at ae769cb; 53 files / 244 tests before this feature)
|
||||||
|
- **Coverage**: thresholds met. `src/lib/` and `src/seo.ts` at 100%. The suite overall is 92% of statements.
|
||||||
|
- **Includes, new in this feature**:
|
||||||
|
- `PageSection` (renamed) and `MediaText`, with the homepage `AboutBlock` output unchanged
|
||||||
|
- the page components (`AboutIntro`, `StorySection`, `RichParagraph`, `PhotoDuo`), axe-checked
|
||||||
|
- the `/over-mij` route through the real route tree: heading outline, section names, link and button targets, head tags
|
||||||
|
- property-based tests (fast-check) for `person`, `aboutPage`, `professionalService` and `knowsAboutList`: two-way `@id` links, `sameAs` only valid https socials, no e-mail address, idempotency
|
||||||
|
- **Report**: terminal output plus `web/coverage/`
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
# Code Summary — Unit 2: Over mij page
|
||||||
|
|
||||||
|
Plan: [over-mij-page-code-generation-plan.md](../../plans/over-mij-page-code-generation-plan.md). Functional design: [../functional-design/](../functional-design/business-rules.md).
|
||||||
|
|
||||||
|
## Created
|
||||||
|
- `web/src/routes/over-mij.tsx` — replaced the placeholder: head (`pageHead` + `AboutPage` JSON-LD) and the page composition
|
||||||
|
- `web/src/content/aboutContent.ts` — live texts, photos, booking link, person data
|
||||||
|
- `web/src/components/about/AboutIntro/*`, `about/StorySection/*`, `about/RichParagraph/*` (+ tests)
|
||||||
|
- `web/src/components/PhotoDuo/*` (+ test)
|
||||||
|
- `web/src/lib/knowsAboutList.ts` (+ test, PBT invariants and idempotency)
|
||||||
|
- `web/src/assets/about/andrea-portret.jpg` (1200×800, 83 KB), `about-1.jpg` (1200×798, 97 KB), `about-2.jpg` (1200×800, 86 KB)
|
||||||
|
- `web/public/og-over-mij.jpg` (1200×630, 68 KB, crop of the portrait)
|
||||||
|
|
||||||
|
## Modified
|
||||||
|
- `web/src/content/types.ts` — `LinkTarget`, `InlineLink`, `RichText`, `AboutPageContent`
|
||||||
|
- `web/src/seo.ts` — `businessId`, `personId`; `professionalService` gains `@id` and `founder`; new `person`, `aboutPage`, `structuredDataScript` (also used by `siteHead`)
|
||||||
|
- `web/src/sitePages.ts` — `/over-mij`: new title/description, `indexed: true`, `ogImage`
|
||||||
|
- `web/lighthouserc.cjs` — `/over-mij` indexed; the home page's lower mobile performance target (0.8) now applies to `/` only, other indexed pages need 0.9 (before, it applied to every indexed page)
|
||||||
|
- `web/src/components/PageSection/PageSection.tsx` — `labelledBy` optional (+ test)
|
||||||
|
- `web/src/components/FramedImage/FramedImage.tsx`, `MediaText/MediaText.tsx` — `priority` option: load at once with `fetchpriority="high"` instead of deferred (+ test); used for the portrait at the top of the page
|
||||||
|
- `web/src/seo.test.ts`, `web/src/sitemap.test.ts`, `web/src/app.test.tsx`, `web/src/test/arbitraries.ts` — new and updated tests, `anySiteContent` and `knowsAboutEntries` generators
|
||||||
|
- `LAYOUT.md` — About me: Intro → About Me → Background → Photos → Personal
|
||||||
|
- `aidlc-docs/_shared/reverse-engineering/*.md` — routes, components, content model, SEO functions, debt
|
||||||
|
|
||||||
|
## Image script
|
||||||
|
One-off, outside the project (`scratchpad/resize-image.ps1`): the homepage-sections script extended with EXIF orientation and an optional cover crop (`-Height`, `-FocusY`). Commands:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
& .\resize-image.ps1 -Source portret.jpg -Target web\src\assets\about\andrea-portret.jpg -Width 1200
|
||||||
|
& .\resize-image.ps1 -Source about-1.jpg -Target web\src\assets\about\about-1.jpg -Width 1200
|
||||||
|
& .\resize-image.ps1 -Source about-2.jpg -Target web\src\assets\about\about-2.jpg -Width 1200
|
||||||
|
& .\resize-image.ps1 -Source portret.jpg -Target web\public\og-over-mij.jpg -Width 1200 -Height 630 -FocusY 0.4
|
||||||
|
```
|
||||||
|
|
||||||
|
Originals from andreaslop.nl: `2024/10/WhatsApp-Image-2024-10-27-at-14.31.41.jpeg` (1600×1067), `2025/08/slide-1.jpg` (1920×1277), `2025/08/IMG_1718.jpg` (6000×4000).
|
||||||
|
|
||||||
|
## Alt texts (reviewed and approved by the owner, 2026-10-24)
|
||||||
|
- Portrait: "Andrea Slop in een groene trui met haar camera in de handen, glimlachend in het bos"
|
||||||
|
- Concert: "Concert vanaf het podium: de zanger steekt zijn microfoon omhoog voor een volle zaal in blauw licht"
|
||||||
|
- Cat: "Een grijze langharige kat slaapt met een uitgestrekte poot op de bank"
|
||||||
|
- Preview image: "Andrea Slop met haar camera in het bos"
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
- **`pnpm check`**: lint, format, 60 test files / 273 tests (coverage thresholds met), build, `audit:deps` clean, Lighthouse passed. Two earlier runs stopped on an outdated sitemap expectation ("only the homepage") and on Prettier formatting of that fix; both corrected.
|
||||||
|
- **Lighthouse `/over-mij`**: mobile performance 0.90, accessibility 1, best practices 1, SEO 1; desktop 1 everywhere. Home unchanged (mobile 0.82, desktop 1).
|
||||||
|
- **LCP on mobile**: the portrait, 3.2 s. Breakdown: 2.1 s before the request can start, because the page is rendered by JavaScript (FCP 2.3 s, same as the placeholders), and 0.5 s render delay from the design's fade-in (`Reveal`). `priority` shortened the request delay by 0.3 s. Not changed further: removing the fade-in on the first block would deviate from the design; prerendering is the known fix for the JavaScript-first paint.
|
||||||
|
- **Homepage unchanged**: layout comparison against master at 1440/768/390 px — identical except React's generated carousel ids, which also differ between two runs of master.
|
||||||
|
- **Visual**: `/over-mij` compared with `design/andreaslop-static/over-mij.html` at 1440, 820 and 390 px — same structure, order, backgrounds, frame and button; differences are agreed ones (30 px section heading, wider content column as on the homepage, live texts).
|
||||||
|
|
||||||
|
## Extension Compliance
|
||||||
|
| Rule | Status | Rationale |
|
||||||
|
|---|---|---|
|
||||||
|
| SECURITY-04 | Compliant | CSP unchanged; only self-hosted images |
|
||||||
|
| SECURITY-10 | Compliant | No new dependencies |
|
||||||
|
| SECURITY-11 | Compliant | JSON-LD via `jsonLdScript`; e-mail never in output (PBT) |
|
||||||
|
| SECURITY-13 | Compliant | No external resources |
|
||||||
|
| Other SECURITY rules | N/A | No data stores, endpoints, auth or infrastructure |
|
||||||
|
| PBT-01 | Compliant | Properties from business-logic-model.md implemented |
|
||||||
|
| PBT-02 | Compliant | `jsonLdScript` round-trip (existing) + `structuredDataScript` example |
|
||||||
|
| PBT-03 | Compliant | Two-way ids, sameAs = valid socials, no e-mail, registry match, knowsAbout invariants |
|
||||||
|
| PBT-04 | Compliant | `knowsAboutList` idempotency |
|
||||||
|
| PBT-05, PBT-06 | N/A | No oracle, no stateful logic |
|
||||||
|
| PBT-07 | Compliant | `anySiteContent`, `knowsAboutEntries` generators |
|
||||||
|
| PBT-08, PBT-09 | Compliant | Existing seed logging, fast-check |
|
||||||
|
| PBT-10 | Compliant | Example-based component and route tests alongside PBT |
|
||||||
+81
@@ -0,0 +1,81 @@
|
|||||||
|
# Business Logic Model — Unit 2: Over mij page
|
||||||
|
|
||||||
|
The page has no runtime decisions beyond rendering static content; the logic lives in the head (SEO) and in small pure functions.
|
||||||
|
|
||||||
|
## Request Flow
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
box rgba(33,150,243,0.3) Router
|
||||||
|
participant Root as Root route
|
||||||
|
participant Route as Over mij route
|
||||||
|
end
|
||||||
|
box rgba(255,152,0,0.3) Pure modules
|
||||||
|
participant Seo as seo.ts
|
||||||
|
participant Reg as sitePages.ts
|
||||||
|
end
|
||||||
|
box rgba(76,175,80,0.3) Data
|
||||||
|
participant Site as siteContent
|
||||||
|
participant About as aboutContent
|
||||||
|
end
|
||||||
|
Root->>Seo: siteHead with siteContent
|
||||||
|
Seo-->>Root: meta and ProfessionalService script with ids
|
||||||
|
Route->>Seo: pageHead for over-mij
|
||||||
|
Seo->>Reg: read title, description, indexed, ogImage
|
||||||
|
Seo-->>Route: meta and canonical
|
||||||
|
Route->>Seo: aboutPage with path, person content and siteContent
|
||||||
|
Seo-->>Route: AboutPage with Person
|
||||||
|
Route->>Seo: structuredDataScript
|
||||||
|
Seo-->>Route: escaped ld+json script
|
||||||
|
Route->>About: read static content
|
||||||
|
Route-->>Root: head tags and rendered page
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: the root route adds the site-wide head and business data; the Over mij route gets its meta tags from the registry, builds the AboutPage/Person data from its content and the site data, serialises it safely, and renders the page from static content.
|
||||||
|
|
||||||
|
## Pure Functions and Properties (PBT-01)
|
||||||
|
|
||||||
|
| Function | Category | Property (fast-check) |
|
||||||
|
|---|---|---|
|
||||||
|
| `professionalService(site)` | Invariant | `@id === businessId` and `founder['@id'] === personId` for any `SiteContent` |
|
||||||
|
| `person(content, site, image)` | Invariant | `sameAs` equals `visibleSocials(site.socials).map(href)` (absent when empty) for any socials incl. invalid hrefs |
|
||||||
|
| `person(...)` | Invariant | `worksFor['@id'] === businessId` |
|
||||||
|
| `knowsAboutList(entries)` (helper in `lib/`) | Invariant | output ⊆ trimmed input, no empty strings, no duplicates, keeps first-seen order |
|
||||||
|
| `knowsAboutList` | Idempotency | `f(f(x))` deep-equals `f(x)` |
|
||||||
|
| `aboutPage(path, ...)` | Invariant | serialised output never contains the assembled e-mail address, for any valid `EmailAddress` in `siteContent` |
|
||||||
|
| `aboutPage(path, ...)` | Invariant | `@id`/`url` equal `canonicalUrl(path)`; `name`/`description` equal the registry entry |
|
||||||
|
| `jsonLdScript(x)` | Round-trip | already covered: `JSON.parse(jsonLdScript(x))` deep-equals `x`; no `<`/`>` in output |
|
||||||
|
|
||||||
|
Generators: reuse `socialLink`, `validEmail`/`anyEmail` from `src/test/arbitraries.ts`; add a `siteContent` arbitrary and a `knowsAbout` arbitrary (strings with surrounding spaces, empties and duplicates).
|
||||||
|
|
||||||
|
Example-based tests complement these: the real content produces the expected Person (name, job title, three specialisations, Instagram and Facebook), and the head of `/over-mij` contains no `noindex`, the new title, canonical and `og:image`.
|
||||||
|
|
||||||
|
## Rendering Logic
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
Route["Over mij route"] --> Head["PageIntro: eyebrow + h1"]
|
||||||
|
Route --> Intro["AboutIntro: MediaText with portrait"]
|
||||||
|
Intro --> Paras{"Paragraph piece is a link?"}
|
||||||
|
Paras -->|"yes"| Link["underlined RouterLink to route and hash"]
|
||||||
|
Paras -->|"no"| Txt["plain text"]
|
||||||
|
Route --> Bg["StorySection: background, tone alt"]
|
||||||
|
Route --> Duo["PhotoDuo: two photos, not a named region"]
|
||||||
|
Route --> Pers["StorySection: personal, flush top"]
|
||||||
|
Pers --> Btn["LinkButton accent: Boek je shoot"]
|
||||||
|
classDef route fill:#4CAF50,stroke:#2e7d32,color:#000;
|
||||||
|
classDef ui fill:#2196F3,stroke:#0d47a1,color:#000;
|
||||||
|
classDef decision fill:#FF9800,stroke:#e65100,color:#000;
|
||||||
|
class Route route;
|
||||||
|
class Head,Intro,Link,Txt,Bg,Duo,Pers,Btn ui;
|
||||||
|
class Paras decision;
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: the route renders the page head, the intro (whose paragraphs render text pieces as text and link pieces as underlined router links), the background story, the photo duo, and the personal story ending in the booking button.
|
||||||
|
|
||||||
|
## Navigation to `/#contact`
|
||||||
|
Uses the existing mechanism of the price cards (`RouterLink` with `to="/"` and `hash="contact"`): the router navigates to the homepage and scrolls to `#contact`; `PageSection` gives that section a scroll margin of the sticky header height. No new logic; covered by a route test that the link targets `/#contact`.
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
- Static content only: no loading or error states. Invalid optional data degrades by omission (BR-SD-02, BR-SD-05), never by an error.
|
||||||
|
- A missing image file or a wrong route is a build/type error, not a runtime case.
|
||||||
+66
@@ -0,0 +1,66 @@
|
|||||||
|
# Business Rules — Unit 2: Over mij page
|
||||||
|
|
||||||
|
## Content
|
||||||
|
|
||||||
|
| ID | Rule |
|
||||||
|
|---|---|
|
||||||
|
| BR-OM-01 | Texts are the live texts in the design's structure (FR-OM-02..05); no "(vaak met een kat naast me)". |
|
||||||
|
| BR-OM-02 | Link targets are a `RoutePath` plus optional hash; "mijn portfolio" → `/portfolio`, "neem contact op" and "Boek je shoot" → `/` + `contact` (the homepage contact section, until `/contact` exists). |
|
||||||
|
| BR-OM-03 | A `RichText` paragraph renders its pieces in order: text as text, an `InlineLink` as an underlined router link with its `text` as the link name. Link names are descriptive on their own ("mijn portfolio", "neem contact op"). |
|
||||||
|
| BR-OM-04 | Every photo is informative and has a Dutch alt text that says what is in it; no "Werk van Andrea Slop"-style alt texts. |
|
||||||
|
| BR-OM-05 | Images carry their intrinsic `width`/`height` (space reserved, no layout shift). |
|
||||||
|
|
||||||
|
## Structure and Accessibility
|
||||||
|
|
||||||
|
| ID | Rule |
|
||||||
|
|---|---|
|
||||||
|
| BR-OM-10 | Heading outline: h1 "Over mij" (PageIntro) → h2 "Hoi! Ik ben Andrea" → h3 "Hoe het begon", h3 "Buiten de camera om". The h3s look like eyebrow labels (`Eyebrow as="h3"`). |
|
||||||
|
| BR-OM-11 | The intro, background and personal blocks are `section`s named by their heading. The photo block has no heading in the design, so it is **not** a named region; its photo list has the accessible name "Foto's". `PageSection.labelledBy` becomes optional for this case. |
|
||||||
|
| BR-OM-12 | Reveal and the photo hover zoom respect `prefers-reduced-motion`. |
|
||||||
|
|
||||||
|
## Structured Data
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
Start["Build head for a page"] --> Root["Root route adds ProfessionalService"]
|
||||||
|
Root --> Ids["ProfessionalService gets @id businessId and founder @id personId"]
|
||||||
|
Start --> IsAbout{"Is the path /over-mij?"}
|
||||||
|
IsAbout -->|"no"| Done["Only page meta and site data"]
|
||||||
|
IsAbout -->|"yes"| Person["Build Person from content and site data"]
|
||||||
|
Person --> Socials{"Any valid https social links?"}
|
||||||
|
Socials -->|"yes"| WithSame["sameAs = their hrefs, same order"]
|
||||||
|
Socials -->|"no"| NoSame["leave sameAs out"]
|
||||||
|
WithSame --> Skills{"Any non-empty knowsAbout entries?"}
|
||||||
|
NoSame --> Skills
|
||||||
|
Skills -->|"yes"| WithSkills["knowsAbout = trimmed, non-empty, unique"]
|
||||||
|
Skills -->|"no"| NoSkills["leave knowsAbout out"]
|
||||||
|
WithSkills --> About["AboutPage with mainEntity Person"]
|
||||||
|
NoSkills --> About
|
||||||
|
About --> Script["Serialise with jsonLdScript"]
|
||||||
|
classDef step fill:#2196F3,stroke:#0d47a1,color:#000;
|
||||||
|
classDef decision fill:#FF9800,stroke:#e65100,color:#000;
|
||||||
|
classDef result fill:#4CAF50,stroke:#2e7d32,color:#000;
|
||||||
|
class Start,Root,Ids,Person,About step;
|
||||||
|
class IsAbout,Socials,Skills decision;
|
||||||
|
class Done,WithSame,NoSame,WithSkills,NoSkills,Script result;
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: every page gets the business with its id and founder reference; only the about page also builds a Person (sameAs only with valid https socials, knowsAbout only with non-empty entries) inside an AboutPage, serialised through jsonLdScript.
|
||||||
|
|
||||||
|
| ID | Rule |
|
||||||
|
|---|---|
|
||||||
|
| BR-SD-01 | **No e-mail address** anywhere in the structured data, on any page. |
|
||||||
|
| BR-SD-02 | `sameAs` contains exactly the hrefs of `visibleSocials(socials)`, in that order; omitted when that list is empty. |
|
||||||
|
| BR-SD-03 | Stable identifiers: `businessId` and `personId` are constants. `ProfessionalService.founder['@id'] === personId` and `Person.worksFor['@id'] === businessId` (two-way link, Q4 B). The business keeps all its current fields. |
|
||||||
|
| BR-SD-04 | `Person.image` is the absolute URL of `/over-mij`'s `ogImage` (stable path in `public/`). |
|
||||||
|
| BR-SD-05 | `knowsAbout`: entries trimmed, empty ones dropped, duplicates removed (first one kept); the field is omitted when nothing is left. |
|
||||||
|
| BR-SD-06 | `AboutPage.name`/`description` equal the page's registry title and description; `@id`/`url` equal its canonical URL. |
|
||||||
|
| BR-SD-07 | All structured data is serialised by `jsonLdScript` (escapes `<`, `>`, `&`), in one `application/ld+json` script per object (site script from the root route, about script from the page). |
|
||||||
|
|
||||||
|
## SEO Registry
|
||||||
|
|
||||||
|
| ID | Rule |
|
||||||
|
|---|---|
|
||||||
|
| BR-SEO-OM-01 | `/over-mij` is `indexed: true`: no `robots noindex`, listed in `sitemap.xml`, checked as an indexed page by Lighthouse CI (`indexedPaths`). |
|
||||||
|
| BR-SEO-OM-02 | Rendered title ≤ 60 characters, description ≤ 155 characters (registry guideline). |
|
||||||
|
| BR-SEO-OM-03 | `ogImage` is a 1200×630 JPEG at `web/public/og-over-mij.jpg` with an alt text that describes the crop. |
|
||||||
+99
@@ -0,0 +1,99 @@
|
|||||||
|
# Domain Entities — Unit 2: Over mij page
|
||||||
|
|
||||||
|
Decisions: [over-mij-page-fd-questions.md](../../plans/over-mij-page-fd-questions.md) — Q1 A (segments), Q2 A (route + hash), Q3 B (basis + knowsAbout), Q4 B (two-way link).
|
||||||
|
|
||||||
|
## Entity Relationships
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
Page["AboutPageContent"] -->|"head"| Head["PageHead: eyebrow, title"]
|
||||||
|
Page -->|"intro"| Intro["Intro: eyebrow, title, paragraphs, image"]
|
||||||
|
Intro -->|"paragraphs: RichText[]"| Rich["RichText = (string or InlineLink)[]"]
|
||||||
|
Rich -->|"contains"| Inline["InlineLink = LinkTarget + text"]
|
||||||
|
Inline -->|"is a"| Target["LinkTarget: to RoutePath, hash?"]
|
||||||
|
Page -->|"background, personal"| Story["Story: title, paragraphs string[]"]
|
||||||
|
Page -->|"photos"| Img["ContentImage x2"]
|
||||||
|
Intro -->|"image"| Img
|
||||||
|
Page -->|"booking"| Booking["Booking: label + LinkTarget"]
|
||||||
|
Booking -->|"is a"| Target
|
||||||
|
Page -->|"person"| PersonC["PersonContent: name, jobTitle, knowsAbout[]"]
|
||||||
|
PersonC -->|"becomes"| PersonLd["Person JSON-LD"]
|
||||||
|
PersonLd -->|"worksFor @id"| Business["ProfessionalService JSON-LD"]
|
||||||
|
Business -->|"founder @id"| PersonLd
|
||||||
|
AboutLd["AboutPage JSON-LD"] -->|"mainEntity"| PersonLd
|
||||||
|
classDef content fill:#2196F3,stroke:#0d47a1,color:#000;
|
||||||
|
classDef shared fill:#4CAF50,stroke:#2e7d32,color:#000;
|
||||||
|
classDef ld fill:#FF9800,stroke:#e65100,color:#000;
|
||||||
|
class Page,Head,Intro,Rich,Inline,Story,Booking,PersonC content;
|
||||||
|
class Target,Img shared;
|
||||||
|
class PersonLd,Business,AboutLd ld;
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: the page content holds a head, an intro with rich-text paragraphs (text and inline links) and a photo, two story blocks, two photos, a booking link and person data; link targets are a route plus optional hash; the person data becomes a Person in the structured data, which works for the business, is its founder and is the main entity of the AboutPage.
|
||||||
|
|
||||||
|
## Content Types (`web/src/content/types.ts`)
|
||||||
|
|
||||||
|
### LinkTarget (new, shared)
|
||||||
|
| Field | Type | Notes |
|
||||||
|
|---|---|---|
|
||||||
|
| `to` | `RoutePath` | an existing route; a typo is a type error (same as the menus) |
|
||||||
|
| `hash` | `string?` | anchor without `#`, e.g. `'contact'` |
|
||||||
|
|
||||||
|
### InlineLink (new)
|
||||||
|
`LinkTarget & { text: string }` — e.g. `{ text: 'neem contact op', to: '/', hash: 'contact' }`
|
||||||
|
|
||||||
|
### RichText (new)
|
||||||
|
`(string | InlineLink)[]` — one paragraph as a list of plain text pieces and links, in reading order. Spaces belong to the text pieces.
|
||||||
|
|
||||||
|
### AboutPageContent (new)
|
||||||
|
| Field | Type | Content (from the live site, FR-OM-01..05) |
|
||||||
|
|---|---|---|
|
||||||
|
| `head` | `{ eyebrow: string; title: string }` | "Andrea Slop Fotografie", "Over mij" |
|
||||||
|
| `intro` | `{ eyebrow: string; title: string; paragraphs: RichText[]; image: ContentImage }` | "Lifestyle fotograaf", "Hoi! Ik ben Andrea", 3 paragraphs (third with two links), portrait |
|
||||||
|
| `background` | `{ title: string; paragraphs: string[] }` | "Hoe het begon", 1 paragraph |
|
||||||
|
| `photos` | `[ContentImage, ContentImage]` | the two duo photos |
|
||||||
|
| `personal` | `{ title: string; paragraphs: string[] }` | "Buiten de camera om", 2 paragraphs |
|
||||||
|
| `booking` | `LinkTarget & { label: string }` | "Boek je shoot" → `/` + `contact` |
|
||||||
|
| `person` | `{ name: string; jobTitle: string; knowsAbout: string[] }` | "Andrea Slop", "Lifestyle fotograaf", ["Newbornfotografie", "Zwangerschapsfotografie", "Gezinsfotografie"] |
|
||||||
|
|
||||||
|
`person` is content (not code) because the API/CMS will own it, like the texts it summarises.
|
||||||
|
|
||||||
|
### ContentImage (existing, reused)
|
||||||
|
`src`, `alt`, `width`, `height` — intrinsic size of the resized file.
|
||||||
|
|
||||||
|
## Structured Data (`web/src/seo.ts`)
|
||||||
|
|
||||||
|
### Identifiers (new constants)
|
||||||
|
| Name | Value |
|
||||||
|
|---|---|
|
||||||
|
| `businessId` | `https://andreaslop.nl/#business` |
|
||||||
|
| `personId` | `https://andreaslop.nl/over-mij#andrea` |
|
||||||
|
|
||||||
|
### ProfessionalService (existing, extended)
|
||||||
|
Adds `'@id': businessId` and `founder: { '@id': personId }`; everything else unchanged. Present on every page (root route).
|
||||||
|
|
||||||
|
### Person (new, only on `/over-mij`)
|
||||||
|
| Field | Source |
|
||||||
|
|---|---|
|
||||||
|
| `@type` | `Person` |
|
||||||
|
| `@id` | `personId` |
|
||||||
|
| `name`, `jobTitle` | `AboutPageContent.person` |
|
||||||
|
| `knowsAbout` | `AboutPageContent.person.knowsAbout` (cleaned, BR-SD-05) |
|
||||||
|
| `image` | absolute URL of the page's `ogImage` (`/og-over-mij.jpg`) |
|
||||||
|
| `address` | `PostalAddress`, `addressLocality: 'Huizen'`, `addressCountry: 'NL'` (same as the business) |
|
||||||
|
| `sameAs` | `visibleSocials(siteContent.socials)` hrefs; omitted when empty |
|
||||||
|
| `worksFor` | `{ '@id': businessId }` |
|
||||||
|
| `url` | canonical URL of `/over-mij` |
|
||||||
|
|
||||||
|
### AboutPage (new, only on `/over-mij`)
|
||||||
|
| Field | Source |
|
||||||
|
|---|---|
|
||||||
|
| `@type` | `AboutPage` |
|
||||||
|
| `@id`, `url` | canonical URL of `/over-mij` |
|
||||||
|
| `name` | page title from `sitePages` ("Over mij – fotograaf in Huizen") |
|
||||||
|
| `description` | page description from `sitePages` |
|
||||||
|
| `inLanguage` | `nl-NL` |
|
||||||
|
| `mainEntity` | the `Person` above (embedded) |
|
||||||
|
|
||||||
|
## Registry (`web/src/sitePages.ts`)
|
||||||
|
`/over-mij`: title "Over mij – fotograaf in Huizen", the approved description, `indexed: true`, `ogImage: { path: '/og-over-mij.jpg', width: 1200, height: 630, alt: <describes the crop> }`.
|
||||||
+78
@@ -0,0 +1,78 @@
|
|||||||
|
# Frontend Components — Unit 2: Over mij page
|
||||||
|
|
||||||
|
## Component Hierarchy
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
Shell["AppShell (existing)"] --> Route["routes/over-mij.tsx"]
|
||||||
|
Route --> PageIntro["PageIntro"]
|
||||||
|
Route --> AboutIntro["about/AboutIntro"]
|
||||||
|
AboutIntro --> PS1["PageSection flushTop"]
|
||||||
|
PS1 --> MediaText["MediaText"]
|
||||||
|
MediaText --> SH["SectionHeading h2"]
|
||||||
|
MediaText --> Rich["about/RichParagraph x3"]
|
||||||
|
Rich --> RLink["Link underline + RouterLink"]
|
||||||
|
Route --> Story1["about/StorySection background"]
|
||||||
|
Story1 --> PS2["PageSection alt narrow"]
|
||||||
|
PS2 --> Eb1["Eyebrow as h3"]
|
||||||
|
Route --> Duo["PhotoDuo"]
|
||||||
|
Duo --> DI["DeferredImage x2"]
|
||||||
|
Route --> Story2["about/StorySection personal"]
|
||||||
|
Story2 --> PS3["PageSection narrow flushTop"]
|
||||||
|
PS3 --> Eb2["Eyebrow as h3"]
|
||||||
|
Story2 --> Btn["LinkButton accent"]
|
||||||
|
classDef root fill:#4CAF50,stroke:#2e7d32,color:#000;
|
||||||
|
classDef ui fill:#2196F3,stroke:#0d47a1,color:#000;
|
||||||
|
classDef shared fill:#9C27B0,stroke:#4a148c,color:#000;
|
||||||
|
class Shell,Route root;
|
||||||
|
class AboutIntro,Story1,Story2,Rich ui;
|
||||||
|
class PageIntro,PS1,PS2,PS3,MediaText,SH,RLink,Eb1,Eb2,Duo,DI,Btn shared;
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: inside the shell the route renders PageIntro, AboutIntro (a flush-top PageSection with MediaText holding the h2 and three rich paragraphs with links), the background StorySection (alternate tone, narrow, h3 label), PhotoDuo (two deferred images) and the personal StorySection (narrow, flush top, h3 label) ending in the accent LinkButton.
|
||||||
|
|
||||||
|
## Components
|
||||||
|
|
||||||
|
### routes/over-mij.tsx
|
||||||
|
- `head`: `pageHead('/over-mij')` + `scripts: [structuredDataScript(aboutPage('/over-mij', aboutContent.person, siteContent))]`
|
||||||
|
- Composes the blocks with `aboutContent`; passes `booking` as the personal story's child.
|
||||||
|
|
||||||
|
### about/AboutIntro
|
||||||
|
- Props: `{ content: AboutPageContent['intro'] }`
|
||||||
|
- `PageSection` `labelledBy="about-intro-title"`, `spacing="flushTop"`, `data-testid="about-intro"` → `MediaText image aspectRatio="4 / 3"` (portrait crop as in the design) → `SectionHeading id="about-intro-title" eyebrow title align="start" spacing="compact"` + `Stack gap={4} color="ink.soft"` of `RichParagraph`s.
|
||||||
|
|
||||||
|
### about/RichParagraph
|
||||||
|
- Props: `{ paragraph: RichText }`
|
||||||
|
- Renders a `Text`; strings as-is, `InlineLink`s as `Link variant="underline" asChild` → `RouterLink to hash`. Keys from index (static content, order never changes).
|
||||||
|
- Test id on links: `about-link-{to}` is not unique enough (two links may share a route later); use `data-testid` only where tests need it: none — tests find links by accessible name.
|
||||||
|
|
||||||
|
### about/StorySection
|
||||||
|
- Props: `{ content: { title; paragraphs }, titleId, tone?, spacing?, children?, 'data-testid'? }`
|
||||||
|
- `PageSection labelledBy={titleId} width="narrow" tone spacing` → `Reveal` → `Eyebrow as="h3" id={titleId}` + `Stack` of `Text` paragraphs (`ink.soft`) → `children` below with design spacing `mt="clamp(2rem, 4vw, 2.5rem)"` (design `.mt-lg`).
|
||||||
|
- Uses: background `titleId="about-background-title"`, `tone="alt"`, `data-testid="about-background"`; personal `titleId="about-personal-title"`, `spacing="flushTop"`, `data-testid="about-personal"`.
|
||||||
|
|
||||||
|
### PhotoDuo (shared)
|
||||||
|
- Props: `{ photos: [ContentImage, ContentImage]; label: string; 'data-testid'? }`
|
||||||
|
- Wrapped by the route in `PageSection` **without** `labelledBy` (BR-OM-11; prop becomes optional, then the section has no accessible name and is no region).
|
||||||
|
- `ul` (`aria-label={label}`, grid `1fr` → `repeat(2, 1fr)` from `sm`, gap `gridGap`) → `li` → `figure` (`overflow hidden`, `bg="paper.deep"`, hover zoom 1.05 with `fade` duration, off under reduced motion) → `DeferredImage aspectRatio="3 / 2"`; whole list in `Reveal`.
|
||||||
|
- `data-testid="about-photos"`.
|
||||||
|
|
||||||
|
### Booking button
|
||||||
|
- `LinkButton variant="accent" to={booking.to} hash={booking.hash} data-testid="about-booking-link"`.
|
||||||
|
|
||||||
|
## Interactions
|
||||||
|
| Interaction | Result |
|
||||||
|
|---|---|
|
||||||
|
| "mijn portfolio" | navigates to `/portfolio` (placeholder for now) |
|
||||||
|
| "neem contact op", "Boek je shoot" | navigates to `/` and scrolls to `#contact`, which lands below the sticky header |
|
||||||
|
| Scroll | blocks fade in once (instant with reduced motion) |
|
||||||
|
| Hover on a duo photo | gentle zoom (none with reduced motion) |
|
||||||
|
| Keyboard | all links reachable in reading order with the theme focus ring |
|
||||||
|
|
||||||
|
## State
|
||||||
|
None. Pure presentation from props.
|
||||||
|
|
||||||
|
## Responsive
|
||||||
|
- Intro: photo above text below `lg`, side by side from `lg` (MediaText); frame block hidden on phones (FramedImage).
|
||||||
|
- Duo: one column on phones, two from `sm` (design switches at 680px; Chakra `sm` = 480px, same as `IntroGallery`'s choice for its grid).
|
||||||
|
- Story blocks: `contentNarrow` column at all widths.
|
||||||
+64
@@ -0,0 +1,64 @@
|
|||||||
|
# Code Generation Plan — Unit 2: Over mij page
|
||||||
|
|
||||||
|
Single source of truth for code generation of this unit. Workspace root: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie`; code in `web/`. Branch `feature/over-mij-page`.
|
||||||
|
|
||||||
|
## Unit Context
|
||||||
|
- **Requirements**: FR-OM-01..08, SEO-OM-01..05, NFR-OM-01, 03..06
|
||||||
|
- **Design**: [application-design.md](../../inception/application-design/application-design.md); functional design in [construction/over-mij-page/functional-design/](../over-mij-page/functional-design/) (BR-OM-*, BR-SD-*, BR-SEO-OM-*)
|
||||||
|
- **Depends on**: unit 1 (`PageSection`, `MediaText`, `Eyebrow`) — done
|
||||||
|
- **Behavioural contract for existing pages**: the homepage and other pages only change in their head: the business JSON-LD gains `@id` and `founder`
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
### Images
|
||||||
|
- [x] **Step 1** — Download the originals from andreaslop.nl: portrait `2024/10/WhatsApp-Image-2024-10-27-at-14.31.41.jpeg`, `2025/08/slide-1.jpg`, `2025/08/IMG_1718.jpg` (into the scratchpad, not the repo).
|
||||||
|
- [x] **Step 2** — Resize once with the same one-off PowerShell/System.Drawing approach as homepage-sections (quality 80): portrait and duo photos to 1200 px wide → `web/src/assets/about/andrea-portret.jpg`, `about-1.jpg`, `about-2.jpg`; a 1200×630 centre-weighted crop of the portrait → `web/public/og-over-mij.jpg`. Record exact sizes for `width`/`height`.
|
||||||
|
- [x] **Step 3** — Look at each photo and write descriptive Dutch alt texts (BR-OM-04), plus the preview image alt.
|
||||||
|
|
||||||
|
### Content
|
||||||
|
- [x] **Step 4** — `content/types.ts`: add `LinkTarget`, `InlineLink`, `RichText`, `AboutPageContent` (domain-entities.md).
|
||||||
|
- [x] **Step 5** — Create `content/aboutContent.ts` with the live texts, photos, booking link and person data.
|
||||||
|
|
||||||
|
### SEO and pure helpers
|
||||||
|
- [x] **Step 6** — `lib/knowsAboutList.ts` + test: trim, drop empties, dedupe keeping first (example + PBT: invariants, idempotency).
|
||||||
|
- [x] **Step 7** — `seo.ts`: `businessId`, `personId`; `professionalService` gains `@id` + `founder`; new `person(...)`, `aboutPage(...)`, `structuredDataScript(...)`; `siteHead` uses `structuredDataScript`. Comments in English for new code.
|
||||||
|
- [x] **Step 8** — `seo.test.ts`: example tests for the real content and PBT properties from business-logic-model.md (ids, sameAs, no e-mail, registry match); add a `siteContent` and `knowsAbout` arbitrary to `test/arbitraries.ts`.
|
||||||
|
- [x] **Step 9** — `sitePages.ts`: `/over-mij` title, description, `indexed: true`, `ogImage`. `lighthouserc.cjs`: move `/over-mij` to `indexedPaths` (desktop config builds on it). Existing sync and sitemap tests updated where they list noindex pages.
|
||||||
|
|
||||||
|
### Components
|
||||||
|
- [x] **Step 10** — `PageSection`: `labelledBy` optional (BR-OM-11) + test case (no region role without it).
|
||||||
|
- [x] **Step 11** — `components/PhotoDuo/PhotoDuo.tsx` + test (two images with alt, list named by `label`, axe).
|
||||||
|
- [x] **Step 12** — `components/about/RichParagraph.tsx` + test (text and links in order, link targets incl. hash).
|
||||||
|
- [x] **Step 13** — `components/about/AboutIntro.tsx` + test (h2, eyebrow, paragraphs, two links, portrait, region name, axe).
|
||||||
|
- [x] **Step 14** — `components/about/StorySection.tsx` + test (h3 label names the region, paragraphs, children, tone, axe).
|
||||||
|
|
||||||
|
### Route
|
||||||
|
- [x] **Step 15** — `routes/over-mij.tsx`: head (`pageHead` + AboutPage script) and composition (PageIntro → AboutIntro → StorySection background → PhotoDuo in an unnamed PageSection → StorySection personal with `LinkButton accent`).
|
||||||
|
- [x] **Step 16** — Route tests in `app.test.tsx`: `/over-mij` renders in the shell with the heading outline h1/h2/h3/h3, links `/portfolio`, `/#contact` (×2), no `noindex`, the AboutPage script; axe on the whole page.
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
- [x] **Step 17** — `LAYOUT.md`: About me diagram → Intro, About Me, Background, Photos, Personal (letters/colours A–E per `.ai/layout-conventions.md`).
|
||||||
|
- [x] **Step 18** — Update the shared reverse engineering docs (routes table, new components, content model, `/over-mij` indexed, debt item about Over mij images resolved).
|
||||||
|
|
||||||
|
### Verification and summary
|
||||||
|
- [x] **Step 19** — `pnpm check` (lint, format, tests incl. coverage thresholds, build, audits, Lighthouse incl. `/over-mij` as indexed page) — nothing else running on the machine during Lighthouse.
|
||||||
|
- [x] **Step 20** — Visual check of `/over-mij` against `design/andreaslop-static/over-mij.html` in the browser at desktop, tablet and phone widths (screenshots); homepage layout comparison against the unit 1 build (only head changes expected).
|
||||||
|
- [x] **Step 21** — Write `construction/over-mij-page/code/code-summary.md` incl. the resize command and image sizes.
|
||||||
|
- [x] **Step 22** — Commit on `feature/over-mij-page` (push/deploy only when asked).
|
||||||
|
|
||||||
|
## Extension Compliance (unit 2)
|
||||||
|
| Rule | Status | Rationale |
|
||||||
|
|---|---|---|
|
||||||
|
| SECURITY-04 | Compliant | CSP unchanged; only self-hosted images |
|
||||||
|
| SECURITY-10 | Compliant | No new dependencies; image resizing is a one-off local step |
|
||||||
|
| SECURITY-11 | Compliant | JSON-LD through `jsonLdScript`; e-mail excluded (BR-SD-01, PBT) |
|
||||||
|
| SECURITY-13 | Compliant | No external resources at runtime |
|
||||||
|
| Other SECURITY rules | N/A | No data stores, endpoints, auth or infrastructure |
|
||||||
|
| PBT-01 | Compliant | Properties identified in business-logic-model.md |
|
||||||
|
| PBT-02 | Compliant | `jsonLdScript` round-trip already tested |
|
||||||
|
| PBT-03 | Planned | Invariants for ids, sameAs, no e-mail, knowsAbout (Steps 6, 8) |
|
||||||
|
| PBT-04 | Planned | `knowsAboutList` idempotency (Step 6) |
|
||||||
|
| PBT-05, PBT-06 | N/A | No oracle, no stateful logic |
|
||||||
|
| PBT-07 | Planned | `siteContent` and `knowsAbout` arbitraries (Step 8) |
|
||||||
|
| PBT-08, PBT-09 | Compliant | Existing seed logging and fast-check setup |
|
||||||
|
| PBT-10 | Planned | Example-based component and route tests alongside PBT |
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
# Functional Design-vragen — Unit 2: Over mij-pagina
|
||||||
|
|
||||||
|
Al vastgelegd (geen vraag nodig):
|
||||||
|
|
||||||
|
- **`sameAs`** in de JSON-LD komt uit dezelfde social-links als in de footer, met dezelfde filter (`visibleSocials`: alleen geldige https-links). Zijn er geen geldige links, dan valt `sameAs` weg.
|
||||||
|
- **Geen e-mailadres** in de JSON-LD, net als nu.
|
||||||
|
- **Afbeelding van `Person`**: de nieuwe preview-afbeelding uit `public/` (`/og-over-mij.jpg`). Die heeft een vaste URL; de foto's in de bundel krijgen bij elke build een andere naam.
|
||||||
|
- **"Boek je shoot" en "neem contact op"** gaan naar `/#contact`, zonder een vooraf gekozen pakket. Dat werkt op dezelfde manier als de knoppen op de prijskaarten (`RouterLink` met `hash="contact"`).
|
||||||
|
- **Alt-teksten** schrijf ik nadat ik de foto's heb bekeken; Andrea leest ze later na.
|
||||||
|
|
||||||
|
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Vraag 1: Hoe leggen we een alinea met links vast?
|
||||||
|
|
||||||
|
De alinea "Nieuwsgierig naar mijn werk? Bekijk **mijn portfolio** of **neem contact op** voor een fotoshoot!" bevat twee links. De content moet platte data blijven die de API straks 1-op-1 kan leveren, en Andrea moet zulke tekst later in een CMS kunnen bewerken.
|
||||||
|
|
||||||
|
- A) **Stukjes**: een alinea is een lijst van tekst en links, bijvoorbeeld `['Nieuwsgierig naar mijn werk? Bekijk ', { text: 'mijn portfolio', to: '/portfolio' }, ' of ', …]`. Geen parser nodig, de link-doelen zijn getypeerd, en het lijkt op wat rich-text-editors in een CMS opslaan. (aanbevolen)
|
||||||
|
- B) **Markdown-achtige tekst**: `'Bekijk [mijn portfolio](/portfolio) of …'`, met een kleine parser in `lib/`. Leesbaar voor mensen, maar de parser en de controle van de link-doelen moeten zelf gebouwd en getest worden, en een tikfout in een link valt pas bij het draaien op.
|
||||||
|
- C) **Sjabloon met plaatshouders**: `'Bekijk {portfolio} of {contact} voor een fotoshoot!'` plus een lijst links. Kort, maar twee plekken die bij elkaar moeten blijven passen.
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 2: Hoe ziet een link-doel eruit?
|
||||||
|
|
||||||
|
Links gaan naar een pagina, soms met een anker: `/portfolio`, `/#contact` en later `/contact`.
|
||||||
|
|
||||||
|
- A) **Route plus optioneel anker**: `{ to: '/', hash: 'contact' }`, waarbij `to` een bestaande route moet zijn (een tikfout is een typefout, net als in de menu's). Past direct op `RouterLink`. (aanbevolen)
|
||||||
|
- B) **Vrije tekst**: `'/#contact'`. Simpeler, maar zonder controle of de pagina bestaat.
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 3: Wat staat er over Andrea in de gestructureerde data (`Person`)?
|
||||||
|
|
||||||
|
Zoekmachines verwachten dat gestructureerde data overeenkomt met wat er zichtbaar op de pagina staat.
|
||||||
|
|
||||||
|
- A) **Basis**: naam (Andrea Slop), functie (lifestyle fotograaf), plaats (Huizen, NL), afbeelding, social-links en de koppeling aan het bedrijf
|
||||||
|
- B) **Basis + specialisaties**: als A, plus `knowsAbout` met de drie specialisaties die in de tekst staan (newbornfotografie, zwangerschapsfotografie, gezinsfotografie) (aanbevolen)
|
||||||
|
- C) **B + opleiding**: ook de studie Communicatie & Media Design. De naam van de hogeschool staat niet op de pagina, dus dat wordt een opleiding zonder instelling.
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: B
|
||||||
|
|
||||||
|
## Vraag 4: Koppeling tussen Andrea en het bedrijf
|
||||||
|
|
||||||
|
Het bedrijf (`ProfessionalService`) staat op elke pagina; Andrea (`Person`) alleen op deze pagina.
|
||||||
|
|
||||||
|
- A) **Alleen vanaf deze pagina**: `Person.worksFor` verwijst naar het bedrijf via zijn `@id`. De gegevens van het bedrijf op de andere pagina's veranderen niet, behalve dat ze dat vaste `@id` krijgen. (aanbevolen)
|
||||||
|
- B) **Twee kanten op**: ook het bedrijf op elke pagina verwijst naar Andrea (`founder`), via een `@id` dat naar deze pagina wijst
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: B
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
# Functional Design Plan — Unit 2: Over mij page
|
||||||
|
|
||||||
|
Depth: minimal. Scope from the execution plan: the content model with inline links, and the rules and testable properties of the structured data (PBT-01). Questions: [over-mij-page-fd-questions.md](over-mij-page-fd-questions.md).
|
||||||
|
|
||||||
|
- [x] Collect and analyse the answers in `over-mij-page-fd-questions.md`
|
||||||
|
- [x] `domain-entities.md` — `AboutPageContent`, `RichText` and its segments, link target, `ContentImage` reuse; structured data entities (`AboutPage`, `Person`, `ProfessionalService` `@id`)
|
||||||
|
- [x] `business-rules.md` — content rules (texts, link targets, alt texts), structured data rules (fields, sources, exclusions, linking), SEO registry rules (indexed, title/description limits, preview image)
|
||||||
|
- [x] `business-logic-model.md` — how the route turns content and site data into head tags, JSON-LD and the rendered page; pure functions and their properties for PBT (PBT-01)
|
||||||
|
- [x] `frontend-components.md` — component hierarchy, props, heading ids, interactions (links, hash navigation to `/#contact`, reveal), test ids
|
||||||
|
- [x] Validate against requirements.md, application-design.md and the extension rules
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
# Code Generation Plan — Unit 1: Shared blocks
|
||||||
|
|
||||||
|
Single source of truth for code generation of this unit. Workspace root: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie`; all code in `web/src/`. Branch `feature/over-mij-page`.
|
||||||
|
|
||||||
|
## Unit Context
|
||||||
|
- **Requirements**: FR-OM-09 (`HomeSection` → `PageSection`), FR-OM-10 (shared media+text block), NFR-OM-02 (reuse, tokens, English comments), NFR-OM-03 (tests)
|
||||||
|
- **Design**: [application-design.md](../../inception/application-design/application-design.md) — `Eyebrow` (Q2), `PageSection` + `flushTop`, `MediaText` layout-only (Q1)
|
||||||
|
- **Dependencies**: none on other units; unit 2 builds on everything here
|
||||||
|
- **Behavioural contract**: the homepage renders exactly as before — same DOM roles, names, texts, styles. Existing tests must pass unchanged except for renamed imports/names.
|
||||||
|
- **No business logic, no new pure helpers** → no property-based tests in this unit (PBT rules N/A: no properties to test in layout components). Example-based component tests + axe.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
### Eyebrow
|
||||||
|
- [x] **Step 1** — Create `components/Eyebrow/Eyebrow.tsx`: Chakra `Text` with `textStyle="eyebrow"`, `color="accent.deep"`, `mb={4}`, an `as` prop (`'p' | 'span' | 'h2' | 'h3' | 'h4'`, default `p`) and pass-through `TextProps`. Comment: why `accent.deep` (4.5:1).
|
||||||
|
- [x] **Step 2** — Create `components/Eyebrow/Eyebrow.test.tsx`: renders a paragraph by default; with `as="h3"` it is a level-3 heading with that name and can carry an `id`; extra props (e.g. `mb`) pass through; axe clean.
|
||||||
|
- [x] **Step 3** — Switch the four identical inline labels to `Eyebrow` (same output): `SectionHeading`, `PageIntro`, `ContactForm/ContactFormGate`, `home/Testimonials/TestimonialSlide` (only its shoot label, not the author line). Remove the then-duplicated contrast comments where `Eyebrow` now carries the reason.
|
||||||
|
|
||||||
|
### PageSection
|
||||||
|
- [x] **Step 4** — Rename `components/HomeSection/` → `components/PageSection/` (`git mv` for the component and its test), rename the component and props type, update the doc comment to "a content section on any page".
|
||||||
|
- [x] **Step 5** — Add `spacing="flushTop"`: no top padding, bottom padding as `default` (design `.section--flush-top`).
|
||||||
|
- [x] **Step 6** — Update all importers: `home/AboutBlock`, `home/ContactSection`, `home/InstagramGrid`, `home/IntroGallery`, `home/Pricing/Pricing`, `home/Testimonials/Testimonials`.
|
||||||
|
- [x] **Step 7** — Update `PageSection.test.tsx`: renamed; add a case for `flushTop` (top padding 0, bottom padding kept).
|
||||||
|
|
||||||
|
### MediaText
|
||||||
|
- [x] **Step 8** — Create `components/MediaText/MediaText.tsx`: grid `1fr` → `1fr 1fr` from `lg`, gap `clamp(2rem, 6vw, 5.5rem)`, `alignItems="center"`; first column `Reveal` → `FramedImage image aspectRatio`; second column `Reveal` → `children`. Props: `image`, `aspectRatio`, `data-testid?`, `children`.
|
||||||
|
- [x] **Step 9** — Create `components/MediaText/MediaText.test.tsx`: shows the image with its alt text and the children; photo comes before the text in DOM order; axe clean.
|
||||||
|
- [x] **Step 10** — Switch `home/AboutBlock` to `PageSection` + `MediaText` (the text column keeps `SectionHeading`, the paragraphs and the link). `AboutBlock.test.tsx` passes unchanged.
|
||||||
|
|
||||||
|
### Verification and summary
|
||||||
|
- [x] **Step 11** — Search for leftovers: no `HomeSection` references in `web/` (code, tests, comments); no duplicate component files.
|
||||||
|
- [x] **Step 12** — Run `pnpm check` in `web/` (lint, format, typecheck/build, tests with coverage, audits, Lighthouse). Fix and rerun until green.
|
||||||
|
- [x] **Step 13** — Visual check of the homepage against master in the browser (desktop and phone width): About block, section headings, page intro of a placeholder page, contact notice, testimonial label — no visible difference.
|
||||||
|
- [x] **Step 14** — Update the shared reverse engineering docs where they name `HomeSection` (architecture, code-structure, api-documentation, component-inventory, code-quality-assessment: debt item resolved) and list `Eyebrow`, `MediaText`.
|
||||||
|
- [x] **Step 15** — Write `aidlc-docs/features/over-mij-page/construction/shared-blocks/code/code-summary.md` (created/modified files, tests, verification outcome).
|
||||||
|
- [x] **Step 16** — Commit on `feature/over-mij-page` (no push until asked).
|
||||||
|
|
||||||
|
## Files
|
||||||
|
- **Created**: `components/Eyebrow/Eyebrow.tsx`, `Eyebrow.test.tsx`; `components/MediaText/MediaText.tsx`, `MediaText.test.tsx`
|
||||||
|
- **Renamed + modified**: `components/HomeSection/*` → `components/PageSection/PageSection.tsx`, `PageSection.test.tsx`
|
||||||
|
- **Modified**: `components/SectionHeading/SectionHeading.tsx`, `components/PageIntro/PageIntro.tsx`, `components/ContactForm/ContactFormGate.tsx`, `components/home/Testimonials/TestimonialSlide.tsx`, `components/home/AboutBlock/AboutBlock.tsx`, `components/home/{ContactSection,InstagramGrid,IntroGallery,Pricing/Pricing,Testimonials/Testimonials}.tsx`
|
||||||
|
- **Docs**: `aidlc-docs/_shared/reverse-engineering/*.md` (names), unit code summary
|
||||||
|
|
||||||
|
## Extension Compliance (unit 1)
|
||||||
|
| Rule | Status | Rationale |
|
||||||
|
|---|---|---|
|
||||||
|
| SECURITY-10 | Compliant | No new dependencies |
|
||||||
|
| Other SECURITY rules | N/A | Presentational refactor; no data, endpoints, headers or config |
|
||||||
|
| PBT-01..10 | N/A | No pure functions or business logic in this unit; example-based component tests cover the layout contract (PBT-10 complementary testing applies in unit 2) |
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# Code Summary — Unit 1: Shared blocks
|
||||||
|
|
||||||
|
Plan: [shared-blocks-code-generation-plan.md](../../plans/shared-blocks-code-generation-plan.md). Requirements: FR-OM-09, FR-OM-10, NFR-OM-02, NFR-OM-03.
|
||||||
|
|
||||||
|
## Created
|
||||||
|
- `web/src/components/Eyebrow/Eyebrow.tsx` — accent label (`textStyle="eyebrow"`, `accent.deep`, `mb={4}`), `as` prop for `p`/`span`/`h2`–`h4`, other `TextProps` pass through
|
||||||
|
- `web/src/components/Eyebrow/Eyebrow.test.tsx` — paragraph by default; as h3 a heading that names a region; props pass through; axe
|
||||||
|
- `web/src/components/MediaText/MediaText.tsx` — framed photo next to a text column (`children`), stacked below `lg`, both columns in `Reveal`
|
||||||
|
- `web/src/components/MediaText/MediaText.test.tsx` — photo and text shown, photo first in DOM order; axe
|
||||||
|
|
||||||
|
## Renamed and modified
|
||||||
|
- `web/src/components/HomeSection/HomeSection.tsx` → `web/src/components/PageSection/PageSection.tsx` — renamed component/props; new `spacing="flushTop"` (no top padding, bottom padding as default)
|
||||||
|
- `HomeSection.test.tsx` → `PageSection.test.tsx` — renamed; new case for `flushTop`
|
||||||
|
|
||||||
|
## Modified
|
||||||
|
- `components/SectionHeading/SectionHeading.tsx`, `components/PageIntro/PageIntro.tsx`, `components/ContactForm/ContactFormGate.tsx`, `components/home/Testimonials/TestimonialSlide.tsx` — inline label replaced by `Eyebrow` (contrast comment now lives in `Eyebrow`)
|
||||||
|
- `components/home/AboutBlock/AboutBlock.tsx` — uses `PageSection` + `MediaText`
|
||||||
|
- `components/home/{ContactSection,InstagramGrid,IntroGallery,Pricing/Pricing,Testimonials/Testimonials}.tsx` — import `PageSection`
|
||||||
|
- `aidlc-docs/_shared/reverse-engineering/*.md` — names updated (`PageSection`, `MediaText`, `Eyebrow`); `HomeSection` debt item removed
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
- **Leftovers**: no `HomeSection` in `web/` source, tests or comments
|
||||||
|
- **`pnpm check`**: lint, format, typecheck/build, 55 test files / 250 tests, coverage thresholds, audits — passed. Lighthouse failed in the first run (mobile performance `/` 0.71, `/over-mij` 0.87) because a second production build was running at the same time on the same machine; rerun alone: passed — mobile `/` 0.82 (budget 0.8), other pages 0.94–0.95; desktop 0.99–1; accessibility 1 everywhere
|
||||||
|
- **Homepage unchanged**: master and branch production builds compared in headless Chrome at 1440, 768 and 390 px (reduced motion, after scrolling through the page): tag, ids, `aria-labelledby`, alt, text, position, size and 21 computed styles of every element in `<main>` — 233/233 elements identical on `/`, identical on `/over-mij` and `/contact` (placeholders with `PageIntro`). The same comparison of master against itself is also identical, so the method is stable. (Byte-for-byte screenshots were not usable: they already differ between two runs of master, through image loading and timing.)
|
||||||
|
|
||||||
|
## Extension Compliance
|
||||||
|
| Rule | Status | Rationale |
|
||||||
|
|---|---|---|
|
||||||
|
| SECURITY-10 | Compliant | No new dependencies |
|
||||||
|
| Other SECURITY rules | N/A | Presentational refactor only |
|
||||||
|
| PBT-01..10 | N/A | No pure functions or business logic in this unit |
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# Application Design — Over mij Page
|
||||||
|
|
||||||
|
Consolidated view of [components.md](components.md), [component-methods.md](component-methods.md), [services.md](services.md) and [component-dependency.md](component-dependency.md). Decisions: [application-design-plan.md](../plans/application-design-plan.md) (Q1–Q4 = A).
|
||||||
|
|
||||||
|
## Design Decisions
|
||||||
|
| # | Decision |
|
||||||
|
|---|---|
|
||||||
|
| Q1 | `MediaText` is layout only: photo as data, text column as `children` |
|
||||||
|
| Q2 | One `Eyebrow` component (`as` prop) for every accent label; with `as="h3"` it is the story headings; `SectionHeading`, `PageIntro`, `ContactFormGate` and `TestimonialSlide` switch to it |
|
||||||
|
| Q3 | New small `PhotoDuo`; `IntroGallery` stays as it is |
|
||||||
|
| Q4 | Page-specific components in `components/about/` (`AboutIntro`, `StorySection`, `RichParagraph`); shared blocks each in their own folder under `components/` |
|
||||||
|
| — | `HomeSection` → `PageSection`, plus spacing `flushTop` |
|
||||||
|
| — | Structured data builders in `seo.ts`; route head = `pageHead` + `AboutPage` script; business gets a stable `@id` |
|
||||||
|
| — | Content in `content/aboutContent.ts` typed by `AboutPageContent`; images in `assets/about/`, preview image in `public/` |
|
||||||
|
|
||||||
|
## Page Composition
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
Page["/over-mij"] --> Intro["PageIntro: eyebrow + h1 Over mij"]
|
||||||
|
Page --> A["AboutIntro: PageSection flushTop + MediaText"]
|
||||||
|
A --> AH["SectionHeading: Lifestyle fotograaf + h2 Hoi! Ik ben Andrea"]
|
||||||
|
A --> AP["RichParagraph x3 with links /portfolio and /#contact"]
|
||||||
|
Page --> B["StorySection tone alt: Eyebrow h3 Hoe het begon + text"]
|
||||||
|
Page --> D["PhotoDuo: two 3:2 photos"]
|
||||||
|
Page --> E["StorySection: Eyebrow h3 Buiten de camera om + text"]
|
||||||
|
E --> Btn["LinkButton accent: Boek je shoot to /#contact"]
|
||||||
|
classDef page fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
||||||
|
classDef block fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
||||||
|
classDef part fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||||
|
class Page page;
|
||||||
|
class Intro,A,B,D,E block;
|
||||||
|
class AH,AP,Btn part;
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: the page renders the page head with the h1, the intro block (photo next to an h2 and three paragraphs with links), the "Hoe het begon" story block on the alternate background, the photo duo, and the "Buiten de camera om" story block ending in the booking button.
|
||||||
|
|
||||||
|
Heading outline: h1 Over mij → h2 Hoi! Ik ben Andrea → h3 Hoe het begon, h3 Buiten de camera om.
|
||||||
|
|
||||||
|
## Components
|
||||||
|
- **New shared**: `MediaText`, `Eyebrow` (unit 1), `PhotoDuo` (unit 2)
|
||||||
|
- **Changed shared**: `PageSection` (renamed + `flushTop`), `SectionHeading`, `PageIntro`, `ContactFormGate`, `TestimonialSlide` (use `Eyebrow`), `home/AboutBlock` (uses `MediaText`) — all output-preserving
|
||||||
|
- **New page-specific**: `about/AboutIntro`, `about/StorySection`, `about/RichParagraph`
|
||||||
|
- **Changed modules**: `routes/over-mij.tsx`, `content/types.ts`, `seo.ts`, `sitePages.ts`, `lighthouserc*.cjs`
|
||||||
|
- **New modules/assets**: `content/aboutContent.ts`, `assets/about/*`, `public/og-over-mij.jpg`
|
||||||
|
|
||||||
|
Interfaces: see [component-methods.md](component-methods.md).
|
||||||
|
|
||||||
|
## Composition and Data Flow
|
||||||
|
Props down only, from the route; no service layer, context or fetching. The route builds the head from `seo.ts` and passes static content to presentational components (see [services.md](services.md)).
|
||||||
|
|
||||||
|
## Dependencies and Order
|
||||||
|
See [component-dependency.md](component-dependency.md). Unit 1 builds `Eyebrow`, `PageSection` and `MediaText` and switches the existing users with unchanged output; unit 2 builds the page on top.
|
||||||
|
|
||||||
|
## Left to Functional Design (unit 2)
|
||||||
|
- `RichText` (paragraph with inline links) and the type of link targets that may include a hash (`/#contact`)
|
||||||
|
- Fields and rules of the `Person` / `AboutPage` structured data, and the properties to test (PBT-01)
|
||||||
|
|
||||||
|
## Extension Compliance — Application Design
|
||||||
|
| Rule | Status | Rationale |
|
||||||
|
|---|---|---|
|
||||||
|
| SECURITY-04 | Compliant | No CSP change; only self-hosted assets |
|
||||||
|
| SECURITY-10 | Compliant | No new dependencies |
|
||||||
|
| SECURITY-11 | Compliant | Structured data via the escaping `jsonLdScript`; e-mail kept out |
|
||||||
|
| SECURITY-13 | Compliant | No external resources |
|
||||||
|
| Other SECURITY rules | N/A | No data stores, endpoints, auth, infrastructure or server code |
|
||||||
|
| PBT-01 | Planned | Properties of the SEO builders identified in Functional Design (unit 2) |
|
||||||
|
| PBT-02..10 | N/A at this stage | Applied in Functional Design and Code Generation |
|
||||||
+67
@@ -0,0 +1,67 @@
|
|||||||
|
# Component Dependencies — Over mij Page
|
||||||
|
|
||||||
|
## Dependency Matrix
|
||||||
|
|
||||||
|
| Component (uses →) | PageSection | MediaText | Eyebrow | SectionHeading | PhotoDuo | FramedImage | DeferredImage | Reveal | LinkButton | Link + RouterLink |
|
||||||
|
|---|---|---|---|---|---|---|---|---|---|---|
|
||||||
|
| routes/over-mij.tsx | | | | | ✓ | | | | ✓ | |
|
||||||
|
| AboutIntro | ✓ | ✓ | | ✓ | | | | | | ✓ (via RichParagraph) |
|
||||||
|
| StorySection | ✓ | | ✓ | | | | | ✓ | | |
|
||||||
|
| RichParagraph | | | | | | | | | | ✓ |
|
||||||
|
| home/AboutBlock | ✓ | ✓ | | ✓ | | | | | | ✓ |
|
||||||
|
| MediaText | | | | | | ✓ | | ✓ | | |
|
||||||
|
| PhotoDuo | | | | | | | ✓ | ✓ | | |
|
||||||
|
| SectionHeading | | | ✓ | | | | | | | |
|
||||||
|
| PageIntro | | | ✓ | | | | | | | |
|
||||||
|
| ContactFormGate, TestimonialSlide | | | ✓ | | | | | | | |
|
||||||
|
| other home sections | ✓ | | | ✓ | | | ✓ | ✓ | | |
|
||||||
|
|
||||||
|
The route also uses `PageIntro`, the components in `components/about/`, `content/aboutContent.ts`, `content/siteContent.ts` and `seo.ts`.
|
||||||
|
|
||||||
|
## Diagram
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
Route["routes/over-mij.tsx"] --> PageIntro
|
||||||
|
Route --> AboutIntro["about/AboutIntro"]
|
||||||
|
Route --> Story["about/StorySection (x2)"]
|
||||||
|
Route --> PhotoDuo
|
||||||
|
Route --> LinkButton
|
||||||
|
Route --> Content["content/aboutContent.ts"]
|
||||||
|
Route --> Seo["seo.ts + sitePages.ts"]
|
||||||
|
AboutIntro --> MediaText
|
||||||
|
AboutIntro --> SectionHeading
|
||||||
|
AboutIntro --> Rich["about/RichParagraph"]
|
||||||
|
Story --> Eyebrow
|
||||||
|
Story --> PageSection
|
||||||
|
AboutIntro --> PageSection
|
||||||
|
HomeAbout["home/AboutBlock"] --> MediaText
|
||||||
|
HomeAbout --> PageSection
|
||||||
|
MediaText --> FramedImage
|
||||||
|
FramedImage --> DeferredImage
|
||||||
|
PhotoDuo --> DeferredImage
|
||||||
|
SectionHeading --> Eyebrow
|
||||||
|
PageIntro --> Eyebrow
|
||||||
|
classDef route fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
||||||
|
classDef newpart fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000;
|
||||||
|
classDef changed fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||||
|
classDef existing fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||||
|
class Route route;
|
||||||
|
class AboutIntro,Story,Rich,PhotoDuo,MediaText,Eyebrow,Content newpart;
|
||||||
|
class PageSection,HomeAbout,SectionHeading,PageIntro,Seo changed;
|
||||||
|
class FramedImage,DeferredImage,LinkButton existing;
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: the route composes PageIntro, AboutIntro, two StorySections, PhotoDuo and LinkButton from aboutContent and the SEO module; AboutIntro and the homepage AboutBlock both use MediaText and PageSection; StorySection, SectionHeading and PageIntro use the new Eyebrow; MediaText and PhotoDuo rely on FramedImage/DeferredImage (new in orange, changed in blue, existing in grey).
|
||||||
|
|
||||||
|
## Communication Patterns
|
||||||
|
- **Props down only**: content flows from the route into components; no context, store or fetching. Components stay presentational and testable in isolation.
|
||||||
|
- **Heading ids**: each section component owns a constant title id (as on the homepage) or receives one (`StorySection` is used twice, so the route passes `titleId`), and passes it to `PageSection labelledBy`.
|
||||||
|
- **Theme coupling**: components reference tokens by name (`paper.alt`, `gridGap`, `accent.deep`, text styles); no literal colours.
|
||||||
|
|
||||||
|
## Data Flow
|
||||||
|
`aboutContent.ts` (static data, image imports) → route → page components → shared blocks → Chakra primitives. Head data: `sitePages.ts` + `siteContent.ts` → `seo.ts` builders → route `head()` → `HeadContent` in the root route.
|
||||||
|
|
||||||
|
## Change Order (from the dependencies)
|
||||||
|
1. Unit 1: `Eyebrow` → switch `SectionHeading`/`PageIntro`/`ContactFormGate`/`TestimonialSlide` → rename `HomeSection` → `PageSection` (+ `flushTop`) → `MediaText` → switch `AboutBlock`. Homepage output unchanged after each step.
|
||||||
|
2. Unit 2: assets → content types and data → `seo.ts`/`sitePages.ts` → `PhotoDuo`, `components/about/*` → route → Lighthouse config → LAYOUT.md.
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
# Component Methods — Over mij Page
|
||||||
|
|
||||||
|
Props are TypeScript types; components are default-exported function components, as elsewhere in `web/src/components/`. Business rules (structured data contents, inline link model) are detailed in Functional Design for unit 2.
|
||||||
|
|
||||||
|
## Shared building blocks
|
||||||
|
|
||||||
|
### PageSection (renamed from HomeSection)
|
||||||
|
```ts
|
||||||
|
type PageSectionProps = {
|
||||||
|
labelledBy: string; // id of the heading that names the section
|
||||||
|
id?: string; // anchor target, gets the header offset
|
||||||
|
tone?: 'paper' | 'alt';
|
||||||
|
width?: 'default' | 'narrow' | 'full';
|
||||||
|
spacing?: 'default' | 'tight' | 'flushTop'; // flushTop: new
|
||||||
|
'data-testid'?: string;
|
||||||
|
children: ReactNode;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### MediaText
|
||||||
|
```ts
|
||||||
|
type MediaTextProps = {
|
||||||
|
image: ContentImage;
|
||||||
|
aspectRatio: string; // crop of the photo, e.g. '4 / 3'
|
||||||
|
'data-testid'?: string;
|
||||||
|
children: ReactNode; // the text column
|
||||||
|
};
|
||||||
|
```
|
||||||
|
- Renders the grid; the photo column is `FramedImage`, each column wrapped in `Reveal`.
|
||||||
|
- A `reverse` (photo on the right) option is **not** added: no page needs it yet (design `.about--reverse` is unused).
|
||||||
|
|
||||||
|
### Eyebrow
|
||||||
|
```ts
|
||||||
|
type EyebrowProps = Omit<TextProps, 'as'> & {
|
||||||
|
as?: 'p' | 'span' | 'h2' | 'h3' | 'h4'; // default 'p'
|
||||||
|
children: ReactNode;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
- Applies `textStyle="eyebrow"`, `color="accent.deep"`, `mb={4}`; other `TextProps` (e.g. `id`, `mb`) pass through, so a heading can be referenced by `aria-labelledby`.
|
||||||
|
- Heading levels do not get the heading recipe's font family/size: the label style wins on purpose (FR-OM-03).
|
||||||
|
|
||||||
|
### PhotoDuo
|
||||||
|
```ts
|
||||||
|
type PhotoDuoProps = {
|
||||||
|
photos: [ContentImage, ContentImage];
|
||||||
|
label: string; // accessible name of the list, e.g. "Foto's"
|
||||||
|
'data-testid'?: string;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### SectionHeading, PageIntro, ContactFormGate, TestimonialSlide
|
||||||
|
- Props unchanged; internally `Eyebrow` replaces the inline `Text` label.
|
||||||
|
|
||||||
|
## Page-specific components (`components/about/`)
|
||||||
|
|
||||||
|
### AboutIntro
|
||||||
|
```ts
|
||||||
|
type AboutIntroProps = { content: AboutPageContent['intro'] };
|
||||||
|
```
|
||||||
|
|
||||||
|
### StorySection
|
||||||
|
```ts
|
||||||
|
type StorySectionProps = {
|
||||||
|
content: AboutPageContent['story']; // one story block: title + paragraphs
|
||||||
|
titleId: string; // id of the h3, for aria-labelledby
|
||||||
|
tone?: 'paper' | 'alt';
|
||||||
|
children?: ReactNode; // below the text, e.g. the booking button
|
||||||
|
'data-testid'?: string;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### RichParagraph
|
||||||
|
```ts
|
||||||
|
type RichParagraphProps = { paragraph: RichText }; // RichText defined in Functional Design
|
||||||
|
```
|
||||||
|
|
||||||
|
## Route
|
||||||
|
```ts
|
||||||
|
export const Route = createFileRoute('/over-mij')({
|
||||||
|
head: () => aboutHead(aboutContent, siteContent), // or inline: pageHead + script
|
||||||
|
component: About,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## SEO functions (`seo.ts`, pure, 100% coverage)
|
||||||
|
```ts
|
||||||
|
export const businessId: string; // e.g. `${siteUrl}/#business`
|
||||||
|
export function professionalService(content: SiteContent); // now includes '@id': businessId
|
||||||
|
export function person(content: SiteContent, image: OgImage): PersonJsonLd;
|
||||||
|
export function aboutPage(path: RoutePath, content: SiteContent): AboutPageJsonLd;
|
||||||
|
export function structuredDataScript(data: unknown): { type: 'application/ld+json'; children: string };
|
||||||
|
```
|
||||||
|
- `structuredDataScript` wraps the existing `jsonLdScript` so `siteHead` and the about page build the script tag the same way.
|
||||||
|
- Exact fields and the rules behind them (`sameAs`, image, no e-mail, `@id` links) are specified in Functional Design (unit 2).
|
||||||
|
|
||||||
|
## Content types (`content/types.ts`)
|
||||||
|
```ts
|
||||||
|
export interface AboutPageContent {
|
||||||
|
head: { eyebrow: string; title: string };
|
||||||
|
intro: { eyebrow: string; title: string; paragraphs: RichText[]; image: ContentImage };
|
||||||
|
background: { title: string; paragraphs: string[] };
|
||||||
|
photos: [ContentImage, ContentImage];
|
||||||
|
personal: { title: string; paragraphs: string[] };
|
||||||
|
booking: { label: string; to: /* route + optional hash, see Functional Design */ };
|
||||||
|
}
|
||||||
|
```
|
||||||
|
- `RichText` and the link target type are defined in Functional Design.
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
# Components — Over mij Page
|
||||||
|
|
||||||
|
All paths are under `web/src/`. "Unit" refers to the execution plan (1 = Shared blocks, 2 = Over mij page).
|
||||||
|
|
||||||
|
## Shared building blocks (`components/<Name>/`)
|
||||||
|
|
||||||
|
### PageSection — changed (unit 1)
|
||||||
|
- **Was**: `HomeSection` (renamed: folder, file, component, test, all imports). *Source: Q9 = A*
|
||||||
|
- **Purpose**: frame of a content section on any page (design `.section`): `section` element named by its heading, vertical rhythm, background tone, content column, anchor offset under the fixed header.
|
||||||
|
- **Change besides the rename**: spacing option `flushTop` — no top padding, for the first block directly under a page head (design `.section--flush-top`). Existing options and output stay identical.
|
||||||
|
|
||||||
|
### MediaText — new (unit 1)
|
||||||
|
- **Purpose**: a photo in the sand-coloured frame next to a text column (design `.about`); stacked on phones and tablets, two equal columns from `lg`, vertically centred. Both columns fade in (`Reveal`).
|
||||||
|
- **Interface**: layout only — the photo comes in as data, the text column as `children`. *Source: Q1 = A*
|
||||||
|
- **Used by**: homepage `AboutBlock` (unit 1, no visible change) and `AboutIntro` (unit 2).
|
||||||
|
- **Reuses**: `FramedImage` (→ `DeferredImage`), `Reveal`, Chakra `Grid`.
|
||||||
|
|
||||||
|
### Eyebrow — new (unit 1)
|
||||||
|
- **Purpose**: the small capitals label above a heading (design `.eyebrow`) in one place: text style `eyebrow`, colour `accent.deep` (meets 4.5:1), standard space below. Renders a `p` by default; with `as="h3"` (or another heading level) it is a real heading that looks like the label. *Source: Q2 = A*
|
||||||
|
- **Replaces** the four identical inline label blocks in `SectionHeading`, `PageIntro`, `ContactFormGate` and `TestimonialSlide` (same output). Labels that look different on purpose (hero on photos, footer column titles, form labels, nav links, testimonial author line) are left alone.
|
||||||
|
|
||||||
|
### PhotoDuo — new (unit 2)
|
||||||
|
- **Purpose**: two landscape photos side by side at 3:2 (design `.intro-gallery--duo`), one below the other on phones; no stagger, no swipe row. *Source: Q3 = A*
|
||||||
|
- **Semantics**: a labelled list of figures (`ul`/`li`), each image with its own alt text.
|
||||||
|
- **Hover**: the design's `.intro-gallery figure:hover img` zoom applies to the duo too, so `PhotoDuo` zooms gently on hover like `IntroGallery`, with `_motionReduce` turning the transition off.
|
||||||
|
- **Reuses**: `DeferredImage`, `Reveal`, token `gridGap`.
|
||||||
|
|
||||||
|
### Existing, reused unchanged
|
||||||
|
- `PageIntro` (page head with the h1) — only switches to `Eyebrow` internally.
|
||||||
|
- `SectionHeading` (eyebrow + h2 + lead) — only switches to `Eyebrow` internally.
|
||||||
|
- `FramedImage`, `DeferredImage`, `Reveal`, `LinkButton` (`accent`), `RouterLink`, Chakra `Link` (`underline` variant).
|
||||||
|
|
||||||
|
## Page-specific components (`components/about/`, unit 2) — *Source: Q4 = A*
|
||||||
|
|
||||||
|
### AboutIntro
|
||||||
|
- **Purpose**: the "Hoi! Ik ben Andrea" block: `PageSection` (`flushTop`) → `MediaText` with the portrait → `SectionHeading` (eyebrow "Lifestyle fotograaf", h2, `align="start"`, compact) and the paragraphs, one of which contains the links "mijn portfolio" and "neem contact op".
|
||||||
|
|
||||||
|
### StorySection
|
||||||
|
- **Purpose**: one text block of Andrea's story, used twice ("Hoe het begon", "Buiten de camera om"): `PageSection` (narrow column, tone per use) → `Eyebrow as="h3"` → paragraphs → optional `children` below the text (the "Boek je shoot" button).
|
||||||
|
|
||||||
|
### RichParagraph (helper inside `components/about/`, or shared if Functional Design shows a second user)
|
||||||
|
- **Purpose**: renders one paragraph of the content model in which some words are links (shape defined in Functional Design), mapping link segments to `Link variant="underline"` + `RouterLink`.
|
||||||
|
|
||||||
|
## Route
|
||||||
|
### routes/over-mij.tsx — changed (unit 2)
|
||||||
|
- `head()`: `pageHead('/over-mij')` plus the `AboutPage` JSON-LD script.
|
||||||
|
- `component`: `PageIntro` → `AboutIntro` → `StorySection` (Hoe het begon, `paper.alt`) → `PhotoDuo` → `StorySection` (Buiten de camera om, with `LinkButton`).
|
||||||
|
|
||||||
|
## Content and SEO modules
|
||||||
|
### content/aboutContent.ts + `AboutPageContent` in content/types.ts — new (unit 2)
|
||||||
|
- Page head texts, intro block (eyebrow, title, paragraphs, portrait), two story blocks (title, paragraphs), duo photos, booking button (label, target).
|
||||||
|
|
||||||
|
### seo.ts — changed (unit 2)
|
||||||
|
- New pure builders for the `Person` and `AboutPage` structured data; the business (`professionalService`) gets a stable `@id`.
|
||||||
|
|
||||||
|
### sitePages.ts — changed (unit 2)
|
||||||
|
- `/over-mij`: new title and description, `indexed: true`, `ogImage` → `/og-over-mij.jpg` (1200×630).
|
||||||
|
|
||||||
|
### Lighthouse config — changed (unit 2)
|
||||||
|
- `lighthouserc.cjs` / `.desktop.cjs`: `/over-mij` moves from the noindex to the indexed paths.
|
||||||
|
|
||||||
|
## Assets (unit 2)
|
||||||
|
- `assets/about/`: portrait and two duo photos (resized originals).
|
||||||
|
- `public/og-over-mij.jpg`: 1200×630 crop of the portrait.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Services — Over mij Page
|
||||||
|
|
||||||
|
This is a static single-page app without a back-end: there is no service layer. "Orchestration" is composition in the route, as on the homepage.
|
||||||
|
|
||||||
|
## Route composition (`routes/over-mij.tsx`)
|
||||||
|
- **Responsibility**: load the static content, build the head, compose the page.
|
||||||
|
- **Head**: `pageHead('/over-mij')` (title, description, canonical, Open Graph incl. the page's own `ogImage`, no `noindex`) plus one `application/ld+json` script with the `AboutPage` (built by `seo.ts`). The site-wide `ProfessionalService` script still comes from the root route.
|
||||||
|
- **Body**: content objects are passed as props to presentational components; components never import content themselves. This keeps the API swap a change in the route only.
|
||||||
|
|
||||||
|
## Content source (`content/aboutContent.ts`)
|
||||||
|
- **Responsibility**: the page's static data until the CMS API exists; same role as `homeContent.ts`. Images are imported from `assets/about/` so Vite fingerprints them.
|
||||||
|
|
||||||
|
## SEO module (`seo.ts`, `sitePages.ts`)
|
||||||
|
- **Responsibility**: one registry for titles, descriptions, indexing and preview images (`sitePages.ts`), and pure builders for head tags and structured data (`seo.ts`). The sitemap (`config/sitemapPlugin.ts`) and Lighthouse CI config follow the registry.
|
||||||
|
|
||||||
|
## Interaction
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
box rgba(99,179,237,0.4) Router
|
||||||
|
participant R as Root route
|
||||||
|
participant P as over-mij route
|
||||||
|
end
|
||||||
|
box rgba(154,230,180,0.4) Modules
|
||||||
|
participant S as seo.ts and sitePages.ts
|
||||||
|
participant C as aboutContent.ts
|
||||||
|
end
|
||||||
|
box rgba(246,224,94,0.4) Components
|
||||||
|
participant V as Page components
|
||||||
|
end
|
||||||
|
R->>S: siteHead (ProfessionalService with id)
|
||||||
|
P->>S: pageHead and aboutPage
|
||||||
|
S-->>P: meta, links, JSON-LD script
|
||||||
|
P->>C: read static content
|
||||||
|
P->>V: render PageIntro, AboutIntro, StorySection, PhotoDuo with props
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: the root route adds the site-wide business data; the Over mij route asks the SEO module for its head tags and AboutPage data, reads its static content and passes it as props to the page components.
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
# Application Design Plan — Over mij Page
|
||||||
|
|
||||||
|
Depth: minimal. Business rules (structured data, content model with inline links) follow in Functional Design for unit 2.
|
||||||
|
|
||||||
|
## Plan
|
||||||
|
|
||||||
|
- [x] Answer the design questions below
|
||||||
|
- [x] Generate `components.md` — new and changed components with responsibilities and interfaces
|
||||||
|
- [x] Generate `component-methods.md` — props and function signatures (incl. the new SEO builders)
|
||||||
|
- [x] Generate `services.md` — composition in the route (there is no service layer in this SPA)
|
||||||
|
- [x] Generate `component-dependency.md` — dependency matrix and data flow
|
||||||
|
- [x] Generate `application-design.md` — consolidated design
|
||||||
|
- [x] Validate completeness and consistency against requirements.md
|
||||||
|
|
||||||
|
## Already decided (no question needed)
|
||||||
|
|
||||||
|
- **`PageSection`** = `HomeSection` renamed, same props. One addition for this page: a way to drop the top padding, because the first block sits directly under the page head (design `.section--flush-top`), e.g. `spacing="flushTop"`.
|
||||||
|
- **SEO**: the structured data builders (`aboutPage(...)`, `person(...)`) are pure functions in `seo.ts`, next to `professionalService`. The route's `head()` combines `pageHead('/over-mij')` with one extra `application/ld+json` script; the business gets a stable `@id`. The page registry (`sitePages.ts`) stays limited to title, description, indexed and `ogImage`.
|
||||||
|
- **Content**: `content/aboutContent.ts` + `AboutPageContent` in `content/types.ts`, passed in from the route (same pattern as the homepage). The exact shape of a paragraph with inline links is defined in Functional Design.
|
||||||
|
- **Booking button**: the existing `LinkButton` with `variant="accent"`; links in text use `Link variant="underline"` + `RouterLink`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe.
|
||||||
|
|
||||||
|
## Vraag 1: Interface van het gedeelde blok "foto naast tekst" (`MediaText`)
|
||||||
|
|
||||||
|
Het blok wordt gebruikt door `AboutBlock` op de homepage (eyebrow + h2 + 3 alinea's + link "Lees mijn verhaal") en door "Hoi! Ik ben Andrea" hier (eyebrow + h2 + 3 alinea's, waarvan één met twee links).
|
||||||
|
|
||||||
|
- A) **Alleen layout**: `MediaText` krijgt de foto (`image`, `aspectRatio`) en de tekstkolom als `children`. Elk gebruik vult zelf de kop en de tekst in met `SectionHeading`, `Text` en links. Flexibel, en de inhoud blijft bij de pagina die hem kent. (aanbevolen)
|
||||||
|
- B) **Inhoud als data**: `MediaText` krijgt `{ eyebrow, title, paragraphs, image, link? }` en rendert alles zelf. Minder code per gebruik, maar inline links in een alinea en verschillen tussen de twee pagina's moeten dan via extra props.
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 2: De h3-koppen in labelstijl ("Hoe het begon", "Buiten de camera om")
|
||||||
|
|
||||||
|
De labelstijl (klein, hoofdletters, ruime letterafstand, `accent.deep`) staat nu twee keer los uitgeschreven: in `SectionHeading` en in `PageIntro`, beide als `Text`.
|
||||||
|
|
||||||
|
- A) **Eén `Eyebrow`-component** met een `as`-prop: standaard een gewone tekst, en met `as="h3"` een kop. `SectionHeading` en `PageIntro` gaan hem ook gebruiken, zodat de labelstijl (tekststijl + kleur + marge) op één plek staat. (aanbevolen)
|
||||||
|
- B) `SectionHeading` uitbreiden met een optie die alleen een label als kop rendert (bijvoorbeeld `level="h3"` zonder titel)
|
||||||
|
- C) Per sectie direct `<Heading as="h3" textStyle="eyebrow" color="accent.deep">` schrijven, zonder nieuwe component
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 3: De twee foto's naast elkaar
|
||||||
|
|
||||||
|
In het ontwerp is dit een variant van de introgalerij van de homepage (`.intro-gallery--duo`): 2 kolommen, liggend 3:2, geen verspringing en geen swipe-rij op telefoons (daar onder elkaar). `IntroGallery` is nu een complete homepage-sectie, met de kop en de swipe-rij erin.
|
||||||
|
|
||||||
|
- A) **Nieuwe kleine component `PhotoDuo`** (of algemener `PhotoGrid` met een aantal kolommen), die `DeferredImage` en de theme-tokens hergebruikt. `IntroGallery` blijft zoals hij is. Simpel, want het gedrag verschilt duidelijk. (aanbevolen)
|
||||||
|
- B) **Eén gedeelde galerijcomponent** uit `IntroGallery` halen met de varianten `staggered` (homepage) en `duo` (hier), en `IntroGallery` daarop laten draaien. Meer hergebruik, maar wel een component met varianten die zich anders gedragen (wel of geen swipe-rij, wel of geen verspringing).
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 4: Waar komen de onderdelen van deze pagina?
|
||||||
|
|
||||||
|
De homepage-secties staan in `components/home/`. Deze pagina heeft twee tekstblokken met dezelfde opbouw ("Hoe het begon" en "Buiten de camera om": smalle kolom, h3-label, alinea's, optioneel iets eronder zoals de knop).
|
||||||
|
|
||||||
|
- A) **`components/about/`** met de pagina-specifieke delen (bijvoorbeeld `AboutIntro` en één `StorySection` voor beide tekstblokken). Gedeelde bouwstenen (`MediaText`, `Eyebrow`, `PhotoDuo`, `PageSection`) staan elk in een eigen map direct onder `components/`. Dezelfde indeling als de homepage. (aanbevolen)
|
||||||
|
- B) Alles direct in de route `routes/over-mij.tsx` opbouwen met de gedeelde bouwstenen, zonder pagina-specifieke componenten
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
# Execution Plan — Over mij Page
|
||||||
|
|
||||||
|
## Detailed Analysis Summary
|
||||||
|
|
||||||
|
### Transformation Scope (Brownfield)
|
||||||
|
- **Transformation Type**: Single component (`web/`), application-level only
|
||||||
|
- **Primary Changes**: replace the `/over-mij` placeholder with the real page; rename the shared section frame (`HomeSection` → `PageSection`); extract a shared media+text block from the homepage `AboutBlock`; page-specific SEO (indexing, title/description, `AboutPage`/`Person` JSON-LD, own preview image)
|
||||||
|
- **Related Components**: `web/src/routes/over-mij.tsx`, `web/src/components/{HomeSection,home/AboutBlock,…}`, `web/src/content/`, `web/src/seo.ts`, `web/src/sitePages.ts`, `web/lighthouserc*.cjs`, `web/public/`, `web/src/assets/`, [LAYOUT.md](../../../../../LAYOUT.md)
|
||||||
|
|
||||||
|
### Change Impact Assessment
|
||||||
|
- **User-facing changes**: Yes — a new page; the homepage must look and behave exactly as before
|
||||||
|
- **Structural changes**: Minor — one component renamed, one shared component extracted; no architectural change
|
||||||
|
- **Data model changes**: Yes (small) — new `AboutPageContent` interface; `HomeContent['about']` may share a type with the new block
|
||||||
|
- **API changes**: No external API; internal component props change for the extracted block
|
||||||
|
- **NFR impact**: Yes — SEO (the page becomes indexed and gets structured data), accessibility (heading outline h1/h2/h3), performance (new photos; Lighthouse budget 0.9 for this page)
|
||||||
|
|
||||||
|
### Component Relationships
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
Route["routes/over-mij.tsx"] --> PageIntro["PageIntro (existing)"]
|
||||||
|
Route --> PageSection["PageSection (renamed from HomeSection)"]
|
||||||
|
Route --> MediaText["MediaText (new, extracted)"]
|
||||||
|
Route --> Duo["Photo duo (new or composed)"]
|
||||||
|
Route --> LinkButton["LinkButton accent (existing)"]
|
||||||
|
Home["routes/index.tsx + components/home/*"] --> PageSection
|
||||||
|
AboutBlock["home/AboutBlock"] --> MediaText
|
||||||
|
MediaText --> FramedImage["FramedImage + DeferredImage (existing)"]
|
||||||
|
Route --> Content["content/aboutContent.ts (new)"]
|
||||||
|
Route --> Seo["seo.ts + sitePages.ts (extended)"]
|
||||||
|
Seo --> Lhci["lighthouserc*.cjs (indexed paths)"]
|
||||||
|
classDef newpart fill:#FFA726,stroke:#E65100,stroke-width:1px,color:#000;
|
||||||
|
classDef changed fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
||||||
|
classDef existing fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
||||||
|
class Route,MediaText,Duo,Content newpart;
|
||||||
|
class PageSection,Home,AboutBlock,Seo,Lhci changed;
|
||||||
|
class PageIntro,LinkButton,FramedImage existing;
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: the new route composes PageIntro, the renamed PageSection, the new shared MediaText block, a photo duo and LinkButton from new content and extended SEO modules; the homepage and AboutBlock switch to PageSection and MediaText; Lighthouse config follows the SEO registry.
|
||||||
|
|
||||||
|
- **Primary Component**: `web` (front-end SPA)
|
||||||
|
- **Shared Components**: `PageSection` (Major rename, every homepage section imports it), `MediaText` (new, used by `AboutBlock`), `seo.ts` (Minor, new functions)
|
||||||
|
- **Dependent Components**: the six homepage sections (import path change only)
|
||||||
|
- **Supporting Components**: Lighthouse CI config (Configuration-only), LAYOUT.md (documentation)
|
||||||
|
|
||||||
|
### Risk Assessment
|
||||||
|
- **Risk Level**: Low
|
||||||
|
- **Rollback Complexity**: Easy (one branch, commits per unit)
|
||||||
|
- **Testing Complexity**: Simple — existing component and route tests guard the homepage during the refactor; new page tests and Lighthouse cover the page
|
||||||
|
|
||||||
|
## Workflow Visualization
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
Start(["User Request"])
|
||||||
|
|
||||||
|
subgraph INCEPTION["🔵 INCEPTION PHASE"]
|
||||||
|
WD["Workspace Detection<br/><b>COMPLETED</b>"]
|
||||||
|
RE["Reverse Engineering<br/><b>COMPLETED</b>"]
|
||||||
|
RA["Requirements Analysis<br/><b>COMPLETED</b>"]
|
||||||
|
US["User Stories<br/><b>SKIP</b>"]
|
||||||
|
WP["Workflow Planning<br/><b>IN PROGRESS</b>"]
|
||||||
|
AD["Application Design<br/><b>EXECUTE</b>"]
|
||||||
|
UG["Units Generation<br/><b>SKIP</b>"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph CONSTRUCTION["🟢 CONSTRUCTION PHASE"]
|
||||||
|
FD["Functional Design<br/><b>EXECUTE (unit 2)</b>"]
|
||||||
|
NFRA["NFR Requirements<br/><b>SKIP</b>"]
|
||||||
|
NFRD["NFR Design<br/><b>SKIP</b>"]
|
||||||
|
ID["Infrastructure Design<br/><b>SKIP</b>"]
|
||||||
|
CG["Code Generation<br/>(Planning + Generation)<br/><b>EXECUTE</b>"]
|
||||||
|
BT["Build and Test<br/><b>EXECUTE</b>"]
|
||||||
|
end
|
||||||
|
|
||||||
|
Start --> WD
|
||||||
|
WD --> RE
|
||||||
|
RE --> RA
|
||||||
|
RA --> WP
|
||||||
|
WP --> AD
|
||||||
|
AD --> FD
|
||||||
|
FD --> CG
|
||||||
|
CG --> BT
|
||||||
|
BT --> End(["Complete"])
|
||||||
|
|
||||||
|
style WD fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||||
|
style RE fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||||
|
style RA fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||||
|
style WP fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||||
|
style CG fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||||
|
style BT fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
|
||||||
|
style AD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||||
|
style FD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
|
||||||
|
style US fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||||
|
style UG fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||||
|
style NFRA fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||||
|
style NFRD fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||||
|
style ID fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
|
||||||
|
style INCEPTION fill:#BBDEFB,stroke:#1565C0,stroke-width:3px,color:#000
|
||||||
|
style CONSTRUCTION fill:#C8E6C9,stroke:#2E7D32,stroke-width:3px,color:#000
|
||||||
|
style Start fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
|
||||||
|
style End fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
|
||||||
|
|
||||||
|
linkStyle default stroke:#333,stroke-width:2px
|
||||||
|
```
|
||||||
|
|
||||||
|
Text alternative: completed Workspace Detection, Reverse Engineering and Requirements Analysis lead to Workflow Planning, then Application Design, Functional Design (unit 2 only), Code Generation per unit and Build and Test; User Stories, Units Generation, NFR Requirements, NFR Design, Infrastructure Design and the Operations phase are skipped.
|
||||||
|
|
||||||
|
## Phases to Execute
|
||||||
|
|
||||||
|
### 🔵 INCEPTION PHASE
|
||||||
|
- [x] Workspace Detection (COMPLETED)
|
||||||
|
- [x] Reverse Engineering (COMPLETED — refresh)
|
||||||
|
- [x] Requirements Analysis (COMPLETED)
|
||||||
|
- [x] User Stories (SKIPPED)
|
||||||
|
- **Rationale**: one persona (the visitor), concrete FRs with exact texts and link targets; stories would restate the requirements
|
||||||
|
- [x] Execution Plan (IN PROGRESS)
|
||||||
|
- [ ] Application Design - EXECUTE (minimal depth)
|
||||||
|
- **Rationale**: new and changed shared components need agreed boundaries and props before code: `PageSection` (rename), `MediaText` (extracted from `AboutBlock`), the h3 eyebrow-style heading (component, text style or `SectionHeading` option), the photo duo, `AboutPageContent`, and where the new SEO functions live
|
||||||
|
- [ ] Units Generation - SKIP
|
||||||
|
- **Rationale**: the split is obvious and fixed below (two units); no separate unit-of-work artifacts needed
|
||||||
|
|
||||||
|
### 🟢 CONSTRUCTION PHASE
|
||||||
|
- [ ] Functional Design - EXECUTE for unit 2 only (minimal depth)
|
||||||
|
- **Rationale**: the structured data has rules (what goes into `Person`/`AboutPage`, `@id` linking, no e-mail, only valid socials) and PBT-01 requires its properties to be identified in design; the content model with inline links needs a definition. Unit 1 is a behaviour-preserving refactor with nothing to design beyond Application Design
|
||||||
|
- [ ] NFR Requirements - SKIP
|
||||||
|
- **Rationale**: NFRs are set at requirements level (NFR-OM-01..06) and the stack is fixed
|
||||||
|
- [ ] NFR Design - SKIP
|
||||||
|
- **Rationale**: no new NFR patterns; existing ones (DeferredImage, Reveal, theme focus ring, jsonLdScript) are reused
|
||||||
|
- [ ] Infrastructure Design - SKIP
|
||||||
|
- **Rationale**: static assets only; no server config, CSP or deployment changes
|
||||||
|
- [ ] Code Generation - EXECUTE (ALWAYS, per unit)
|
||||||
|
- **Rationale**: implementation and tests
|
||||||
|
- [ ] Build and Test - EXECUTE (ALWAYS)
|
||||||
|
- **Rationale**: full `pnpm check` incl. Lighthouse for `/` and `/over-mij`
|
||||||
|
|
||||||
|
### 🟡 OPERATIONS PHASE
|
||||||
|
- [ ] Deployment Setup, Monitoring Setup, Production Readiness Validation - SKIP
|
||||||
|
- **Rationale**: Operations Configuration = No (decided at Requirements Analysis); the existing pipeline deploys to test on merge
|
||||||
|
|
||||||
|
## Units of Work (in order)
|
||||||
|
|
||||||
|
| # | Unit | Scope | Requirements |
|
||||||
|
|---|---|---|---|
|
||||||
|
| 1 | **Shared blocks** | Rename `HomeSection` → `PageSection` (folder, component, test, imports); extract the shared media+text block and switch `AboutBlock` to it. No visible change on the homepage. | FR-OM-09, FR-OM-10, NFR-OM-02 |
|
||||||
|
| 2 | **Over mij page** | Photos (download, resize, alt texts) and preview image; `aboutContent.ts` + types; the page sections and photo duo; links and button; SEO (indexed, title/description, `ogImage`, `AboutPage`/`Person` JSON-LD, Lighthouse indexed paths); LAYOUT.md | FR-OM-01..08, SEO-OM-01..05, NFR-OM-01, 03..06 |
|
||||||
|
|
||||||
|
Unit 1 goes first because unit 2 builds on its components. Each unit: one or more commits on `feature/over-mij-page`, full `pnpm check` (incl. Lighthouse) before its completion message; one PR to master at the end.
|
||||||
|
|
||||||
|
## Estimated Timeline
|
||||||
|
- **Total Stages to execute from here**: 5 (Application Design, Functional Design for unit 2, Code Generation ×2 units, Build and Test)
|
||||||
|
- **Estimated Duration**: one to two working sessions
|
||||||
|
|
||||||
|
## Success Criteria
|
||||||
|
- **Primary Goal**: a finished, indexed Over mij page that matches the design with the live texts
|
||||||
|
- **Key Deliverables**: `/over-mij` page; `PageSection` and the shared media+text block; `aboutContent.ts`; new SEO functions with tests; resized photos and a 1200×630 preview image; updated LAYOUT.md and Lighthouse config
|
||||||
|
- **Quality Gates**: `pnpm check` passes (lint, format, tests with coverage thresholds, build, audits, Lighthouse: accessibility 1.0, best practices 1.0, performance ≥ 0.9 for `/over-mij`, homepage budgets unchanged); axe clean; homepage output unchanged after unit 1
|
||||||
|
- **Integration Testing**: route tests render `/` and `/over-mij` in the shell; navigation to `/#contact` from the page lands on the contact section
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
# Verduidelijkingsvraag — Over mij-pagina
|
||||||
|
|
||||||
|
Alle antwoorden zijn verwerkt. Bij één antwoord vroeg je me om mee te denken.
|
||||||
|
|
||||||
|
## Kopniveau van "Hoe het begon" en "Buiten de camera om" (vraag 2)
|
||||||
|
|
||||||
|
Je koos voor h3, met als reden dat alles onder het "Over mij"-deel valt, en dat is een h2. Op de **homepage** klopt dat: daar is "Over mij" een h2 onder de h1 van de hero. Op **deze pagina** is "Over mij" zelf de **h1** (de paginatitel in `PageIntro`). De koppenstructuur wordt dan:
|
||||||
|
|
||||||
|
| Kies je h2 (A) | Kies je h3 (B) |
|
||||||
|
| ------------------------ | -------------------------- |
|
||||||
|
| h1 Over mij | h1 Over mij |
|
||||||
|
| · h2 Hoi! Ik ben Andrea | · h2 Hoi! Ik ben Andrea |
|
||||||
|
| · h2 Hoe het begon | · · h3 Hoe het begon |
|
||||||
|
| · h2 Buiten de camera om | · · h3 Buiten de camera om |
|
||||||
|
|
||||||
|
Met h3 vallen "Hoe het begon" en "Buiten de camera om" onder **"Hoi! Ik ben Andrea"**, niet onder "Over mij". In het ontwerp zijn het drie losse, gelijkwaardige secties: elk een eigen `section` met een eigen achtergrond. Een screenreader noemt elke sectie bij de naam van zijn kop, en wie met de toetsen van kop naar kop springt, verwacht gelijkwaardige blokken op hetzelfde niveau. Technisch zijn beide toegestaan: axe en Lighthouse geven bij h3 geen fout, omdat er een h2 voor staat.
|
||||||
|
|
||||||
|
Bij beide keuzes ziet de kop eruit als het kleine label uit het ontwerp. Alleen het kopniveau verschilt.
|
||||||
|
|
||||||
|
- A) h2 in de stijl van het ontwerp: drie gelijkwaardige secties onder de h1 "Over mij" (aanbevolen)
|
||||||
|
- B) h3 in de stijl van het ontwerp: "Hoe het begon" en "Buiten de camera om" vallen onder "Hoi! Ik ben Andrea"
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: ah ja dat bedoelde ik ook. ze staan onder hoi ik ben andrea en zijn een vervolg op haar verhaal daar. dus daarom zou ik zeggen h3 wat ook het verschil in styling zou kunnen verklaren. als we h2 doen denk ik dat de styling hetzelfde als de andere h2's moet worden
|
||||||
+183
@@ -0,0 +1,183 @@
|
|||||||
|
# Verificatievragen — Over mij-pagina
|
||||||
|
|
||||||
|
Al vastgelegd (geen vraag nodig):
|
||||||
|
|
||||||
|
- **Route** `/over-mij` bestaat al als placeholder ([over-mij.tsx](../../../../../web/src/routes/over-mij.tsx)) en wordt de echte pagina. De navigatie, de footer en de link "Lees mijn verhaal" op de homepage verwijzen er al naar.
|
||||||
|
- **Layout en stijl** komen uit het ontwerp ([over-mij.html](../../../../../design/andreaslop-static/over-mij.html)). Teksten en foto's komen als vaste data in `web/src/content/`, in de vorm die de API straks levert (zoals bij de homepage).
|
||||||
|
- **Hergebruik eerst**: `PageIntro` (h1), `HomeSection`, `SectionHeading`, `FramedImage`, `DeferredImage`, `Reveal`, `LinkButton` (variant `accent`), de `underline`-variant van `Link`, plus de theme-tokens (`paper.alt`, `contentNarrow`, `sectionY`, `gridGap`, tekststijlen). Geen hardgecodeerde kleuren, geen CSS-bestanden en geen nieuwe dependencies.
|
||||||
|
- **Toegankelijkheid**: dezelfde lat als bij de homepage (NFR-HP-01): één h1, secties met een toegankelijke naam, contrast ≥ 4.5:1, `prefers-reduced-motion`, axe in de tests en Lighthouse accessibility 1.0.
|
||||||
|
- **Codecommentaar** in het Engels in nieuwe code; teksten voor bezoekers blijven Nederlands (afspraak uit homepage-sections).
|
||||||
|
|
||||||
|
Wat ik op de live site (andreaslop.nl/over-mij) zag en wat afwijkt van het ontwerp:
|
||||||
|
|
||||||
|
| Onderdeel | Ontwerp | Live site |
|
||||||
|
| ----------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| Kop van het eerste blok | eyebrow "Lifestyle fotograaf" + h2 **"Hoi! Ik ben Andrea"** | alleen "Lifestyle Fotograaf" (h3) |
|
||||||
|
| Eerste alinea | "…liefde voor het vastleggen van momenten." | zelfde, plus **"Momenten die je voor altijd bewaart."** |
|
||||||
|
| Achtergrond | eyebrow **"Hoe het begon"** + de tekst over de studie | geen kop; de tekst eindigt met **"Het was even een zoektocht maar uiteindelijk heb ik mijn specialisatie gevonden. Je kunt bij mij terecht voor newbornshoots, zwangerschapsshoots en gezinsshoots."** |
|
||||||
|
| Persoonlijk | eyebrow **"Buiten de camera om"**; "…tekenen, schilderen of lezen **(vaak met een kat naast me)**." | geen kop; "…tekenen, schilderen of lezen." |
|
||||||
|
| Afsluiting | knop **"Boek je shoot"** | geen knop |
|
||||||
|
| Foto's | portret + 2 foto's, alt-teksten "Portret van Andrea Slop" en twee keer "Werk van Andrea Slop" | dezelfde foto's, **zonder alt-teksten** |
|
||||||
|
|
||||||
|
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Vraag 1: Bron voor de teksten
|
||||||
|
|
||||||
|
Welke teksten komen op de pagina als ontwerp en live site verschillen?
|
||||||
|
|
||||||
|
- A) De opbouw van het ontwerp (eyebrows, de kop "Hoi! Ik ben Andrea", de knop) met de **volledige live teksten** erin: de extra zin in de eerste alinea en de zin over de specialisatie erbij. "(vaak met een kat naast me)" uit het ontwerp blijft ook staan. (aanbevolen)
|
||||||
|
- B) Zelfde als A, maar zonder "(vaak met een kat naast me)" (precies de live tekst)
|
||||||
|
- C) Alles precies zoals in het ontwerp
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: B
|
||||||
|
|
||||||
|
## Vraag 2: Koppen van "Hoe het begon" en "Buiten de camera om"
|
||||||
|
|
||||||
|
In het ontwerp zijn dit kleine labels (eyebrows) zonder kopelement. Voor screenreaders en zoekmachines is een pagina met echte tussenkoppen beter te scannen.
|
||||||
|
|
||||||
|
- A) Echte h2-koppen die er precies uitzien als het label uit het ontwerp (tekststijl `eyebrow`). Visueel verandert er niets; de structuur wordt beter. (aanbevolen)
|
||||||
|
- B) Echte h2-koppen in de grote koptekststijl (`sectionTitle`), zoals op de homepage. Dat wijkt visueel af van het ontwerp.
|
||||||
|
- C) Gewone labels zonder kopelement, letterlijk zoals in het ontwerp
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: X, Net als A, maar dan met h3. Het valt uiteindelijk allemaal onder het "Over mij" deel wat een H2 is. Dus ik denk dat h3 dan logischer is. in de stijl van het design. Als jij wat anders denkt laat me dat dan weten. Misschien mis ik iets.
|
||||||
|
|
||||||
|
## Vraag 3: Links "mijn portfolio" en "neem contact op"
|
||||||
|
|
||||||
|
`/portfolio` en `/contact` zijn nu nog placeholders ("in de maak", noindex). Het werkende contactblok staat op de homepage (`/#contact`).
|
||||||
|
|
||||||
|
- A) Link naar `/portfolio` en `/contact`. Die pagina's worden later echt, en dan klopt de link vanzelf. (aanbevolen)
|
||||||
|
- B) "neem contact op" linkt voorlopig naar `/#contact` op de homepage, "mijn portfolio" naar `/portfolio`. Later omzetten naar `/contact`.
|
||||||
|
- C) Voorlopig geen links: platte tekst tot die pagina's bestaan
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: B
|
||||||
|
|
||||||
|
## Vraag 4: Knop "Boek je shoot"
|
||||||
|
|
||||||
|
Waar gaat de knop onderaan de pagina naartoe?
|
||||||
|
|
||||||
|
- A) Naar dezelfde plek als "neem contact op" uit vraag 3, zodat beide contactlinks overeenkomen (aanbevolen)
|
||||||
|
- B) Altijd naar `/#contact` op de homepage (het contactblok met de "binnenkort"-melding en de mailto-link)
|
||||||
|
- C) Knop weglaten, net als op de live site
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 5: Indexeren door zoekmachines
|
||||||
|
|
||||||
|
`/over-mij` staat nu op `noindex` en ontbreekt in `sitemap.xml`.
|
||||||
|
|
||||||
|
- A) Bij het mergen van deze feature op **geïndexeerd** zetten: geen `noindex` meer, opnemen in de sitemap, in Lighthouse CI als geïndexeerde pagina controleren. (aanbevolen: de pagina is dan af)
|
||||||
|
- B) Voorlopig op `noindex` laten tot alle pagina's klaar zijn en de site live gaat
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 6: Titel en beschrijving (SEO)
|
||||||
|
|
||||||
|
De huidige titel is "Over mij | Andrea Slop Fotografie" en de beschrijving: "Hi! Ik ben Andrea, lifestyle fotograaf uit Huizen. Ik leg jullie vast zoals jullie zijn: spontaan en natuurlijk, zonder ongemakkelijke poses."
|
||||||
|
|
||||||
|
- A) Titel met zoekwoorden, bijvoorbeeld "Over mij – lifestyle fotograaf in Huizen", en een beschrijving die aansluit op de tekst van deze pagina (warm en spontaan; newborn-, zwangerschaps- en gezinsshoots). Ik stel ze voor in requirements.md en jij keurt ze goed. (aanbevolen)
|
||||||
|
- B) Titel en beschrijving laten zoals ze zijn
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 7: Gestructureerde data (JSON-LD)
|
||||||
|
|
||||||
|
De site geeft nu op elke pagina een `ProfessionalService` (het bedrijf) mee. Zoekmachines kunnen een over-mijpagina beter begrijpen met extra gegevens.
|
||||||
|
|
||||||
|
- A) Op deze pagina een `AboutPage` toevoegen met een `Person` (Andrea Slop, fotograaf, Huizen, met de social-links), gekoppeld aan de bestaande `ProfessionalService`. Zonder e-mailadres, net als nu. (aanbevolen)
|
||||||
|
- B) Alleen de bestaande `ProfessionalService`, niets extra
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 8: Preview-afbeelding bij delen (Open Graph)
|
||||||
|
|
||||||
|
Bij het delen via WhatsApp of Facebook verschijnt nu de standaardafbeelding van de site (heide op een arm).
|
||||||
|
|
||||||
|
- A) Een eigen preview voor deze pagina: het portret van Andrea, bijgesneden tot 1200×630 in `web/public/` (aanbevolen)
|
||||||
|
- B) De standaardafbeelding van de site houden
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 9: Naam van het sectieframe `HomeSection`
|
||||||
|
|
||||||
|
`HomeSection` (achtergrond, verticale ritmiek, contentkolom, `aria-labelledby`) is precies wat deze pagina, en straks ook Portfolio, Soorten fotoshoots en Contact, nodig heeft. Alleen de naam verwijst naar de homepage.
|
||||||
|
|
||||||
|
- A) Hernoemen naar `PageSection` (map, component, test en alle imports op de homepage), zonder gedragswijziging. Daarna gebruiken alle pagina's hetzelfde frame. (aanbevolen)
|
||||||
|
- B) De naam laten staan en `HomeSection` gewoon ook op deze pagina gebruiken
|
||||||
|
- C) Een aparte, nieuwe component voor gewone pagina's
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 10: Gedeeld blok "foto naast tekst"
|
||||||
|
|
||||||
|
Het eerste blok van deze pagina (portret met het zandkleurige kader naast eyebrow, kop en tekst) is dezelfde opbouw als het blok Over mij op de homepage (`AboutBlock`). In het ontwerp is het allebei `.about`.
|
||||||
|
|
||||||
|
- A) Eén gedeelde component maken (bijvoorbeeld `MediaText`: foto met kader naast een tekstkolom, stapelt op telefoon en tablet) en die zowel in `AboutBlock` als op deze pagina gebruiken. Zo staat de layout op één plek. (aanbevolen)
|
||||||
|
- B) Alleen de bestaande kleine bouwstenen hergebruiken (`FramedImage`, `SectionHeading`, `Reveal`) en de grid op deze pagina apart opbouwen
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 11: Foto's en alt-teksten
|
||||||
|
|
||||||
|
De live foto's hebben geen alt-teksten, en die in het ontwerp ("Werk van Andrea Slop") beschrijven niet wat er te zien is.
|
||||||
|
|
||||||
|
- A) De originele foto's van andreaslop.nl downloaden, eenmalig verkleinen en comprimeren (zoals bij de homepage) en per foto een beschrijvende Nederlandse alt-tekst schrijven die Andrea later kan nalezen (aanbevolen)
|
||||||
|
- B) De foto's uit het ontwerp gebruiken (`assets/img`) met beschrijvende alt-teksten
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag 12: LAYOUT.md
|
||||||
|
|
||||||
|
In [LAYOUT.md](../../../../../LAYOUT.md) heeft "About me" nu drie blokken: About Me, Background en Personal. Het ontwerp heeft ook de twee foto's tussen Background en Personal, en de knop onderaan.
|
||||||
|
|
||||||
|
- A) LAYOUT.md bijwerken naar het ontwerp: About Me → Background → Photos → Personal (de knop hoort bij Personal), volgens [.ai/layout-conventions.md](../../../../../.ai/layout-conventions.md) (aanbevolen)
|
||||||
|
- B) LAYOUT.md laten zoals het is
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Vraag: Beveiligingsextensies
|
||||||
|
|
||||||
|
Moeten de beveiligingsregels als harde vereisten worden afgedwongen voor dit project?
|
||||||
|
|
||||||
|
- A) Ja — dwing alle BEVEILIGINGSREGELS af als blokkerende vereisten (aanbevolen voor productietoepassingen)
|
||||||
|
- B) Nee — sla alle BEVEILIGINGSREGELS over (geschikt voor PoC's, prototypes en experimentele projecten)
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag: Property-Based Testing Extensie
|
||||||
|
|
||||||
|
Moeten de property-based testing (PBT) regels worden afgedwongen voor dit project?
|
||||||
|
|
||||||
|
- A) Ja — dwing alle PBT-regels af als blokkerende vereisten (aanbevolen voor projecten met bedrijfslogica, datatransformaties, serialisatie of stateful componenten)
|
||||||
|
- B) Gedeeltelijk — dwing PBT-regels alleen af voor pure functies en serialisatie round-trips (geschikt voor projecten met beperkte algoritmische complexiteit)
|
||||||
|
- C) Nee — sla alle PBT-regels over (geschikt voor eenvoudige CRUD-applicaties, UI-only projecten of dunne integratielagen zonder significante bedrijfslogica)
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: A
|
||||||
|
|
||||||
|
## Vraag: Operations-fase
|
||||||
|
|
||||||
|
Moet deze feature na Construction door de Operations-fase (deployment en monitoring inrichten)? Deployment naar test en productie en de monitoring (Sentry, Umami, UptimeRobot) bestaan al.
|
||||||
|
|
||||||
|
- A) Ja — na Construction de Operations-fase doorlopen (deployment + monitoring inrichten)
|
||||||
|
- B) Nee — stoppen na Build and Test (deployment en monitoring vallen buiten deze feature)
|
||||||
|
- C) Weet ik nog niet — vraag het opnieuw na de Construction-fase
|
||||||
|
- X) Anders (beschrijf hieronder na de [Answer]:-tag)
|
||||||
|
|
||||||
|
[Answer]: B
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
# Requirements — Over mij Page
|
||||||
|
|
||||||
|
## Intent Analysis
|
||||||
|
- **User Request**: add the "Over mij" page to the front end with AI-DLC, paying attention to SEO, accessibility and reuse of code and styling (Chakra UI, theme).
|
||||||
|
- **Request Type**: New Feature (replaces the `/over-mij` placeholder with the real page) with a small supporting refactor (shared section frame and media+text block)
|
||||||
|
- **Scope Estimate**: Multiple components within one package (`web/`), plus [LAYOUT.md](../../../../../LAYOUT.md)
|
||||||
|
- **Complexity Estimate**: Simple to moderate — one presentational page, two refactors of existing shared components, SEO additions (indexing, page-specific structured data and preview image), image preparation
|
||||||
|
- **Requirements Depth**: Standard
|
||||||
|
|
||||||
|
## Source of Truth
|
||||||
|
- **Layout and styling**: [design/andreaslop-static/over-mij.html](../../../../../design/andreaslop-static/over-mij.html) and `assets/css/style.css` (`.page-head`, `.about`, `.section--alt`, `.container--narrow`, `.intro-gallery--duo`, `.btn--accent`).
|
||||||
|
- **Texts**: the live page https://andreaslop.nl/over-mij/ as of 2026-10-22, placed in the design's structure (eyebrows, heading, button). *Source: Q1 = B*
|
||||||
|
- **Decisions**: [requirement-verification-questions.md](requirement-verification-questions.md), [requirement-clarification-questions.md](requirement-clarification-questions.md)
|
||||||
|
|
||||||
|
## Page Structure
|
||||||
|
Shell header → **Intro** (page head, h1) → **About me** → **Background** → **Photos** → **Personal** (with booking button) → shell footer.
|
||||||
|
|
||||||
|
## Out of Scope
|
||||||
|
- The `/portfolio` and `/contact` pages (stay placeholders; linked from this page).
|
||||||
|
- A responsive image pipeline (srcset/WebP) — unchanged from homepage-sections.
|
||||||
|
- Rewriting existing Dutch code comments.
|
||||||
|
- Operations phase. *Source: Operations = B*
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Functional Requirements
|
||||||
|
|
||||||
|
### FR-OM-01 Intro (page head)
|
||||||
|
- Eyebrow **"Andrea Slop Fotografie"** and the page's only h1 **"Over mij"**, via the existing `PageIntro` without intro text (design `.page-head`).
|
||||||
|
|
||||||
|
### FR-OM-02 About me
|
||||||
|
- Portrait of Andrea (live photo `WhatsApp-Image-2024-10-27-at-14.31.41.jpeg`, design `andrea-portret.jpg`) in the sand-coloured frame, next to the text column; stacked on phones and tablets (design `.about`, same breakpoint as the homepage block).
|
||||||
|
- Eyebrow **"Lifestyle fotograaf"**, heading **"Hoi! Ik ben Andrea"** (h2, `sectionTitle` style), and the live paragraphs:
|
||||||
|
1. "Hoi! Ik ben Andrea, een fotograaf met liefde voor het vastleggen van momenten. Momenten die je voor altijd bewaart."
|
||||||
|
2. "Mijn stijl is te omschrijven als warm en spontaan. Ik houd van natuurlijke, ongedwongen foto's die een verhaal vertellen."
|
||||||
|
3. "Nieuwsgierig naar mijn werk? Bekijk **mijn portfolio** of **neem contact op** voor een fotoshoot!"
|
||||||
|
- "mijn portfolio" links to `/portfolio`; "neem contact op" links to **`/#contact`** (the homepage contact section) for now, to become `/contact` once that page exists. Both use the `underline` link variant. *Source: Q3 = B*
|
||||||
|
- Background `paper` with the section directly below the page head (design `.section--flush-top`).
|
||||||
|
|
||||||
|
### FR-OM-03 Background ("Hoe het begon")
|
||||||
|
- **h3 "Hoe het begon"** styled as the design's eyebrow label. *Source: Q2 = X, clarification answer — the two story sections continue Andrea's story under "Hoi! Ik ben Andrea", and the smaller style matches the lower level*
|
||||||
|
- The live text, in the narrow content column on the `paper.alt` background: "Tijdens de studie Communicatie & Media Design … Ik was helemaal in mijn element. Het was even een zoektocht maar uiteindelijk heb ik mijn specialisatie gevonden. Je kunt bij mij terecht voor newbornshoots, zwangerschapsshoots en gezinsshoots." *Source: Q1 = B*
|
||||||
|
|
||||||
|
### FR-OM-04 Photos
|
||||||
|
- Two photos side by side at a 3:2 crop (design `.intro-gallery--duo`), one below the other on phones; live photos `slide-1.jpg` and `IMG_1718.jpg`.
|
||||||
|
- Decorative or informative is decided per photo when the alt texts are written (FR-OM-07); both are expected to be informative.
|
||||||
|
|
||||||
|
### FR-OM-05 Personal ("Buiten de camera om")
|
||||||
|
- **h3 "Buiten de camera om"** styled as the eyebrow label (same rule as FR-OM-03).
|
||||||
|
- The live text, without the design's "(vaak met een kat naast me)": "Mijn camera gaat altijd mee op reis. Het liefst ga ik naar een plek met een mooie zee maar ik ga ook graag op pad om de natuur vast te leggen met mijn camera." / "Wanneer ik niet achter de camera sta ben ik bezig met tekenen, schilderen of lezen." *Source: Q1 = B*
|
||||||
|
- Button **"Boek je shoot"** (`LinkButton`, variant `accent`) to the same target as "neem contact op": `/#contact`. *Source: Q4 = A*
|
||||||
|
- Navigating to `/#contact` from this page lands on the homepage contact section below the fixed header, as the price card links already do.
|
||||||
|
|
||||||
|
### FR-OM-06 Scroll reveal
|
||||||
|
- Blocks fade in as on the homepage (existing `Reveal`), respecting `prefers-reduced-motion`; content is always in the DOM.
|
||||||
|
|
||||||
|
### FR-OM-07 Content and images
|
||||||
|
- All page content lives as API-shaped static data in `web/src/content/` (a new `aboutContent.ts` with an `AboutPageContent` interface in `content/types.ts`), passed into the components from the route.
|
||||||
|
- Photos are downloaded from andreaslop.nl in their original size, resized once to at most ±1600 px wide, compressed and stored in `web/src/assets/` — same approach as homepage-sections, no new dependency. *Source: Q11 = A*
|
||||||
|
- Every photo gets a descriptive Dutch alt text, written after looking at the photo, for Andrea to review.
|
||||||
|
|
||||||
|
### FR-OM-08 LAYOUT.md
|
||||||
|
- Update the "About me" diagram to the page structure above — **Intro → About Me → Background → Photos → Personal** — following [.ai/layout-conventions.md](../../../../../.ai/layout-conventions.md). "Intro" is added for consistency with the other page diagrams (Types of shoots, Contact), which start with their page head. *Source: Q12 = A*
|
||||||
|
|
||||||
|
### FR-OM-09 Shared section frame: `HomeSection` → `PageSection`
|
||||||
|
- Rename `HomeSection` to `PageSection` (folder, component, test, every import on the homepage) without changing its behaviour, and use it on this page. *Source: Q9 = A*
|
||||||
|
|
||||||
|
### FR-OM-10 Shared media+text block
|
||||||
|
- Extract the photo-in-frame next to a text column (design `.about`) into one shared component (working name `MediaText`), used by both the homepage `AboutBlock` and FR-OM-02. The homepage must look and behave exactly as before. *Source: Q10 = A*
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## SEO Requirements
|
||||||
|
|
||||||
|
### SEO-OM-01 Indexing
|
||||||
|
- `/over-mij` becomes **indexed** when this feature merges: `indexed: true` in `sitePages.ts` (no `robots noindex`, included in `sitemap.xml`), and moved to the indexed paths in `web/lighthouserc.cjs` / `.desktop.cjs` (the existing sync test must pass). *Source: Q5 = A*
|
||||||
|
|
||||||
|
### SEO-OM-02 Title and description
|
||||||
|
- Title: **"Over mij – fotograaf in Huizen"** → rendered as "Over mij – fotograaf in Huizen | Andrea Slop Fotografie" (55 characters, within the ~60 guideline).
|
||||||
|
- Description: **"Hoi! Ik ben Andrea, lifestyle fotograaf uit Huizen. Ik maak warme, spontane foto's die een verhaal vertellen: newborn-, zwangerschaps- en gezinsshoots."** (151 characters, within the ~155 guideline).
|
||||||
|
- *Source: Q6 = A; description wording changed by the user at Requirements review (the second sentence now has a subject)*
|
||||||
|
|
||||||
|
### SEO-OM-03 Structured data
|
||||||
|
- On this page, add an `AboutPage` JSON-LD whose `mainEntity` is a `Person` (Andrea Slop; job title lifestyle fotograaf; locality Huizen, NL; `sameAs` the visible social links; `image` the page preview image), linked to the existing `ProfessionalService` by `@id` (the business gets a stable `@id`, e.g. `https://andreaslop.nl/#business`).
|
||||||
|
- No e-mail address in the structured data (same rule as today). Escaped through the existing `jsonLdScript`.
|
||||||
|
- Built by pure functions in `seo.ts` (100% coverage threshold applies). *Source: Q7 = A*
|
||||||
|
|
||||||
|
### SEO-OM-04 Preview image (Open Graph)
|
||||||
|
- A page-specific preview image: the portrait cropped to **1200×630**, stored in `web/public/` (stable URL, outside the bundle), set as the page's `ogImage` in `sitePages.ts` with its own alt text. *Source: Q8 = A*
|
||||||
|
|
||||||
|
### SEO-OM-05 Semantic structure
|
||||||
|
- One h1; `section` landmarks named by their heading; a heading outline that matches the content (h1 Over mij → h2 Hoi! Ik ben Andrea → h3 Hoe het begon, h3 Buiten de camera om); descriptive link texts; images with width/height.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Non-Functional Requirements
|
||||||
|
|
||||||
|
### NFR-OM-01 Accessibility (WCAG 2.1 AA as guideline)
|
||||||
|
- Heading outline as in SEO-OM-05; no skipped levels.
|
||||||
|
- Each content block is a `section` with an accessible name (`aria-labelledby` its h2/h3). The photos block is not a landmark of its own unless it has a name (it has no heading in the design).
|
||||||
|
- Text contrast ≥ 4.5:1: `accent.deep` for eyebrow-styled text (incl. the h3 labels), `ink.soft` for running text.
|
||||||
|
- Descriptive alt texts (FR-OM-07); links distinguishable and keyboard reachable with the theme focus ring; touch targets ≥ 44×44 px for the button.
|
||||||
|
- `prefers-reduced-motion` respected (reveal).
|
||||||
|
- Axe checks in the component and route tests; Lighthouse accessibility 1.0 for `/over-mij` (mobile and desktop).
|
||||||
|
|
||||||
|
### NFR-OM-02 Styling and reuse
|
||||||
|
- Reuse before building: `PageIntro`, `PageSection` (renamed), `SectionHeading`, `FramedImage`, `DeferredImage`, `Reveal`, `LinkButton` (`accent`), `Link` (`underline`), `RouterLink`, and theme tokens/text styles (`paper.alt`, `contentNarrow`, `sectionY`, `gridGap`, `eyebrow`, `sectionTitle`, `pageTitle`).
|
||||||
|
- If the h3 eyebrow heading or the photo duo needs styling that another page will need too, it goes into a shared component, text style or recipe, not inline per page.
|
||||||
|
- No hard-coded colours, CSS files or Tailwind; Chakra primitives where they fit.
|
||||||
|
- Components in their own folders under `components/`, Prettier style; code comments in English in new code (including new comments in existing files); visitor-facing texts in Dutch.
|
||||||
|
- Responsive from 320 px to ultrawide, mobile-first, no horizontal scroll, works at 200% zoom.
|
||||||
|
|
||||||
|
### NFR-OM-03 Testing
|
||||||
|
- **Example-based**: page content and structure (heading outline, section names, links and their targets, button target), the renamed `PageSection`, the shared media+text block, the homepage `AboutBlock` unchanged in output, head tags (title, description, no `noindex`, canonical, `og:image`), axe checks.
|
||||||
|
- **Property-based** (fast-check, existing arbitraries) for the new pure SEO functions, e.g. the structured data never contains an e-mail address, `sameAs` only contains valid https social links, the script output always stays escaped. *Source: PBT extension = A (full)*
|
||||||
|
- `pnpm check` (lint, format, tests incl. coverage thresholds, build, audits, Lighthouse) passes.
|
||||||
|
|
||||||
|
### NFR-OM-04 Security (Security Baseline extension enabled)
|
||||||
|
- No new third parties: no external scripts, fonts, embeds or endpoints; CSP in `web/config/securityHeaders.ts` unchanged.
|
||||||
|
- No e-mail address in markup, bundle, content or structured data.
|
||||||
|
- Structured data goes through `jsonLdScript` (escapes `<`, `>`, `&`).
|
||||||
|
- No new runtime dependencies; image processing is a one-off local step, not a build dependency.
|
||||||
|
|
||||||
|
### NFR-OM-05 Performance
|
||||||
|
- All page photos except possibly the portrait are below the fold and use `DeferredImage` with intrinsic width/height (no layout shift). Whether the portrait is above the fold at common viewport sizes is decided in design; if it is the largest contentful paint it must not be deferred.
|
||||||
|
- Lighthouse performance for `/over-mij`: ≥ 0.9 on mobile and desktop (the default budget for pages other than the homepage).
|
||||||
|
- No new network requests other than the bundled images.
|
||||||
|
|
||||||
|
### NFR-OM-06 Content for the future API
|
||||||
|
- `AboutPageContent` is plain data (strings, arrays, `ContentImage`, link targets typed as routes or route-plus-hash) so the API can deliver it 1-to-1; rich text with links is modelled without HTML strings.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Extension Compliance — Requirements Level
|
||||||
|
|
||||||
|
### Security Baseline
|
||||||
|
| Rule | Status | Rationale |
|
||||||
|
|---|---|---|
|
||||||
|
| SECURITY-01 Encryption | N/A | No data stores |
|
||||||
|
| SECURITY-02 Access logging | N/A | No intermediaries added; hosting unchanged |
|
||||||
|
| SECURITY-03 Application logging | N/A | No server-side component; client errors already go to Sentry |
|
||||||
|
| SECURITY-04 HTTP security headers | Compliant | Existing header set unchanged; no CSP loosening (NFR-OM-04) |
|
||||||
|
| SECURITY-05 Input validation | N/A | No input or API endpoint on this page |
|
||||||
|
| SECURITY-06 Least privilege | N/A | No IAM |
|
||||||
|
| SECURITY-07 Network configuration | N/A | No network infrastructure |
|
||||||
|
| SECURITY-08 Access control | N/A | Public content |
|
||||||
|
| SECURITY-09 Hardening | Compliant | No debug output; no new configuration |
|
||||||
|
| SECURITY-10 Supply chain | Compliant | No new dependencies |
|
||||||
|
| SECURITY-11 Secure design | Compliant | Structured data escaped; e-mail kept out of the page |
|
||||||
|
| SECURITY-12 Authentication | N/A | No authentication |
|
||||||
|
| SECURITY-13 Integrity | Compliant | No external CDN resources; all assets self-hosted |
|
||||||
|
| SECURITY-14 Alerting | N/A | No server-side component; existing monitoring unchanged |
|
||||||
|
| SECURITY-15 Exception handling | Compliant | Existing global error handling and error page |
|
||||||
|
|
||||||
|
### Property-Based Testing
|
||||||
|
| Rule | Status | Rationale |
|
||||||
|
|---|---|---|
|
||||||
|
| PBT-01 Property identification | Planned | Properties of the new SEO functions identified in design |
|
||||||
|
| PBT-02 Round-trip | Planned | `jsonLdScript` output parses back to the same data (if not already covered) |
|
||||||
|
| PBT-03 Invariants | Planned | No e-mail in structured data; `sameAs` ⊆ valid https socials |
|
||||||
|
| PBT-04 Idempotency | N/A | No idempotent operations added |
|
||||||
|
| PBT-05 Oracle | N/A | No reference implementation |
|
||||||
|
| PBT-06 Stateful | N/A | No stateful logic added |
|
||||||
|
| PBT-07 Generators | Planned | Reuse/extend `src/test/arbitraries.ts` |
|
||||||
|
| PBT-08 Shrinking/reproducibility | Compliant | Existing seed logging (`config/testSeed.ts`) |
|
||||||
|
| PBT-09 Framework | Compliant | fast-check already configured |
|
||||||
|
| PBT-10 Complementary testing | Planned | Example-based tests for the page and components alongside PBT |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Summary of Key Decisions
|
||||||
|
| # | Decision |
|
||||||
|
|---|---|
|
||||||
|
| Q1 | Design structure with the exact live texts (no cat remark) |
|
||||||
|
| Q2 | "Hoe het begon" and "Buiten de camera om" are h3, styled as eyebrow labels, under h2 "Hoi! Ik ben Andrea" |
|
||||||
|
| Q3 | "mijn portfolio" → `/portfolio`; "neem contact op" → `/#contact` for now |
|
||||||
|
| Q4 | "Boek je shoot" → same target as "neem contact op" (`/#contact`) |
|
||||||
|
| Q5 | Indexed on merge (sitemap, no noindex, Lighthouse indexed list) |
|
||||||
|
| Q6 | New title and description (proposed above) |
|
||||||
|
| Q7 | `AboutPage` + `Person` JSON-LD linked to the business |
|
||||||
|
| Q8 | Own 1200×630 preview image from the portrait |
|
||||||
|
| Q9 | `HomeSection` renamed to `PageSection` |
|
||||||
|
| Q10 | Shared media+text block for this page and the homepage `AboutBlock` |
|
||||||
|
| Q11 | Original live photos, resized once, descriptive alt texts |
|
||||||
|
| Q12 | LAYOUT.md updated (Intro → About Me → Background → Photos → Personal) |
|
||||||
|
| Ext. | Security Baseline: Yes · PBT: Yes (full) · Operations: No |
|
||||||
+14
-3
@@ -6,9 +6,8 @@
|
|||||||
const origin = 'http://localhost:4173';
|
const origin = 'http://localhost:4173';
|
||||||
|
|
||||||
// Moet gelijk lopen met src/sitePages.ts (een test bewaakt dat)
|
// Moet gelijk lopen met src/sitePages.ts (een test bewaakt dat)
|
||||||
const indexedPaths = ['/'];
|
const indexedPaths = ['/', '/over-mij'];
|
||||||
const noindexPaths = [
|
const noindexPaths = [
|
||||||
'/over-mij',
|
|
||||||
'/portfolio',
|
'/portfolio',
|
||||||
'/soorten-fotoshoots',
|
'/soorten-fotoshoots',
|
||||||
'/contact',
|
'/contact',
|
||||||
@@ -68,9 +67,12 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
assert: {
|
assert: {
|
||||||
|
// Home first: lighthouserc.desktop.cjs raises its performance
|
||||||
|
// target back to 0.9. Every URL matching an entry must pass it,
|
||||||
|
// so the home exception may only match the home page itself.
|
||||||
assertMatrix: [
|
assertMatrix: [
|
||||||
{
|
{
|
||||||
matchingUrlPattern: exact(indexedPaths),
|
matchingUrlPattern: exact(['/']),
|
||||||
assertions: {
|
assertions: {
|
||||||
...quality,
|
...quality,
|
||||||
'categories:performance': [
|
'categories:performance': [
|
||||||
@@ -80,6 +82,15 @@ module.exports = {
|
|||||||
'categories:seo': ['error', { minScore: 1 }],
|
'categories:seo': ['error', { minScore: 1 }],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
matchingUrlPattern: exact(
|
||||||
|
indexedPaths.filter((path) => path !== '/'),
|
||||||
|
),
|
||||||
|
assertions: {
|
||||||
|
...quality,
|
||||||
|
'categories:seo': ['error', { minScore: 1 }],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
matchingUrlPattern: exact(noindexPaths),
|
matchingUrlPattern: exact(noindexPaths),
|
||||||
assertions: {
|
assertions: {
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@@ -125,6 +125,44 @@ describe('app', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('shows the about page with its outline, links and structured data', async () => {
|
||||||
|
const { container } = await renderApp('/over-mij');
|
||||||
|
await screen.findByRole('heading', { level: 1, name: 'Over mij' });
|
||||||
|
// The page's own outline; the footer adds its own column headings
|
||||||
|
expect(
|
||||||
|
within(screen.getByRole('main'))
|
||||||
|
.getAllByRole('heading')
|
||||||
|
.map((h) => `${h.tagName} ${h.textContent}`),
|
||||||
|
).toEqual([
|
||||||
|
'H1 Over mij',
|
||||||
|
'H2 Hoi! Ik ben Andrea',
|
||||||
|
'H3 Hoe het begon',
|
||||||
|
'H3 Buiten de camera om',
|
||||||
|
]);
|
||||||
|
expect(
|
||||||
|
screen.getByRole('link', { name: 'mijn portfolio' }),
|
||||||
|
).toHaveAttribute('href', '/portfolio');
|
||||||
|
expect(
|
||||||
|
screen.getByRole('link', { name: 'neem contact op' }),
|
||||||
|
).toHaveAttribute('href', '/#contact');
|
||||||
|
expect(
|
||||||
|
screen.getByRole('link', { name: 'Boek je shoot' }),
|
||||||
|
).toHaveAttribute('href', '/#contact');
|
||||||
|
expect(
|
||||||
|
screen.getByRole('list', { name: "Foto's" }),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
|
||||||
|
expect(document.title).toBe(
|
||||||
|
'Over mij – fotograaf in Huizen | Andrea Slop Fotografie',
|
||||||
|
);
|
||||||
|
expect(document.head.querySelector('meta[name="robots"]')).toBeNull();
|
||||||
|
const types = [
|
||||||
|
...document.querySelectorAll('script[type="application/ld+json"]'),
|
||||||
|
].map((script) => JSON.parse(script.textContent!)['@type']);
|
||||||
|
expect(types.sort()).toEqual(['AboutPage', 'ProfessionalService']);
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
|
||||||
it('toont een onbekende URL als 404 binnen de shell', async () => {
|
it('toont een onbekende URL als 404 binnen de shell', async () => {
|
||||||
const { container } = await renderApp('/bestaat-niet');
|
const { container } = await renderApp('/bestaat-niet');
|
||||||
expect(
|
expect(
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
@@ -1,5 +1,6 @@
|
|||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { Box, chakra, Link, Text, useRecipe } from '@chakra-ui/react';
|
import { Box, chakra, Link, Text, useRecipe } from '@chakra-ui/react';
|
||||||
|
import Eyebrow from '@/components/Eyebrow/Eyebrow';
|
||||||
import type { EmailAddress } from '@/content/types';
|
import type { EmailAddress } from '@/content/types';
|
||||||
import { emailAddress } from '@/lib/emailAddress';
|
import { emailAddress } from '@/lib/emailAddress';
|
||||||
import { mailtoLink } from '@/lib/mailLink';
|
import { mailtoLink } from '@/lib/mailLink';
|
||||||
@@ -46,10 +47,7 @@ export default function ContactFormGate({
|
|||||||
textAlign="center"
|
textAlign="center"
|
||||||
data-testid="contact-gate-notice"
|
data-testid="contact-gate-notice"
|
||||||
>
|
>
|
||||||
{/* accent.deep instead of the design's accent: meets 4.5:1 */}
|
<Eyebrow>Binnenkort</Eyebrow>
|
||||||
<Text textStyle="eyebrow" color="accent.deep" mb={4}>
|
|
||||||
Binnenkort
|
|
||||||
</Text>
|
|
||||||
<Text color="ink.soft" mb={address ? 7 : 0}>
|
<Text color="ink.soft" mb={address ? 7 : 0}>
|
||||||
Het contactformulier komt binnenkort.
|
Het contactformulier komt binnenkort.
|
||||||
{address && (
|
{address && (
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import { screen } from '@testing-library/react';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { axeResults } from '@/test/axe';
|
||||||
|
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||||
|
import Eyebrow from './Eyebrow';
|
||||||
|
|
||||||
|
describe('Eyebrow', () => {
|
||||||
|
it('is a paragraph by default', async () => {
|
||||||
|
const { container } = await renderWithProviders(
|
||||||
|
<Eyebrow>Over mij</Eyebrow>,
|
||||||
|
);
|
||||||
|
expect(screen.getByText('Over mij').tagName).toBe('P');
|
||||||
|
expect(screen.queryByRole('heading')).not.toBeInTheDocument();
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can be a heading that a section refers to by id', async () => {
|
||||||
|
const { container } = await renderWithProviders(
|
||||||
|
<section aria-labelledby="story-title">
|
||||||
|
<Eyebrow as="h3" id="story-title">
|
||||||
|
Hoe het begon
|
||||||
|
</Eyebrow>
|
||||||
|
</section>,
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
screen.getByRole('heading', { level: 3, name: 'Hoe het begon' }),
|
||||||
|
).toHaveAttribute('id', 'story-title');
|
||||||
|
expect(
|
||||||
|
screen.getByRole('region', { name: 'Hoe het begon' }),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('passes other props through', async () => {
|
||||||
|
await renderWithProviders(
|
||||||
|
<Eyebrow data-testid="label" textAlign="center">
|
||||||
|
Binnenkort
|
||||||
|
</Eyebrow>,
|
||||||
|
);
|
||||||
|
expect(screen.getByTestId('label')).toHaveTextContent('Binnenkort');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { Text, type TextProps } from '@chakra-ui/react';
|
||||||
|
|
||||||
|
type EyebrowProps = Omit<TextProps, 'as'> & {
|
||||||
|
// A heading level makes the label a real heading that keeps the small
|
||||||
|
// label look, e.g. the story headings on the about page
|
||||||
|
as?: 'p' | 'span' | 'h2' | 'h3' | 'h4';
|
||||||
|
};
|
||||||
|
|
||||||
|
// Small capitals label above a heading or text (design .eyebrow).
|
||||||
|
// accent.deep instead of the design's accent: meets 4.5:1 on paper and white.
|
||||||
|
export default function Eyebrow({ as = 'p', ...rest }: EyebrowProps) {
|
||||||
|
return (
|
||||||
|
<Text
|
||||||
|
as={as}
|
||||||
|
textStyle="eyebrow"
|
||||||
|
color="accent.deep"
|
||||||
|
mb={4}
|
||||||
|
{...rest}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -24,4 +24,15 @@ describe('FramedImage', () => {
|
|||||||
expect(img).toHaveAttribute('loading', 'lazy');
|
expect(img).toHaveAttribute('loading', 'lazy');
|
||||||
expect(await axeResults(container)).toHaveNoViolations();
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('loads a priority photo straight away, not lazily', async () => {
|
||||||
|
await renderWithProviders(
|
||||||
|
<FramedImage image={image} aspectRatio="4 / 3" priority />,
|
||||||
|
);
|
||||||
|
const img = screen.getByRole('img');
|
||||||
|
expect(img).toHaveAttribute('src', '/andrea.jpg');
|
||||||
|
expect(img).not.toHaveAttribute('loading', 'lazy');
|
||||||
|
expect(img).toHaveAttribute('fetchpriority', 'high');
|
||||||
|
expect(img).toHaveAttribute('width', '1200');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Box } from '@chakra-ui/react';
|
import { Box, Image, type ImageProps } from '@chakra-ui/react';
|
||||||
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
||||||
import type { ContentImage } from '@/content/types';
|
import type { ContentImage } from '@/content/types';
|
||||||
|
|
||||||
@@ -6,13 +6,30 @@ type FramedImageProps = {
|
|||||||
image: ContentImage;
|
image: ContentImage;
|
||||||
// CSS aspect ratio of the visible crop, e.g. '4 / 3'
|
// CSS aspect ratio of the visible crop, e.g. '4 / 3'
|
||||||
aspectRatio: string;
|
aspectRatio: string;
|
||||||
|
// For a photo at the top of a page, likely the largest paint: load it
|
||||||
|
// straight away with high priority instead of after the page has loaded
|
||||||
|
priority?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
// A photo with a soft sand-coloured block offset behind its lower left
|
// A photo with a soft sand-coloured block offset behind its lower left
|
||||||
// corner (design .about__media). The block is pure decoration (a CSS
|
// corner (design .about__media). The block is pure decoration (a CSS
|
||||||
// pseudo-element), so assistive technology never announces it. On phones it
|
// pseudo-element), so assistive technology never announces it. On phones it
|
||||||
// is left out, since it would stick out past the page edge.
|
// is left out, since it would stick out past the page edge.
|
||||||
export default function FramedImage({ image, aspectRatio }: FramedImageProps) {
|
export default function FramedImage({
|
||||||
|
image,
|
||||||
|
aspectRatio,
|
||||||
|
priority = false,
|
||||||
|
}: FramedImageProps) {
|
||||||
|
const style: ImageProps = {
|
||||||
|
display: 'block',
|
||||||
|
w: '100%',
|
||||||
|
h: 'auto',
|
||||||
|
aspectRatio,
|
||||||
|
objectFit: 'cover',
|
||||||
|
// Shown until the photo arrives
|
||||||
|
bg: 'paper.deep',
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
position="relative"
|
position="relative"
|
||||||
@@ -30,16 +47,19 @@ export default function FramedImage({ image, aspectRatio }: FramedImageProps) {
|
|||||||
zIndex: -1,
|
zIndex: -1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DeferredImage
|
{priority ? (
|
||||||
image={image}
|
<Image
|
||||||
display="block"
|
src={image.src}
|
||||||
w="100%"
|
alt={image.alt}
|
||||||
h="auto"
|
htmlWidth={image.width}
|
||||||
aspectRatio={aspectRatio}
|
htmlHeight={image.height}
|
||||||
objectFit="cover"
|
fetchPriority="high"
|
||||||
// Shown until the deferred photo arrives
|
decoding="async"
|
||||||
bg="paper.deep"
|
{...style}
|
||||||
/>
|
/>
|
||||||
|
) : (
|
||||||
|
<DeferredImage image={image} {...style} />
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
import { screen } from '@testing-library/react';
|
|
||||||
import { describe, expect, it } from 'vitest';
|
|
||||||
import { axeResults } from '@/test/axe';
|
|
||||||
import { renderWithProviders } from '@/test/renderWithProviders';
|
|
||||||
import HomeSection from './HomeSection';
|
|
||||||
|
|
||||||
describe('HomeSection', () => {
|
|
||||||
it('is a region named by its heading', async () => {
|
|
||||||
const { container } = await renderWithProviders(
|
|
||||||
<HomeSection labelledBy="about-title" data-testid="about">
|
|
||||||
<h2 id="about-title">Over mij</h2>
|
|
||||||
</HomeSection>,
|
|
||||||
);
|
|
||||||
expect(screen.getByRole('region', { name: 'Over mij' })).toBe(
|
|
||||||
screen.getByTestId('about'),
|
|
||||||
);
|
|
||||||
expect(await axeResults(container)).toHaveNoViolations();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('passes the anchor id through for every tone, width and spacing', async () => {
|
|
||||||
await renderWithProviders(
|
|
||||||
<HomeSection
|
|
||||||
labelledBy="contact-title"
|
|
||||||
id="contact"
|
|
||||||
tone="alt"
|
|
||||||
width="narrow"
|
|
||||||
spacing="tight"
|
|
||||||
>
|
|
||||||
<h2 id="contact-title">Contact</h2>
|
|
||||||
</HomeSection>,
|
|
||||||
);
|
|
||||||
expect(screen.getByRole('region', { name: 'Contact' })).toHaveAttribute(
|
|
||||||
'id',
|
|
||||||
'contact',
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('leaves out the content column at full width', async () => {
|
|
||||||
await renderWithProviders(
|
|
||||||
<HomeSection labelledBy="insta-title" width="full">
|
|
||||||
<h2 id="insta-title" data-testid="child">
|
|
||||||
Instagram
|
|
||||||
</h2>
|
|
||||||
</HomeSection>,
|
|
||||||
);
|
|
||||||
// The heading is a direct child of the section, not of a Container
|
|
||||||
expect(screen.getByTestId('child').parentElement).toBe(
|
|
||||||
screen.getByRole('region', { name: 'Instagram' }),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import { screen } from '@testing-library/react';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import type { ContentImage } from '@/content/types';
|
||||||
|
import { axeResults } from '@/test/axe';
|
||||||
|
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||||
|
import MediaText from './MediaText';
|
||||||
|
|
||||||
|
const image: ContentImage = {
|
||||||
|
src: '/andrea.jpg',
|
||||||
|
alt: 'Andrea met haar camera',
|
||||||
|
width: 1200,
|
||||||
|
height: 800,
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('MediaText', () => {
|
||||||
|
it('shows the photo and the text column', async () => {
|
||||||
|
const { container } = await renderWithProviders(
|
||||||
|
<MediaText image={image} aspectRatio="4 / 3" data-testid="block">
|
||||||
|
<h2>Hoi! Ik ben Andrea</h2>
|
||||||
|
<p>Lifestyle fotograaf uit Huizen.</p>
|
||||||
|
</MediaText>,
|
||||||
|
);
|
||||||
|
expect(screen.getByRole('img')).toHaveAccessibleName(image.alt);
|
||||||
|
expect(
|
||||||
|
screen.getByRole('heading', { name: 'Hoi! Ik ben Andrea' }),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
expect(
|
||||||
|
screen.getByText('Lifestyle fotograaf uit Huizen.'),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('puts the photo before the text, also when stacked', async () => {
|
||||||
|
await renderWithProviders(
|
||||||
|
<MediaText image={image} aspectRatio="4 / 3">
|
||||||
|
<h2>Hoi! Ik ben Andrea</h2>
|
||||||
|
</MediaText>,
|
||||||
|
);
|
||||||
|
const photo = screen.getByRole('img');
|
||||||
|
const heading = screen.getByRole('heading');
|
||||||
|
expect(
|
||||||
|
photo.compareDocumentPosition(heading) &
|
||||||
|
Node.DOCUMENT_POSITION_FOLLOWING,
|
||||||
|
).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import type { ReactNode } from 'react';
|
||||||
|
import { Grid } from '@chakra-ui/react';
|
||||||
|
import FramedImage from '@/components/FramedImage/FramedImage';
|
||||||
|
import Reveal from '@/components/Reveal/Reveal';
|
||||||
|
import type { ContentImage } from '@/content/types';
|
||||||
|
|
||||||
|
type MediaTextProps = {
|
||||||
|
image: ContentImage;
|
||||||
|
// CSS aspect ratio of the visible crop, e.g. '4 / 3'
|
||||||
|
aspectRatio: string;
|
||||||
|
// The photo is at the top of the page and should not wait (FramedImage)
|
||||||
|
priority?: boolean;
|
||||||
|
'data-testid'?: string;
|
||||||
|
// The text column; each page fills in its own heading and text
|
||||||
|
children: ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
// A framed photo next to a text column (design .about), used on the
|
||||||
|
// homepage and the about page. Stacked on phones and tablets, two equal
|
||||||
|
// columns from `lg`; both columns fade in on scroll.
|
||||||
|
export default function MediaText({
|
||||||
|
image,
|
||||||
|
aspectRatio,
|
||||||
|
priority,
|
||||||
|
'data-testid': testId,
|
||||||
|
children,
|
||||||
|
}: MediaTextProps) {
|
||||||
|
return (
|
||||||
|
<Grid
|
||||||
|
templateColumns={{ base: '1fr', lg: '1fr 1fr' }}
|
||||||
|
gap="clamp(2rem, 6vw, 5.5rem)"
|
||||||
|
alignItems="center"
|
||||||
|
data-testid={testId}
|
||||||
|
>
|
||||||
|
<Reveal>
|
||||||
|
<FramedImage
|
||||||
|
image={image}
|
||||||
|
aspectRatio={aspectRatio}
|
||||||
|
priority={priority}
|
||||||
|
/>
|
||||||
|
</Reveal>
|
||||||
|
<Reveal>{children}</Reveal>
|
||||||
|
</Grid>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { Container, Heading, Text } from '@chakra-ui/react';
|
import { Container, Heading, Text } from '@chakra-ui/react';
|
||||||
|
import Eyebrow from '@/components/Eyebrow/Eyebrow';
|
||||||
|
|
||||||
type PageIntroProps = {
|
type PageIntroProps = {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -21,12 +22,7 @@ export default function PageIntro({
|
|||||||
pb={{ base: 8, md: 12, lg: 16 }}
|
pb={{ base: 8, md: 12, lg: 16 }}
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
>
|
>
|
||||||
{eyebrow && (
|
{eyebrow && <Eyebrow>{eyebrow}</Eyebrow>}
|
||||||
// accent.deep i.p.v. accent uit het design: haalt 4.5:1 (NFR-01)
|
|
||||||
<Text textStyle="eyebrow" color="accent.deep" mb={4}>
|
|
||||||
{eyebrow}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
<Heading as="h1" textStyle="pageTitle" mb={4}>
|
<Heading as="h1" textStyle="pageTitle" mb={4}>
|
||||||
{title}
|
{title}
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
import { screen } from '@testing-library/react';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { axeResults } from '@/test/axe';
|
||||||
|
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||||
|
import PageSection from './PageSection';
|
||||||
|
|
||||||
|
describe('PageSection', () => {
|
||||||
|
it('is a region named by its heading', async () => {
|
||||||
|
const { container } = await renderWithProviders(
|
||||||
|
<PageSection labelledBy="about-title" data-testid="about">
|
||||||
|
<h2 id="about-title">Over mij</h2>
|
||||||
|
</PageSection>,
|
||||||
|
);
|
||||||
|
expect(screen.getByRole('region', { name: 'Over mij' })).toBe(
|
||||||
|
screen.getByTestId('about'),
|
||||||
|
);
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('passes the anchor id through for every tone, width and spacing', async () => {
|
||||||
|
await renderWithProviders(
|
||||||
|
<PageSection
|
||||||
|
labelledBy="contact-title"
|
||||||
|
id="contact"
|
||||||
|
tone="alt"
|
||||||
|
width="narrow"
|
||||||
|
spacing="tight"
|
||||||
|
>
|
||||||
|
<h2 id="contact-title">Contact</h2>
|
||||||
|
</PageSection>,
|
||||||
|
);
|
||||||
|
expect(screen.getByRole('region', { name: 'Contact' })).toHaveAttribute(
|
||||||
|
'id',
|
||||||
|
'contact',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('has no space above when it sits flush below a page head', async () => {
|
||||||
|
await renderWithProviders(
|
||||||
|
<>
|
||||||
|
<PageSection labelledBy="flush-title" data-testid="flush">
|
||||||
|
<h2 id="flush-title">Hoi!</h2>
|
||||||
|
</PageSection>
|
||||||
|
<PageSection
|
||||||
|
labelledBy="next-title"
|
||||||
|
spacing="flushTop"
|
||||||
|
data-testid="flush-top"
|
||||||
|
>
|
||||||
|
<h2 id="next-title">Verder</h2>
|
||||||
|
</PageSection>
|
||||||
|
</>,
|
||||||
|
);
|
||||||
|
const regular = getComputedStyle(screen.getByTestId('flush'));
|
||||||
|
const flush = getComputedStyle(screen.getByTestId('flush-top'));
|
||||||
|
expect(flush.paddingTop).toBe('0px');
|
||||||
|
expect(flush.paddingBottom).toBe(regular.paddingBottom);
|
||||||
|
expect(regular.paddingTop).not.toBe('0px');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('is no landmark without a heading to name it', async () => {
|
||||||
|
const { container } = await renderWithProviders(
|
||||||
|
<PageSection data-testid="photos">
|
||||||
|
<p>Foto's</p>
|
||||||
|
</PageSection>,
|
||||||
|
);
|
||||||
|
expect(screen.getByTestId('photos').tagName).toBe('SECTION');
|
||||||
|
expect(screen.queryByRole('region')).not.toBeInTheDocument();
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('leaves out the content column at full width', async () => {
|
||||||
|
await renderWithProviders(
|
||||||
|
<PageSection labelledBy="insta-title" width="full">
|
||||||
|
<h2 id="insta-title" data-testid="child">
|
||||||
|
Instagram
|
||||||
|
</h2>
|
||||||
|
</PageSection>,
|
||||||
|
);
|
||||||
|
// The heading is a direct child of the section, not of a Container
|
||||||
|
expect(screen.getByTestId('child').parentElement).toBe(
|
||||||
|
screen.getByRole('region', { name: 'Instagram' }),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
+15
-9
@@ -1,22 +1,25 @@
|
|||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { Box, Container } from '@chakra-ui/react';
|
import { Box, Container } from '@chakra-ui/react';
|
||||||
|
|
||||||
type HomeSectionProps = {
|
type PageSectionProps = {
|
||||||
// Id of the heading that names this section for assistive technology
|
// Id of the heading that names this section for assistive technology.
|
||||||
labelledBy: string;
|
// Without it (a block without a heading) the section is no landmark.
|
||||||
|
labelledBy?: string;
|
||||||
id?: string;
|
id?: string;
|
||||||
tone?: 'paper' | 'alt';
|
tone?: 'paper' | 'alt';
|
||||||
// full: no content column, for edge-to-edge content; the section then
|
// full: no content column, for edge-to-edge content; the section then
|
||||||
// places its own Container around what should stay in the column
|
// places its own Container around what should stay in the column
|
||||||
width?: 'default' | 'narrow' | 'full';
|
width?: 'default' | 'narrow' | 'full';
|
||||||
spacing?: 'default' | 'tight';
|
// flushTop: no space above, for the first block right below a page head
|
||||||
|
// (design .section--flush-top)
|
||||||
|
spacing?: 'default' | 'tight' | 'flushTop';
|
||||||
'data-testid'?: string;
|
'data-testid'?: string;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Frame of a homepage section (design .section): vertical rhythm, an
|
// Frame of a content section on any page (design .section): vertical
|
||||||
// optional alternate background and the content column.
|
// rhythm, an optional alternate background and the content column.
|
||||||
export default function HomeSection({
|
export default function PageSection({
|
||||||
labelledBy,
|
labelledBy,
|
||||||
id,
|
id,
|
||||||
tone = 'paper',
|
tone = 'paper',
|
||||||
@@ -24,7 +27,9 @@ export default function HomeSection({
|
|||||||
spacing = 'default',
|
spacing = 'default',
|
||||||
'data-testid': testId,
|
'data-testid': testId,
|
||||||
children,
|
children,
|
||||||
}: HomeSectionProps) {
|
}: PageSectionProps) {
|
||||||
|
const padding = spacing === 'tight' ? 'sectionYTight' : 'sectionY';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
as="section"
|
as="section"
|
||||||
@@ -35,7 +40,8 @@ export default function HomeSection({
|
|||||||
// An anchor target (#contact) lands right below the fixed header,
|
// An anchor target (#contact) lands right below the fixed header,
|
||||||
// which has shrunk to its sticky height by the time it gets there
|
// which has shrunk to its sticky height by the time it gets there
|
||||||
scrollMarginTop={id ? 'header.sticky' : undefined}
|
scrollMarginTop={id ? 'header.sticky' : undefined}
|
||||||
py={spacing === 'tight' ? 'sectionYTight' : 'sectionY'}
|
pt={spacing === 'flushTop' ? 0 : padding}
|
||||||
|
pb={padding}
|
||||||
>
|
>
|
||||||
{width === 'full' ? (
|
{width === 'full' ? (
|
||||||
children
|
children
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { screen, within } from '@testing-library/react';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import type { ContentImage } from '@/content/types';
|
||||||
|
import { axeResults } from '@/test/axe';
|
||||||
|
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||||
|
import PhotoDuo from './PhotoDuo';
|
||||||
|
|
||||||
|
const photos: [ContentImage, ContentImage] = [
|
||||||
|
{
|
||||||
|
src: '/concert.jpg',
|
||||||
|
alt: 'Concert vanaf het podium',
|
||||||
|
width: 1200,
|
||||||
|
height: 798,
|
||||||
|
},
|
||||||
|
{ src: '/kat.jpg', alt: 'Slapende grijze kat', width: 1200, height: 800 },
|
||||||
|
];
|
||||||
|
|
||||||
|
describe('PhotoDuo', () => {
|
||||||
|
it('shows both photos in a named list', async () => {
|
||||||
|
const { container } = await renderWithProviders(
|
||||||
|
<PhotoDuo photos={photos} label="Foto's" />,
|
||||||
|
);
|
||||||
|
const list = screen.getByRole('list', { name: "Foto's" });
|
||||||
|
const images = within(list).getAllByRole('img');
|
||||||
|
expect(images).toHaveLength(2);
|
||||||
|
expect(images[0]).toHaveAccessibleName('Concert vanaf het podium');
|
||||||
|
expect(images[1]).toHaveAccessibleName('Slapende grijze kat');
|
||||||
|
expect(images[0]).toHaveAttribute('width', '1200');
|
||||||
|
expect(images[0]).toHaveAttribute('height', '798');
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
import { chakra } from '@chakra-ui/react';
|
||||||
|
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
||||||
|
import Reveal from '@/components/Reveal/Reveal';
|
||||||
|
import type { ContentImage } from '@/content/types';
|
||||||
|
|
||||||
|
type PhotoDuoProps = {
|
||||||
|
photos: [ContentImage, ContentImage];
|
||||||
|
// Accessible name of the photo list, e.g. "Foto's"
|
||||||
|
label: string;
|
||||||
|
'data-testid'?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Two landscape photos side by side (design .intro-gallery--duo), one below
|
||||||
|
// the other on phones. Each zooms in gently on hover, as in the homepage
|
||||||
|
// gallery, except with reduced motion.
|
||||||
|
export default function PhotoDuo({
|
||||||
|
photos,
|
||||||
|
label,
|
||||||
|
'data-testid': testId,
|
||||||
|
}: PhotoDuoProps) {
|
||||||
|
return (
|
||||||
|
<Reveal>
|
||||||
|
<chakra.ul
|
||||||
|
listStyleType="none"
|
||||||
|
aria-label={label}
|
||||||
|
data-testid={testId}
|
||||||
|
display="grid"
|
||||||
|
gridTemplateColumns={{ base: '1fr', sm: 'repeat(2, 1fr)' }}
|
||||||
|
gap="gridGap"
|
||||||
|
>
|
||||||
|
{photos.map((photo) => (
|
||||||
|
<chakra.li key={photo.src}>
|
||||||
|
<chakra.figure
|
||||||
|
overflow="hidden"
|
||||||
|
// Shown until the deferred photo arrives
|
||||||
|
bg="paper.deep"
|
||||||
|
css={{
|
||||||
|
'&:hover img': { transform: 'scale(1.05)' },
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DeferredImage
|
||||||
|
image={photo}
|
||||||
|
display="block"
|
||||||
|
w="100%"
|
||||||
|
h="auto"
|
||||||
|
aspectRatio="3 / 2"
|
||||||
|
objectFit="cover"
|
||||||
|
transitionProperty="transform"
|
||||||
|
transitionDuration="fade"
|
||||||
|
transitionTimingFunction="smooth"
|
||||||
|
_motionReduce={{ transition: 'none' }}
|
||||||
|
/>
|
||||||
|
</chakra.figure>
|
||||||
|
</chakra.li>
|
||||||
|
))}
|
||||||
|
</chakra.ul>
|
||||||
|
</Reveal>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { Box, Heading, Text } from '@chakra-ui/react';
|
import { Box, Heading, Text } from '@chakra-ui/react';
|
||||||
|
import Eyebrow from '@/components/Eyebrow/Eyebrow';
|
||||||
|
|
||||||
type SectionHeadingProps = {
|
type SectionHeadingProps = {
|
||||||
// Referenced by the section's aria-labelledby
|
// Referenced by the section's aria-labelledby
|
||||||
@@ -35,12 +36,7 @@ export default function SectionHeading({
|
|||||||
mb={spacing === 'compact' ? 6 : 'sectionHeadGap'}
|
mb={spacing === 'compact' ? 6 : 'sectionHeadGap'}
|
||||||
textAlign={centered ? 'center' : 'start'}
|
textAlign={centered ? 'center' : 'start'}
|
||||||
>
|
>
|
||||||
{eyebrow && (
|
{eyebrow && <Eyebrow>{eyebrow}</Eyebrow>}
|
||||||
// accent.deep instead of the design's accent: meets 4.5:1 (NFR-HP-01)
|
|
||||||
<Text textStyle="eyebrow" color="accent.deep" mb={4}>
|
|
||||||
{eyebrow}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
<Heading
|
<Heading
|
||||||
as="h2"
|
as="h2"
|
||||||
id={id}
|
id={id}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import { screen, within } from '@testing-library/react';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import aboutContent from '@/content/aboutContent';
|
||||||
|
import { axeResults } from '@/test/axe';
|
||||||
|
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||||
|
import AboutIntro from './AboutIntro';
|
||||||
|
|
||||||
|
const intro = aboutContent.intro;
|
||||||
|
|
||||||
|
describe('AboutIntro', () => {
|
||||||
|
it('shows the label, heading, text, portrait and links', async () => {
|
||||||
|
const { container } = await renderWithProviders(
|
||||||
|
<AboutIntro content={intro} />,
|
||||||
|
);
|
||||||
|
const section = screen.getByRole('region', { name: intro.title });
|
||||||
|
expect(
|
||||||
|
within(section).getByRole('heading', { level: 2 }),
|
||||||
|
).toHaveTextContent(intro.title);
|
||||||
|
expect(within(section).getByText(intro.eyebrow)).toBeInTheDocument();
|
||||||
|
expect(within(section).getByRole('img')).toHaveAccessibleName(
|
||||||
|
intro.image.alt,
|
||||||
|
);
|
||||||
|
expect(section).toHaveTextContent(
|
||||||
|
'Bekijk mijn portfolio of neem contact op voor een fotoshoot!',
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
within(section).getByRole('link', { name: 'mijn portfolio' }),
|
||||||
|
).toHaveAttribute('href', '/portfolio');
|
||||||
|
expect(
|
||||||
|
within(section).getByRole('link', { name: 'neem contact op' }),
|
||||||
|
).toHaveAttribute('href', '/#contact');
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import { Stack } from '@chakra-ui/react';
|
||||||
|
import RichParagraph from '@/components/about/RichParagraph/RichParagraph';
|
||||||
|
import MediaText from '@/components/MediaText/MediaText';
|
||||||
|
import PageSection from '@/components/PageSection/PageSection';
|
||||||
|
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
||||||
|
import type { AboutPageContent } from '@/content/types';
|
||||||
|
|
||||||
|
const TITLE_ID = 'about-intro-title';
|
||||||
|
|
||||||
|
type AboutIntroProps = {
|
||||||
|
content: AboutPageContent['intro'];
|
||||||
|
};
|
||||||
|
|
||||||
|
// "Hoi! Ik ben Andrea": the framed portrait next to the introduction, right
|
||||||
|
// below the page head (design .about in a .section--flush-top)
|
||||||
|
export default function AboutIntro({ content }: AboutIntroProps) {
|
||||||
|
return (
|
||||||
|
<PageSection
|
||||||
|
labelledBy={TITLE_ID}
|
||||||
|
spacing="flushTop"
|
||||||
|
data-testid="about-intro"
|
||||||
|
>
|
||||||
|
{/* Right below the page head: on phones the portrait is the
|
||||||
|
largest paint, so it must not wait for the page to load */}
|
||||||
|
<MediaText image={content.image} aspectRatio="4 / 3" priority>
|
||||||
|
<SectionHeading
|
||||||
|
id={TITLE_ID}
|
||||||
|
eyebrow={content.eyebrow}
|
||||||
|
title={content.title}
|
||||||
|
align="start"
|
||||||
|
spacing="compact"
|
||||||
|
/>
|
||||||
|
<Stack gap={4} color="ink.soft">
|
||||||
|
{content.paragraphs.map((paragraph, index) => (
|
||||||
|
<RichParagraph key={index} paragraph={paragraph} />
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
</MediaText>
|
||||||
|
</PageSection>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import { screen } from '@testing-library/react';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { axeResults } from '@/test/axe';
|
||||||
|
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||||
|
import RichParagraph from './RichParagraph';
|
||||||
|
|
||||||
|
describe('RichParagraph', () => {
|
||||||
|
it('renders text and links in reading order', async () => {
|
||||||
|
const { container } = await renderWithProviders(
|
||||||
|
<RichParagraph
|
||||||
|
paragraph={[
|
||||||
|
'Bekijk ',
|
||||||
|
{ text: 'mijn portfolio', to: '/portfolio' },
|
||||||
|
' of ',
|
||||||
|
{ text: 'neem contact op', to: '/', hash: 'contact' },
|
||||||
|
'!',
|
||||||
|
]}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
expect(container).toHaveTextContent(
|
||||||
|
'Bekijk mijn portfolio of neem contact op!',
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
screen.getByRole('link', { name: 'mijn portfolio' }),
|
||||||
|
).toHaveAttribute('href', '/portfolio');
|
||||||
|
expect(
|
||||||
|
screen.getByRole('link', { name: 'neem contact op' }),
|
||||||
|
).toHaveAttribute('href', '/#contact');
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a paragraph without links as plain text', async () => {
|
||||||
|
await renderWithProviders(<RichParagraph paragraph={['Hoi!']} />);
|
||||||
|
expect(screen.getByText('Hoi!')).toBeInTheDocument();
|
||||||
|
expect(screen.queryByRole('link')).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { Link, Text } from '@chakra-ui/react';
|
||||||
|
import RouterLink from '@/components/RouterLink';
|
||||||
|
import type { RichText } from '@/content/types';
|
||||||
|
|
||||||
|
type RichParagraphProps = {
|
||||||
|
paragraph: RichText;
|
||||||
|
};
|
||||||
|
|
||||||
|
// One paragraph of running text with links in it (BR-OM-03): text pieces as
|
||||||
|
// they are, link pieces as underlined router links.
|
||||||
|
export default function RichParagraph({ paragraph }: RichParagraphProps) {
|
||||||
|
return (
|
||||||
|
<Text>
|
||||||
|
{paragraph.map((piece, index) =>
|
||||||
|
typeof piece === 'string' ? (
|
||||||
|
piece
|
||||||
|
) : (
|
||||||
|
// Static content: the order never changes, so the index
|
||||||
|
// is a stable key
|
||||||
|
<Link key={index} variant="underline" asChild>
|
||||||
|
<RouterLink to={piece.to} hash={piece.hash}>
|
||||||
|
{piece.text}
|
||||||
|
</RouterLink>
|
||||||
|
</Link>
|
||||||
|
),
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import { screen, within } from '@testing-library/react';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import aboutContent from '@/content/aboutContent';
|
||||||
|
import { axeResults } from '@/test/axe';
|
||||||
|
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||||
|
import StorySection from './StorySection';
|
||||||
|
|
||||||
|
const personal = aboutContent.personal;
|
||||||
|
|
||||||
|
describe('StorySection', () => {
|
||||||
|
it('is a region named by its h3 label, with the text', async () => {
|
||||||
|
const { container } = await renderWithProviders(
|
||||||
|
// An h2 above it, as on the page, so the outline is complete
|
||||||
|
<>
|
||||||
|
<h2>Hoi! Ik ben Andrea</h2>
|
||||||
|
<StorySection
|
||||||
|
content={personal}
|
||||||
|
titleId="personal-title"
|
||||||
|
tone="alt"
|
||||||
|
/>
|
||||||
|
</>,
|
||||||
|
);
|
||||||
|
const section = screen.getByRole('region', { name: personal.title });
|
||||||
|
expect(
|
||||||
|
within(section).getByRole('heading', { level: 3 }),
|
||||||
|
).toHaveAttribute('id', 'personal-title');
|
||||||
|
personal.paragraphs.forEach((paragraph) =>
|
||||||
|
expect(within(section).getByText(paragraph)).toBeInTheDocument(),
|
||||||
|
);
|
||||||
|
expect(await axeResults(container)).toHaveNoViolations();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows extra content below the text', async () => {
|
||||||
|
await renderWithProviders(
|
||||||
|
<StorySection content={personal} titleId="personal-title">
|
||||||
|
<a href="/#contact">Boek je shoot</a>
|
||||||
|
</StorySection>,
|
||||||
|
);
|
||||||
|
const section = screen.getByRole('region', { name: personal.title });
|
||||||
|
expect(
|
||||||
|
within(section).getByRole('link', { name: 'Boek je shoot' }),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import type { ReactNode } from 'react';
|
||||||
|
import { Box, Stack, Text } from '@chakra-ui/react';
|
||||||
|
import Eyebrow from '@/components/Eyebrow/Eyebrow';
|
||||||
|
import PageSection from '@/components/PageSection/PageSection';
|
||||||
|
import Reveal from '@/components/Reveal/Reveal';
|
||||||
|
import type { AboutPageContent } from '@/content/types';
|
||||||
|
|
||||||
|
type StorySectionProps = {
|
||||||
|
content: AboutPageContent['background'];
|
||||||
|
// Id of the h3, which names the section
|
||||||
|
titleId: string;
|
||||||
|
tone?: 'paper' | 'alt';
|
||||||
|
spacing?: 'default' | 'flushTop';
|
||||||
|
'data-testid'?: string;
|
||||||
|
// Shown below the text, e.g. the booking button
|
||||||
|
children?: ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
// One part of Andrea's story in the narrow column. Its heading is an h3 in
|
||||||
|
// the small label style: the story continues "Hoi! Ik ben Andrea" (FR-OM-03).
|
||||||
|
export default function StorySection({
|
||||||
|
content,
|
||||||
|
titleId,
|
||||||
|
tone,
|
||||||
|
spacing,
|
||||||
|
'data-testid': testId,
|
||||||
|
children,
|
||||||
|
}: StorySectionProps) {
|
||||||
|
return (
|
||||||
|
<PageSection
|
||||||
|
labelledBy={titleId}
|
||||||
|
width="narrow"
|
||||||
|
tone={tone}
|
||||||
|
spacing={spacing}
|
||||||
|
data-testid={testId}
|
||||||
|
>
|
||||||
|
<Reveal>
|
||||||
|
<Eyebrow as="h3" id={titleId}>
|
||||||
|
{content.title}
|
||||||
|
</Eyebrow>
|
||||||
|
<Stack gap={4} color="ink.soft">
|
||||||
|
{content.paragraphs.map((paragraph) => (
|
||||||
|
<Text key={paragraph}>{paragraph}</Text>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
{/* design .mt-lg */}
|
||||||
|
{children && (
|
||||||
|
<Box mt="clamp(2rem, 4vw, 2.5rem)">{children}</Box>
|
||||||
|
)}
|
||||||
|
</Reveal>
|
||||||
|
</PageSection>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Grid, Link, Stack, Text } from '@chakra-ui/react';
|
import { Link, Stack, Text } from '@chakra-ui/react';
|
||||||
import FramedImage from '@/components/FramedImage/FramedImage';
|
import MediaText from '@/components/MediaText/MediaText';
|
||||||
import HomeSection from '@/components/HomeSection/HomeSection';
|
import PageSection from '@/components/PageSection/PageSection';
|
||||||
import Reveal from '@/components/Reveal/Reveal';
|
|
||||||
import RouterLink from '@/components/RouterLink';
|
import RouterLink from '@/components/RouterLink';
|
||||||
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
||||||
import type { HomeContent } from '@/content/types';
|
import type { HomeContent } from '@/content/types';
|
||||||
@@ -16,16 +15,8 @@ type AboutBlockProps = {
|
|||||||
// link to the about page (design .about). Stacked on phones and tablets.
|
// link to the about page (design .about). Stacked on phones and tablets.
|
||||||
export default function AboutBlock({ content }: AboutBlockProps) {
|
export default function AboutBlock({ content }: AboutBlockProps) {
|
||||||
return (
|
return (
|
||||||
<HomeSection labelledBy={TITLE_ID} tone="alt" data-testid="about-block">
|
<PageSection labelledBy={TITLE_ID} tone="alt" data-testid="about-block">
|
||||||
<Grid
|
<MediaText image={content.image} aspectRatio="4 / 3">
|
||||||
templateColumns={{ base: '1fr', lg: '1fr 1fr' }}
|
|
||||||
gap="clamp(2rem, 6vw, 5.5rem)"
|
|
||||||
alignItems="center"
|
|
||||||
>
|
|
||||||
<Reveal>
|
|
||||||
<FramedImage image={content.image} aspectRatio="4 / 3" />
|
|
||||||
</Reveal>
|
|
||||||
<Reveal>
|
|
||||||
<SectionHeading
|
<SectionHeading
|
||||||
id={TITLE_ID}
|
id={TITLE_ID}
|
||||||
eyebrow={content.eyebrow}
|
eyebrow={content.eyebrow}
|
||||||
@@ -48,8 +39,7 @@ export default function AboutBlock({ content }: AboutBlockProps) {
|
|||||||
</Link>
|
</Link>
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Reveal>
|
</MediaText>
|
||||||
</Grid>
|
</PageSection>
|
||||||
</HomeSection>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Box, useMediaQuery } from '@chakra-ui/react';
|
|||||||
import { useNavigate } from '@tanstack/react-router';
|
import { useNavigate } from '@tanstack/react-router';
|
||||||
import { DEFERRED_LOAD_MARGIN } from '@/components/DeferredImage/DeferredImage';
|
import { DEFERRED_LOAD_MARGIN } from '@/components/DeferredImage/DeferredImage';
|
||||||
import ContactFormGate from '@/components/ContactForm/ContactFormGate';
|
import ContactFormGate from '@/components/ContactForm/ContactFormGate';
|
||||||
import HomeSection from '@/components/HomeSection/HomeSection';
|
import PageSection from '@/components/PageSection/PageSection';
|
||||||
import Reveal from '@/components/Reveal/Reveal';
|
import Reveal from '@/components/Reveal/Reveal';
|
||||||
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
||||||
import type {
|
import type {
|
||||||
@@ -109,7 +109,7 @@ export default function ContactSection({
|
|||||||
const placeholder = <Box minH={FORM_PLACEHOLDER_HEIGHT} />;
|
const placeholder = <Box minH={FORM_PLACEHOLDER_HEIGHT} />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomeSection
|
<PageSection
|
||||||
labelledBy={TITLE_ID}
|
labelledBy={TITLE_ID}
|
||||||
id="contact"
|
id="contact"
|
||||||
width="narrow"
|
width="narrow"
|
||||||
@@ -146,6 +146,6 @@ export default function ContactSection({
|
|||||||
</Box>
|
</Box>
|
||||||
</ContactFormGate>
|
</ContactFormGate>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
</HomeSection>
|
</PageSection>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Box, chakra, Container, Link, VisuallyHidden } from '@chakra-ui/react';
|
import { Box, chakra, Container, Link, VisuallyHidden } from '@chakra-ui/react';
|
||||||
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
||||||
import HomeSection from '@/components/HomeSection/HomeSection';
|
import PageSection from '@/components/PageSection/PageSection';
|
||||||
import Reveal from '@/components/Reveal/Reveal';
|
import Reveal from '@/components/Reveal/Reveal';
|
||||||
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
||||||
import type { HomeContent } from '@/content/types';
|
import type { HomeContent } from '@/content/types';
|
||||||
@@ -22,7 +22,7 @@ export default function InstagramGrid({
|
|||||||
profileUrl,
|
profileUrl,
|
||||||
}: InstagramGridProps) {
|
}: InstagramGridProps) {
|
||||||
return (
|
return (
|
||||||
<HomeSection
|
<PageSection
|
||||||
labelledBy={TITLE_ID}
|
labelledBy={TITLE_ID}
|
||||||
spacing="tight"
|
spacing="tight"
|
||||||
width="full"
|
width="full"
|
||||||
@@ -112,6 +112,6 @@ export default function InstagramGrid({
|
|||||||
))}
|
))}
|
||||||
</chakra.ul>
|
</chakra.ul>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
</HomeSection>
|
</PageSection>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { chakra, useBreakpointValue } from '@chakra-ui/react';
|
|||||||
import DeferredImage, {
|
import DeferredImage, {
|
||||||
DEFERRED_LOAD_MARGIN,
|
DEFERRED_LOAD_MARGIN,
|
||||||
} from '@/components/DeferredImage/DeferredImage';
|
} from '@/components/DeferredImage/DeferredImage';
|
||||||
import HomeSection from '@/components/HomeSection/HomeSection';
|
import PageSection from '@/components/PageSection/PageSection';
|
||||||
import Reveal from '@/components/Reveal/Reveal';
|
import Reveal from '@/components/Reveal/Reveal';
|
||||||
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
||||||
import type { HomeContent } from '@/content/types';
|
import type { HomeContent } from '@/content/types';
|
||||||
@@ -33,7 +33,7 @@ export default function IntroGallery({ content }: IntroGalleryProps) {
|
|||||||
const scrollable = useBreakpointValue({ base: true, sm: false }) ?? false;
|
const scrollable = useBreakpointValue({ base: true, sm: false }) ?? false;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomeSection labelledBy={TITLE_ID} data-testid="intro-gallery">
|
<PageSection labelledBy={TITLE_ID} data-testid="intro-gallery">
|
||||||
<Reveal>
|
<Reveal>
|
||||||
<SectionHeading
|
<SectionHeading
|
||||||
id={TITLE_ID}
|
id={TITLE_ID}
|
||||||
@@ -99,6 +99,6 @@ export default function IntroGallery({ content }: IntroGalleryProps) {
|
|||||||
))}
|
))}
|
||||||
</chakra.ul>
|
</chakra.ul>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
</HomeSection>
|
</PageSection>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Box, Grid } from '@chakra-ui/react';
|
import { Box, Grid } from '@chakra-ui/react';
|
||||||
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
||||||
import HomeSection from '@/components/HomeSection/HomeSection';
|
import PageSection from '@/components/PageSection/PageSection';
|
||||||
import Reveal from '@/components/Reveal/Reveal';
|
import Reveal from '@/components/Reveal/Reveal';
|
||||||
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
||||||
import type { HomeContent, PricingPackage } from '@/content/types';
|
import type { HomeContent, PricingPackage } from '@/content/types';
|
||||||
@@ -32,7 +32,7 @@ export default function Pricing({ content, packages }: PricingProps) {
|
|||||||
if (shown.length === 0) return null;
|
if (shown.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomeSection labelledBy={TITLE_ID} data-testid="pricing">
|
<PageSection labelledBy={TITLE_ID} data-testid="pricing">
|
||||||
<Box position="relative" isolation="isolate">
|
<Box position="relative" isolation="isolate">
|
||||||
{content.decorations.map((decoration, index) => (
|
{content.decorations.map((decoration, index) => (
|
||||||
<DeferredImage
|
<DeferredImage
|
||||||
@@ -68,6 +68,6 @@ export default function Pricing({ content, packages }: PricingProps) {
|
|||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
</HomeSection>
|
</PageSection>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Box, chakra, Grid, Text } from '@chakra-ui/react';
|
import { Box, chakra, Grid, Text } from '@chakra-ui/react';
|
||||||
|
import Eyebrow from '@/components/Eyebrow/Eyebrow';
|
||||||
import FramedImage from '@/components/FramedImage/FramedImage';
|
import FramedImage from '@/components/FramedImage/FramedImage';
|
||||||
import type { Testimonial } from '@/content/types';
|
import type { Testimonial } from '@/content/types';
|
||||||
|
|
||||||
@@ -44,10 +45,7 @@ export default function TestimonialSlide({
|
|||||||
>
|
>
|
||||||
“
|
“
|
||||||
</Text>
|
</Text>
|
||||||
{/* accent.deep instead of the design's accent: meets 4.5:1 (NFR-HP-01) */}
|
<Eyebrow>{testimonial.shoot}</Eyebrow>
|
||||||
<Text textStyle="eyebrow" color="accent.deep" mb={4}>
|
|
||||||
{testimonial.shoot}
|
|
||||||
</Text>
|
|
||||||
{/* Plain elements, not Chakra's Blockquote: its slot recipe
|
{/* Plain elements, not Chakra's Blockquote: its slot recipe
|
||||||
would pull shared code into the chunk the hero waits for */}
|
would pull shared code into the chunk the hero waits for */}
|
||||||
<chakra.figure display="flex" flexDirection="column" gap={7}>
|
<chakra.figure display="flex" flexDirection="column" gap={7}>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { lazy, Suspense } from 'react';
|
import { lazy, Suspense } from 'react';
|
||||||
import { Box } from '@chakra-ui/react';
|
import { Box } from '@chakra-ui/react';
|
||||||
import { DEFERRED_LOAD_MARGIN } from '@/components/DeferredImage/DeferredImage';
|
import { DEFERRED_LOAD_MARGIN } from '@/components/DeferredImage/DeferredImage';
|
||||||
import HomeSection from '@/components/HomeSection/HomeSection';
|
import PageSection from '@/components/PageSection/PageSection';
|
||||||
import Reveal from '@/components/Reveal/Reveal';
|
import Reveal from '@/components/Reveal/Reveal';
|
||||||
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
||||||
import type { HomeContent, Testimonial } from '@/content/types';
|
import type { HomeContent, Testimonial } from '@/content/types';
|
||||||
@@ -36,7 +36,7 @@ export default function Testimonials({
|
|||||||
if (shown.length === 0) return null;
|
if (shown.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomeSection
|
<PageSection
|
||||||
labelledBy={TITLE_ID}
|
labelledBy={TITLE_ID}
|
||||||
tone="alt"
|
tone="alt"
|
||||||
data-testid="testimonials"
|
data-testid="testimonials"
|
||||||
@@ -63,7 +63,7 @@ export default function Testimonials({
|
|||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
</Reveal>
|
</Reveal>
|
||||||
</HomeSection>
|
</PageSection>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
import type { AboutPageContent } from './types';
|
||||||
|
|
||||||
|
// Images
|
||||||
|
import portrait from '../assets/about/andrea-portret.jpg';
|
||||||
|
import concert from '../assets/about/about-1.jpg';
|
||||||
|
import cat from '../assets/about/about-2.jpg';
|
||||||
|
|
||||||
|
// Static content of the about page until the CMS API exists; texts from the
|
||||||
|
// live site, structure from the design (FR-OM-01..05).
|
||||||
|
const aboutContent: AboutPageContent = {
|
||||||
|
head: {
|
||||||
|
eyebrow: 'Andrea Slop Fotografie',
|
||||||
|
title: 'Over mij',
|
||||||
|
},
|
||||||
|
intro: {
|
||||||
|
eyebrow: 'Lifestyle fotograaf',
|
||||||
|
title: 'Hoi! Ik ben Andrea',
|
||||||
|
paragraphs: [
|
||||||
|
[
|
||||||
|
'Hoi! Ik ben Andrea, een fotograaf met liefde voor het vastleggen van momenten. Momenten die je voor altijd bewaart.',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Mijn stijl is te omschrijven als warm en spontaan. Ik houd van natuurlijke, ongedwongen foto's die een verhaal vertellen.",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'Nieuwsgierig naar mijn werk? Bekijk ',
|
||||||
|
{ text: 'mijn portfolio', to: '/portfolio' },
|
||||||
|
' of ',
|
||||||
|
// The homepage contact section until /contact exists
|
||||||
|
{ text: 'neem contact op', to: '/', hash: 'contact' },
|
||||||
|
' voor een fotoshoot!',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
image: {
|
||||||
|
src: portrait,
|
||||||
|
alt: 'Andrea Slop in een groene trui met haar camera in de handen, glimlachend in het bos',
|
||||||
|
width: 1200,
|
||||||
|
height: 800,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
title: 'Hoe het begon',
|
||||||
|
paragraphs: [
|
||||||
|
"Tijdens de studie Communicatie & Media Design kon ik mijn creativiteit kwijt in verschillende vormen. Fotografie was mijn favoriet. De keuze voor de minor Fotojournalistiek was dan ook snel gemaakt. Tijdens de studie werd mijn liefde voor fotografie alleen maar groter. Waar ik voorheen altijd foto's in mijn vrije tijd maakte, ging ik tijdens de minor op pad voor verschillende opdrachten. Tijdens het fotograferen van een concert voelde ik me meteen op mijn plek. De hele zaal door met mijn camera. Ik was helemaal in mijn element. Het was even een zoektocht maar uiteindelijk heb ik mijn specialisatie gevonden. Je kunt bij mij terecht voor newbornshoots, zwangerschapsshoots en gezinsshoots.",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
photos: [
|
||||||
|
{
|
||||||
|
src: concert,
|
||||||
|
alt: 'Concert vanaf het podium: de zanger steekt zijn microfoon omhoog voor een volle zaal in blauw licht',
|
||||||
|
width: 1200,
|
||||||
|
height: 798,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: cat,
|
||||||
|
alt: 'Een grijze langharige kat slaapt met een uitgestrekte poot op de bank',
|
||||||
|
width: 1200,
|
||||||
|
height: 800,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
personal: {
|
||||||
|
title: 'Buiten de camera om',
|
||||||
|
paragraphs: [
|
||||||
|
'Mijn camera gaat altijd mee op reis. Het liefst ga ik naar een plek met een mooie zee maar ik ga ook graag op pad om de natuur vast te leggen met mijn camera.',
|
||||||
|
'Wanneer ik niet achter de camera sta ben ik bezig met tekenen, schilderen of lezen.',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
booking: { label: 'Boek je shoot', to: '/', hash: 'contact' },
|
||||||
|
person: {
|
||||||
|
name: 'Andrea Slop',
|
||||||
|
jobTitle: 'Lifestyle fotograaf',
|
||||||
|
knowsAbout: [
|
||||||
|
'Newbornfotografie',
|
||||||
|
'Zwangerschapsfotografie',
|
||||||
|
'Gezinsfotografie',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default aboutContent;
|
||||||
@@ -88,6 +88,36 @@ export interface HomeContent {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Where a link goes: a route (a typo is a type error) and optionally an
|
||||||
|
// anchor on that page, without the '#'
|
||||||
|
export interface LinkTarget {
|
||||||
|
to: RoutePath;
|
||||||
|
hash?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InlineLink = LinkTarget & { text: string };
|
||||||
|
|
||||||
|
// A paragraph as text pieces and links in reading order, so the API can
|
||||||
|
// deliver links inside running text without HTML. Spaces belong to the text.
|
||||||
|
export type RichText = (string | InlineLink)[];
|
||||||
|
|
||||||
|
// Content of the about page (/over-mij)
|
||||||
|
export interface AboutPageContent {
|
||||||
|
head: { eyebrow: string; title: string };
|
||||||
|
intro: {
|
||||||
|
eyebrow: string;
|
||||||
|
title: string;
|
||||||
|
paragraphs: RichText[];
|
||||||
|
image: ContentImage;
|
||||||
|
};
|
||||||
|
background: { title: string; paragraphs: string[] };
|
||||||
|
photos: [ContentImage, ContentImage];
|
||||||
|
personal: { title: string; paragraphs: string[] };
|
||||||
|
booking: LinkTarget & { label: string };
|
||||||
|
// For the structured data about Andrea; summarises what the page says
|
||||||
|
person: { name: string; jobTitle: string; knowsAbout: string[] };
|
||||||
|
}
|
||||||
|
|
||||||
export interface HeroSlide {
|
export interface HeroSlide {
|
||||||
id: string;
|
id: string;
|
||||||
src: string;
|
src: string;
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import fc from 'fast-check';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { knowsAboutEntries } from '@/test/arbitraries';
|
||||||
|
import { knowsAboutList } from './knowsAboutList';
|
||||||
|
|
||||||
|
describe('knowsAboutList', () => {
|
||||||
|
it('trims, drops empty entries and duplicates, keeps the first one', () => {
|
||||||
|
expect(
|
||||||
|
knowsAboutList([
|
||||||
|
' Newbornfotografie ',
|
||||||
|
'',
|
||||||
|
' ',
|
||||||
|
'Gezinsfotografie',
|
||||||
|
'Newbornfotografie',
|
||||||
|
]),
|
||||||
|
).toEqual(['Newbornfotografie', 'Gezinsfotografie']);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('only keeps trimmed, non-empty, unique input entries (invariant)', () => {
|
||||||
|
fc.assert(
|
||||||
|
fc.property(knowsAboutEntries, (entries) => {
|
||||||
|
const out = knowsAboutList(entries);
|
||||||
|
const trimmed = entries.map((entry) => entry.trim());
|
||||||
|
expect(out.every((entry) => entry !== '')).toBe(true);
|
||||||
|
expect(out.every((entry) => trimmed.includes(entry))).toBe(
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
expect(new Set(out).size).toBe(out.length);
|
||||||
|
// Every non-empty input entry survives, in first-seen order
|
||||||
|
expect(out).toEqual(
|
||||||
|
trimmed.filter(
|
||||||
|
(entry, index) =>
|
||||||
|
entry !== '' && trimmed.indexOf(entry) === index,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('changes nothing the second time (idempotency)', () => {
|
||||||
|
fc.assert(
|
||||||
|
fc.property(knowsAboutEntries, (entries) => {
|
||||||
|
const once = knowsAboutList(entries);
|
||||||
|
expect(knowsAboutList(once)).toEqual(once);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
// The specialisations for the structured data (BR-SD-05): trimmed, without
|
||||||
|
// empty entries or duplicates, in the order the CMS delivers them.
|
||||||
|
export function knowsAboutList(entries: readonly string[]): string[] {
|
||||||
|
const trimmed = entries.map((entry) => entry.trim()).filter(Boolean);
|
||||||
|
return [...new Set(trimmed)];
|
||||||
|
}
|
||||||
@@ -1,17 +1,63 @@
|
|||||||
import { createFileRoute } from '@tanstack/react-router';
|
import { createFileRoute } from '@tanstack/react-router';
|
||||||
|
import AboutIntro from '../components/about/AboutIntro/AboutIntro';
|
||||||
|
import StorySection from '../components/about/StorySection/StorySection';
|
||||||
|
import LinkButton from '../components/LinkButton';
|
||||||
import PageIntro from '../components/PageIntro/PageIntro';
|
import PageIntro from '../components/PageIntro/PageIntro';
|
||||||
import { pageHead } from '../seo';
|
import PageSection from '../components/PageSection/PageSection';
|
||||||
|
import PhotoDuo from '../components/PhotoDuo/PhotoDuo';
|
||||||
|
import aboutContent from '../content/aboutContent';
|
||||||
|
import siteContent from '../content/siteContent';
|
||||||
|
import { aboutPage, pageHead, structuredDataScript } from '../seo';
|
||||||
|
|
||||||
export const Route = createFileRoute('/over-mij')({
|
export const Route = createFileRoute('/over-mij')({
|
||||||
head: () => pageHead('/over-mij'),
|
head: () => ({
|
||||||
|
...pageHead('/over-mij'),
|
||||||
|
scripts: [
|
||||||
|
structuredDataScript(
|
||||||
|
aboutPage('/over-mij', aboutContent.person, siteContent),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
}),
|
||||||
component: About,
|
component: About,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Placeholder tot de echte pagina er is (noindex via sitePages)
|
// The about page: who Andrea is, how it started, two photos and what she
|
||||||
|
// does besides photography, in the order of LAYOUT.md
|
||||||
function About() {
|
function About() {
|
||||||
|
const { head, intro, background, photos, personal, booking } = aboutContent;
|
||||||
return (
|
return (
|
||||||
<PageIntro eyebrow="Andrea Slop Fotografie" title="Over mij">
|
<>
|
||||||
Deze pagina is nog in de maak. Kom snel terug!
|
<PageIntro eyebrow={head.eyebrow} title={head.title} />
|
||||||
</PageIntro>
|
<AboutIntro content={intro} />
|
||||||
|
<StorySection
|
||||||
|
content={background}
|
||||||
|
titleId="about-background-title"
|
||||||
|
tone="alt"
|
||||||
|
data-testid="about-background"
|
||||||
|
/>
|
||||||
|
{/* No heading in the design, so no named region (BR-OM-11) */}
|
||||||
|
<PageSection>
|
||||||
|
<PhotoDuo
|
||||||
|
photos={photos}
|
||||||
|
label="Foto's"
|
||||||
|
data-testid="about-photos"
|
||||||
|
/>
|
||||||
|
</PageSection>
|
||||||
|
<StorySection
|
||||||
|
content={personal}
|
||||||
|
titleId="about-personal-title"
|
||||||
|
spacing="flushTop"
|
||||||
|
data-testid="about-personal"
|
||||||
|
>
|
||||||
|
<LinkButton
|
||||||
|
variant="accent"
|
||||||
|
to={booking.to}
|
||||||
|
hash={booking.hash}
|
||||||
|
data-testid="about-booking-link"
|
||||||
|
>
|
||||||
|
{booking.label}
|
||||||
|
</LinkButton>
|
||||||
|
</StorySection>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+157
-1
@@ -1,15 +1,28 @@
|
|||||||
import fc from 'fast-check';
|
import fc from 'fast-check';
|
||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import aboutContent from './content/aboutContent';
|
||||||
import siteContent from './content/siteContent';
|
import siteContent from './content/siteContent';
|
||||||
|
import { emailAddress } from './lib/emailAddress';
|
||||||
|
import { visibleSocials } from './lib/visibleSocials';
|
||||||
import {
|
import {
|
||||||
|
aboutPage,
|
||||||
|
businessId,
|
||||||
canonicalUrl,
|
canonicalUrl,
|
||||||
jsonLdScript,
|
jsonLdScript,
|
||||||
pageHead,
|
pageHead,
|
||||||
|
person,
|
||||||
|
personId,
|
||||||
professionalService,
|
professionalService,
|
||||||
siteHead,
|
siteHead,
|
||||||
siteUrl,
|
siteUrl,
|
||||||
|
structuredDataScript,
|
||||||
} from './seo';
|
} from './seo';
|
||||||
import { routePath } from './test/arbitraries';
|
import sitePages from './sitePages';
|
||||||
|
import {
|
||||||
|
anySiteContent,
|
||||||
|
knowsAboutEntries,
|
||||||
|
routePath,
|
||||||
|
} from './test/arbitraries';
|
||||||
|
|
||||||
const meta = (head: ReturnType<typeof pageHead>, key: string) =>
|
const meta = (head: ReturnType<typeof pageHead>, key: string) =>
|
||||||
head.meta.find(
|
head.meta.find(
|
||||||
@@ -122,3 +135,146 @@ describe('professionalService en siteHead', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('pageHead for the about page', () => {
|
||||||
|
it('is indexed, with its own title, description and preview image', () => {
|
||||||
|
const head = pageHead('/over-mij');
|
||||||
|
expect(head.meta[0]).toEqual({
|
||||||
|
title: 'Over mij – fotograaf in Huizen | Andrea Slop Fotografie',
|
||||||
|
});
|
||||||
|
expect(meta(head, 'robots')).toBeUndefined();
|
||||||
|
expect(meta(head, 'description')).toMatchObject({
|
||||||
|
content: sitePages['/over-mij'].description,
|
||||||
|
});
|
||||||
|
expect(meta(head, 'og:image')).toMatchObject({
|
||||||
|
content: `${siteUrl}/og-over-mij.jpg`,
|
||||||
|
});
|
||||||
|
expect(head.links[0].href).toBe(`${siteUrl}/over-mij`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('keeps title and description within what search engines show', () => {
|
||||||
|
const page = sitePages['/over-mij'];
|
||||||
|
expect(
|
||||||
|
`${page.title} | Andrea Slop Fotografie`.length,
|
||||||
|
).toBeLessThanOrEqual(60);
|
||||||
|
expect(page.description.length).toBeLessThanOrEqual(155);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('structured data about Andrea', () => {
|
||||||
|
const image = `${siteUrl}/og-over-mij.jpg`;
|
||||||
|
|
||||||
|
it('describes Andrea from the page content and the site socials', () => {
|
||||||
|
expect(person(aboutContent.person, siteContent, image)).toEqual({
|
||||||
|
'@type': 'Person',
|
||||||
|
'@id': personId,
|
||||||
|
name: 'Andrea Slop',
|
||||||
|
jobTitle: 'Lifestyle fotograaf',
|
||||||
|
image,
|
||||||
|
address: {
|
||||||
|
'@type': 'PostalAddress',
|
||||||
|
addressLocality: 'Huizen',
|
||||||
|
addressCountry: 'NL',
|
||||||
|
},
|
||||||
|
url: `${siteUrl}/over-mij`,
|
||||||
|
worksFor: { '@id': businessId },
|
||||||
|
knowsAbout: [
|
||||||
|
'Newbornfotografie',
|
||||||
|
'Zwangerschapsfotografie',
|
||||||
|
'Gezinsfotografie',
|
||||||
|
],
|
||||||
|
sameAs: siteContent.socials.map((social) => social.href),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('leaves out empty lists instead of writing them', () => {
|
||||||
|
const data = person(
|
||||||
|
{ ...aboutContent.person, knowsAbout: [' ', ''] },
|
||||||
|
{ ...siteContent, socials: [] },
|
||||||
|
image,
|
||||||
|
);
|
||||||
|
expect(data).not.toHaveProperty('knowsAbout');
|
||||||
|
expect(data).not.toHaveProperty('sameAs');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('links Andrea and the business both ways (invariant)', () => {
|
||||||
|
fc.assert(
|
||||||
|
fc.property(anySiteContent, (site) => {
|
||||||
|
const business = professionalService(site);
|
||||||
|
const andrea = person(aboutContent.person, site, image);
|
||||||
|
expect(business['@id']).toBe(businessId);
|
||||||
|
expect(business.founder['@id']).toBe(andrea['@id']);
|
||||||
|
expect(andrea.worksFor['@id']).toBe(business['@id']);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('lists exactly the valid https socials in sameAs (invariant)', () => {
|
||||||
|
fc.assert(
|
||||||
|
fc.property(anySiteContent, (site) => {
|
||||||
|
const valid = visibleSocials(site.socials).map((s) => s.href);
|
||||||
|
const andrea = person(aboutContent.person, site, image);
|
||||||
|
expect(andrea.sameAs ?? []).toEqual(valid);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('lists the cleaned specialisations in knowsAbout (invariant)', () => {
|
||||||
|
fc.assert(
|
||||||
|
fc.property(knowsAboutEntries, (entries) => {
|
||||||
|
const andrea = person(
|
||||||
|
{ ...aboutContent.person, knowsAbout: entries },
|
||||||
|
siteContent,
|
||||||
|
image,
|
||||||
|
);
|
||||||
|
const list = andrea.knowsAbout ?? [];
|
||||||
|
expect(
|
||||||
|
list.every(
|
||||||
|
(entry) => entry === entry.trim() && entry !== '',
|
||||||
|
),
|
||||||
|
).toBe(true);
|
||||||
|
expect(new Set(list).size).toBe(list.length);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('never contains the e-mail address, on any page (invariant)', () => {
|
||||||
|
fc.assert(
|
||||||
|
fc.property(anySiteContent, (site) => {
|
||||||
|
const address = emailAddress(site.email);
|
||||||
|
const out =
|
||||||
|
jsonLdScript(
|
||||||
|
aboutPage('/over-mij', aboutContent.person, site),
|
||||||
|
) + jsonLdScript(professionalService(site));
|
||||||
|
return address === null || !out.includes(address);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('matches the page registry and canonical URL (invariant)', () => {
|
||||||
|
fc.assert(
|
||||||
|
fc.property(anySiteContent, (site) => {
|
||||||
|
const page = aboutPage('/over-mij', aboutContent.person, site);
|
||||||
|
expect(page['@id']).toBe(canonicalUrl('/over-mij'));
|
||||||
|
expect(page.url).toBe(canonicalUrl('/over-mij'));
|
||||||
|
expect(page.name).toBe(sitePages['/over-mij'].title);
|
||||||
|
expect(page.description).toBe(
|
||||||
|
sitePages['/over-mij'].description,
|
||||||
|
);
|
||||||
|
expect(page.mainEntity.image).toBe(image);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('falls back to the site preview image for a page without its own', () => {
|
||||||
|
const page = aboutPage('/portfolio', aboutContent.person, siteContent);
|
||||||
|
expect(page.mainEntity.image).toBe(`${siteUrl}/og-image.jpg`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('wraps data in an escaped ld+json script tag', () => {
|
||||||
|
const script = structuredDataScript({ name: '</script>' });
|
||||||
|
expect(script.type).toBe('application/ld+json');
|
||||||
|
expect(script.children).not.toMatch(/[<>]/);
|
||||||
|
expect(JSON.parse(script.children)).toEqual({ name: '</script>' });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
+69
-12
@@ -1,6 +1,7 @@
|
|||||||
// SEO: head-tags per pagina en voor de hele site, plus gestructureerde data.
|
// SEO: head-tags per pagina en voor de hele site, plus gestructureerde data.
|
||||||
// Titels en beschrijvingen staan in het pagina-register (sitePages.ts).
|
// Titels en beschrijvingen staan in het pagina-register (sitePages.ts).
|
||||||
import type { SiteContent } from './content/types.ts';
|
import type { AboutPageContent, SiteContent } from './content/types.ts';
|
||||||
|
import { knowsAboutList } from './lib/knowsAboutList.ts';
|
||||||
import { visibleSocials } from './lib/visibleSocials.ts';
|
import { visibleSocials } from './lib/visibleSocials.ts';
|
||||||
import type { RoutePath } from './navigation.ts';
|
import type { RoutePath } from './navigation.ts';
|
||||||
import sitePages from './sitePages.ts';
|
import sitePages from './sitePages.ts';
|
||||||
@@ -61,24 +62,85 @@ export function jsonLdScript(data: unknown): string {
|
|||||||
.replace(/&/g, '\\u0026');
|
.replace(/&/g, '\\u0026');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stable ids, so the business on every page and Andrea on the about page
|
||||||
|
// refer to each other (BR-SD-03)
|
||||||
|
export const businessId = `${siteUrl}/#business`;
|
||||||
|
export const personId = `${siteUrl}/over-mij#andrea`;
|
||||||
|
|
||||||
|
const huizen = {
|
||||||
|
'@type': 'PostalAddress',
|
||||||
|
addressLocality: 'Huizen',
|
||||||
|
addressCountry: 'NL',
|
||||||
|
} as const;
|
||||||
|
|
||||||
// Gestructureerde data: een lokale fotograaf in Huizen. Bewust zonder
|
// Gestructureerde data: een lokale fotograaf in Huizen. Bewust zonder
|
||||||
// e-mailadres, anders staat het alsnog leesbaar in de pagina.
|
// e-mailadres, anders staat het alsnog leesbaar in de pagina.
|
||||||
export function professionalService(content: SiteContent) {
|
export function professionalService(content: SiteContent) {
|
||||||
return {
|
return {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
'@type': 'ProfessionalService',
|
'@type': 'ProfessionalService',
|
||||||
|
'@id': businessId,
|
||||||
name: siteName,
|
name: siteName,
|
||||||
url: `${siteUrl}/`,
|
url: `${siteUrl}/`,
|
||||||
logo: `${siteUrl}/logo.png`,
|
logo: `${siteUrl}/logo.png`,
|
||||||
image: siteUrl + defaultOgImage.path,
|
image: siteUrl + defaultOgImage.path,
|
||||||
description: sitePages['/'].description,
|
description: sitePages['/'].description,
|
||||||
address: {
|
address: huizen,
|
||||||
'@type': 'PostalAddress',
|
|
||||||
addressLocality: 'Huizen',
|
|
||||||
addressCountry: 'NL',
|
|
||||||
},
|
|
||||||
areaServed: { '@type': 'Place', name: 'Huizen' },
|
areaServed: { '@type': 'Place', name: 'Huizen' },
|
||||||
sameAs: visibleSocials(content.socials).map((social) => social.href),
|
sameAs: visibleSocials(content.socials).map((social) => social.href),
|
||||||
|
founder: { '@id': personId },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Andrea as a person (BR-SD-01..05). Optional lists are left out when empty;
|
||||||
|
// no e-mail address, for the same reason as above.
|
||||||
|
export function person(
|
||||||
|
content: AboutPageContent['person'],
|
||||||
|
site: SiteContent,
|
||||||
|
image: string,
|
||||||
|
) {
|
||||||
|
const sameAs = visibleSocials(site.socials).map((social) => social.href);
|
||||||
|
const knowsAbout = knowsAboutList(content.knowsAbout);
|
||||||
|
return {
|
||||||
|
'@type': 'Person',
|
||||||
|
'@id': personId,
|
||||||
|
name: content.name,
|
||||||
|
jobTitle: content.jobTitle,
|
||||||
|
image,
|
||||||
|
address: huizen,
|
||||||
|
url: canonicalUrl('/over-mij'),
|
||||||
|
worksFor: { '@id': businessId },
|
||||||
|
...(knowsAbout.length > 0 ? { knowsAbout } : {}),
|
||||||
|
...(sameAs.length > 0 ? { sameAs } : {}),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// The about page with Andrea as its subject (BR-SD-06); name, description
|
||||||
|
// and preview image come from the page registry
|
||||||
|
export function aboutPage(
|
||||||
|
path: RoutePath,
|
||||||
|
content: AboutPageContent['person'],
|
||||||
|
site: SiteContent,
|
||||||
|
) {
|
||||||
|
const page = sitePages[path];
|
||||||
|
const image = siteUrl + (page.ogImage ?? defaultOgImage).path;
|
||||||
|
return {
|
||||||
|
'@context': 'https://schema.org',
|
||||||
|
'@type': 'AboutPage',
|
||||||
|
'@id': canonicalUrl(path),
|
||||||
|
url: canonicalUrl(path),
|
||||||
|
name: page.title,
|
||||||
|
description: page.description,
|
||||||
|
inLanguage: 'nl-NL',
|
||||||
|
mainEntity: person(content, site, image),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// A head script tag with structured data, escaped by jsonLdScript (BR-SD-07)
|
||||||
|
export function structuredDataScript(data: unknown) {
|
||||||
|
return {
|
||||||
|
type: 'application/ld+json',
|
||||||
|
children: jsonLdScript(data),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,11 +153,6 @@ export function siteHead(content: SiteContent) {
|
|||||||
{ property: 'og:type', content: 'website' },
|
{ property: 'og:type', content: 'website' },
|
||||||
{ name: 'twitter:card', content: 'summary_large_image' },
|
{ name: 'twitter:card', content: 'summary_large_image' },
|
||||||
],
|
],
|
||||||
scripts: [
|
scripts: [structuredDataScript(professionalService(content))],
|
||||||
{
|
|
||||||
type: 'application/ld+json',
|
|
||||||
children: jsonLdScript(professionalService(content)),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,10 +26,16 @@ const sitePages: Record<RoutePath, PageMeta> = {
|
|||||||
indexed: true,
|
indexed: true,
|
||||||
},
|
},
|
||||||
'/over-mij': {
|
'/over-mij': {
|
||||||
title: 'Over mij',
|
title: 'Over mij – fotograaf in Huizen',
|
||||||
description:
|
description:
|
||||||
'Hi! Ik ben Andrea, lifestyle fotograaf uit Huizen. Ik leg jullie vast zoals jullie zijn: spontaan en natuurlijk, zonder ongemakkelijke poses.',
|
"Hoi! Ik ben Andrea, lifestyle fotograaf uit Huizen. Ik maak warme, spontane foto's die een verhaal vertellen: newborn-, zwangerschaps- en gezinsshoots.",
|
||||||
indexed: false,
|
indexed: true,
|
||||||
|
ogImage: {
|
||||||
|
path: '/og-over-mij.jpg',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'Andrea Slop met haar camera in het bos',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
'/portfolio': {
|
'/portfolio': {
|
||||||
title: 'Portfolio',
|
title: 'Portfolio',
|
||||||
|
|||||||
@@ -17,9 +17,10 @@ const locs = (xml: string) => {
|
|||||||
const page = fc.record({ path: routePath, indexed: fc.boolean() });
|
const page = fc.record({ path: routePath, indexed: fc.boolean() });
|
||||||
|
|
||||||
describe('sitemapXml', () => {
|
describe('sitemapXml', () => {
|
||||||
it('bevat nu alleen de homepage', () => {
|
it('contains the homepage and the about page', () => {
|
||||||
expect(locs(sitemapXml(pageList(sitePages), base))).toEqual([
|
expect(locs(sitemapXml(pageList(sitePages), base))).toEqual([
|
||||||
`${base}/`,
|
`${base}/`,
|
||||||
|
`${base}/over-mij`,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import type { ContactFormEvent } from '../lib/contactFormReducer';
|
|||||||
import type {
|
import type {
|
||||||
EmailAddress,
|
EmailAddress,
|
||||||
PricingPackage,
|
PricingPackage,
|
||||||
|
SiteContent,
|
||||||
SocialLink,
|
SocialLink,
|
||||||
Testimonial,
|
Testimonial,
|
||||||
} from '../content/types';
|
} from '../content/types';
|
||||||
@@ -55,6 +56,31 @@ export const anyEmail: fc.Arbitrary<EmailAddress> = fc.oneof(
|
|||||||
fc.record({ user: fc.string(), domain: fc.string() }),
|
fc.record({ user: fc.string(), domain: fc.string() }),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Site-wide content as the CMS could deliver it; a valid e-mail address, so
|
||||||
|
// tests can check it never leaks into output
|
||||||
|
export const anySiteContent: fc.Arbitrary<SiteContent> = fc.record({
|
||||||
|
footerIntro: fc.string(),
|
||||||
|
socials: fc.array(socialLink, { maxLength: 4 }),
|
||||||
|
email: validEmail,
|
||||||
|
contactForm: fc.record({ enabled: fc.boolean() }),
|
||||||
|
});
|
||||||
|
|
||||||
|
// Specialisations with padding, blanks and repeats, as an editor might type
|
||||||
|
const specialisation = fc.oneof(
|
||||||
|
fc.constantFrom('Newbornfotografie', 'Gezinsfotografie', '', ' '),
|
||||||
|
fc.string({ maxLength: 20 }),
|
||||||
|
);
|
||||||
|
export const knowsAboutEntries = fc.array(
|
||||||
|
fc
|
||||||
|
.tuple(
|
||||||
|
fc.constantFrom('', ' ', ' '),
|
||||||
|
specialisation,
|
||||||
|
fc.constantFrom('', ' '),
|
||||||
|
)
|
||||||
|
.map(([before, text, after]) => before + text + after),
|
||||||
|
{ maxLength: 8 },
|
||||||
|
);
|
||||||
|
|
||||||
// Package ids: a few fixed ones so lists contain duplicates, plus random slugs
|
// Package ids: a few fixed ones so lists contain duplicates, plus random slugs
|
||||||
const packageId = fc.oneof(
|
const packageId = fc.oneof(
|
||||||
fc.constantFrom('newborn', 'gezin', 'zwangerschap'),
|
fc.constantFrom('newborn', 'gezin', 'zwangerschap'),
|
||||||
|
|||||||
Reference in New Issue
Block a user