From ffb04a96a7a484dcf61f78c3974842b485f99a97 Mon Sep 17 00:00:00 2001 From: alexspeaker Date: Fri, 6 Nov 2026 16:08:48 +0100 Subject: [PATCH] Rollback alla 3.0.0 (24391c4) Ripristinato per intero lo stato del commit 24391c4, che sull'iPhone con l'icona installata si vedeva correttamente. Le modifiche dei commit successivi restano nella storia per essere riprese una per volta. Co-Authored-By: Claude Fable 5.1 --- css/style.css | 39 +++++-------------------------- data/changelog.xml | 27 --------------------- debug.html | 58 ---------------------------------------------- js/app.js | 32 ++----------------------- js/pwa-install.js | 17 +------------- manifest.json | 1 + pages/app.php | 3 +-- sw.js | 23 +----------------- 8 files changed, 12 insertions(+), 188 deletions(-) delete mode 100644 debug.html diff --git a/css/style.css b/css/style.css index dc2addf..1527446 100644 --- a/css/style.css +++ b/css/style.css @@ -107,11 +107,6 @@ body.has-player { --dock-space: var(--player-h); } -/* Colore della tab bar */ -:root { - --bar-bg: color-mix(in srgb, var(--brand-900) 92%, black); -} - @media (max-width: 899px) { :root { --player-h: 64px; @@ -246,12 +241,7 @@ button { Solo il contenuto scorre: il resto resta fermo come in un'app. -------------------------------------------------------------------------- */ -/* Ancorato ai bordi dello schermo: su iOS (app installata, barra di stato trasparente) le altezze in vh/dvh - possono risultare più corte dello schermo e lasciare una fascia vuota sotto la tab bar */ -/* Guscio in flusso alto quanto il viewport dinamico (come nella 3.0.0). Player, banner, overlay e barra di - avanzamento sono figli del guscio con position: absolute: seguono il guscio. */ .app-shell { - position: relative; height: 100vh; height: 100dvh; display: grid; @@ -320,7 +310,7 @@ button { grid-template-columns: repeat(4, 1fr); height: calc(var(--tabbar-h) + var(--safe-bottom)); padding: 0 0.5rem var(--safe-bottom); - background: var(--bar-bg); + background: color-mix(in srgb, var(--brand-900) 92%, black); border-top: 1px solid rgba(255, 255, 255, 0.08); z-index: 30; } @@ -478,7 +468,7 @@ button { /* Barra di avanzamento durante il cambio pagina */ .route-progress { - position: absolute; + position: fixed; top: 0; left: 0; height: 3px; @@ -883,10 +873,7 @@ button { .page-head { position: relative; overflow: hidden; - /* Su iOS Safari overflow: hidden non ritaglia i livelli con filter: blur (il bagliore uscirebbe sopra la topbar) */ - clip-path: inset(0); isolation: isolate; - z-index: 0; background: var(--brand-gradient); color: var(--on-ink); padding: clamp(1.5rem, 1rem + 1.5vw, 2.5rem) 0 clamp(1.75rem, 1.25rem + 1.5vw, 2.75rem); @@ -1018,27 +1005,18 @@ button { position: relative; isolation: isolate; overflow: hidden; - clip-path: inset(0); - z-index: 0; background: var(--brand-gradient); color: var(--on-ink); padding: clamp(2rem, 1.5rem + 3vw, 4.5rem) 0 clamp(4.5rem, 3.5rem + 4vw, 7rem); } -/* Livelli dell'apertura: sfondo (macchie e anelli) sotto, testo sopra; le macchie restano dentro l'apertura */ .hero-bg { position: absolute; inset: 0; z-index: -1; - overflow: hidden; - clip-path: inset(0); pointer-events: none; } -.hero-inner { - z-index: 1; -} - .hero-motivo { position: absolute; width: min(760px, 120vw); @@ -1557,8 +1535,6 @@ iframe.contentplayer { position: relative; isolation: isolate; overflow: hidden; - clip-path: inset(0); - z-index: 0; flex: 1 1 auto; min-height: 0; display: grid; @@ -1572,9 +1548,6 @@ iframe.contentplayer { position: absolute; inset: 0; z-index: -1; - overflow: hidden; - clip-path: inset(0); - pointer-events: none; } .station-static-motivo { @@ -1708,7 +1681,7 @@ iframe.contentplayer { /* Barra a tutta larghezza, agganciata in basso: sopra la tab bar su telefono, accanto alla sidebar su computer */ .player-dock { - position: absolute; + position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); @@ -2105,7 +2078,7 @@ iframe.contentplayer { } .pwa-install-banner { - position: absolute; + position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px); @@ -2170,7 +2143,7 @@ body.has-player .pwa-install-banner { } .pwa-modal-overlay { - position: absolute; + position: fixed; inset: 0; z-index: 110000; display: flex; @@ -2295,7 +2268,7 @@ body.has-player .pwa-install-banner { /* Offline */ .offline-overlay { - position: absolute; + position: fixed; inset: 0; z-index: 999999; display: flex; diff --git a/data/changelog.xml b/data/changelog.xml index 8c5afcf..0df8d41 100644 --- a/data/changelog.xml +++ b/data/changelog.xml @@ -2,33 +2,6 @@ - - 3.0.4 - - Guscio dell'app, topbar e colori riportati a come erano nella 3.0.0 (che sull'iPhone si vedeva correttamente); restano le migliorie al player, ai podcast e all'aggiornamento automatico. - Pagina di diagnostica /debug.html per verificare i confini del viewport sul dispositivo. - - - - - - 3.0.3 - - iPhone (app installata): su iOS 26 il sistema tiene fuori dal viewport la barra di stato e una fascia in basso e le dipinge con lo sfondo della pagina. Ora topbar, barra delle sezioni e sfondo hanno lo stesso colore, così le fasce si fondono con le barre, e l'area sicura in basso non viene contata due volte. - - - - - - 3.0.1 - - iPhone: il guscio dell'app riempie tutto lo schermo (niente fascia vuota sotto la barra delle sezioni) e i bagliori delle intestazioni restano dentro la loro sezione. - Aggiornamento automatico dell'app dopo un rilascio: le pagine arrivano sempre dalla rete, il service worker si aggiorna a ogni apertura e ricarica una volta sola. - Player a tutta larghezza agganciato in basso; griglia TV con anteprime più grandi; accessi rapidi della home a righe su telefono. - - - - 3.0.0 diff --git a/debug.html b/debug.html deleted file mode 100644 index 97fe7de..0000000 --- a/debug.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - -RPIGroup Play - diagnostica viewport - - - - - - - -
-
-
-
-
position: fixed; bottom: 0
-
rosso = fixed inset 0 · verde = 100dvh · blu = 100vh · giallo = area sicura
-
misuro…
- - - diff --git a/js/app.js b/js/app.js index 3461776..6005a0b 100644 --- a/js/app.js +++ b/js/app.js @@ -758,7 +758,7 @@ ''; - (document.getElementById('app') || body).appendChild(overlay); + body.appendChild(overlay); var btn = $('#offlineRetryBtn'); btn.addEventListener('click', function () { @@ -786,36 +786,8 @@ Avvio ===================================================================== */ - /** - * Guscio vecchio con script nuovo (un service worker di una versione precedente ha servito l'HTML dalla cache): - * si svuotano cache e worker e si ricarica, una volta sola. - */ - function gusciVecchio() { - if (document.getElementById('player-dock')) return false; - var chiave = 'rpi-riparazione'; - try { - if (sessionStorage.getItem(chiave)) return true; - sessionStorage.setItem(chiave, '1'); - } catch (e) { /* senza archivio si tenta comunque una volta */ } - var pulizia = []; - if ('serviceWorker' in navigator) { - pulizia.push(navigator.serviceWorker.getRegistrations().then(function (regs) { - return Promise.all(regs.map(function (r) { return r.unregister(); })); - })); - } - if ('caches' in window) { - pulizia.push(caches.keys().then(function (keys) { - return Promise.all(keys.map(function (k) { return caches.delete(k); })); - })); - } - Promise.all(pulizia).catch(function () { /* si ricarica comunque */ }).then(function () { - window.location.reload(); - }); - return true; - } - function init() { - if (!content || gusciVecchio()) return; + if (!content) return; Offline.init(); Player.init(); Podcast.init(); diff --git a/js/pwa-install.js b/js/pwa-install.js index 042e1c8..8acdbec 100644 --- a/js/pwa-install.js +++ b/js/pwa-install.js @@ -12,26 +12,11 @@ var BASE = window.BASE_PATH || ''; if ('serviceWorker' in navigator) { - // C'era già un worker a governare la pagina? Allora un cambio di worker è un aggiornamento dell'app - var avevaWorker = !!navigator.serviceWorker.controller; - var ricaricando = false; - window.addEventListener('load', function () { - navigator.serviceWorker.register(BASE + '/sw.js', { updateViaCache: 'none' }).then(function (reg) { - // Controllo esplicito a ogni apertura: il browser da solo lo fa al massimo ogni 24 ore - reg.update().catch(function () { /* offline: si riprova alla prossima apertura */ }); - }).catch(function (error) { + navigator.serviceWorker.register(BASE + '/sw.js').catch(function (error) { console.error('[PWA] Registrazione Service Worker fallita:', error); }); }); - - // Il worker nuovo ha preso il controllo (skipWaiting + clients.claim): si ricarica una volta, - // così guscio e script sono della stessa versione - navigator.serviceWorker.addEventListener('controllerchange', function () { - if (!avevaWorker || ricaricando) return; - ricaricando = true; - window.location.reload(); - }); } var isStandalone = window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone === true; diff --git a/manifest.json b/manifest.json index e5e976f..589569c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,6 +6,7 @@ "start_url": "./?app=true", "scope": "./", "display": "standalone", + "display_override": ["standalone", "minimal-ui"], "background_color": "#1c2555", "theme_color": "#1c2555", "orientation": "any", diff --git a/pages/app.php b/pages/app.php index fac5da5..e026398 100644 --- a/pages/app.php +++ b/pages/app.php @@ -120,6 +120,7 @@ $legal = rpi_legal_links(); + - - diff --git a/sw.js b/sw.js index a447dd4..e006ea4 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -const CACHE_NAME = 'rpigroupplay-v10'; +const CACHE_NAME = 'rpigroupplay-v5'; const ASSETS = [ './', './index.php', @@ -75,27 +75,6 @@ self.addEventListener('fetch', (e) => { const isStatic = STATIC_RE.test(new URL(url).pathname); const matchOptions = isStatic ? { ignoreSearch: true } : undefined; - // Pagine (guscio dell'app e contenuti PHP): prima la rete, la cache solo se la rete manca. - // Così dopo un aggiornamento nessuno resta con il guscio vecchio e gli script nuovi. - if (!isStatic) { - e.respondWith( - fetch(e.request).then((response) => { - if (response.status === 200) { - const responseClone = response.clone(); - caches.open(CACHE_NAME).then((cache) => cache.put(e.request, responseClone)); - } - return response; - }).catch(() => { - return caches.match(e.request).then((cached) => { - if (cached) return cached; - if (e.request.mode === 'navigate') return caches.match('./index.php'); - }); - }) - ); - return; - } - - // File statici (css, js, font, immagini): subito dalla cache, aggiornati in sottofondo e.respondWith( caches.match(e.request, matchOptions).then((cachedResponse) => { if (cachedResponse) {