Aligns the page edges with the design and fixes the Contact anchor offset
The content column now uses the design's gutter as side padding instead of Chakra's 16/24/32px. The Lifestyle fotografie row on phones bled out by the gutter, so the page was 4px too wide and Chrome zoomed out slightly. The header drops its extra padding and the to-top button follows the gutter, so logo, hero controls and content share one edge. Anchored sections now scroll to the height of the shrunken header, so Contact lands right below it instead of 24px lower. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+52
@@ -0,0 +1,52 @@
|
||||
# Build and Test Summary — homepage-sections
|
||||
|
||||
## Build
|
||||
- **Tool**: pnpm + Vite (`tsc && vite build`)
|
||||
- **Status**: ✅ Success (built in ~2.5 s locally; CI `check` job green on the Pi and on the PC runner)
|
||||
- **Artifacts**: `web/dist/`
|
||||
|
||||
## Unit tests
|
||||
- **Total**: 244 in 53 files. **Passed**: 244. **Failed**: 0.
|
||||
- **Coverage**: `src/lib/` 100%, overall ~92% of statements
|
||||
- **Status**: ✅ Pass
|
||||
|
||||
## Integration (whole homepage)
|
||||
- **Automated, in the suite**: section order with one h1 and axe clean; "Boek Newborn" scrolls to Contact and selects the package; `?pakket=` selects, tidies and focuses; Instagram absent without a valid https link. ✅
|
||||
- **Browser, production build, 1440 px and 390 px phone** (scenarios in `integration-test-instructions.md`):
|
||||
|
||||
| Scenario | Result |
|
||||
|---|---|
|
||||
| Section order | ✅ |
|
||||
| Layout shift while scrolling the whole page | ✅ 0.0008 / 0 |
|
||||
| All three "Boek" buttons | ✅ after fixes 1 and 2 below |
|
||||
| Keyboard focus on the Instagram tiles | ✅ |
|
||||
| Horizontal overflow, 7 pages × 5 widths | ✅ after fix 1 below |
|
||||
| No new image requests from Instagram | ✅ |
|
||||
|
||||
### Found and fixed in this stage
|
||||
1. **Phones: the page was 4 px too wide.**
|
||||
- Cause: Chakra's `Container` padded 16 / 24 / 32 px, while the design's `.container` uses `--gutter` (clamp(20 px, 4vw, 48 px)). The Lifestyle fotografie row bleeds out by the gutter, so it stuck out 4 px on both sides.
|
||||
- Effect: Chrome widened the layout viewport to 394 px, and the page could be nudged sideways.
|
||||
- Fix (the owner chose to follow the design everywhere): `Container` pads with `gutter`. The header loses its extra padding from the first hero commit, and the to-top button aligns with the gutter. The logo, hero controls and content now share one edge.
|
||||
2. **Desktop: Contact landed 24 px below the header.**
|
||||
- Cause: the scroll margin was the full header height (92 px), but the header has shrunk to 68 px by the time the page reaches Contact.
|
||||
- Fix: anchored sections use the sticky header height (`spacing.header.sticky`).
|
||||
|
||||
## Performance (Lighthouse CI, production build)
|
||||
| Page | Mobile | Desktop |
|
||||
|---|---|---|
|
||||
| Homepage | 0.83 (budget 0.8) | 1.0 |
|
||||
| Other pages | 0.94–0.95 (budget 0.9) | 1.0 |
|
||||
|
||||
Accessibility and best practices are 1.0 on every page, and SEO passes everywhere. CI `lighthouse` job: ✅ (reporting only).
|
||||
|
||||
Two things disturb local measurements: a busy machine, and the CI Lighthouse job on the PC runner. That job uses `--network host`, so it occupies port 4173 and makes a local `pnpm check` fail with "port in use". See `performance-test-instructions.md`.
|
||||
|
||||
## Additional
|
||||
- **Security**: `pnpm audit --prod` clean. The new section adds no new dependencies or external resources. External links use `noopener noreferrer`, and only https links are rendered.
|
||||
- **Contract / E2E suite**: N/A (static front end without an API). The browser checks above cover the user flows.
|
||||
|
||||
## Overall
|
||||
- **Build**: ✅ **Tests**: ✅ **Performance budgets**: ✅
|
||||
- **Test environment**: test.andreaslop.nl was updated with unit 6 (run 557). The layout fixes are deployed in a follow-up run.
|
||||
- **Ready for Operations**: yes, depending on the owner's decision about the Operations phase
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
# Build Instructions — homepage-sections
|
||||
|
||||
## Prerequisites
|
||||
- **Node.js** 24 and **pnpm** (version pinned in `web/package.json`)
|
||||
- **OS**: Windows, Linux or macOS. CI builds on the Raspberry Pi runner (arm64).
|
||||
- **Environment variables**: none for the build. `LIGHTHOUSE_PERFORMANCE=warn` only in CI (see performance instructions)
|
||||
|
||||
## Build steps
|
||||
```bash
|
||||
cd web
|
||||
pnpm install # also runs `chakra typegen` (postinstall)
|
||||
pnpm build # tsc && vite build
|
||||
```
|
||||
|
||||
After changing theme tokens (`src/theme.ts`), run `pnpm typegen` so token names such as `header.sticky` type-check.
|
||||
|
||||
## Verify
|
||||
- **Expected output**: `✓ built in …s` and no TypeScript errors
|
||||
- **Artifacts**: `web/dist/` (`index.html`, `assets/*.js|css|jpg|png`)
|
||||
- **Accepted warning**: Vite's chunk-size warning for the main bundle (`index-*.js`, ~575 kB unminified size before gzip). This is known and tracked under responsive images and prerendering (NFR-P-01).
|
||||
|
||||
## Troubleshooting
|
||||
- **Unknown token type errors after a theme change** → `pnpm typegen`.
|
||||
- **Lighthouse or preview fails with "port in use"** → a preview server is still running on 4173. Stop it first.
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
# Integration Test Instructions — homepage-sections
|
||||
|
||||
The six units are sections of one page, so "integration" means how they behave together on the real homepage.
|
||||
|
||||
## Automated (in `pnpm test`, `src/app.test.tsx`)
|
||||
- **Section order**: Hero → Lifestyle fotografie → Over mij → Prijzen → Lieve woorden → Contact → Instagram, exactly one h1, axe clean on the whole page
|
||||
- **Prijzen → Contact**: a click on "Boek Newborn" scrolls to `#contact` and selects Newborn. A `?pakket=` link selects the package, tidies the URL and focuses Contact.
|
||||
- **siteContent → Instagram**: the section is absent when the Instagram link is missing or not https
|
||||
|
||||
## In a real browser (production build)
|
||||
Run against `pnpm build && pnpm preview`, with headless Chrome (puppeteer-core and chrome-launcher are already installed as Lighthouse dependencies) or by hand, at 1440 px and at an emulated 390 px phone:
|
||||
|
||||
| # | Scenario | Expected |
|
||||
|---|---|---|
|
||||
| 1 | Scroll the whole homepage in steps | Cumulative layout shift < 0.1 (measured 0.0008 / 0) |
|
||||
| 2 | Each "Boek …" button, starting from the top | Contact's top edge lines up with the bottom of the (shrunken) header, the select shows the package, the URL ends in `/#contact` |
|
||||
| 3 | Tab from the Instagram handle to the first tile | 2px focus ring visible on top of the neighbouring tiles; the photo zooms in |
|
||||
| 4 | Every page at 320, 390, 768, 1024 and 1440 px | `scrollWidth === innerWidth`: no horizontal overflow |
|
||||
| 5 | Network panel while scrolling the homepage | The Instagram section requests no new images |
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
# Performance Test Instructions — homepage-sections
|
||||
|
||||
A static site: there is no load or throughput testing. Performance means page-load performance, measured with Lighthouse CI.
|
||||
|
||||
```bash
|
||||
cd web
|
||||
pnpm build
|
||||
pnpm lighthouse # mobile (lighthouserc.cjs) then desktop (lighthouserc.desktop.cjs)
|
||||
```
|
||||
|
||||
## Budgets
|
||||
- **Performance**:
|
||||
- homepage on mobile ≥ 0.8. This is a temporary budget until responsive images and prerendering arrive (NFR-P-01).
|
||||
- every other page on mobile ≥ 0.9.
|
||||
- every page on desktop ≥ 0.9.
|
||||
- **Accessibility and best practices**: 1.0 on every page
|
||||
- **SEO**: the basic audits on every page; `is-crawlable` only on indexed pages
|
||||
|
||||
## Measuring reliably
|
||||
- Measure the **production build**. The Vite dev server (`pnpm dev`) serves 137 unbundled modules and scores ~0.55 on desktop and ~0.36 on mobile, which says nothing about the site.
|
||||
- Lighthouse throttles the CPU relative to the machine's own speed. A busy machine (a game, a dev server rebuilding) scatters the homepage mobile score between 0.68 and 0.84. Compare `environment.benchmarkIndex` in the report: when it is far below ~3500–4200, rerun on a quiet machine.
|
||||
- In CI the Raspberry Pi scores 30–40 points lower, so performance is reported there and does not block (`LIGHTHOUSE_PERFORMANCE=warn`).
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
# Unit Test Execution — homepage-sections
|
||||
|
||||
```bash
|
||||
cd web
|
||||
pnpm test # vitest run --coverage
|
||||
```
|
||||
|
||||
- **Expected**: 53 files, 244 tests, 0 failures (count at the end of unit 6)
|
||||
- **Coverage**: `src/lib/` (all business logic) at 100%. The suite overall is ~92% of statements.
|
||||
- **Includes**: axe checks per section and per page, property-based tests (fast-check) for the contact form logic, and app-level tests through the real route tree (`src/app.test.tsx`)
|
||||
- **Report**: terminal output plus `web/coverage/`
|
||||
- jsdom has no layout or scrolling, so anything about positions, sizes and scroll behaviour is checked in the browser instead (see integration instructions).
|
||||
Reference in New Issue
Block a user