Marks the portfolio page as built and tested
Continuous Integration / check (pull_request) Successful in 13m30s
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / lighthouse (pull_request) Successful in 14m13s
Continuous Integration / deploy-production (pull_request) Skipped

Records the build and test results (full suite, integration scenarios,
Lighthouse in CI and locally) and completes the feature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 20:25:19 +01:00
co-authored by Claude Opus 5.5
parent 9efa7fc596
commit 2246986d77
8 changed files with 141 additions and 7 deletions
@@ -0,0 +1,26 @@
# Build and Test Summary — Portfolio Page
## Build
- **Tool**: pnpm + Vite (`tsc && vite build`)
- **Status**: ✅ Success (9efa7fc)
- **Artifacts**: `web/dist/` — route chunk `portfolio-*.js` 2.6 kB gzip, lazy `Lightbox-*.js` 15.4 kB gzip, main bundle +0.1 kB gzip versus master
## Tests
| Kind | Result |
|---|---|
| Unit + component + property-based | ✅ 82 files, 460 tests; coverage thresholds met (100% `lib/**`, `seo.ts`, `sitemap.ts`; 95.3% overall) |
| Integration (route tests, gallery) | ✅ 6 scenarios, see integration-test-instructions.md |
| Accessibility (axe in tests; Lighthouse 1.0) | ✅ incl. the open lightbox |
| Performance (Lighthouse) | ✅ CI run 580 (mobile + desktop); locally `/portfolio` 0.91; pre-existing local borderline on `/`, `/soorten-fotoshoots`, `/contact` (same on master) |
| Security | ✅ no new dependencies; `?shoot=` allowlisted and never rendered (tested with `<script>`); CSP unchanged; `pnpm audit:deps` passes (dev-tool findings are informational, NFR-SEC-05) |
| E2E / browser | Deployed to test (run 580); reviewed by the user before this stage |
## Extension compliance
- **Security Baseline**: SECURITY-04, 05, 09, 10, 11, 13, 15 compliant; others N/A (no data stores, auth, server or infrastructure)
- **PBT**: PBT-01..10 compliant (properties identified in functional design, generators in `src/test/arbitraries.ts`, seed logging, example tests alongside)
## Overall
- **Build**: Success · **Tests**: Pass · **Operations phase**: No (decided at Requirements Analysis)
## Next
Open a PR from `feature/portfolio-page` to master. Merging deploys master to test; production stays a manual `release/*` step.
@@ -0,0 +1,23 @@
# Build Instructions — Portfolio Page
## Prerequisites
- **Build tool**: pnpm 12.11.2 (`packageManager` in `web/package.json`), Node 24
- **Dependencies**: from `web/pnpm-lock.yaml`; no new dependency in this feature
- **Environment variables**: none
- **System**: any OS supported by Node 24; Chrome for Lighthouse
## Build Steps
```bash
cd web
pnpm install --frozen-lockfile # also runs `chakra typegen` (theme: swap duration, filterControl recipe)
pnpm build # tsc && vite build
```
## Verify
- `dist/` with, among others, `assets/portfolio-*.js` (route, ~2.6 kB gzip), `assets/Lightbox-*.js` (lazy chunk, ~15.4 kB gzip), `assets/index-*.js` (main, ~150 kB gzip; +0.1 kB gzip versus master), 20 portfolio photos and `og-portfolio.jpg`
- `sitemap.xml` lists `/portfolio`
- Known warning: chunk size > 500 kB for the main bundle (pre-existing)
## Troubleshooting
- **Type errors on Chakra tokens/recipes** after a theme change: run `pnpm typegen`.
- **Missing photos**: the assets are committed in `web/src/assets/portfolio/`; they were produced once with a local `System.Drawing` script (not part of the build).
@@ -0,0 +1,16 @@
# Integration Test Instructions — Portfolio Page
The units meet in the route tests (`web/src/app.test.tsx`, real route tree and router) and in `PortfolioGallery.test.tsx`; both run in `pnpm test`.
## Scenarios
| # | Units | Scenario | Covered by |
|---|---|---|---|
| 1 | 1 + 3 | `/portfolio` and `/` both render the shared `InstagramGrid`; without a valid Instagram link it is left out | `app.test.tsx` (portfolio, homepage) |
| 2 | 2 + 3 | Filter → grid → lightbox: filtered list, caption from the shoot type, counter within the filter, lightbox closes on a filter change | `PortfolioGallery.test.tsx` |
| 3 | 3 + router | `?shoot=gezin` starts filtered; `onzin`, `loveshoot`, `<script>` show "Alles"; choosing a filter replaces the URL (no history entry); canonical without parameters | `app.test.tsx` |
| 4 | 3 + Soorten fotoshoots | "Bekijk meer …foto's" only for newborn, zwangerschap, gezin while `/portfolio` is indexed | `app.test.tsx` (shoot types page) |
| 5 | 3 + SEO registry | `/portfolio` indexed, in the sitemap and in Lighthouse's indexed paths (sync test) | `app.test.tsx`, `sitemap.test.ts` |
| 6 | 2 + hero | Hero swipe and wrap unchanged after moving to `useSwipe` / `wrapIndex` | Hero tests (unchanged) |
## Manual check on test
After `deploy_test` (done: run 580), open https://test.andreaslop.nl/portfolio on desktop and phone: masonry 1/2/3 columns without shifting, filter row on one line, lightbox (tap, swipe, bottom bar on phones, Escape, focus back to the photo), and the three links on /soorten-fotoshoots.
@@ -0,0 +1,26 @@
# Performance Test Instructions — Portfolio Page
No load testing: static site. Performance is measured with Lighthouse CI.
```bash
cd web
pnpm lighthouse # lhci autorun (mobile) && lhci autorun --config=lighthouserc.desktop.cjs
```
## Targets and results
| Page | Mobile target | Local result | CI (run 580, Pi) |
|---|---|---|---|
| `/portfolio` | 0.9 | 0.91 (dedicated runs) | ✅ pass |
| `/` | 0.8 | 0.77 (master 0.78) | ✅ pass |
| `/soorten-fotoshoots` | 0.85 | 0.84–0.86 (master 0.84) | ✅ pass |
| `/contact` | 0.9 | 0.87 (master 0.87) | ✅ pass |
| all pages, desktop | 0.9 | ✅ | ✅ pass |
Accessibility, best practices and SEO: 1.0 on every page (mobile and desktop).
## Findings fixed in this feature
- Filter bar re-wrapping when the web font loaded caused CLS 0.119 → single non-wrapping row, CLS 0.001
- Three eager (but fading-in) grid photos delayed the fonts and the intro text (LCP 4.5 s) → no eager photos, LCP 2.9 s (user decision)
## Known, pre-existing
Locally `/`, `/soorten-fotoshoots` and `/contact` sit at or just below their mobile budgets on this PC, equally on master; CI on the Pi passes. Tracked in the memory note "Open follow-ups".
@@ -0,0 +1,15 @@
# Unit Test Execution — Portfolio Page
```bash
cd web
pnpm test # vitest run with v8 coverage; fast-check seed is logged (config/testSeed.ts)
```
## Expected
- 82 test files, 460 tests, 0 failures (as of 9efa7fc)
- Coverage thresholds met: 100% for `src/lib/**`, `src/seo.ts`, `src/sitemap.ts` (incl. the new `portfolioFilters`, `wrapIndex`, `swipeDirection`, `masonryRowSpan`, `neighbourIndexes`, `lightboxReducer`, `galleryImages`); overall 95.3% statements
- Property-based tests (PBT-02..07): round-trip (`wrapIndex`, `shootFromSearch`), invariants, idempotence (`filterPhotos`, `wrapIndex`), oracles (`neighbourIndexes`, `shootTypesWithPhotos`, `toGalleryItems`), stateful (`lightboxReducer`); a failure prints the seed and the shrunk counterexample — rerun with that seed
## jsdom limits handled in tests (documented in the test files)
- The dialog's focus trap needs layout boxes: the focus test stubs `getClientRects`
- Chakra removes a closed dialog after its fade-out, which needs real animation events: tests check `data-state="closed"` and the callbacks