Skip to content

F8.1 — PWA manifest + service worker + install prompt #122

Description

@Flow-Fly

Parent: F8 (PWA). Self-contained; no backend dependency.

Recipe

  1. Adopt vite-plugin-pwa (in vite.config.ts) — it generates the manifest, registers the service worker, and handles Workbox precaching of the built shell. Config:
    • registerType: 'prompt' (NOT autoUpdate): an art tool must never swap code under an unsaved drawing session. Show a small "Update available — restart" toast wired to needRefresh from virtual:pwa-register.
    • Precache: all built assets (default globPatterns). navigateFallback: 'index.html' for offline SPA loads.
    • NetworkOnly / no runtime caching for any future API origin — add the rule now with a comment pointing at F2 (sync must never be served stale by the SW).
  2. Manifest: name "Pixel Forge", display: 'standalone', theme/background colors from the app's dark UI, icons 192/512 + maskable (generate from the app logo into public/icons/; create a simple pixel-art icon if none exists).
  3. Install prompt UX: listen for beforeinstallprompt, stash the event, surface a menu item "Install app" in pf-menu-bar.ts (hidden when already installed / event unavailable). No nagging banners.
  4. Update flow test plan (manual, document in the PR): deploy A → install → deploy B → toast appears → restart loads B; offline: devtools offline → reload → app loads and edits persist to IndexedDB.
  5. CI: build must fail loudly if SW generation breaks (vite build already covers this once the plugin is in).

Acceptance

  • Lighthouse PWA installability checks pass.
  • Full offline session works: launch offline, draw, auto-save, reload offline, work is there.
  • Updates require explicit user confirmation; no stale-forever cache and no mid-session code swap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentic-loopTracked by the reusable agentic loop workflowenhancementNew feature or requestrisk:mediumMedium-risk work touching shared behavior, architecture, or broader design

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions