Author SHA1 Message Date
SluijsensandClaude Sonnet 5.5 0d08d1524b Plan: ASF production on IIS and the production pipeline (plan only)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 09:57:19 +01:00
Sluijsens 440a298cc7 Hero: no pause on hover, slow zoom on the first photo
Continuous Integration / check (push) Successful in 2m4s
Continuous Integration / build-test (push) Successful in 1m1s
Continuous Integration / deploy-test (push) Successful in 1m17s
Continuous Integration / lighthouse (push) Successful in 9m10s
Continuous Integration / deploy-production (push) Skipped
2026-11-17 11:17:47 +01:00
SluijsensandClaude Sonnet 5.5 8050072ce5 Hero: slow zoom on the first photo without replacing the plain HTML
Continuous Integration / check (pull_request) Successful in 1m57s
Continuous Integration / build-test (pull_request) Skipped
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 9m0s
Continuous Integration / deploy-production (pull_request) Skipped
The plain HTML is painted at scale 1.06 and the slider zooms it out to 1
after hydration, like the other photos: same first frame (no CLS), and the
LCP does not wait for hydration. Assumptions 15 and 16 recorded.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 10:31:22 +01:00
SluijsensandClaude Sonnet 5.5 20806692bb Hero: no pause on mouse hover (Bryan, 2026-11-17)
The pause button, reduced motion, hidden tab and keyboard focus on the
controls still pause.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 10:31:21 +01:00
Sluijsens 78d3f594e5 Hero uit het CMS met ingebakken terugval
Continuous Integration / check (push) Successful in 23m36s
Continuous Integration / build-test (push) Successful in 58s
Continuous Integration / deploy-test (push) Successful in 1m20s
Continuous Integration / lighthouse (push) Successful in 9m53s
Continuous Integration / deploy-production (push) Skipped
2026-11-17 10:26:37 +01:00
9 changed files with 237 additions and 38 deletions
@@ -0,0 +1,10 @@
# AI-DLC state: asf-production-iis
- Feature: ASF production on IIS and the production pipeline (plus the privacy statement as JSON)
- Branch: feature/asf-production-iis (from origin/master, 2026-11-18)
- Lane: Feature
- Stage: Inception, plan written ([plan.md](plan.md)); nothing executed
- Language: documentation in Dutch for this plan (instruction of the owner via SLP Software - SLS - Main); conversation in Dutch
- Extensions: none enabled for this plan
- Origin: written by SLP Software - SLS - Main while "Andrea Slop Fotografie - ASF - Main" was offline and the owner away; the ASF session can continue from this
- Open: questions V1-V10 and assumptions A1-A8 in plan.md
@@ -0,0 +1,5 @@
# Audit: asf-production-iis
## 2026-11-18 Plan written
**User Input** (relayed): "ASF productie op IIS en de pipeline fixen; privacyverklaring en JSON meenemen; Bryan is niet bij de computer; stel een plan op."
**AI Response**: Read the CI workflow, deploy docs, go-live and joint-release checklists, the contact-form and frontend-shell operations records, the CMS workflow and the media-library production rollout. Recorded what is wrong with the production path (static FTPS design from before the host-as-single-entry decision, missing FTP secrets, no ASF production path in the CMS pipeline) in plan.md with assumptions and questions. No workflow file changed, nothing deployed.
@@ -0,0 +1,150 @@
# Plan: ASF in productie op IIS en de productiepipeline
Status (2026-11-18): **alleen een plan**. Niets uitgevoerd, niets naar productie, geen release-branch, geen workflow-bestand gewijzigd. Opgesteld door SLP Software - SLS - Main omdat de ASF-sessie offline was en Bryan niet bij de computer; de ASF-sessie kan hierop doorbouwen. Alles wat onbekend is staat als **aanname, te controleren** (A1, A2, ...), de vragen voor Bryan staan onderaan (V1, V2, ...).
Uitgangspunten (Bryan): de pipeline-fix gebeurt in een feature-branch (`feature/asf-production-iis`), nooit in een release-branch tenzij Bryan dat vraagt. Productie alleen op zijn expliciete go. De CMS-host is het enige ingangspunt van de website (besluit 2026-11-15, `docs/cms-integration.md`, "Hosting").
## 1. Wat er nu staat (met bewijs)
| Onderdeel | Stand | Bewijs |
| --- | --- | --- |
| ASF-test | Werkt: master-push bouwt `dist-test`, uploadt naar de Pi (scp), controleert na deploy. De CMS-host op de Pi bedient site, `/admin` en `/api/v1`. | Laatste runs 782 t/m 789 op master/dispatch zijn groen. Run 761 faalde één keer op `lighthouse` (performance op de Pi, daarna groen). |
| ASF-productie (ASF-repo) | Job `deploy-production` bestaat: handmatig, alleen vanaf `release/*`, upload van `dist` met **FTPS** (`web/deploy/upload-production.sh`) en een gegenereerde `web/deploy/iis/web.config` die **zelf statische bestanden serveert**. | `.gitea/workflows/continuous_integration.yaml` (job `deploy-production`), `web/deploy/iis/web.config` (rewrite naar `{R:1}.html`, 404.html, geen doorgeven aan de host). |
| Strijdig met het besluit | Dat ontwerp is van vóór 2026-11-15: de host moet álle verzoeken krijgen (pagina's, `/admin`, `/api/v1`), IIS doet alleen redirects en pass-through. Zonder dat toont productie de ingebakken snapshot en geeft elke pageview een 404 voor de API. | `docs/cms-integration.md` ("Production: not in place yet"), `docs/go-live-checklist.md` ("Packages and banners"). |
| Geheimen/variabelen | Aanwezig: secrets `PI_MAIN_*`; variabelen `DEPLOY_PATH_TEST`, `HEALTH_CHECK_URL_TEST`, `HEALTH_CHECK_URL_PRODUCTION`, `FTP_REMOTE_DIR`, `ASF_OFFERINGS_URL_TEST`. **Ontbreekt:** `FTP_HOST`, `FTP_USERNAME`, `FTP_PASSWORD`. De productiejob kan dus niet draaien. | Gitea API-lijst van secrets en variabelen (alleen namen). |
| CMS-pipeline (CMS-repo) | Inputs `deploy_sls_test`, `deploy_sls_production`, `deploy_asf_test`. Er is **geen** `deploy_asf_production`: "Test only: there is no production path for ASF". Publiceren is `linux-arm64`, `--self-contained false`; uitrollen is `deploy-scp.yaml` (SSH, `releases/`, symlink `current`, systemd user-unit). Voor IIS is geen van drie bruikbaar. | CMS `master`, `.gitea/workflows/continuous_integration.yaml` (`PUBLISH_RID: linux-arm64`, `publish-asf-test`, `deploy-asf-test`). |
| Twee repo's, twee pipelines | De ASF-repo bouwt de site (`dist`), de CMS-repo bouwt de host. Op test regelt de ASF-pipeline dat `dist-test` in de prerendered-map van de host landt. Voor productie is niet beschreven hoe en in welke volgorde beide op de IIS-host komen. | `joint-release-checklist.md` (SLS `aidlc-docs/_shared`): "ASF IIS publish pipeline exists (own feature: self-contained win-x64 publish, FTP upload, web.config, the CMS host as the single entry)". |
| Productie-artefact | `dist` uit job `check`: zonder `OFFERINGS_URL` (snapshot), zonder `VITE_SITE_URL`, formulier dicht. Bewust zo. | `docs/deploy-and-ci.md`. |
Samengevat: de testpijplijn is gezond; wat ontbreekt of verkeerd is, is het hele productiepad (ontwerp, repo-overstijgende volgorde, secrets, CMS-kant, verificatie).
## 2. Doelarchitectuur op IIS (MijnHostingPartner)
```mermaid
flowchart LR
B[Bezoeker] -->|HTTPS| I[IIS, redirects www en HTTPS]
I -->|alle verzoeken| H[CMS-host Api.AndreaSlopFotografie]
H --> P[prerendered dist, host injecteert pakketten, banners, hero]
H --> A["/admin en /api/v1"]
H --> D[(Database)]
H --> M[Mediamap]
H --> S[SMTP, captcha uit]
classDef edge fill:#f6e05e,stroke:#c05621,color:#000;
classDef host fill:#63b3ed,stroke:#2b6cb0,color:#000;
classDef data fill:#9ae6b4,stroke:#2f855a,color:#000;
class I edge;
class H,P,A host;
class D,M,S data;
```
Tekstalternatief: de bezoeker komt bij IIS, dat alleen redirects doet en alles doorgeeft aan de CMS-host; de host serveert de pagina's, de admin en de API en gebruikt database, mediamap en mail.
- **Host publiceren:** self-contained `win-x64` (de host hoeft dan geen runtime geïnstalleerd te hebben) met `web.config` voor de ASP.NET Core Module. In-process of out-of-process hangt af van wat het pakket biedt (A1).
- **Site (`dist`)** gaat naar de prerendered-map van de host (op test `wwwroot-web`; op IIS een map naast de app, A2). De host injecteert de live data (cache 60 s); een inhoudswijziging vraagt geen rebuild.
- **IIS-`web.config`:** nog steeds gegenereerd door `web/config/serverConfig.ts` (nooit met de hand), maar nieuw: alleen redirect www -> apex, HTTP -> HTTPS, en doorgeven aan de host. De bestaande canonieke redirects (`index`, hoofdletters, slash) doet de host op test ook; de eerste stap is te controleren welke de host al doet en wat IIS moet blijven doen. Beveiligingsheaders komen van de host, zoals op test.
- **Geheimen:** als environment-variabelen, niet in de repo. Op IIS is dat `web.config` of het hostingpaneel; wie FTP-toegang heeft ziet ze (risico R3). Aanname A3: het paneel ondersteunt dat.
- **Database:** de CMS-host gebruikt MariaDB/MySQL. Aanname A4: het hostingpakket levert een MariaDB/MySQL-database en een back-upmogelijkheid. Is dat niet zo, dan is dit een blokkade en komt er een alternatief (V3).
- **Mediamap:** schrijfbare map buiten de gedeployde release, zodat een deploy foto's niet wist (zoals `shared/` op de Pi). Hier is een persistent pad nodig (A2).
- **Mail:** SMTP van MijnHostingPartner, afzender in `Email:AllowedFromAddresses`, ontvanger via de omgeving, SPF/DKIM controleren met een echte mail (go-live-checklist).
- **Captcha:** blijft **uit** bij go-live tot er een betaald Friendly Captcha-plan is; het formulier blijft dicht (`VITE_CONTACT_FORM_ENABLED` niet gezet) tot Bryans go.
- **HTTPS:** certificaat via het hostingpakket, HSTS pas na een geslaagde proefperiode (A5).
- **Client-IP/ratelimit:** `ForwardedHeaders:KnownProxies` en `ClientPartitionKey` voor de IIS-situatie (bestaande eis uit `contact-api-contract.md`).
## 3. Pipeline-wijzigingen stap voor stap
Alles in feature-branches, geen release-branch. Elke stap die iets op productie raakt wacht op Bryans go.
**Stap 0 - hostingfeiten vaststellen (geen code).** Beantwoord A1 t/m A6 en V1 t/m V4 door het pakket te bekijken of een proef-upload te doen. De joint-release-checklist zegt: "open hosting questions are answered by trying it with ASF". Een proef op een tijdelijk subdomein (bijvoorbeeld `staging.andreaslop.nl`) is de veiligste manier (V2).
**Stap 1 - CMS-repo (SMC, eigen feature-branch).**
1. Publiceer-job `publish-asf-production`: `dotnet publish -r win-x64 --self-contained true`, adminbouw met `VITE_APP_ENV=production`, `VITE_THEME=asf`, `VITE_DEFAULT_LANGUAGE=nl`.
2. Deploy-job voor IIS: FTPS-upload in rondes (zoals `upload-production.sh`), met `app_offline.htm` tijdens het vervangen van de host-bestanden en een kopie van de vorige release voor terugdraaien.
3. Nieuwe input `deploy_asf_production`, gate zoals SLS-productie (V5: `release/*` of vervangen door een goedkeuringsstap).
4. `scripts/smoke-site.sh` uitbreiden met een `asf-production`-modus.
5. Voorlopig uit via een variabele (zoals `ASF_TEST_DEPLOY_ENABLED`) zodat niets verandert tot alles klaar is.
**Stap 2 - ASF-repo (deze branch, `feature/asf-production-iis`).**
1. `serverConfig.ts` en de gegenereerde `web/deploy/iis/web.config` omzetten naar "redirects + pass-through"; de test die gegenereerd en gecommit vergelijkt blijft gelden.
2. Job `deploy-production` herschrijven: `dist` via FTPS naar de prerendered-map van de host (assets eerst, HTML als laatste, daarna opruimen; bestaand idee van `upload-production.sh`, nieuw doelpad en géén `web.config`-kopie), daarna `verify-deployment.sh ... --cms` tegen de productie-URL (genormaliseerd vergelijken zoals op test).
3. Secrets/variabelen laten aanmaken door Bryan of SLS (feature-sessies wijzigen repo-variabelen niet): `FTP_HOST`, `FTP_USERNAME`, `FTP_PASSWORD`, `FTP_REMOTE_DIR`, `HEALTH_CHECK_URL_PRODUCTION`.
4. Docs bijwerken in dezelfde wijziging (`docs/deploy-and-ci.md`, `docs/go-live-checklist.md`, `docs/cms-integration.md`), zoals `AGENTS.md` eist.
5. Lighthouse op de Pi is flaky (run 761). Voorstel: performance blijft "melden" zoals nu; de overige categorieën blokkeren.
**Stap 3 - repetitie op de proefomgeving (zonder productie).**
1. Beide pipelines draaien naar de proefomgeving (A6) met testwaarden (testpakketten, `noindex`).
2. Controleren: `/health`, `/admin`, een echte pagina, injectie van pakketten/banners/hero, headers (CSP), redirects, een upload (ook HEIC op win-x64, R4), een mail.
3. Terugdraaien oefenen (sectie 6).
**Stap 4 - go-live (alleen met Bryans go, in de gezamenlijke release).** Volgorde uit de `joint-release-checklist.md`: SLS-CMS-productie, daarna de SLS-website, daarna ASF. Zie sectie 7.
## 4. Hoe de mediabibliotheek-uitrol erin past
- CMS PR #29 (gemerged op master van het CMS, op test gedeployed): bij de start doet de host de kopie `HeroImages -> MediaAssets`, controleert streng en dropt pas daarna; bij een weigering start de app niet (Critical-regel). Productie van SLS gaat dus in één release (`production-rollout.md` in de CMS-repo).
- **ASF-productie begint zonder database (A7):** er is nog geen ASF-productie-CMS met hero-foto's. De migraties lopen op een lege database en `HeroImages` is leeg; de guard laat een lege tabel door. Voor ASF is er dus **geen** kopie en geen drop met data. Het "verse herstelpunt" uit `production-rollout.md` geldt voor **SLS-productie**; voor ASF is een database-back-up vóór de eerste echte beheerdersdata genoeg, maar de back-upprocedure moet er wel zijn (V3).
- **Seeden:** daarna eerst beheerder aanmaken (setup-token, verwijderen na gebruik), echte pakketten invoeren, hero seeden en `offerings.snapshot.json` vullen met de echte pakketten (go-live-checklist).
- **Volgorde:** de productie-CMS moet de echte pakketten hebben vóór er verkeer komt; het productie-artefact bevat de testprijzen nooit.
## 5. Privacyverklaring en JSON
- **Tekst:** het goedgekeurde concept van 17-11-2026 staat in `aidlc-docs/_shared/privacyverklaring-asf-concept-2026-11-17.txt` (SLS-repo). Andrea controleert het nog; het is de basis voor livegang (Bryan, 2026-11-17).
- **Code:** op `master` is `/privacyverklaring` nog een placeholder. De opzet (`privacyContent.ts`, `PrivacyNote`, tests) staat op `feature/privacy-statement` (2 commits voor, 59 achter op master). Stap: die wijzigingen op master laten aansluiten en overnemen in deze branch.
- **JSON:** `privacyContent.ts` wordt een JSON-bestand (bijvoorbeeld `web/src/content/privacy.nl.json`), samen met de definitieve tekst. Behouden: de `PLACEHOLDER_MARK`-controle (`unresolvedPlaceholders()`), de captcha-sectie (`onlyWithCaptcha`, verborgen zolang captcha uit staat) en hun tests; plus een vormtest voor het JSON-bestand. Privacy blijft een eigen bestand en komt niet in `nl.json`, omdat het juridische tekst met een eigen reviewproces is (A8).
- **Voorwaarden voor livegang** (go-live-checklist): Bryan en Andrea keuren de tekst goed; MijnHostingPartner is vastgelegd als verwerker met verwerkersovereenkomst en verwerking in Nederland; de reactietermijn is bevestigd (het concept zegt "binnen vier weken"); de captcha-alinea klopt met de captchabeslissing; geen `[OPEN:`-markers; de bewaartermijnen kloppen met de server (1 jaar, 30 dagen spam).
- **KvK-nummer:** staat niet in het concept en moet zichtbaar zijn op de site (V6).
## 6. Terugdraaien
| Wat | Hoe |
| --- | --- |
| Site (`dist`) | Vorige `dist` terugzetten (artefacten blijven 7 dagen in Gitea; hoe lang we ze apart bewaren: V7). HTML wordt als laatste geüpload, dus een mislukte asset-ronde laat de oude site intact. |
| Host-app | Vorige release terugzetten (kopie van de vorige map) en `app_offline.htm` weghalen. Migraties zijn additief; voor terugdraaien van migraties geldt het databaseherstelpunt. |
| Database | Back-up vóór de eerste uitrol met data; terugzetten met de functie van de hoster (A4). |
| Formulier | `VITE_CONTACT_FORM_ENABLED` weglaten en opnieuw deployen, of `Contact:Enabled` uit op de server. |
| DNS/cutover | Zie V8: oude site bewaren tot de nieuwe site verifieerbaar werkt. |
## 7. Open punten (uit de go-live- en gezamenlijke releasechecklist)
- Echte HEIC-test (upload en verwerking op win-x64, R4).
- Captcha-provider kiezen (Gitea-issue #14 in de CMS-repo); tot dan uit.
- Gezamenlijke release: SLS-CMS -> SLS-site -> ASF, elke stap met go; daarna Sentry, smoke-tests, deelafbeelding, sitemap, een echt formulierbericht (alleen als het formulier open staat), cookies/statistiek zoals in de privacyverklaring.
- KvK-nummer zichtbaar op de site.
- Verwerkersovereenkomst met MijnHostingPartner.
- Eerste ASF-beheerder aanmaken en het setup-token verwijderen.
- `offerings.snapshot.json` met echte pakketten; testprijzen nooit in het productie-artefact.
- Productie-CMS bevat de echte hero (zonder seed toont productie de ingebakken hero uit `heroContent.ts`).
## 8. Risico's
| # | Risico | Maatregel |
| --- | --- | --- |
| R1 | Het hostingpakket kan de .NET-host niet draaien (A1). | Stap 0 vóór alle bouwwerk; alternatief: host elders (bijvoorbeeld de Pi, zoals SLS) en IIS alleen als reverse proxy. |
| R2 | Twee losse uploads (host en site) lopen even uit de pas. | Volgorde: host eerst met `app_offline.htm`, dan site, dan `app_offline` weg; smoke-test erna. |
| R3 | Geheimen leesbaar voor wie FTP-toegang heeft. | Environment-variabelen via het paneel indien mogelijk; geen geheimen in repo of logs. |
| R4 | HEIC-verwerking werkt anders op Windows (native bibliotheken). | Echte HEIC-test op de proefomgeving vóór go-live. |
| R5 | Lighthouse-performance op de Pi is wisselend en blokkeert productie. | Performance blijft "melden"; andere categorieën blokkeren. |
| R6 | SEO-verlies bij de overstap van de oude site. | Redirectlijst van oude URL's (V8). |
| R7 | Een foute deploy raakt de testsites (zelfde CMS-pipeline). | Productiestappen achter een variabele en een eigen input; test blijft ongewijzigd. |
## 9. Aannames (te controleren)
- **A1** MijnHostingPartner draait ASP.NET Core 10 (self-contained) achter IIS met de ASP.NET Core Module. Onbekend: `cms-api-foundation/requirements.md` zegt "whether the production host runs .NET is unknown".
- **A2** Er is een persistent, schrijfbaar pad buiten de release voor media en een map voor de prerendered pages.
- **A3** Omgevingsvariabelen zijn instelbaar via het paneel of de `web.config` van de host.
- **A4** Het pakket bevat een MariaDB/MySQL-database met back-up en terugzetten.
- **A5** Certificaat en HSTS regelt de hoster.
- **A6** Een tijdelijk subdomein voor een proef is mogelijk.
- **A7** Er bestaat nog geen ASF-productie-CMS met gegevens.
- **A8** Privacytekst blijft een eigen JSON-bestand (niet in `nl.json`).
## 10. Vragen voor Bryan
1. **V1** Wat is het hostingpakket precies (Windows/IIS, .NET 10 en de ASP.NET Core Module, FTP/FTPS, SSH)? Is er een paneel of documentatie die ik moet zien?
2. **V2** Mag er een tijdelijk subdomein (bijvoorbeeld `staging.andreaslop.nl`) voor een proef-uitrol, en mag dat kosten?
3. **V3** Welke database en welke back-upprocedure heeft het pakket; kunnen we daar een herstelpunt maken zoals op de Pi?
4. **V4** Welke SMTP-gegevens en welk afzenderadres voor het formulier?
5. **V5** Productie-gate: houden we `release/*` (zoals SLS) of vervangen we dat door een handmatige goedkeuringsstap op master? Je wilde de pipeline in een feature-branch; een `release/*`-branch zou dan alleen op jouw verzoek voor de uitvoering bestaan.
6. **V6** Welk KvK-nummer en waar op de site (footer of contact)?
7. **V7** Hoe lang bewaren we `dist`-artefacten van productieruns buiten Gitea (voor terugdraaien)?
8. **V8** Wat draait er nu op andreaslop.nl (WordPress, waar?), en wanneer en hoe schakelen we DNS om? Is er een redirectlijst van oude URL's nodig?
9. **V9** Controleert Andrea de privacytekst voordat de definitieve tekst en JSON klaar zijn, en wie levert de verwerkersovereenkomst?
10. **V10** Captcha: laten we het uit bij go-live (formulier dicht), of eerst Friendly Captcha betaald?
@@ -2,22 +2,24 @@
Written while Bryan was away; he decides later. Each point: question, assumption, what changes with another answer, where in the code.
| # | Question | Assumption | If the answer differs | Where |
| --- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| 1 | Focus points of the 8 photos | Estimates from the seed (e.g. hero-8 0.50/0.55) | Change x/y in the seed (CMS) and in the baked values | `web/src/content/heroContent.ts`, `web/contract/host-injection/hero/seed.json` |
| 2 | Is the baked hero cropped around the focus point too? | Yes: object-position from the estimates, so baked and live look the same | Pass `focus: null` for the baked slides to get plain centre crop | `heroContent.ts` |
| 3 | Button target `#anchor` and https: plain link, `/path`: router link | As said | Make all plain links | `web/src/components/Hero/HeroButton.tsx` |
| 4 | Single display (one photo) or slideshow with one slide | No arrows, pause or progress bar for one slide | Show controls anyway | `Hero.tsx` (`shown.length > 1`) |
| 5 | Title with a new line | `<br>` in the plain HTML, `pre-line` in the slider | One line only | `heroHtml.ts`, `Hero.tsx` |
| 6 | Where does the head preload marker come from | Build step adds it to the finished HTML (React cannot write a head comment) | Host adds the head region itself | `web/config/heroPreload.ts` |
| 7 | Hero texts (aria, baked title, alts) | In `nl.json`, block `hero` | Other wording: edit the file | `web/src/i18n/nl.json` |
| 8 | Without a host block the site asks `/api/v1/hero` (8 s time-out) | Yes, like packages and banners | Remove the call: baked only | `web/src/components/Hero/useHero.ts` |
| 9 | Style of the plain hero before hydration | Matches the slider's first frame (checked by screenshot at 1280 and 390 px) | Adjust CSS | `.cms-hero-*` in `web/src/theme.ts` |
| 10 | AVIF for slides 2..n only | As agreed with the CMS session | Add AVIF to the first photo and its preload (then two fetches) | `Hero.tsx` (`SlidePicture`) |
| 11 | The first photo, title and buttons stay the plain HTML after hydration (never replaced); the slider adds the other photos on top | Yes: replacing the nodes at hydration risks a late LCP. Side effect: the first photo has no slow zoom and is not in a role=group slide | Go back to a full slider render (one component), accepting the DOM replacement | `Hero.tsx` (`HeroFrame`), `useHero.ts` (`regionHero`) |
| 12 | Planning (from/to dates) and a hero-wide on/off switch | Deliberately not built: the hero is always there, a hero without usable slides keeps the baked one | Add in the CMS; the site already handles a 204 and an empty hero | CMS (module), `useHero.ts` |
| 13 | Content of the ASF test seed | The 8 existing photos with focus estimates (#1), texts like the baked ones | Edit in the CMS admin; update `heroContent.ts` if the baked fallback should match | `web/contract/host-injection/hero/seed.json` |
| 14 | Baked hero after a CMS change | The baked hero is only a fallback and is not rebuilt from the CMS any more (no nightly build) | Re-bake by hand in `heroContent.ts` when the real hero changes for good | `heroContent.ts` |
| # | Question | Assumption | If the answer differs | Where |
| --- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| 1 | Focus points of the 8 photos | Estimates from the seed (e.g. hero-8 0.50/0.55) | Change x/y in the seed (CMS) and in the baked values | `web/src/content/heroContent.ts`, `web/contract/host-injection/hero/seed.json` |
| 2 | Is the baked hero cropped around the focus point too? | Yes: object-position from the estimates, so baked and live look the same | Pass `focus: null` for the baked slides to get plain centre crop | `heroContent.ts` |
| 3 | Button target `#anchor` and https: plain link, `/path`: router link | As said | Make all plain links | `web/src/components/Hero/HeroButton.tsx` |
| 4 | Single display (one photo) or slideshow with one slide | No arrows, pause or progress bar for one slide | Show controls anyway | `Hero.tsx` (`shown.length > 1`) |
| 5 | Title with a new line | `<br>` in the plain HTML, `pre-line` in the slider | One line only | `heroHtml.ts`, `Hero.tsx` |
| 6 | Where does the head preload marker come from | Build step adds it to the finished HTML (React cannot write a head comment) | Host adds the head region itself | `web/config/heroPreload.ts` |
| 7 | Hero texts (aria, baked title, alts) | In `nl.json`, block `hero` | Other wording: edit the file | `web/src/i18n/nl.json` |
| 8 | Without a host block the site asks `/api/v1/hero` (8 s time-out) | Yes, like packages and banners | Remove the call: baked only | `web/src/components/Hero/useHero.ts` |
| 9 | Style of the plain hero before hydration | Matches the slider's first frame (checked by screenshot at 1280 and 390 px) | Adjust CSS | `.cms-hero-*` in `web/src/theme.ts` |
| 10 | AVIF for slides 2..n only | As agreed with the CMS session | Add AVIF to the first photo and its preload (then two fetches) | `Hero.tsx` (`SlidePicture`) |
| 11 | The first photo, title and buttons stay the plain HTML after hydration (never replaced); the slider adds the other photos on top | Yes: replacing the nodes at hydration risks a late LCP. Side effect: the first photo has no slow zoom and is not in a role=group slide | Go back to a full slider render (one component), accepting the DOM replacement | `Hero.tsx` (`HeroFrame`), `useHero.ts` (`regionHero`) |
| 12 | Planning (from/to dates) and a hero-wide on/off switch | Deliberately not built: the hero is always there, a hero without usable slides keeps the baked one | Add in the CMS; the site already handles a 204 and an empty hero | CMS (module), `useHero.ts` |
| 13 | Content of the ASF test seed | The 8 existing photos with focus estimates (#1), texts like the baked ones | Edit in the CMS admin; update `heroContent.ts` if the baked fallback should match | `web/contract/host-injection/hero/seed.json` |
| 14 | Baked hero after a CMS change | The baked hero is only a fallback and is not rebuilt from the CMS any more (no nightly build) | Re-bake by hand in `heroContent.ts` when the real hero changes for good | `heroContent.ts` |
| 15 | Pause on mouse hover | Removed on purpose (Bryan, 2026-11-17): a full-screen hero almost always has the pointer over it. Kept: the explicit pause button (WCAG 2.2.2), no autoplay with `prefers-reduced-motion`, pause when the tab is hidden, and pause while keyboard focus is on the controls (a deliberate action; a click on an arrow does not pause). Touch and swipe do not pause either: a swipe restarts the progress bar of the new slide | Add hover back: `onPointerEnter`/`onPointerLeave` in `useHeroSlider.ts` | `web/src/components/Hero/useHeroSlider.ts` |
| 16 | Slow zoom on the first photo (supersedes #11 in part; Bryan chose the full slider render, 2026-11-17) | The first photo zooms like the others, without replacing the plain HTML: the plain HTML is painted at scale 1.06 (CSS `.cms-hero-image`), the slider sets `data-zoom` after hydration and it zooms out to 1 over 9 s. Same first frame before and after hydration, so no CLS, and the LCP does not wait for hydration (replacing the nodes made the LCP 5.3 s in the first design). Reduced motion: no scale at all | Replace the nodes at hydration (one component); measure LCP first | `theme.ts`, `Hero.tsx` |
## What Bryan has to check later
+18
View File
@@ -135,6 +135,24 @@ describe('Hero', () => {
});
});
it('laat de eerste foto inzoomen zolang hij de actieve is', async () => {
const { container } = await renderWithProviders(
<Hero content={heroContent} socials={siteContent.socials} />,
);
const picture = container.querySelector('.cms-hero-picture')!;
expect(picture).toHaveAttribute('data-zoom');
expect(picture).not.toHaveAttribute('aria-hidden');
await userEvent.click(
screen.getByRole('button', { name: 'Volgende foto' }),
);
expect(picture).not.toHaveAttribute('data-zoom');
expect(picture).toHaveAttribute('aria-hidden', 'true');
await userEvent.click(
screen.getByRole('button', { name: 'Vorige foto' }),
);
expect(picture).toHaveAttribute('data-zoom');
});
it('heeft pijlen met een toegankelijke naam', async () => {
await renderWithProviders(
<Hero content={heroContent} socials={siteContent.socials} />,
+9 -3
View File
@@ -164,11 +164,17 @@ function HeroFrame({ content, socials, regionHtml, hydrated }: FrameProps) {
}, [firstPainted]);
// The first photo is hidden from screen readers while another one is on
// top of it
// top of it, and it zooms (data-zoom, see .cms-hero-image) while it is the
// active one
useEffect(() => {
const picture = section.current?.querySelector('.cms-hero-picture');
if (active === 0) picture?.removeAttribute('aria-hidden');
else picture?.setAttribute('aria-hidden', 'true');
if (active === 0) {
picture?.removeAttribute('aria-hidden');
picture?.setAttribute('data-zoom', '');
} else {
picture?.setAttribute('aria-hidden', 'true');
picture?.removeAttribute('data-zoom');
}
}, [active]);
const loaded = firstPainted ? slidesToLoad(active, shown.length) : [active];
@@ -45,7 +45,7 @@ describe('useHeroSlider', () => {
expect(result.current.active).toBe(0);
});
it('afspelen via de knop heft ook de pauze door hover op', () => {
it('pauzeert niet bij hover met de muis, wel via de knop', () => {
let slider!: ReturnType<typeof useHeroSlider>;
function Probe() {
slider = useHeroSlider(8);
@@ -53,11 +53,11 @@ describe('useHeroSlider', () => {
}
const { getByTestId } = render(<Probe />);
fireEvent.pointerEnter(getByTestId('hero'), { pointerType: 'mouse' });
expect(slider.paused).toBe(true);
fireEvent.mouseEnter(getByTestId('hero'));
expect(slider.paused).toBe(false);
act(() => slider.toggleStopped());
act(() => slider.toggleStopped());
expect(slider.paused).toBe(false);
expect(slider.paused).toBe(true);
});
it('afspelen via de knop heft ook de pauze door toetsenbordfocus op', () => {
+9 -15
View File
@@ -22,7 +22,6 @@ export default function useHeroSlider(count: number) {
const [announcement, setAnnouncement] = useState<HeroAnnouncement>(null);
// Pauzeknop: blijft gelden tot de bezoeker opnieuw klikt (WCAG 2.2.2)
const [stopped, setStopped] = useState(false);
const [hovered, setHovered] = useState(false);
const [focused, setFocused] = useState(false);
// Server and hydrating render say "visible", like the HTML
const hidden = useSyncExternalStore(
@@ -49,16 +48,13 @@ export default function useHeroSlider(count: number) {
announcement,
reducedMotion,
autoplay: count > 1 && !reducedMotion,
paused: stopped || hovered || focused || hidden,
paused: stopped || focused || hidden,
stopped,
// Afspelen via de knop geldt ook terwijl de muis of de
// toetsenbordfocus nog in de hero staat (de klik zelf is een hover en
// vaak een focus); zonder dit gebeurt er na "afspelen" niets zichtbaars.
// Afspelen via de knop geldt ook terwijl de toetsenbordfocus nog in de
// hero staat (de klik zelf is vaak een focus); zonder dit gebeurt er na
// "afspelen" niets zichtbaars.
toggleStopped: () => {
if (stopped) {
setHovered(false);
setFocused(false);
}
if (stopped) setFocused(false);
setStopped(!stopped);
setAnnouncement(stopped ? 'playing' : 'paused');
},
@@ -66,12 +62,10 @@ export default function useHeroSlider(count: number) {
prev,
advance: () => go(active + 1, false),
handlers: {
// Alleen een echte muis pauzeert; een tik op mobiel niet.
onPointerEnter: (event: React.PointerEvent<HTMLElement>) => {
if (event.pointerType === 'mouse') setHovered(true);
},
onPointerLeave: () => setHovered(false),
// Alleen toetsenbordfocus pauzeert, niet een klik op een pijl.
// Hover pauzeert bewust niet (Bryan, 2026-11-17): een beeldvullende hero
// heeft bijna altijd de muis erboven. Toetsenbordfocus op de besturing
// pauzeert wel, want dat is een bewuste handeling; een klik op een
// pijl niet.
onFocus: (event: React.FocusEvent<HTMLElement>) => {
if (event.target.matches(':focus-visible')) setFocused(true);
},
+14
View File
@@ -55,6 +55,20 @@ const config = defineConfig({
width: '100%',
height: '100%',
objectFit: 'cover',
// Same slow zoom as the other photos of the slider: the plain HTML
// is painted at 1.06 and the slider (after hydration) sets
// data-zoom on the picture, which zooms out to 1 over 9 s. The
// photo itself is never replaced, so the LCP does not wait for
// hydration; the first frame is the same before and after it.
transform: 'scale(1.06)',
transition: 'transform 9s linear',
'@media (prefers-reduced-motion: reduce)': {
transform: 'none',
transition: 'none',
},
},
'.cms-hero-picture[data-zoom] .cms-hero-image': {
transform: 'scale(1)',
},
'.cms-hero-title': {
position: 'relative',