diff --git a/docs/PWA.md b/docs/PWA.md index afe58e07..e6b4a116 100644 --- a/docs/PWA.md +++ b/docs/PWA.md @@ -14,6 +14,11 @@ This is an **online-first app shell**, not an offline radio player. - The worker pre-caches **only** `offline.html`, a small static, noindex, self-contained explanation. Navigation requests go to the network first. On a network failure, the worker displays the translated offline explanation. + The fallback page listens for browser connectivity changes and also probes the + same-origin, deployment-scoped web manifest with a 5-second timeout and + backoff (3 to 15 seconds). It reloads the **original URL** only after a valid + network response, does not loop-refresh while offline, and pauses background + probes while hidden. The manual Retry button uses the same verification. - There is **no audio cache**: MP3/AAC, .m3u8 playlists, HLS segments, provider requests, API, JS, CSS, search index JSON and all real station HTML stay network-only. A stream always requires a current online connection. @@ -41,7 +46,12 @@ tabs; test on the actual device before marking #340 or #346 complete. - [ ] Install on Android Chrome and open the app from its launcher. - [ ] Add to Home Screen on Safari iOS, test lock-screen/audio interruptions. - [ ] With the app open, go offline then navigate: see the offline explanation; - retry after restoring connection should fetch a fresh live page. + restore connection and verify automatic recovery to the same page without + pressing Retry. Also verify Retry works and no repeated reloads occur + while disconnected, including when the browser omits an online event. +- [ ] Repeat the recovery test on a station deep link and on a + `/pr-preview/pr-N/` deployment: its connectivity probe must stay within + the active Pages scope. A browser reload must leave the player paused. - [ ] Use DevTools Application → Cache Storage: **only** `offline.html` is precached; no station catalog, stream segments or signed URLs. - [ ] Update the worker: no forced reload, old audio continues, next visits @@ -49,5 +59,6 @@ tabs; test on the actual device before marking #340 or #346 complete. - [ ] `npm test`, `npm run generate:site`, SEO/GA4 noindex and GitHub Pages subpath validations, mobile light/dark and safe-area smoke tests. -The automated tests verify worker/cache policy and manifest URL resolution. +The automated tests verify worker/cache policy, manifest URL resolution, and +offline-page automatic recovery, polling backoff and preview-scoped probes. Physical iOS/Android QA remains **not run** until independently documented. diff --git a/public/offline.html b/public/offline.html index fa3b43a2..2e2dd09d 100644 --- a/public/offline.html +++ b/public/offline.html @@ -18,7 +18,9 @@ button { appearance: none; border: 0; border-radius: 13px; background: #e11d48; color: white; font: inherit; font-weight: 650; padding: 13px 25px; min-height: 48px; cursor: pointer; } button:focus-visible { outline: 3px solid #fda4af; outline-offset: 4px; } button:hover { background: #be123c; } - .note { display: block; margin-top: 18px; color: #aaaab6; font-size: 12px; } + .connection-state { display: block; min-height: 20px; margin-top: 14px; color: #fda4af; font-size: 13px; } + .note { display: block; margin-top: 12px; color: #aaaab6; font-size: 12px; } + button:disabled { cursor: progress; opacity: .75; } @media (prefers-reduced-motion: no-preference) { button { transition: background .15s ease; } } @@ -31,18 +33,19 @@
Live radio needs an internet connection. Reconnect to keep listening.
+ Waiting for a connection… Live stations cannot play offline.