The Apple HIG polish pass (liquid-glass chrome, iOS SegmentedControl,
ThresholdMeter) was already on origin/main and live, but anyone with
the /water PWA installed on their home screen kept seeing the OLD UI
because the SW cache name never bumped.
Old SW had field-shell-v1 baked into its bytes for every prior deploy.
The activate handler only deletes caches that aren't SHELL_CACHE or
DATA_CACHE and start with 'field-'. Same name = no eviction = stale
HTML + chunks forever.
Bumping SHELL_CACHE to 'field-shell-v2' makes the SW bytes change,
which triggers the normal SW upgrade flow:
install → skipWaiting → activate → claim clients
The activate handler then evicts field-shell-v1 (it's now a foreign
field-* cache). On next navigation the new SHELL_CACHE is repopulated
with the fresh /water HTML + static assets, and the user gets the new
UI.
Same-origin sub-PWA for Tuxedo field workers, fully isolated from the
main Route Commerce PWA.
- public/manifest-field.json: Tuxedo-branded manifest, start_url=/water,
scope=/water, themeColor=#14532d, no Route Commerce branding
- public/sw-field.js: scoped SW with field-shell-v1 + field-data-v1
caches (never touches main app's rc-shell-v* / rc-data-v*). Skips
any request outside /water scope. Two-cache strategy: shell
cache-first + /api/water stale-while-revalidate.
- src/app/water/layout.tsx: child layout overrides root metadata
(manifest, themeColor, applicationName, appleWebApp.title) and
mounts the field SW registration + install prompt.
- src/components/pwa/FieldSWRegistration.tsx: registers /sw-field.js
with scope=/water. Module-scoped registered flag prevents strict-
mode double-registration.
- src/components/pwa/FieldInstallPrompt.tsx: sibling of InstallPrompt,
forest-green #1a4d2e theming, fires after 4s dwell. Captures
display-mode:standalone AND navigator.standalone for iOS.
No conflict with the main app PWA: PWAInstallPrompt is mounted only
under /admin/layout.tsx, so /water routes only see FieldInstallPrompt.
Tuxedo-only by design (matches existing /water single-tenant hardcode).