Phase 1: PWA auto-update, player-view map fit fix, encounter picker

- PWA registerType autoUpdate + skipWaiting/clientsClaim/cleanupOutdatedCaches so
  a fresh deploy reaches browsers without a manual hard-reload (the old 'prompt'
  served the stale cached bundle, hiding shipped fixes like the polygon outline).
- MapCanvas: always mount the outer container so the ResizeObserver binds even when
  the map image arrives late over WebSocket — fixes the networked player view
  showing the map at 100% instead of fit ("3x magnified").
- TokenPalette: encounter picker for planned AND active encounters (was active-only),
  with per-encounter "+ All" and counts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 14:26:00 +02:00
parent 2879059ba5
commit ca3769eb6b
4 changed files with 79 additions and 17 deletions
+7 -1
View File
@@ -32,7 +32,9 @@ export default defineConfig({
tailwindcss(),
cspPlugin(),
VitePWA({
registerType: 'prompt',
// autoUpdate so a fresh deploy is fetched + activated without a manual
// hard-reload (the old 'prompt' kept serving the stale cached bundle).
registerType: 'autoUpdate',
includeAssets: ['favicon.svg'],
manifest: {
name: 'TTRPG Manager',
@@ -51,6 +53,10 @@ export default defineConfig({
globPatterns: ['**/*.{js,css,html,svg,png,woff2}'],
// SRD data chunks can be large; allow them to be precached.
maximumFileSizeToCacheInBytes: 6 * 1024 * 1024,
// Take over and drop stale precaches as soon as a new build is live.
skipWaiting: true,
clientsClaim: true,
cleanupOutdatedCaches: true,
},
}),
],