Task 96ab3c0b: PWA manifest and service worker #189

Member

Maestro task: 96ab3c0b-7554-4098-8af1-2be7815f8929 (Feature 19 - Admin PWA).

Done condition: the app installs as a PWA — a web app manifest and a service worker are served, an installability check passes, and the offline shell loads.

Head: fb432fda5a
Base: feature/24ce7ebf-40cc-432f-976d-f0814b8a375c-admin-pwa @ 75ad989

Delivers admin/public/manifest.webmanifest, admin/public/sw.js, three committed PNG icons, admin/src/pwa/register.ts wired from main.tsx, index.html manifest/theme-color/apple-touch-icon links, and admin/src/pwa/pwa.test.ts. Checks: npm run build exit 0; npm test 51 passed (7 files).

Maestro task: 96ab3c0b-7554-4098-8af1-2be7815f8929 (Feature 19 - Admin PWA). Done condition: the app installs as a PWA — a web app manifest and a service worker are served, an installability check passes, and the offline shell loads. Head: fb432fda5a5ca1a9de6af47deff7150a3c18497c Base: feature/24ce7ebf-40cc-432f-976d-f0814b8a375c-admin-pwa @ 75ad989 Delivers admin/public/manifest.webmanifest, admin/public/sw.js, three committed PNG icons, admin/src/pwa/register.ts wired from main.tsx, index.html manifest/theme-color/apple-touch-icon links, and admin/src/pwa/pwa.test.ts. Checks: npm run build exit 0; npm test 51 passed (7 files).
dev_agent added 1 commit 2026-09-23 19:26:05 -04:00
- 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>
overseer added 1 commit 2026-09-23 19:31:06 -04:00
- Add a build-only Vite plugin (admin/vite-sw-plugin.ts) that, after the
  bundle is written, injects every same-origin script/link asset referenced
  by dist/index.html into dist/sw.js's precache, so the offline shell renders
  immediately after install (PWA-001).
- Replace the literal cache version with a build revision (sha256 of the built
  index.html and sw.js source, truncated) used in both cache names, so each
  release installs a new worker with fresh caches (PWA-002).
- On activate, delete only stale nestquest-admin-* caches; unrelated
  same-origin caches survive (PWA-003).
- Add Vitest regressions for all three findings.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
overseer added 1 commit 2026-09-23 19:37:50 -04:00
The build revision now hashes index.html, the sw.js source, the web app
manifest and every precached icon (sorted by path, length-prefixed), so a
deploy that changes only the manifest or an icon ships a new worker and
fresh caches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-5.6-terra review completed for this exact commit.

Independent Codex gpt-5.6-terra review completed for this exact commit.
dev_agent merged commit f476821e8e into feature/24ce7ebf-40cc-432f-976d-f0814b8a375c-admin-pwa 2026-09-23 19:42:28 -04:00
Sign in to join this conversation.
No Reviewers
No labels
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#189