diff --git a/aidlc-docs/active-features.md b/aidlc-docs/active-features.md index 50476ee..6aea403 100644 --- a/aidlc-docs/active-features.md +++ b/aidlc-docs/active-features.md @@ -2,4 +2,4 @@ | Type | Name | Status | Branch | Affected Components | Session Start | |------|------|--------|--------|---------------------|---------------| -| Feature | frontend-shell | 🔵 Inception | 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 | 🟢 Construction | 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 | diff --git a/aidlc-docs/features/frontend-shell/aidlc-state.md b/aidlc-docs/features/frontend-shell/aidlc-state.md index 927efde..25fc87e 100644 --- a/aidlc-docs/features/frontend-shell/aidlc-state.md +++ b/aidlc-docs/features/frontend-shell/aidlc-state.md @@ -5,7 +5,7 @@ - **Feature Slug**: frontend-shell - **Project Type**: Brownfield - **Start Date**: 2026-10-14T09:46:02Z -- **Current Stage**: INCEPTION - Application Design (awaiting approval) +- **Current Stage**: CONSTRUCTION - Build and Test (complete, awaiting Operations decision) - **Branch**: feature/frontend-shell ## Workspace State @@ -53,24 +53,24 @@ - [x] Requirements Analysis - [x] User Stories - SKIP - [x] Workflow Planning -- [~] Application Design - EXECUTE (artifacts generated, awaiting approval) -- [ ] Units Generation - SKIP +- [x] Application Design - EXECUTE (approved) +- [x] Units Generation - SKIP ### 🟢 CONSTRUCTION PHASE -- [ ] Functional Design - EXECUTE -- [ ] NFR Requirements - EXECUTE -- [ ] NFR Design - SKIP -- [ ] Infrastructure Design - SKIP -- [ ] Code Generation - EXECUTE -- [ ] Build and Test - EXECUTE +- [x] Functional Design - EXECUTE (approved) +- [x] NFR Requirements - EXECUTE (approved) +- [x] NFR Design - SKIP +- [x] Infrastructure Design - SKIP +- [x] Code Generation - EXECUTE (approved) +- [x] Build and Test - EXECUTE (complete; Operations decision pending) ### 🟡 OPERATIONS PHASE - [ ] Deployment Setup, Monitoring Setup, Production Readiness Validation - UNDECIDED ## Current Status -- **Lifecycle Phase**: INCEPTION -- **Current Stage**: Application Design -- **Next Stage**: Functional Design +- **Lifecycle Phase**: CONSTRUCTION +- **Current Stage**: Build and Test +- **Next Stage**: Operations (undecided) ## Reverse Engineering Status - [x] Reverse Engineering - Artifacts generated on 2026-10-14T09:58:04Z (approved 2026-10-14T10:05:21Z) diff --git a/aidlc-docs/features/frontend-shell/audit.md b/aidlc-docs/features/frontend-shell/audit.md index 6457398..12a9944 100644 --- a/aidlc-docs/features/frontend-shell/audit.md +++ b/aidlc-docs/features/frontend-shell/audit.md @@ -174,3 +174,303 @@ **Context**: INCEPTION - Application Design; artifacts generated, awaiting approval --- + +## Session Resume + +**Timestamp**: 2026-10-18T09:04:08Z + +**User Input**: "kan je met aidlc verdergaan met de openstaande feature?" + +**AI Response**: "Resumed feature frontend-shell (only active item, treated as option A). active-features.md (Inception) consistent with aidlc-state.md (Application Design awaiting approval). Loaded application-design.md and audit history. Re-presented the Application Design completion message; awaiting explicit approval before starting Functional Design." + +**Context**: INCEPTION - Application Design; awaiting approval + +--- + +## Application Design - Approval + +**Timestamp**: 2026-10-18T09:08:25Z + +**User Input**: "ga verder naar het volgende onderdeel" + +**AI Response**: "Application Design approved. Marked complete in aidlc-state.md; Units Generation skipped (single unit 'frontend-shell'). Started CONSTRUCTION - Functional Design for unit frontend-shell." + +**Context**: INCEPTION - Application Design complete; CONSTRUCTION - Functional Design started + +--- + +## Functional Design - Plan and Questions + +**Timestamp**: 2026-10-18T09:08:25Z + +**User Input**: "(none — stage start)" + +**AI Response**: "Created construction/plans/frontend-shell-functional-design-plan.md and construction/plans/frontend-shell-fd-questions.md (12 questions): 404 head mechanism, BackToTop focus after click, BackToTop hide/show animation, BackToTop hover colour, social href validation, empty-content behaviour, footer active state, placeholder copy, 404 copy, error page actions, error logging, footer e-mail display." + +**Context**: CONSTRUCTION - Functional Design; awaiting answers + +--- + +## Functional Design - Answers and Clarification + +**Timestamp**: 2026-10-18T09:34:55Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Read frontend-shell-fd-questions.md. Answers: Q1 A, Q2 A, Q3 A, Q4 'A, al vind ik de knop en z'n kleuren nu sowieso niet heel erg duidelijk en vraga me af of die niet wegvalt. Daarbij komt dat op een 32:9 scherm de knop nog steeds helemaal rechtsonderin getoond wordt terwijl de content een max width heeft.', Q5 A, Q6 'A, verder wil ik kijken hoe we het e-mailadres zo veilig mogelijk kunnen plaatsen om te beschermen tegen spam. Dat is nu namelijk ook al een probleem.', Q7 B, Q8 A, Q9 A, Q10 B, Q11 A, Q12 'x, bij vraag 6 heb ik ook al een opmerking geplaatst. Wat is de veiligste manier om het e-mailadres te tonen? Geef mij aanbevelingen'. Created frontend-shell-fd-clarification-questions.md with 4 questions: to-top appearance, to-top position on ultrawide screens, e-mail anti-spam display technique (with comparison of techniques and recommendation), recording out-of-scope follow-ups." + +**Context**: CONSTRUCTION - Functional Design; awaiting clarification answers + +--- + +## Functional Design - Clarifications and Artifacts + +**Timestamp**: 2026-10-18T09:48:15Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Read frontend-shell-fd-clarification-questions.md. Answers: CQ1 A, CQ2 A, CQ3 'A, verder ter info: techniek 4 is al toegepast met dit specifieke e-mailadres.', CQ4 'A, maar techniek 4 is al (deels) toegepast. info@andreaslop.nl is al een mailadres specifiek voor de website.' No remaining ambiguities. Generated construction/frontend-shell/functional-design/domain-entities.md, business-rules.md (incl. Testable Properties for PBT-01), business-logic-model.md (incl. recommendations outside this feature), frontend-components.md. Refinements: SiteContent.email becomes { user, domain } (FR-04 updated), StatusPage action prop becomes actions ReactNode, to-top styling/position deviates from design (FR-06 updated), ErrorPage also gets own title + noindex." + +**Context**: CONSTRUCTION - Functional Design; artifacts generated, awaiting approval + +--- + +## Functional Design - Change Request + +**Timestamp**: 2026-10-18T10:16:26Z + +**User Input**: "De footerIntro tekst mag worden `Lifestyle fotograaf uit Huizen. Ik leg jouw mooiste momenten vast.` + +Ik zie niks staan over SEo-optimalisatie en screenreader-optimalisatie of Responsive design. Ik wil dat daar meteen rekening me egehouden wordt zodat we dat niet achteraf nog moeten toevoegen. +Denk ook aan het gebruik van chakra en het thema om redundatie zoveel mogelijk te voorkomen." + +**AI Response**: "Request Changes. Updated footerIntro in domain-entities.md and requirements.md (FR-05). Created construction/plans/frontend-shell-fd-change-questions.md: listed SEO/screen-reader/responsive/reuse items that will be designed without a question, plus 6 questions with trade-offs: prerendering for link previews, canonical domain, og:image, JSON-LD structured data, robots.txt/sitemap.xml, route-change announcement for screen readers." + +**Context**: CONSTRUCTION - Functional Design; change request, awaiting answers + +--- + +## Functional Design - Change Answers and Revised Artifacts + +**Timestamp**: 2026-10-18T10:32:08Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Read frontend-shell-fd-change-questions.md. Answers: Q1 A, Q2 A, Q3 A, Q4 A, Q5 'B is het makkelijkste. Hoeveel meerwerk is het en hoe wordt het automatisch opgebouwd? Hoe betrouwbaar is het? Bij teveel gedoe of onzekerheden is A het beste. Anders B, met eventueel de test uit optie A', Q6 A. Assessed Q5: verified TanStack Router head supports links and scripts; chose B via a single sitePages registry + small Vite plugin + sync test (low effort, no extra dependency, reliable). Updated functional design: domain-entities.md (site config, sitePages registry, JSON-LD), business-rules.md (BR-SEO-01..11, BR-A11Y-01..07, BR-RWD-01..05, BR-THEME-01..07, extra testable properties for canonicalUrl, sitemapXml, jsonLdScript), business-logic-model.md (flows 5 focus on page change, 6 build-time SEO files; recommendations prerendering and responsive images), frontend-components.md (useRouteFocus, root head, route heads, responsive table checked against design CSS, theme usage table). Footer headings set to h2 (corrects the note in the change-question file). requirements.md: FR-12, FR-13, NFR-06 added." + +**Context**: CONSTRUCTION - Functional Design; revised artifacts, awaiting approval + +--- + +## Functional Design - Approval + +**Timestamp**: 2026-10-18T10:40:10Z + +**User Input**: "goedgekeurd, ga verder" + +**AI Response**: "Functional Design approved. Marked complete in aidlc-state.md. Started CONSTRUCTION - NFR Requirements for unit frontend-shell." + +**Context**: CONSTRUCTION - Functional Design complete; NFR Requirements started + +--- + +## NFR Requirements - Plan and Questions + +**Timestamp**: 2026-10-18T10:40:51Z + +**User Input**: "(none — stage start)" + +**AI Response**: "Created construction/plans/frontend-shell-nfr-requirements-plan.md with pre-decided items (test stack per PBT-09, security headers, production CSP, devtools dev-only, sitemap plugin in vite.config.ts) and 8 questions: CSP in dev, next-themes removal (verified it injects an inline script), Lighthouse targets, axe testing, ESLint, browser support, coverage, dependency audit script." + +**Context**: CONSTRUCTION - NFR Requirements; awaiting answers + +--- + +## NFR Requirements - Answers and Clarification + +**Timestamp**: 2026-10-18T10:51:59Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Read frontend-shell-nfr-requirements-plan.md. Answers: Q1 A, Q2 A, Q3 B, Q4 A, Q5 A, Q6 'Begin met optie A. B zou later nog kunnen met name voor de mobiele versies.', Q7 A, Q8 A. Q6 interpreted as A now, B recorded as possible follow-up. Q3 B ambiguous on when Lighthouse CI runs (every build vs pre-release check); created frontend-shell-nfr-clarification-questions.md with 1 question, noting SEO 100 target applies to indexed pages only." + +**Context**: CONSTRUCTION - NFR Requirements; awaiting clarification + +--- + +## NFR Requirements - Clarification Answer and Artifacts + +**Timestamp**: 2026-10-18T10:58:52Z + +**User Input**: "ik heb de vraag beantwoord" + +**AI Response**: "Read clarification answer: 'A, er vanuitgaand dat ik lokaal de check kan draaien zodat ik tussendoor ook een check kan doen. Ik vraag me alleen wel af of een automatische check vlak voor release niet te laat is. Stel ik doe onderhoud en vergeet dat ik die check moet doen. Dan zie ik dat pas vlak voor release. Als het standaard in CI/CD workflow wordt meegenomen als bijvoorbeeld de laatste stap, dan hoeft het niks in de weg te zitten.' Resolved: pnpm lighthouse + pnpm check runnable locally at any time; CI/CD running pnpm check as final step on every push recorded as follow-up for Deployment Setup. Generated nfr-requirements/nfr-requirements.md and nfr-requirements/tech-stack-decisions.md." + +**Context**: CONSTRUCTION - NFR Requirements; artifacts generated, awaiting approval + +--- + +## NFR Requirements - Approval + +**Timestamp**: 2026-10-18T10:59:54Z + +**User Input**: "Goedgekeurd, ga verder" + +**AI Response**: "NFR Requirements approved. NFR Design and Infrastructure Design skipped per execution plan. Started CONSTRUCTION - Code Generation Part 1 (Planning) for unit frontend-shell." + +**Context**: CONSTRUCTION - NFR Requirements complete; Code Generation planning started + +--- + +## Code Generation - Plan Approval Prompt + +**Timestamp**: 2026-10-18T11:00:58Z + +**User Input**: "(none — plan created)" + +**AI Response**: "Created construction/plans/frontend-shell-code-generation-plan.md: 31 steps in 7 parts (A tooling/config, B theme, C content + pure logic + PBT, D shared primitives/hooks, E components + tests incl. axe, F routes/entry/static files, G docs + unit verification). Asked for plan approval (Request Changes / Approve Plan)." + +**Context**: CONSTRUCTION - Code Generation Part 1; awaiting plan approval + +--- + +## Code Generation - Plan Approval + +**Timestamp**: 2026-10-18T11:07:51Z + +**User Input**: "heb je voor de preofessionalservice nog content nodig? Of is dat iets wat ik later handmatig moet in- of aanvullen? + +Ziet er verder goed uit. Dus als je niks nodig hebt mag je verder." + +**AI Response**: "Answered: no extra content needed for ProfessionalService (name, url, logo, image, locality/country, areaServed, sameAs, description from home meta description all available); optional later additions: telephone, priceRange, openingHours, full address (advised to omit when working from home). Plan approved; starting Code Generation Part 2." + +**Context**: CONSTRUCTION - Code Generation; plan approved, generation started + +--- + +## Code Generation - Generation Complete + +**Timestamp**: 2026-10-18T11:48:36Z + +**User Input**: "(none — generation)" + +**AI Response**: "Executed all 31 plan steps. Verification: lint 0 issues (72 files), Prettier clean, 77 tests in 17 files pass incl. PBT and axe, 100% coverage thresholds on pure functions met, build OK, sitemap.xml generated, e-mail address absent from dist, devtools absent from dist, pnpm audit --prod clean. Fixed during verification: Chakra Image width/height were style props (logo rendered 500px high) -> htmlWidth/htmlHeight; typegen output lost on reinstall -> postinstall typegen; footer accessible name lost a space; hero loaded all 6 slides at once -> others load after first photo painted (mobile LCP 19.7s -> 4.2s); source-map-js override. Unresolved, needs user decision: (1) mobile Lighthouse performance on / is 0.81 vs target 0.9 (all other pages and all desktop pass); (2) pnpm audit:deps fails on 5 high dev-only advisories (4 via @lhci/cli, 1 via pre-existing @chakra-ui/cli), no fix available for most. Presented completion message." + +**Context**: CONSTRUCTION - Code Generation; awaiting approval and 2 decisions + +--- + +## Code Generation - Change Request (hero images, audit) + +**Timestamp**: 2026-10-18T12:06:47Z + +**User Input**: "1. Ik heb hero-5.jpg vervangen voor een webversie die een stuk kleiner is. +2. Ik snap niet zo goe dhoe developer tools de productiescore beinvloeden. + +Verder heb ik 2 afbeeldingen toegevoegd aan de hero. Dat zijn er nu totaal 8. Maakt dat uit? Is er een max die je aan zou raden vanuit performance-oogpunt?" + +**AI Response**: "Rebuilt and re-measured: home mobile performance 0.82 (unchanged; deferred slides load after LCP), total download 2.6 MB. Explained dev tools never ship; audit:deps fails because it scans all packages incl. dev-only tools; prod audit clean. Advised just-in-time slide loading instead of a maximum; 5-8 slides fine, 150-250 KB per photo. Created construction/plans/frontend-shell-code-change-questions.md with 3 questions (mobile performance approach, audit gate scope, hero slide loading)." + +**Context**: CONSTRUCTION - Code Generation; change request, awaiting answers + +--- + +## Code Generation - Change Answers Applied + +**Timestamp**: 2026-10-18T12:17:47Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Answers: Q1 'B, omdat de data later uit een API komt weet ik niet of responseive foto's met een vite-plugin toevoegen verstandig is voor een tijdelijke situatie. Prerendering pakken we sowieso later op.', Q2 A, Q3 'A, maar je kan vanaf de eerste foto ook terug-klikken naar de laatste foto, dus de actieve foto + de volgende en vorige (of laatste in geval van eerste foto) wil je laden.' Applied: lighthouserc.cjs home mobile >= 0.8, new lighthouserc.desktop.cjs keeps 0.9; audit:deps --prod (blocking) + audit:dev (report only); lib/slidesToLoad (active, next, previous wrapping) with PBT, Hero uses it after first paint. Updated NFR-P-01, NFR-SEC-05, follow-up responsive images via API/CMS, BR-HERO-01, code-summary. Full pnpm check exit 0: lint, format, 82 tests in 18 files, build, audit, Lighthouse mobile+desktop. Home mobile 0.81, download 2.6 MB -> 1.2 MB." + +**Context**: CONSTRUCTION - Code Generation; changes applied, awaiting approval + +--- + +## Code Generation - Footer Brand Column Review + +**Timestamp**: 2026-10-18T14:04:37Z + +**User Input**: "De eerste kolom van de footer ziet er gek uit met die tekst onder de afbeelding. De 2 zinnetjes onder elkaar zetten of mnisschien de afbeelding in het midden uitlijnen zal het beter maken gok ik. heb je een suggestie?" / "Ik kan nog geen echte keuze maken, want de varianten op de tablet geven een error-afbeelding dus ik weet niet hoe dat er op een tabelt uit ziet. Zelfde voor mobile schermen. Die heb je helemaal niet gemaakt met de varianten" / "Ik heb even gekeken. ik vind optie C het mooiste, behalve voor mobiel. Daar is B het beste. Dus Optie C voor table en desktop en optie B voor mobiel" + +**AI Response**: "First variant renders were broken (compile error overlay; tablet shown as error, mobile missing) - acknowledged. Re-rendered current/A/B/C (+ D) with puppeteer-core device emulation at 390/820/1440 px; no horizontal overflow at any width. Implemented user choice: mobile centred stacked (B), tablet/desktop logo 110px beside text (C); footerIntro split into two lines in content with whiteSpace pre-line. Noted remaining tablet issues (orphan word, Contact alone on second row) and offered full-width brand block on tablet. Lint, format, 82 tests, build pass. Docs updated." + +**Context**: CONSTRUCTION - Code Generation; footer change applied, awaiting approval + +--- + +## Code Generation - Approval + +**Timestamp**: 2026-10-18T14:22:30Z + +**User Input**: "dat ziet er goed uit. ga verder" + +**AI Response**: "Code Generation approved (tablet full-width brand option not requested; footer stays as chosen). Marked complete. Started CONSTRUCTION - Build and Test." + +**Context**: CONSTRUCTION - Code Generation complete; Build and Test started + +--- + +## Build and Test Stage + +**Timestamp**: 2026-10-18T14:33:42Z + +**Build Status**: Success (clean install with --frozen-lockfile; postinstall typegen verified) + +**Test Status**: Pass. pnpm check exit 0 in 225 s: lint, format, 82 tests in 18 files (18 property tests, seed logged), build, audit:deps clean, Lighthouse mobile+desktop pass. Home mobile 82 (target 80), other pages 94-95 mobile / 100 desktop. Security headers verified on preview with curl; e-mail and devtools absent from dist. Added PBT-08 seed logging on every run (config/testSeed.ts, FC_SEED replay). Manual keyboard/screen-reader check handed to owner. + +**Files Generated**: +- build-instructions.md +- unit-test-instructions.md +- integration-test-instructions.md +- performance-test-instructions.md +- security-test-instructions.md +- manual-test-instructions.md +- build-and-test-summary.md + +**Operations Phase Decision**: Undecided (asked now, Variant C) + +--- + +## Build and Test - Manual Test Results + +**Timestamp**: 2026-10-18T14:52:32Z + +**User Input**: "K1: De knop wordt wel gefocust, maar ik zie niet in beeld komen "Direct naar inhoud" +K2: Ik weet niet wat er zou moeten gebeuren, we hebben nog geen inhoud, maar de volgende tab gaat eerst door de navigation menu heen en niet naar de inhoud of nu dan de footer, klopt dat? +K3-6: Dat ziet er goed uit +K7-8: Te weinig content en kan ik nog niet testen op desktop. Op mobiel met de screenreader deed deze het wel zoals verwacht. +K9: Gaat ide goed doorheen + +Screen reader ziet er goed uit, behalve de kopjes in de footer. SOCIALS wordt opgelezen als loss eletters. Waarshcijnlijk omdat het alleen hoofdletters zijn. CONTACT doet die wel goed. Responsiveness ziet er ook goed uit" + +**AI Response**: "Reproduced K1 with puppeteer keyboard input: skip link focused and positioned but covered by the fixed header (Chakra skipNavLink recipe sets no z-index). Fixed in recipes/skipNavLink.ts (zIndex skipNav, margin 0); verified not covered, rect 0,0. K2 not reproducible: after Enter focus is on main, next Tab goes to first focusable after main (footer on placeholders, 'Lees meer' on home); only deviation when URL already has #main (browser sets focus start point). Asked user to retest K1/K2 without #main. SOCIALS spelled out: CSS uppercase read as acronym by mobile screen readers; created construction/plans/frontend-shell-bt-questions.md (aria-label / 'Social media' / 'Volg mij')." + +**Context**: CONSTRUCTION - Build and Test; fixing manual test findings + +--- + +## Build and Test - Retest and Socials Fix + +**Timestamp**: 2026-10-18T14:56:51Z + +**User Input**: "k2 skipped nu het menu en hij zet de focus bij de eerstvolgende tab in de Hero. dus dat is nu wel goed. K1 is ook gefixed. +Verder heb ik de vraag ook beantwoord" + +**AI Response**: "K1/K2 confirmed fixed by owner. Question 1 answered A: added aria-label={title} to FooterColumn h2 headings; Footer test asserts the labels. Lint, format, 82 tests, build pass. Updated build-and-test-summary.md with manual test results. Asked owner to retest 'Socials' on mobile screen reader and for the Operations decision." + +**Context**: CONSTRUCTION - Build and Test; awaiting retest and Operations decision + +--- + +## Build and Test - Socials Retest + +**Timestamp**: 2026-10-18T15:02:17Z + +**User Input**: "Hij spreekt Socials op mijn device wel goed uit nu. Op de desktop (Windows) leest hij nog steeds de losse letters, maar de tekst SOCIALS is visueel wel mooier dan Social Media. dus dat mag zo blijven. Die ene tekst in de footer is niet zo;n ramp" + +**AI Response**: "Recorded: mobile reads 'Socials' correctly; Windows desktop still spells it out; accepted known issue by owner. Summary updated (no open items). Operations decision still pending; re-asked." + +**Context**: CONSTRUCTION - Build and Test; awaiting Operations decision + +--- diff --git a/aidlc-docs/features/frontend-shell/construction/build-and-test/build-and-test-summary.md b/aidlc-docs/features/frontend-shell/construction/build-and-test/build-and-test-summary.md new file mode 100644 index 0000000..fca0efa --- /dev/null +++ b/aidlc-docs/features/frontend-shell/construction/build-and-test/build-and-test-summary.md @@ -0,0 +1,75 @@ +# Build and Test Summary — frontend-shell + +Run on 2026-10-18, on a clean install (`node_modules` removed, `pnpm install --frozen-lockfile`), with the full `pnpm check`: **exit 0, 225 s**. + +## Build Status +- **Build tool**: pnpm 12 + Vite 8 (`tsc && vite build`) +- **Build status**: ✅ Success +- **Clean install**: ✅ `postinstall` generated the Chakra types automatically +- **Artifacts**: `dist/` with `index.html`, hashed assets, one chunk per route, plus: + - `sitemap.xml` (home only) + - `robots.txt` + - `og-image.jpg` + - `logo.png` +- **Accepted warning**: main chunk > 500 kB (≈170 kB gzip), mostly Chakra; see performance + +## Test Execution Summary + +### Unit tests +- **Total**: 82 tests in 18 files. **Passed**: 82. **Failed**: 0. +- **Property-based**: 18 properties over 8 pure functions. The seed is logged on every run (e.g. `1344216500`). +- **Coverage**: 100% on all pure functions (enforced); ≈80% of lines overall (reported). +- **Status**: ✅ Pass + +### Integration tests +- **Scenarios**: 7 automated (`src/app.test.tsx`) + 5 build-level checks. **Passed**: all. +- **Status**: ✅ Pass + +### Performance (Lighthouse) +| Measure | Result | Target | +|---|---|---| +| Home, mobile | 82 | ≥ 80 (temporary) | +| Home, desktop | 99 | ≥ 90 | +| Other pages | 94–95 mobile, 100 desktop | ≥ 90 | +| Accessibility / Best Practices | 100 everywhere | 100 | +| SEO | 100 on indexed pages | 100 indexed | + +**Status**: ✅ Pass (with the agreed exception for home mobile) + +### Additional tests +- **Security**: ✅ Pass + - `audit:deps` clean. + - All 5 security headers present on `preview`. + - CSP test, e-mail and devtools absent from the build, only the own origin loaded. + - `audit:dev` reports 8 dev-tool advisories, non-blocking by decision. +- **Accessibility (automated)**: ✅ Pass. axe on every page and component; Lighthouse 100. +- **Manual keyboard / screen reader** ([manual-test-instructions.md](manual-test-instructions.md)), run by the owner: + - K3–K6, K9, screen reader and responsive: ✅ good. + - K7–K8: ✅ on mobile with a screen reader; desktop not testable yet (too little content). + - **K1 (skip link invisible): fixed.** Chakra's skip link has no z-index and sat under the fixed header; it now uses `zIndex: skipNav` and `margin: 0`. ✅ Retested by the owner. + - **K2 (Tab after the skip link went into the menu): resolved with K1.** ✅ Retested by the owner: focus moves to the content. + - **"SOCIALS" spelled out by a mobile screen reader**: CSS uppercase is read as an abbreviation. Footer headings now carry an `aria-label` in normal casing (owner choice A). ✅ Mobile: read correctly. Windows desktop screen reader: still spelled out; **accepted by the owner** (visual "SOCIALS" preferred over "Social media"). Option B remains available if this ever needs to change. +- **Contract tests**: N/A, no API yet. +- **E2E**: covered by integration tests in jsdom and by Lighthouse in a real browser. No separate E2E framework. + +## Extension Compliance (Build and Test) +- **PBT-08**: ✅ Compliant. + - Shrinking is on. + - Seed logged on every run and replayable with `FC_SEED`. + - Property tests are part of `pnpm check`, the future CI step. +- **SECURITY-04 / 10 / 13 / 15**: ✅ Compliant, see [security-test-instructions.md](security-test-instructions.md). +- **Other rules**: N/A at this stage. + +## Overall Status +- **Build**: ✅ Success +- **All automated tests**: ✅ Pass +- **Open**: none (one accepted known issue, see manual tests) +- **Ready for Operations**: Yes, if chosen. + +## Follow-ups (carried forward) +1. **CI/CD**: run `pnpm check` on every push. +2. **Production host**: send the same security headers. +3. **Responsive images**: from the API/CMS. +4. **Prerendering**: restores home mobile to ≥ 90 and correct link previews per page. +5. **Contact form and spam filter**: with the .NET API. +6. **Wider browser support**: once visitor statistics exist. diff --git a/aidlc-docs/features/frontend-shell/construction/build-and-test/build-instructions.md b/aidlc-docs/features/frontend-shell/construction/build-and-test/build-instructions.md new file mode 100644 index 0000000..ac18de7 --- /dev/null +++ b/aidlc-docs/features/frontend-shell/construction/build-and-test/build-instructions.md @@ -0,0 +1,54 @@ +# Build Instructions — frontend-shell + +## Prerequisites +- **Node.js** 24 (tested with v24.16.0) +- **pnpm** 12 (tested with 12.11.2) +- **Google Chrome**, only for `pnpm lighthouse` / `pnpm check` +- **Environment variables**: none required. `FC_SEED` is optional (see unit-test-instructions.md). +- **OS**: tested on Windows 11; nothing OS-specific in the build + +## Build Steps + +All commands run in `web/`. + +### 1. Install dependencies +```bash +pnpm install --frozen-lockfile +``` +- `--frozen-lockfile` installs exactly what `pnpm-lock.yaml` pins (SECURITY-10). +- `postinstall` runs `chakra typegen`, which generates the theme types (recipe variants such as `link` `subtle`) into `node_modules`. Without it, `tsc` fails on custom variants. + +### 2. Build +```bash +pnpm build +``` +This runs `tsc` (type check) and then `vite build`. + +### 3. Verify the build +- **Expected output**: `✓ built in …`, no TypeScript errors. +- **Artifacts in `dist/`**: + - `index.html` with the fallback head (title, description, Open Graph, canonical) + - `assets/` with hashed JS, CSS, fonts and images; one chunk per route + - `sitemap.xml`, generated from `src/sitePages.ts`, indexed pages only + - `robots.txt`, `og-image.jpg`, `logo.png`, `favicon.png` (copied from `public/`) +- **Accepted warning**: "Some chunks are larger than 500 kB". The main chunk is ~580 kB (≈170 kB gzip), mostly Chakra UI. It is tracked under performance (NFR-P-01 exception). + +### 4. Run the built site locally +```bash +pnpm preview # http://localhost:4173, with the production security headers +``` +Measure performance against this, not against `pnpm dev`: the dev server is unbundled, unminified and loads devtools (measured 0.47 vs 0.82 on mobile). + +## Troubleshooting + +### `tsc`: `Type '"subtle"' is not assignable to …` +- **Cause**: the Chakra typegen output in `node_modules` is missing (for example after a manual reinstall with scripts disabled). +- **Fix**: `pnpm typegen`, then build again. + +### `pnpm install` warns about the store location +- **Cause**: the global pnpm store is on another drive than the project, so pnpm cannot hard-link from it. +- **Fix**: none needed; pnpm uses a store on the project drive. Optionally set `storeDir`. + +### Vite warns about imports without a file extension in the config +- **Cause**: Vite 8's native config loader requires extensions. The config import chain uses `.ts` extensions for that reason. +- **Fix**: keep the `.ts` extensions in `vite.config.ts`, `config/*` and the modules they import. diff --git a/aidlc-docs/features/frontend-shell/construction/build-and-test/integration-test-instructions.md b/aidlc-docs/features/frontend-shell/construction/build-and-test/integration-test-instructions.md new file mode 100644 index 0000000..4e969c5 --- /dev/null +++ b/aidlc-docs/features/frontend-shell/construction/build-and-test/integration-test-instructions.md @@ -0,0 +1,38 @@ +# Integration Test Instructions — frontend-shell + +## Purpose +This feature is a single unit, so there are no cross-unit or cross-service calls. Integration here means **the real app wired together**: +- the generated route tree +- router options as in `main.tsx` (scroll restoration, default error component) +- the Chakra theme +- the shell around every page +- the head management per route +- the build-time sitemap + +## Automated scenarios (`src/app.test.tsx`, part of `pnpm test`) + +| # | Scenario | Expected | +|---|---|---| +| 1 | Every route in `sitePages` renders | Inside the shell (banner + contentinfo), exactly one `h1`, no axe violations | +| 2 | `/portfolio` head | Title "Portfolio \| Andrea Slop Fotografie", canonical `https://andreaslop.nl/portfolio`, `robots: noindex` | +| 3 | Structured data | Exactly one `application/ld+json` block of type `ProfessionalService` | +| 4 | Unknown URL `/bestaat-niet` | "Pagina niet gevonden" inside the shell, no axe violations | +| 5 | A page throws while rendering | "Er ging iets mis" inside the shell; error text not shown | +| 6 | Page registry vs route tree | Same set of paths (BR-SEO-07) | +| 7 | Page registry vs Lighthouse URLs | `lighthouserc.cjs` lists the same indexed / noindex pages | + +Also in `pnpm test`: `useRouteFocus` (focus moves to `main` after a page change) and `NavigationBar`/`Footer` with a real router (`aria-current`, link targets). + +## Build-level checks (run after `pnpm build` + `pnpm preview`) + +| Check | How | Expected | +|---|---|---| +| Deep link served | `curl -s -o /dev/null -w "%{http_code}" http://localhost:4173/portfolio` | `200` (SPA fallback) | +| Sitemap | `curl http://localhost:4173/sitemap.xml` | `200`, `text/xml`, only `https://andreaslop.nl/` | +| Robots | `curl http://localhost:4173/robots.txt` | `200`, points to the sitemap | +| E-mail address not in build | `grep -rl "info@andreaslop" dist` | No result (BR-EMAIL-01) | +| No devtools in build | `ls dist/assets \| grep -i devtool` | No result (NFR-P-04) | + +## Setup and cleanup +- **Setup**: no services. The automated tests use an in-memory router history and jsdom. +- **Cleanup**: stop `pnpm preview` (Ctrl+C). diff --git a/aidlc-docs/features/frontend-shell/construction/build-and-test/manual-test-instructions.md b/aidlc-docs/features/frontend-shell/construction/build-and-test/manual-test-instructions.md new file mode 100644 index 0000000..cd80f4c --- /dev/null +++ b/aidlc-docs/features/frontend-shell/construction/build-and-test/manual-test-instructions.md @@ -0,0 +1,44 @@ +# Manual Test Instructions — frontend-shell + +The automated tests cover structure, roles and labels (Testing Library + axe) and Lighthouse covers contrast. What they cannot judge is how the site **feels** with a keyboard and a real screen reader (NFR-A-04). Run this checklist on the built site. + +## Setup +```bash +pnpm build && pnpm preview # http://localhost:4173 +``` +- **Screen reader**: NVDA (Windows, free) with Chrome, or VoiceOver (macOS/iOS) with Safari. +- **Phone**: open `http://:4173`. For that, run `pnpm preview --host`. + +## Keyboard (no mouse) +| # | Step | Expected | +|---|---|---| +| K1 | Load `/`, press Tab once | "Direct naar de inhoud" appears top left | +| K2 | Press Enter | Focus jumps to the content; the next Tab goes to the first link in the page | +| K3 | Tab through the header | Logo, then the menu items, each with a clearly visible focus ring | +| K4 | Below 1024 px: Tab to the menu button, Enter, Escape | Menu opens; Escape closes it; the page does not scroll behind it | +| K5 | Open a page from the menu | Page starts at the top; focus is in the content (next Tab = first link in the page) | +| K6 | Browser back | Previous page at the previous scroll position | +| K7 | Scroll down, Tab to "Terug naar boven", Enter | Page scrolls up; the button disappears; focus is in the content | +| K8 | At the top of the page, Tab | "Terug naar boven" is skipped while invisible | +| K9 | Footer links | Visible focus; Facebook/Instagram open in a new tab | + +## Screen reader +| # | Step | Expected | +|---|---|---| +| S1 | List landmarks (NVDA: D / VoiceOver: rotor) | Banner, "Hoofdmenu" navigation, main, content info, "Footermenu" navigation | +| S2 | List headings (NVDA: H) | One heading level 1 per page; "Socials" and "Contact" at level 2 | +| S3 | Footer social link | "Facebook, opent in nieuw tabblad, link" (wording differs per reader) | +| S4 | Follow a menu link | The new page is read from the start of the content | +| S5 | Unknown URL `/bestaat-niet` | "Pagina niet gevonden" is read; header and footer present | +| S6 | Hero arrows and social icons | "Vorige foto", "Volgende foto", "Instagram, opent in nieuw tabblad" | + +## Visual / responsive +| # | Step | Expected | +|---|---|---| +| V1 | Widths 320, 390, 820, 1440 and ultrawide (DevTools device toolbar) | No horizontal scrolling, nothing cut off | +| V2 | Footer brand column | Mobile: logo and tagline centred, stacked. Tablet and desktop: logo with the tagline beside it | +| V3 | 32:9 screen | "Terug naar boven" aligns with the content edge, not the screen corner | +| V4 | Browser zoom 200% | Everything readable, nothing overlaps | +| V5 | OS "reduce motion" on | No smooth scrolling or slide/fade animations on the to-top button | + +Record findings with page, step and browser/reader, and report them as a bug (Bug Fix lane) or a change request. diff --git a/aidlc-docs/features/frontend-shell/construction/build-and-test/performance-test-instructions.md b/aidlc-docs/features/frontend-shell/construction/build-and-test/performance-test-instructions.md new file mode 100644 index 0000000..bd3570f --- /dev/null +++ b/aidlc-docs/features/frontend-shell/construction/build-and-test/performance-test-instructions.md @@ -0,0 +1,40 @@ +# Performance Test Instructions — frontend-shell + +## Purpose +This is a static front-end without a server, so load, stress and throughput testing do not apply (NFR scalability: N/A). Performance here means **page-load quality as a visitor experiences it**, measured with Lighthouse. + +## Requirements (NFR-P-01) +- **Performance**: ≥ 90 on every page, mobile and desktop. + - **Temporary exception**: home page on mobile ≥ 80, until responsive images come from the API/CMS and prerendering exists. +- **Accessibility, Best Practices**: 100 on every page. +- **SEO**: 100 on indexed pages. On `noindex` pages only the "is crawlable" audit may fail. + +## Run +```bash +pnpm build +pnpm lighthouse # mobile (lighthouserc.cjs), then desktop (lighthouserc.desktop.cjs) +``` +- Lighthouse CI starts `pnpm preview` itself (port 4173, real security headers). +- It measures all six routes plus `/bestaat-niet` (404) once per form factor. +- It fails if any assertion fails. +- Reports are written to `.lighthouseci/` (git-ignored). Open the `.html` files for details. +- Requires a local Chrome. + +Manual measurement in a browser: `pnpm build && pnpm preview`, then open `http://localhost:4173` in a **private window** (extensions and Brave Shields skew results) and run Lighthouse from DevTools. + +## Results (2026-10-18, clean install) + +| Page | Mobile Perf | Desktop Perf | A11y | Best Pr. | SEO | +|---|---|---|---|---|---| +| `/` | **82** (target 80) | 99 | 100 | 100 | 100 | +| `/over-mij`, `/portfolio`, `/soorten-fotoshoots`, `/contact`, `/privacyverklaring` | 94 | 100 | 100 | 100 | 69 (noindex, accepted) | +| `/bestaat-niet` (404) | 95 | 100 | 100 | 100 | 58 (noindex, no description; accepted) | + +Home page mobile: LCP ≈ 4.3 s (simulated slow 4G), total download ≈ 1.2 MB, CLS ≈ 0. + +## Known bottlenecks and follow-ups +- **Responsive images**: the first hero photo is 2560 px wide (≈325 KB), also on a phone. The fix is image variants per width from the API/CMS or an image service, used via `srcset`. +- **Render after JavaScript**: the hero title appears only after the JS bundle (≈170 kB gzip, mostly Chakra) has loaded. Prerendering (planned with hosting) fixes this. +- **Already done in this feature**: + - Hero slides load just-in-time (active, next, previous), so the download went from 2.6 MB to 1.2 MB. + - The logo is sized correctly (`htmlWidth`/`htmlHeight`). diff --git a/aidlc-docs/features/frontend-shell/construction/build-and-test/security-test-instructions.md b/aidlc-docs/features/frontend-shell/construction/build-and-test/security-test-instructions.md new file mode 100644 index 0000000..79d7bc9 --- /dev/null +++ b/aidlc-docs/features/frontend-shell/construction/build-and-test/security-test-instructions.md @@ -0,0 +1,44 @@ +# Security Test Instructions — frontend-shell + +## Dependency scan (SECURITY-10, NFR-SEC-05) +```bash +pnpm audit:deps # blocking: packages that ship with the site +pnpm audit:dev # report only: all packages incl. dev tools +``` +- **`audit:deps`**: expected "No known vulnerabilities found". +- **`audit:dev`**: reports advisories in dev-only tools and never blocks. Status on 2026-10-18: 5 high, 2 moderate, 1 low. + - 7 of them via `@lhci/cli`, 1 via `@chakra-ui/cli`. + - None of these packages end up in `dist/`. + - Review this list periodically, and when you update those tools. +- **`source-map-js`**: held at ≥ 1.2.2 through an override in `pnpm-workspace.yaml` (GHSA-68fv-2mgg-jv7q). + +## HTTP security headers (SECURITY-04) +Automated: `config/securityHeaders.test.ts` checks that the production CSP has: +- no `unsafe-eval` +- no `unsafe-inline` for scripts +- no `ws:` +- `frame-ancestors 'none'` + +Against the built site: +```bash +pnpm build && pnpm preview +curl -sI http://localhost:4173/ +``` +Expected: +- `Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'` +- `Strict-Transport-Security: max-age=31536000; includeSubDomains` (browsers only honour it over HTTPS) +- `X-Content-Type-Options: nosniff` +- `X-Frame-Options: DENY` +- `Referrer-Policy: strict-origin-when-cross-origin` + +The production host must send the same set; that is a follow-up for Operations. + +## Other checks +| Check | Covered by | +|---|---| +| External links use `rel="noopener noreferrer"` and only `https:` | Footer and Hero tests, `visibleSocials` property tests | +| JSON-LD cannot close its `