Files
AndreaSlopFotografie/aidlc-docs/features/homepage-sections/construction/prijzen/code/code-summary.md
T
SluijsensandClaude Opus 5.5 02a7b8436d Removes the hover effect from the price cards
The lift, accent border and shadow on hovering a whole card are gone;
only the booking button keeps its hover and focus effect. Also gives the
test that waits for the lazily loaded review carousel a longer timeout,
since its first import can take over a second under the full suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 22:53:16 +02:00

4.2 KiB
Raw Blame History

Code Summary — Unit 3: Prijzen

Plan: prijzen-code-generation-plan.md. Functional design: ../functional-design/. Branch: feature/homepage-sections.

Files

Created

File Purpose
web/src/assets/home/deco-1.png, deco-2.png Design decorations, unchanged (15 KB, 42 KB)
web/src/content/packages.ts The three live packages (Zwangerschap 175, Newborn 185, Gezin 175)
web/src/lib/formatPrice.ts + test € 175 with a non-breaking space (BR-PRICE-01)
web/src/lib/visiblePackages.ts + test isValidPackage + filter with first-wins de-duplication (BR-PRICE-02)
web/src/lib/bookLabel.ts + test "Boek " up to 14 characters, else "Boek je shoot" + hidden name (BR-BOOK-02)
web/src/lib/packageFromSearch.ts + test ?pakket= → known id or undefined (BR-PARAM-01)
web/src/components/home/Pricing/Pricing.tsx + test The section: decorations, heading, card grid
web/src/components/home/Pricing/PriceCard.tsx + test One package card with the booking link

Modified

File Change
web/src/content/types.ts PricingPackage; HomeContent.pricing
web/src/content/homeContent.ts Pricing title, lead, decorations
web/src/recipes/linkButton.ts size: 'fit' — no wrapping, smaller side padding on phones (BR-BOOK-03); default unchanged
web/src/theme.ts Shadow token lift for the card hover — removed again with the card hover (change request 2026-10-20)
web/src/test/arbitraries.ts pricingPackage, uniquePackages, anyPackage
web/src/routes/index.tsx validateSearch keeps pakket only as a string; renders Pricing after AboutBlock
web/src/app.test.tsx "Prijzen" in the page order; ?pakket=newborn, ?pakket=123 and ?pakket=<script> render without errors and without reflecting the value

Notes and deviations

  • Typed link: the shared RouterLink (chakra(Link)) drops TanStack Router's route generics, so search={{ pakket }} would not type-check. The card uses the router's own Link with the linkButton recipe applied via Chakra's asChild, so the search parameter is checked against the homepage route.
  • Second decoration: the design positions it relative to the whole section; in the content box the last card covered it, so it was moved into the section's bottom padding (found in the visual check).
  • Literal special spaces: an editing tool turned  /  escapes into the characters themselves, which ESLint rejects (no-irregular-whitespace); they were written back as escapes and src was scanned for others.

Change request after testing on test (2026-10-20)

The owner removed the hover effect from the cards (lift, accent border, shadow); only the booking button keeps its effects. Removed in PriceCard.tsx, the lift shadow token in theme.ts, the static design (.price-card:hover) and the functional design.

Property-based tests (PBT)

Function Properties
formatPrice digit round-trip; starts with € + NBSP, no breaking space
visiblePackages only valid + unique ids; subsequence; idempotent; oracle on valid unique input
bookLabel name always in the full text; visible form follows the 14-character rule
packageFromSearch result undefined or a given id; any case/whitespace oracle; non-strings undefined; idempotent

Verification (pnpm check)

  • Lint ✅, Prettier ✅, build ✅
  • Tests: 38 files, 170 passed; 100% coverage on the new lib/ files (threshold)
  • Lighthouse home: mobile 0.83–0.89 across runs (LCP 2.3–3.9 s), desktop 1.0; accessibility, best practices, SEO 1.0
  • Visual check (CDP): 1440 three cards with decorations; 390 and 320 one column; "Boek Zwangerschap" stays on one line at 320 px

Extension compliance

  • Security Baseline: pakket never reflected (tested with a script-like value); only known ids come out; no new dependencies or external resources. Other rules N/A.
  • PBT: PBT-02/03/04/05 covered per the table, PBT-07 domain generators, PBT-08/09 existing setup, PBT-10 example tests alongside; PBT-06 N/A (no stateful component).