From 555ab10e14bbcec7111e2d895f5df95804b2506a Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Tue, 17 Nov 2026 08:21:42 +0100 Subject: [PATCH] Docs: hero zonder planning en hero-brede aan/uit (FR-05, BR-H07/BR-P01, aannamelijst 30, contract) Co-Authored-By: Claude Sonnet 5.5 --- .../features/hero-module/assumptions-and-open-questions.md | 1 + .../construction/functional-design/business-rules.md | 4 ++-- .../hero-module/inception/requirements/requirements.md | 2 +- .../inception/requirements/site-contract-agreed-with-asf.md | 2 +- docs/hero-module.md | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/aidlc-docs/features/hero-module/assumptions-and-open-questions.md b/aidlc-docs/features/hero-module/assumptions-and-open-questions.md index a965d50..f5c4275 100644 --- a/aidlc-docs/features/hero-module/assumptions-and-open-questions.md +++ b/aidlc-docs/features/hero-module/assumptions-and-open-questions.md @@ -34,3 +34,4 @@ Kept while Bryan was away (2026-11-16): no questions to him, a likely assumption | 28 | **The focus dialog showed a stretched photo** for any photo that is not 3:2: it used the published wide crop (`image.src`) as if it were the whole photo. | Every set now also holds a full-frame preview (`full-.webp`, the whole picture at its own shape, at most 1280 wide); the admin API gives it as `previewSrc`, it is not in `variants` and not published to websites. Sets made before it existed get only that file added by the background renderer (not shown as processing, no address changes). | Without a preview yet the dialog says so instead of showing a wrong picture. | `VariantPlanner.Preview`, `HeroMapping.PreviewSrc`, `FocusDialog` | | 29 | **A photo could stay "processing" for ever** in the admin: a photo that was uploaded but not saved yet only had the state of the upload response. | The page now asks the server for those photos one by one (`GET /api/v1/hero/images/{id}`, every 5 s while processing, also in a background tab); each photo shows its own state and, when done, a short "Processing finished" note on that photo (no toast). A photo that was already in the CMS (`reused`, internal only) looks the same and is ready at once. | n/a | `heroImageQuery`, `DoneStatus` | +| 30 | **Planning (from/to) and the hero-wide on/off are gone** (Bryan, 2026-11-17): the hero is part of the design and always on; a planning per slide became too much trouble. | Removed from model, API (PUT/GET, OpenAPI), validation, host logic (`IsLive` = has a title), admin (fields, nl/en texts) and tests; migration `RemoveHeroScheduleAndSwitch` drops `StartsAt`, `EndsAt` and `IsActive` of the hero (the per-slide `IsActive` stays). The public JSON, golden files and both sites did not depend on them. Without hero data the host writes nothing. | Planning can be added later, probably per slide; a hero-wide switch likewise. | `HeroMapping.IsLive`, migration `RemoveHeroScheduleAndSwitch` | diff --git a/aidlc-docs/features/hero-module/construction/functional-design/business-rules.md b/aidlc-docs/features/hero-module/construction/functional-design/business-rules.md index 2802a9b..318fcc0 100644 --- a/aidlc-docs/features/hero-module/construction/functional-design/business-rules.md +++ b/aidlc-docs/features/hero-module/construction/functional-design/business-rules.md @@ -12,7 +12,7 @@ IDs are used in the code, tests and the build and test summary. | BR-H04 | `display` is `single` or `slideshow`; default `single`; any other value is rejected. | | BR-H05 | 0 to 2 buttons. Both `label` (1 to 50 characters) and `target` (at most 500) are required for a button; a half-filled button is rejected. | | BR-H06 | A target is exactly one of: **anchor** `#` followed by a letter and then letters, digits, `-` or `_` (at most 100 characters); **path** starting with a single `/` (not `//`), no `\`, no control characters, no whitespace, no `:` before the first `/`; **https address** with the scheme `https`, a host, no user info, parsed as an absolute URI. Anything else is rejected with the message "Kies een #anker, een /pad of een https://-adres." | -| BR-H07 | Schedule: `startsAt` and `endsAt` optional; when both exist `endsAt` must be after `startsAt`. Stored in UTC; displayed in the admin in local time. | +| BR-H07 | **Removed 2026-11-17 (no schedule, no hero-wide switch; see FR-05).** Was: Schedule: `startsAt` and `endsAt` optional; when both exist `endsAt` must be after `startsAt`. Stored in UTC; displayed in the admin in local time. | | BR-H08 | Text in every field is plain text. The server stores it as typed (control characters other than the line break are removed) and encodes it when writing HTML (`& < > " '`) and JSON in a script element (`< > &` and U+2028/2029 as `\uXXXX`). No field can produce markup or script. | | BR-H09 | Slides: no administrator limit on the number. Each slide has an existing image, `alt` (at most 300 characters) or `decorative = true`, an order, and `isActive`. A slide that is not decorative needs a non-empty alt to be saved. `decorative` and a non-empty alt together are accepted; the alt is then ignored when published. | | BR-H10 | Technical safety ceiling: at most `Hero:MaxPublishedSlides` (default 50) slides are published; the rest stay saved. Reported to Bryan (see the logic model). | @@ -23,7 +23,7 @@ IDs are used in the code, tests and the build and test summary. | ID | Rule | |---|---| -| BR-P01 | The public hero exists only when the hero `isActive`, now is within the schedule (start inclusive, end exclusive), the title is non-empty. Otherwise 204 and the baked hero stays. | +| BR-P01 | **Since 2026-11-17 the hero exists as soon as it has a title (no switch, no schedule); the rest below still holds for slides.** Was: The public hero exists only when the hero `isActive`, now is within the schedule (start inclusive, end exclusive), the title is non-empty. Otherwise 204 and the baked hero stays. | | BR-P02 | Only active slides with a stored image are published, in saved order. | | BR-P03 | `GET /api/v1/hero` answers with `Cache-Control: public, max-age=60`, rate-limited (policy `hero-public`, 120 per 60 s), anonymous, through the availability gate. | | BR-P04 | The HTML region, the preload and the data block are derived from the same read model per request cycle. | diff --git a/aidlc-docs/features/hero-module/inception/requirements/requirements.md b/aidlc-docs/features/hero-module/inception/requirements/requirements.md index 20149da..1b0803b 100644 --- a/aidlc-docs/features/hero-module/inception/requirements/requirements.md +++ b/aidlc-docs/features/hero-module/inception/requirements/requirements.md @@ -57,7 +57,7 @@ | FR-02 | Fields: `title` (required, one text, new lines allowed, max 200 chars), `tagline` (optional, max 120), `lead` (optional, max 600), `display` (`single` or `slideshow`, default `single`). Plain text only; the host and the sites encode it. | | FR-03 | 0 to 2 buttons, each with `label` (max 50) and `target` (max 500). Both required per button. Target must match exactly one of: `#anchor` (letters, digits, `-`, `_`), a site path starting with a single `/` (no `//`, no scheme, no backslash, no control characters), or an absolute `https://` address with a host and no credentials. Anything else is rejected with a clear message. | | FR-04 | 0 to n slides, each with: stable `id`, one image, `alt` text (required, max 300, or an explicit `decorative` flag instead), `order`, `isActive`. Inactive slides are not published. A reasonable maximum (for example 12) protects the page weight. | -| FR-05 | Schedule: optional `startsAt` / `endsAt` for the hero as a whole (as banners). Outside the period the hero counts as not available (204). | +| FR-05 | ~~Schedule~~ **Removed (Bryan, 2026-11-17).** No `startsAt`/`endsAt` and no hero-wide on/off (`isActive`): the hero is part of the design and always on; it is live as soon as it has a title, and without hero data the host writes nothing (the baked hero stays). Per-slide on/off stays. A schedule may come back later, then probably per slide. | | FR-06 | Text fields and slide data are stored so that a language can be added later without migrating existing rows (for example a language key or a translations structure with the current language as the default); only one language is exposed and edited now. | | FR-07 | Management needs role Administrator or higher (policy `AdminOnly`); the public read endpoint is anonymous and reachable through the availability gate (like the banner). | diff --git a/aidlc-docs/features/hero-module/inception/requirements/site-contract-agreed-with-asf.md b/aidlc-docs/features/hero-module/inception/requirements/site-contract-agreed-with-asf.md index 1d4dd7d..546661f 100644 --- a/aidlc-docs/features/hero-module/inception/requirements/site-contract-agreed-with-asf.md +++ b/aidlc-docs/features/hero-module/inception/requirements/site-contract-agreed-with-asf.md @@ -13,7 +13,7 @@ Input for Application Design. Source: message of "Andrea Slop Fotografie - ASF - | Lead | ASF does not render it; if present the site ignores it. | | Decorative | `decorative: true` renders `alt=""` and is not read aloud. | | Display | `single`: no arrows, pause button or progress bar (ASF already does that for one slide). | -| 204 / schedule / error | The baked hero stays (fail-open). ASF shows the baked hero on 204, not nothing. If the host ever means "no hero at all", that must be said explicitly (not planned). | +| 204 / no hero data / error | The baked hero stays (fail-open). ASF shows the baked hero on 204, not nothing. If the host ever means "no hero at all", that must be said explicitly (not planned). | | Image addresses | Same origin `/media/hero//…`, immutable; the CSP `img-src` does not change. | | Markers | `…` (title, tagline, button(s), the FIRST slide as ``), `` in the head, key `hero` in `#cms-data` with all slides. Fail-open: no marker, 204 or an error leaves the baked page. | | Hydration | The region holds neutral HTML (fixed classes, no Chakra classes); React takes over with the same source after hydration; slides 2..n load afterwards. The first slide of the data block must equal the first slide the host wrote into the HTML (same source, same cache rule). | diff --git a/docs/hero-module.md b/docs/hero-module.md index c850457..02e46c6 100644 --- a/docs/hero-module.md +++ b/docs/hero-module.md @@ -8,7 +8,7 @@ Admin > **Hero** (Owner en Administrator, module `Hero`): - Titel (een nieuwe regel is een regelafbreking, maximaal 5 regels), tagline, lead, weergave (`single` of `slideshow`). - Maximaal twee knoppen met tekst en doel. Een doel is een `#anker`, een `/pad` of een `https://`-adres; andere waarden worden geweigerd. -- Planning (aan of uit, van en tot). Buiten de planning, of uitgezet, toont de website zijn eigen ingebakken hero. +- Geen planning en geen aan/uit voor de hero zelf (Bryan, 2026-11-17): de hero is onderdeel van het design en altijd aan. Hij is live zodra er een titel is; zonder hero-gegevens schrijft de host niets en toont de website zijn eigen ingebakken hero. Planning (later eventueel per slide) en een hero-brede aan/uit kunnen later terugkomen. Per slide blijft aan/uit bestaan. - Slides: een afbeelding met verplichte beschrijving (alt-tekst) of de markering decoratief, volgorde, aan of uit per slide. Er is geen grens op het aantal slides; technisch publiceert de host er hoogstens `Hero:MaxPublishedSlides` (50). - Focus: per afbeelding een algemeen punt en zoom, en optioneel een eigen punt voor de liggende (`wide`, 3:2) en de staande (`tall`, 4:5) weergave. De host snijdt de varianten daaromheen uit. **Een wijziging van het focuspunt geldt pas als je de hero opslaat** (Bryan, 2026-11-16): het focus-venster houdt de wijziging lokaal in de admin (knop Toepassen, een markering bij de slide); bij Opslaan gaat ze mee in dezelfde aanvraag (`imageFocus`); de host bewaart hero en focus direct (onder een seconde) en snijdt de varianten daarna op de achtergrond in nieuwe bestanden. De afbeelding schakelt over naar de nieuwe set zodra die compleet is; tot die tijd blijft de oude set in beeld. Verlaat je de pagina zonder op te slaan, dan vervalt de wijziging en is er niets aan de server veranderd. Mislukt een opslag nadat nieuwe bestanden zijn geschreven, dan verwijst niets ernaar en ruimt de opschoning ze na 7 dagen op; de oude bestanden blijven ook 7 dagen staan voor sites die nog oude data hebben.