AI-DLC: inception en ontwerp voor redesign B/E met contactformulier

Requirements, application design (incl. concept-API-contract voor het contactformulier), units en functional design voor U1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 21:06:25 +01:00
co-authored by Claude Sonnet 5.5
parent ad4671334a
commit 1047c738b5
34 changed files with 2248 additions and 3 deletions
@@ -0,0 +1,173 @@
# Requirements-vragen — redesign B (Modern) + E (Tijdreis) + contactformulier
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies de laatste (Anders) en beschrijf je voorkeur.
Context uit de analyse: de zusterrepo `AndreaSlopFotografie-cms-api-foundation` bevat feature-briefs voor de aparte repo **SlpModularCms** (de CMS/API) en een afgeronde `contact-page`-feature met een eigen `ContactForm`. Daar sluiten de andere formulier-sessies en de CMS-sessie op aan (vragen 9 t/m 13).
---
## Vraag 1 — Scope van B en E in deze feature
B is het uitgangspunt. E (Tijdreis) is een grote bouw met vijf tijdperken (2026, 2013, 2006, 1998, 1989).
- A) B volledig + E volledig, in deze feature, als aparte units (B eerst, dan E)
- B) B volledig + de wissel-infrastructuur (knop, thema-model, laden van E) nu; de E-secties in een vervolgfeature
- C) Alleen B nu; de knop naar E pas bouwen zodra E aan de beurt is
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 2 — Uiterlijk van de knop naar E
Naast de licht/donker-schakelaar in de nav.
- A) Icoon + tekst (bijv. een klokje/terugspoelpijl met "Tijdreis")
- B) Alleen een icoon met tooltip en toegankelijk label
- C) Tekst die van label wisselt ("Tijdreis" in B, "Terug naar nu" in E)
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: B
## Vraag 3 — Onthouden van de variant
Moet de bezoeker na een bezoek aan E de volgende keer weer in E starten?
- A) Nee, altijd starten in B (E blijft een verrassing); alleen licht/donker wordt onthouden
- B) Ja, variant én licht/donker worden onthouden (localStorage)
- C) Alleen binnen dezelfde sessie onthouden (sessionStorage)
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 4 — Bestaande rood/paars-thema's
Nu zijn er twee kleurthema's (rood, paars). In het ontwerp heeft B accent #7A1414 en E #AC0000, met licht en donker.
- A) Rood/paars vervalt; thema wordt: variant (B/E) × modus (licht/donker)
- B) Paars blijft als extra accentkeuze voor B
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 5 — Beginstand licht/donker
- A) Standaard licht, daarna de gekozen modus onthouden
- B) Volg de systeeminstelling van de bezoeker (prefers-color-scheme); gekozen modus overschrijft dit en wordt onthouden
- C) Standaard donker (zoals de huidige site)
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: B
## Vraag 6 — Pakketten: aantal, filter en categorieën
De API levert nu 3 pakketten. Het ontwerp toont ook 6 pakketten met filterchips (Websites / Software / Beheer). Vier daarvan hebben nog geen inhoud.
- A) Het blok moet met elk aantal pakketten overweg kunnen; de filterchips verschijnen pas vanaf 4 pakketten; categorie komt als veld uit de API
- B) Zoals A, maar de categorie wordt in de frontend afgeleid uit de slug (geen API-wijziging)
- C) Altijd 3 kaarten zonder filter; het 6-pakkettenontwerp is alleen een toekomstvoorbeeld
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 7 — Pakketten op mobiel
Je suggestie: naast elkaar en swipeable in plaats van onder elkaar.
- A) Horizontale swipe-rij (scroll-snap) op mobiel bij elk aantal pakketten: ~85% kaartbreedte zodat de volgende kaart zichtbaar is, stipjes, uitgelicht pakket als eerste in beeld; raster op tablet/desktop
- B) Swipe-rij alleen bij meer dan 3 pakketten; bij 3 pakketten onder elkaar
- C) Op mobiel onder elkaar laten staan
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 8 — Inhoud van de vier extra pakketten
- A) Niet in scope: ik bouw het blok generiek en test met nepdata; de echte inhoud volgt via de API/CMS
- B) Wel in scope: ik lever de teksten en prijzen aan voordat de code gegenereerd wordt
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 9 — Velden van het contactformulier
- A) Naam, e-mail, onderwerp/pakket (keuzelijst, voorgeselecteerd via de "Kies …"-knop op een kaart), bericht
- B) Zoals A, plus telefoonnummer (optioneel) en bedrijf (optioneel)
- C) Zoals A, plus indicatie budget en gewenste startdatum (optioneel)
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 10 — Wat gebeurt er met een verzonden formulier?
- A) De CMS/API (SlpModularCms) krijgt een eindpunt (bijv. `POST /api/v1/contact-messages`) dat het bericht opslaat én een e-mail naar mij stuurt
- B) Alleen een e-mail naar mij via de API, geen opslag
- C) Voorlopig de mailto-link behouden tot de API klaar is; formulier-UI en validatie wel bouwen en achter een instelling (feature flag) zetten
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 11 — Hoe delen de sessies het formulier?
Andere sessies willen ook een formulier (o.a. de Andrea-site met een eigen `ContactForm`); de CMS-sessie bouwt de API.
- A) Eén gedeeld contract (request/response, foutcodes, spamregels) in de CMS-repo; elke site bouwt zijn eigen formulier-UI daartegen
- B) De CMS-repo levert een herbruikbare formuliermodule (frontend-component + endpoint) die alle sites gebruiken
- C) Elke site volledig eigen formulier en eindpunt (geen deling)
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: B
## Vraag 12 — Spambescherming
- A) Honeypot-veld + tijdcontrole + rate-limit op de server, zonder externe dienst
- B) Externe captcha (bijv. Cloudflare Turnstile of hCaptcha)
- C) Combinatie: A, met een captcha als terugvaloptie als er misbruik komt
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: C
## Vraag 13 — Privacy bij het formulier
- A) Korte privacyzin onder het formulier (waarvoor de gegevens gebruikt worden en hoe lang bewaard), zonder aanvinkvakje
- B) Verplicht aanvinkvakje voor toestemming
- C) Geen aparte tekst
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 14 — Toegankelijkheid en beweging
E heeft veel effecten (scanlines, marquee, dithering, glanzende knoppen).
- A) WCAG 2.1 AA voor B en E (contrast, toetsenbord, schermlezer) en alle animatie uit bij `prefers-reduced-motion`
- B) WCAG AA voor B; in E mogen effecten blijven, maar tekst blijft leesbaar en animatie stopt bij `prefers-reduced-motion`
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: A
## Vraag 15 — Operations-fase
Deployment (Gitea Actions + test/productie op de Pi's) bestaat al uit de vorige feature.
- A) Ja — Operations-fase draaien (deployment- en monitoringaanpassingen, bijv. voor het formulier-eindpunt in de nginx-proxy)
- B) Nee — stoppen na Build and Test; bestaande pipeline blijft ongewijzigd
- C) Nog niet zeker — vraag het opnieuw na de Construction-fase
- X) Anders (beschrijf na de [Answer]:-tag)
[Answer]: C
## Vraag: Beveiligingsextensies
Moeten de beveiligingsregels als harde vereisten worden afgedwongen voor dit project? (Het formulier verwerkt persoonsgegevens, dus A ligt voor de hand.)
- 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? (Denkbare kandidaat: formuliervalidatie.)
- 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]: B
## Vraag 16 — Vervolg op vraag 11: vorm van de formuliermodule
Antwoord gekozen in de chat (interactieve vragenronde, 2026-11-09).
- A) Headless + thema-slots
- B) Vooraf gestyled component
- C) Web component
[Answer]: A
---
Opmerking: alle antwoorden zijn interactief in de chat gegeven op verzoek van de gebruiker en hierboven overgenomen.
@@ -0,0 +1,65 @@
# Requirements — redesign-modern-timetravel
## Intent Analysis
- **User request**: Build design option B (Modern) as the default site, add a button next to the light/dark switch to switch to option E (Time-travel), and build the contact form along with it. Other sessions that also need a form, and the CMS & API session, are attached when the form build starts.
- **Request type**: New Feature (redesign + variant switch + new capability: contact form)
- **Scope estimate**: Multiple components / cross-system (frontend theme system, nav, all landing sections, form; CMS/API repo SlpModularCms for the endpoint and shared module)
- **Complexity estimate**: Complex
- **Requirements depth**: Standard (comprehensive for the form/cross-repo part)
- **Design source**: Claude Design canvas https://claude.ai/artifact/UkpzA5YPLheZm3fpmWdPtn — B = Modern.dc.html, E = Tijdreis2.dc.html, PakkettenModern.dc.html, PakkettenTijd.dc.html, plus dark wrappers. Accent B `#7A1414`, E `#AC0000`.
## Functional Requirements
### Variants and theming
- **FR-1** Variant B (Modern) is the default experience: hero, Over (with photo), Pakketten, Werkwijze ("Van idee naar live in drie stappen"), Contact (with form), footer, per the canvas design. Section years are not in the menu.
- **FR-2** Variant E (Time-travel) is built in full (this feature, separate unit after B): eras 2026 modern, 2013 flat, 2006 web 2.0, 1998 Windows-98 style with the redesigned Werkwijze step cards, 1989 terminal; per canvas design E. Years remain as badges per block.
- **FR-3** The theme model becomes **variant (B | E) × mode (light | dark)**. The old red/purple themes are removed (answer Q4-A). B accent `#7A1414`, E accent `#AC0000`. The 1989 terminal section looks the same in light and dark.
- **FR-4** Nav contains the existing mode switch and, next to it, an **icon-only** button to switch to E (and back to B), with tooltip and accessible label (Q2-B).
- **FR-5** Mode starts from the visitor's system preference (`prefers-color-scheme`); an explicit choice overrides it and is remembered (Q5-B). The **variant is not remembered**: every visit starts in B; E is an easter egg (Q3-A).
- **FR-6** E is loaded lazily (code-split) so the default B bundle stays small. *(Design decision proposed by AI; revisit in Application Design.)*
### Packages
- **FR-7** The packages block works with any number of packages from `/api/v1/offerings` (Q6-A). Skeleton count and grid are no longer hard-coded to 3.
- **FR-8** Filter chips (category + count, e.g. Alles/Websites/Onderhoud) appear from **4 packages** on. Category is a **new field in the API** (`category`, the category name), a CMS/API change handed to the CMS builder. Categories are **managed in the CMS** (sub-section of the Offerings admin), not in settings; Bryan starts with *Websites* and *Onderhoud* (decision 2026-11-09, revised; earlier example values Websites/Software/Beheer were only placeholders). Mock data for 6 packages in tests uses these names.
- **FR-9** A "Past er niets bij? / Maatwerk" banner always stays below the cards.
- **FR-10** On mobile the cards form a **horizontal swipe row** (CSS scroll-snap) for any number of packages (Q7-A): ~85% card width so the next card peeks, dot indicator, the featured package first in view; grid on tablet/desktop (3 columns, 2 columns at ≤1000px). Must be keyboard and screen-reader usable and not depend on JavaScript for scrolling.
- **FR-11** Content for the four additional packages (Webshop, CMS, Koppelingen & API's, Onderhoud) is **out of scope**; layout is built generically and tested with mock data of 6 packages (Q8-A).
- **FR-12** Both B and E have their own styling of the packages block (B: square chips and cards; E: 2006 glossy tabs and cards), light and dark.
### Contact form
- **FR-13** Fields: name, e-mail, subject/package (select, preselected via the "Kies …" button of a package card) and message (Q9-A). **All four fields are required** (follow-up decision 2026-11-09). All fields validated on the client and on the server. Limits and messages are aligned with the ASF form: name max 100, e-mail max 254, message max 2000.
- **FR-14** Submit sends the message to the CMS/API, which **stores it and e-mails the site owner** (Q10-A), e.g. `POST /api/v1/contact-messages`. Exact contract defined together with the CMS sessions. Store first, mail best-effort with a status; a mail failure never fails the save. Stored messages are kept **12 months** (follow-up decision), then removed by a retention job.
- **FR-14a (future, out of scope)** The owner may later turn a stored message into an assignment in an administration system to produce quotes and invoices. Not built now; the stored message keeps its own id and a status so this stays possible.
- **FR-15** Form states: idle, validating (inline errors), submitting, success, server error with retry; no loss of input on error.
- **FR-16** Spam protection (Q12-C): honeypot field + time check + server-side rate limit, with an external captcha as a fallback to switch on if abuse occurs (ASF plans Friendly Captcha; provider to be settled in the contract). Suggested hardening from the CMS session: server-signed timestamp token for the time check, idempotency key against double submit, identical response on spam detection so bots learn nothing, site id derived from host/config (never from the request body).
- **FR-17** A one-sentence privacy note under the form (purpose and retention), no consent checkbox (Q13-A). Recipient e-mail, retention period and the privacy-statement link/text are **configurable per site** (requested by the ASF website session; ASF keeps its sentence "Lees in de privacyverklaring wat ik met je gegevens doe." linking to /privacyverklaring). Captcha provider: Friendly Captcha fits ASF (its code already has a [data-robot-check] slot).
- **FR-18** **Reusable module** (Q11-B, Q16-A, follow-up decision): two parts. (1) A **Contact/Forms API module** in SlpModularCms (endpoint, storage, mail, spam checks, retention job). (2) **One frontend package `cms-client`** (working name) in SlpModularCms that types and calls the CMS API, with **separately importable parts** (subpath imports such as `/contact`, later `/offerings`) so a site only bundles what it uses. The contact part is **headless** (state/reducer, validation, preselect with change counter, idPrefix, render slots for honeypot/robot check/status, injectable texts and submit function, a11y wiring); each site, including B and E here and the other sites, supplies its own markup and styling. Types come from the CMS OpenAPI description. Offerings moves into the same package later for consistency (not in this feature unless cheap). Consumption route (workspace/file dependency or tagged copy first, private registry only with a third consumer) is a recommendation awaiting the user's confirmation.
- **FR-19** Form copy and layout per design: B has a red contact block with a white (light) / dark form panel; E has the terminal-style form in 1989 and matching styles per era where applicable.
## Non-Functional Requirements
- **NFR-1 Accessibility**: WCAG 2.1 AA for B and E (contrast, keyboard, screen reader, visible focus); all animation (marquee, scanlines, dither, caret) disabled under `prefers-reduced-motion` (Q14-A).
- **NFR-2 Responsive**: layouts work from 360px to 1440px+; no horizontal page scroll (swipe row excepted).
- **NFR-3 Performance**: E is code-split; fonts are self-hosted via `@fontsource` (no Google Fonts requests) and limited to the weights used; images keep the existing responsive WebP variants.
- **NFR-4 Security (Security Baseline enabled)**: server-side validation and output encoding, no secrets in the frontend bundle, rate limiting, no PII in logs or Sentry/Umami events, security headers / CSP compatible with the new fonts and API origin, dependency hygiene. Applicable SECURITY rules are enforced as blocking at each stage.
- **NFR-5 Privacy**: stored contact messages contain personal data; retention is **12 months**, stated in the privacy note and enforced by the CMS retention job. No e-mail address or message text in logs or Sentry breadcrumbs.
- **NFR-6 Testing**: Vitest + Testing Library for components (theme switch, variant switch, packages grid with 3 and 6 items, swipe row semantics, form states). Property-based testing **partial** (Q-PBT-B): applies to pure functions and serialization round-trips, e.g. form validation functions and request/response serialization.
- **NFR-7 Maintainability**: theme tokens as CSS variables per variant × mode; Tailwind semantic color names remain; content stays in `content.ts`/API.
- **NFR-8 Compatibility**: hash routing and static hosting remain; the existing Sentry/Umami integration and the CI/CD pipeline keep working.
## Assumptions
- Current copy and texts of the live site (incl. the November text update) are leading unless the design says otherwise.
- The packages API keeps its current shape plus `category`; the CMS session implements it.
- E may use period-appropriate fonts (Archivo for B; Open Sans, Trebuchet/Verdana, Times/Arial, VT323 for E) as self-hosted or system fonts.
- Delivery: one branch `feature/redesign-modern-timetravel`, commits per unit, one PR at the end.
## Risks and Dependencies
- **Cross-repo**: the endpoint, the `category` API field and the headless form module live in SlpModularCms; the CMS session must be attached. See `aidlc-docs/features/redesign-modern-timetravel/aidlc-state.md` § Coordination Notes.
- **Form coordination moment**: the user wants to be told **before** the form build starts so other sessions (e.g. Andrea site with its own `ContactForm`) and the CMS session can join.
- E is a large build; B-first ordering limits risk.
## Operations
- Include Operations Phase: **Undecided** — asked again after Construction (Q15-C). Likely topics: nginx route for the form endpoint, monitoring of form errors.
## Extension Compliance Summary
- Security Baseline: enabled (Q-Security-A). Requirements-level compliance: NFR-4/5 added; detailed per-rule checks run in later stages.
- Property-Based Testing: partial (Q-PBT-B). Requirements-level: NFR-6.