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.
This commit is contained in:
Henrik Jess Nielsen
2026-10-30 11:54:38 +01:00
parent 1dec3b7bd8
commit b640d9950c
9 changed files with 206 additions and 3 deletions

9
static/icon.svg Normal file
View File

@@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
<rect width="512" height="512" rx="96" fill="#c84b2f"/>
<g fill="none" stroke="#fff" stroke-width="26" stroke-linecap="round" stroke-linejoin="round">
<path d="M120 150h40l40 190h170l34-130H190"/>
<circle cx="214" cy="386" r="22" fill="#fff" stroke="none"/>
<circle cx="360" cy="386" r="22" fill="#fff" stroke="none"/>
</g>
<text x="256" y="250" font-family="DM Sans, Arial, sans-serif" font-size="150" font-weight="700" fill="#fff" text-anchor="middle">C</text>
</svg>

After

Width:  |  Height:  |  Size: 578 B