feat(ui): installable offline PWA — service worker, manifest, icons (F5)
Tests · UI / test (push) Failing after 7m31s

Native SvelteKit service worker (src/service-worker.ts): a version-keyed
cache precaches the app shell + build artefacts (incl. core.wasm) +
static files; activate purges old caches; the gateway is never
intercepted; navigations fall back to the cached shell offline. Adds
static/manifest.webmanifest, a generated placeholder icon set
(scripts/gen-pwa-icons.mjs — dependency-free pure-Node PNG encoder), and
manifest / theme-color / apple-touch tags in app.html.

Gated by Playwright against a production preview (playwright.pwa.config.ts
+ tests/pwa/pwa.spec.ts via `pnpm test:pwa`, wired into ui-test):
manifest + installable icons, SW registration + a single version-keyed
cache, and offline shell load. Lighthouse is not used — its PWA category
was removed in v12.

Docs: ui/docs/pwa-strategy.md (+ index); F5 marked done.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-22 15:46:42 +02:00
parent c066a8958e
commit 04c7f6e68a
15 changed files with 396 additions and 2 deletions
+17 -1
View File
@@ -120,7 +120,23 @@ Acceptance: every server error → a translated actionable message;
consistent empty/loading/error states; the selected planet is visually
marked.
## F5 — PWA (was Phase 33)
## F5 — PWA (was Phase 33) — done
Installable, offline-tolerant PWA on SvelteKit's native service worker
(`src/service-worker.ts`): a version-keyed cache precaches the shell,
build artefacts (incl. `core.wasm`), and static files; `activate` purges
old caches; the gateway is never intercepted. Adds
`static/manifest.webmanifest`, a generated placeholder icon set
(`scripts/gen-pwa-icons.mjs`, dependency-free), and the manifest /
theme-color / apple-touch tags in `app.html`. Gated by Playwright against
a production preview (`pnpm test:pwa`, wired into `ui-test`): manifest +
installable icons, SW registration + single version-keyed cache, and
offline shell load. Docs: `ui/docs/pwa-strategy.md`.
**Acceptance correction:** "Lighthouse PWA ≥ 90" is dropped — Lighthouse
removed the PWA category in v12 (current line 13.x), so it is no longer a
valid gate; the Playwright checks verify the same install/offline
behaviour directly.
Goal: the web build is installable and offline-tolerant. Depends on F6
(wasm in CI) so the service worker caches a freshly-built artefact.