Fixes the scroll to Contact from the price cards
Removing ?pakket= from the URL replaced the click's navigation before the router scrolled to #contact, and told it not to scroll, so nothing happened. The clean-up now asks the router to scroll there, below the fixed header. The review carousel's placeholder is now the longest review itself, so it matches the carousel's height at every width and no longer shifts the target while the page scrolls past it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,9 +50,14 @@ Plan: [contact-code-generation-plan.md](../../plans/contact-code-generation-plan
|
||||
First the form was moved into its own chunk, loaded when the section comes within 200 px of the screen, or at once when arriving via "Boek …". The remaining gap came from a new shared chunk (Chakra's slot-recipe factory, now used by three chunks) that the route had to fetch on page load: the price cards' `List` and the review slide's `Blockquote` were the only slot-recipe components on the route, so they became plain elements with the same styling, and the route no longer needs that chunk.
|
||||
- **Placeholder** while the form loads: measured 604 px on phones, 502 px from `sm`.
|
||||
|
||||
## Bugs found by the owner on LAN, fixed (2026-10-21)
|
||||
1. **"Boek …" did not scroll.** The click navigates to `/?pakket=<id>#contact` and the router scrolls to the hash in its `onRendered` step. Our clean-up navigation (removing `?pakket=`) ran first and passed `hashScrollIntoView: false`, so the router's last instruction was "don't scroll". Traced in real Chrome: `pushState`, `replaceState`, no `scrollIntoView`. The clean-up now asks the router to scroll to `#contact` (`smooth`, or `auto` under reduced motion). Anchored sections get `scroll-margin-top` equal to the header, so the section lands below the fixed header. A new app test clicks "Boek Newborn" on the price card and asserts the scroll to `#contact`; it fails with the old code and passes with the fix. jsdom tests missed it because `scrollIntoView` is a stub there.
|
||||
2. **"Boek Zwangerschap" scrolled less far than the others.** Smooth scrolling fixes its target when it starts. From the top card the review carousel was not loaded yet and loaded during the scroll; its fixed-height placeholder only matched the carousel at the measured widths, so `#contact` moved by +29 px (360 px wide) or −44 px (600 px) mid-scroll. The placeholder is now the longest review rendered like a slide plus the control bar's height, which is as tall as the carousel at every width. Measured at 360, 390, 412, 600, 768, 1024 and 1440 px: no movement during the scroll; every button ends at the same place.
|
||||
3. CI run 555: the Lighthouse job on the Pi runner stopped with exit code −1 right after `pnpm install`, before any measurement (runner/infra, not a check failure); rerun with the next deploy.
|
||||
|
||||
## Verification (`pnpm check`)
|
||||
- Lint ✅, Prettier ✅, build ✅ (`ContactForm` in its own chunk, ±5.7 KB gzipped)
|
||||
- Tests: 52 files, **237 passed**; 100% coverage on `src/lib/**`
|
||||
- Tests: 52 files, **238 passed** (after the fixes); 100% coverage on `src/lib/**`
|
||||
- Lighthouse home: mobile **0.83**, desktop **1.0**; accessibility, best practices, SEO **1.0**
|
||||
- Visual check: 1440 and 390 with the overlay; 1440 with the form switched on locally (reverted before the build that was checked)
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ Plan: [lieve-woorden-code-generation-plan.md](../../plans/lieve-woorden-code-gen
|
||||
The photo was too large on phones (it filled the screen). Now: phones max 180 px wide (±75% of a first 240 px step), tablets max 320 px, centred above the quote. Desktop grid `5fr 11fr` after reviewing screenshots of both, so the photo is ±75% of its earlier size (±395×495 px at 1440) and the whole block fits a ±1000 px high screen. Stacked slides align their content to the top (a short review no longer floats in the middle of the shared height) with a 1.25 rem gap between photo and text. Placeholder heights re-measured.
|
||||
|
||||
## Later change (unit 5)
|
||||
The carousel's fixed-height placeholder was replaced by the longest review rendered like a slide plus the control bar's height, so it matches the carousel at every width (a mismatch moved `#contact` during a "Boek" scroll; see the unit 5 code summary).
|
||||
|
||||
The quote is a plain `figure`/`blockquote`/`figcaption` instead of Chakra's `Blockquote`: its slot recipe pulled a shared chunk into the route bundle on page load (see the unit 5 code summary, performance).
|
||||
|
||||
## Verification (`pnpm check`)
|
||||
|
||||
Reference in New Issue
Block a user