The service worker's notificationclick handler called
self.clients.openWindow(url) unconditionally, spawning a new window/PWA
instance on every notification click even when one was already open.
Focus an existing window client and navigate it to the (relative)
deep-link, resolved against self.location.origin, falling back to
openWindow only when no window is available.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve visibility state for beacon reporting to handle focus correctly
Normalize push subscriptions per UI session and send to each endpoint
Suppress push notifications when a visible window exists to avoid redundant alerts
* feat: add Web Push API support and PWA integration
Add web Push API with subscribe/unsubscribe and visibility endpoints
Introduce usePushVisibilityBeacon and useSessionDeepLink hooks
Integrate PWA with service worker, registerSW, and VAPID key persistence
* feat: add heartbeat visibility beacon for web runtime
Add a 10s heartbeat to ping visibility while visible
Subscribe to visibilitychange, focus, blur, pageshow, and pagehide events to report state
Clear heartbeat interval on unmount to avoid leaks