[Frontend] PWA scaffolding: manifest, service worker, icons #108
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
webapp/frontend/index.htmlis bare — a title and viewport meta only: no web manifest, no service worker, notheme-color, no icons. The app is neither installable nor offline-tolerant. Additionally, the theme default is hard-coded to"dark"on first visit (src/hooks/useTheme.jsx:10-11—localStorage.getItem("qb_theme") ?? "dark"), ignoringprefers-color-scheme.Motivation
Players use this on phones at the table. Installable + a sane offline fallback is table-stakes mobile polish, and the manifest/theme-color work also fixes the jarring white/dark flash mismatch for light-theme users.
Fix / Spec
vite-plugin-pwawith:theme-colormeta inindex.html./api/*— authenticated JSON must never be served stale-offline as if fresh.prefers-color-schemewhen no stored preference exists (useTheme.jsx:10-11), keeping the storedqb_themeoverride behavior intact.Acceptance criteria
References
webapp/frontend/index.htmlwebapp/frontend/src/hooks/useTheme.jsx:10-11webapp/frontend/vite.config.jsFiled from the July 2026 full-project review.
Note for whoever does the manual verification pass — this issue's first acceptance criterion can no longer be satisfied as written.
Lighthouse removed the PWA category in v12 (2024). There is no "Progressive Web App" audit in the DevTools Lighthouse panel any more, so there's no Lighthouse report that says "installable". The checks it used to run were folded into DevTools → Application.
The equivalent verification today, against
https://questboard-dev.rhoving.com(now deployed frommain):Two setup notes that will otherwise produce false failures:
https://questboard-dev.rhoving.comworks; hitting the dev host directly over plain HTTP (http://10.1.1.14:18081) will silently not register the SW, making a working PWA look broken.prefers-color-scheme) rather than changing your OS, and clearqb_themefrom Local Storage (or use Incognito) to exercise the genuine first-visit path.What was verified automatically, since it doesn't need a browser: the manifest is served as
application/manifest+json(nginx has no.webmanifestMIME entry by default — fixed in this PR), the servedindex.htmlhas zero inline scripts so nothing is blocked by thescript-src 'self'CSP,sw.js/registerSW.js/theme-init.js/icons all return 200 through the real HTTPS origin, and the generatedsw.jscontains 0 precache entries referencing/apiwith bothNetworkOnlyrules intact.What still genuinely needs a human: confirming the install prompt actually appears, and that a hard refresh while offline renders the shell rather than the browser's offline page.