From bfcdb15606e7d8759ec94c43fcd65d6eb9ba46db Mon Sep 17 00:00:00 2001 From: amoussa1229 <166072409+amoussa1229@users.noreply.github.com> Date: Wed, 1 Jul 2026 17:58:46 +0000 Subject: [PATCH] Update PWA registration comment to match autoUpdate behavior The previous comment described prompt-mode behavior, but the SW is now configured with autoUpdate. Document the reload tradeoff explicitly so the comment no longer contradicts the VitePWA setting. Refs: #86 --- ui/src/client.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/src/client.tsx b/ui/src/client.tsx index da232592..4bdeadd3 100644 --- a/ui/src/client.tsx +++ b/ui/src/client.tsx @@ -3,9 +3,12 @@ import { StrictMode } from "react" import { hydrateRoot } from "react-dom/client" import { registerSW } from "virtual:pwa-register" -// prompt mode: a new SW installs in the background and takes over on the next -// load, so deploys never reload a tab mid-agent-run. Skip in dev — the SW -// precaches production-only build artifacts that 404 against the dev server. +// autoUpdate: vite-plugin-pwa generates a SW that calls skipWaiting and +// clientsClaim, so a new deploy activates for existing tabs. Open dashboard +// tabs may reload when the service worker takes over; this is acceptable for +// a dev/internal dashboard where silent updates are preferred over stale +// bundles. Skip in dev — the SW precaches production-only build artifacts that +// 404 against the dev server. if (import.meta.env.PROD) { registerSW() }