Gives a featured package a quiet highlight and makes the optional CMS fields explicit

A featured card gets a heidegroen top rule, border and a small "Uitgelicht"
tab on its top edge; the tab sits on the border so the row keeps its layout.
Tests and docs state that the site does not depend on description, price note
or button label.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 14:15:23 +01:00
co-authored by Claude Sonnet 5.5
parent 9e8a876cd1
commit ba7288526b
4 changed files with 83 additions and 1 deletions
+2
View File
@@ -12,6 +12,8 @@ Source: `GET /api/v1/offerings`. One list feeds the price cards on the home page
1. At build time `web/config/fetchOfferings.ts` (the first step of `pnpm build`) asks `OFFERINGS_URL` (10 s timeout, 2 attempts) and writes the gitignored `web/src/content/offerings.generated.json`. The packages are baked into the prerendered HTML (search engines see the prices, no layout jump).
2. Without `OFFERINGS_URL`, with a CMS that is down or with an unusable answer, the committed `web/src/content/offerings.snapshot.json` is used. The build never fails and never shows empty prices; the log says which source was used. Tests always use the snapshot.
3. After hydration `PackagesProvider` (`web/src/components/PackagesProvider/`) asks the CMS once and replaces the baked list only if the answer differs. A network error, time-out (8 s), bad status or invalid answer keeps what was baked. A change in the CMS therefore shows at once; the nightly build only matters for search engines.
- **Featured package** (the star in the CMS admin, field `featured`): the card gets a heidegroen rule along its top, a heidegroen border and a small "Uitgelicht" tab on the top edge (`PriceCard`). The tab is positioned on the border, so the cards of a row keep the same layout. Any number of cards may be featured.
- **Description, price note and button label** (`description`, `priceNote`, `ctaLabel`) are optional in the CMS and the site does not use them: they are not shown and a card never depends on them (empty, `null` or absent all give the same card; covered by tests).
- **Scheduling in the CMS:** the API only returns packages that are live at the moment of the request (switched on and inside their from/to dates), so the site shows them and nothing else. The baked list reflects the moment of the build; the live refresh after hydration corrects it for every visitor, and the nightly build corrects it for search engines. A package that goes live or expires between two builds is therefore right in the browser but can be stale in the HTML until the next build.
- **Keep the snapshot current** when the real packages change (prices, features), because production builds use it (see "Reverse proxy" below).