Add PWA manifest, icons and offline service worker to the admin app

- Static web app manifest (standalone, brand-token colours) with 192/512
  "any" icons and a 512 maskable icon, generated as real PNGs by
  admin/scripts/generate-icons.mjs (zlib only, no network).
- Hand-written public/sw.js: precaches the shell on install, prunes stale
  caches on activate, falls back to the cached index.html for offline
  navigations, serves same-origin static assets cache-first; never
  handles cross-origin or non-GET requests.
- registerServiceWorker() registers /sw.js only in production builds and
  logs on failure; called from main.tsx. index.html links the manifest,
  theme colour and apple-touch-icon.
- Vitest coverage for manifest installability, icon PNG dimensions, the
  worker's install/activate/fetch behaviour and the production guard.

Task: 96ab3c0b-7554-4098-8af1-2be7815f8929

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-23 19:22:26 -04:00
co-authored by Claude Opus 5.5
parent 75ad9892b8
commit fb432fda5a
10 changed files with 452 additions and 1 deletions
+3
View File
@@ -3,6 +3,9 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#3b3ab8" />
<link rel="manifest" href="/manifest.webmanifest" />
<link rel="apple-touch-icon" href="/icons/icon-192.png" />
<title>NestQuest Admin</title>
</head>
<body>