3 Commits

Author SHA1 Message Date
Henrik Jess Nielsen
b640d9950c feat(pwa): offline support so the list works in-store with no net
No signal inside the store made the server-rendered app unusable. Make it
an installable PWA:
- service worker (static/sw.js) caches pages (network-first, cache fallback)
  and assets, served from root so scope is /
- offline.js: cittiFetch() queues check-off / price / qty / pick POSTs in
  localStorage when offline and replays them in order on reconnect, with an
  optimistic response and an Offline/Syncing status badge
- manifest + icon for add-to-home-screen; PWA meta tags on the in-store pages
- in-store mutations (saveToServer, pick/unpick) go through cittiFetch;
  archive/refresh/add still need net by design
- Dockerfile copies static/
Open once online first so the SW can cache; then it works offline.
2026-10-30 11:54:38 +01:00
Henrik Jess Nielsen
8dd435a7d0 feat(offers): Danish translation and AI matching via Claude
Offers come from the German avis, so add Claude-backed language help,
reusing BlaaAi's ANTHROPIC_API_KEY + Haiku pattern. Both degrade
gracefully: without a key, offers stay German and the token heuristic
still matches.

- Translate offer headings DE→DA in the fetch job, cached per heading
  in a translations table (only new headings cost a call). UI shows
  Danish primary + German subtitle for in-store navigation.
- AI match the fixed list against offers (offer_matches table): Claude
  returns same-product matches, far more precise than the token
  heuristic (which false-matched e.g. Nutella jar → advent calendar).
  load_deals() prefers AI matches, falls back to the heuristic.
- Haiku 5.5 by default (MATCH_MODEL/TRANSLATE_MODEL env overridable to
  Sonnet); no temperature param (Haiku 5.5 rejects non-default).
- requirements: add anthropic
2026-10-30 11:02:47 +01:00
Henrik Jess Nielsen
3b0ea28db5 feat(koeb-nu): read-only "buy now" shopping status vs current offers
Add a /koeb-nu page that analyses the list without touching quantities:
- which fixed items are on offer in Lübeck right now (honest per-unit
  offer price in EUR + DKK, no fabricated saving vs the Danish-origin
  estimate, since the units differ)
- what still needs ticking off, grouped by section (+ picked offers)
- a selection of this week's cheapest Tilbud specials not on the list,
  linking to the full Tilbud page
Header gets a 🛒 Køb nu link. The source carries no pre-price, so no
discount % is shown.
2026-10-30 10:43:22 +01:00