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 <noreply@anthropic.com>
This commit is contained in:
alexspeakerandClaude Fable 5.1 committed 2026-11-06 16:08:48 +01:00
1 parent c9fecb068b
commit ffb04a96a7
8 files changed
+12 -188

No files matched your search

+6 -33
View File
@@ -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;
-27
View File
@@ -2,33 +2,6 @@
<changelog>
<version>
<number>3.0.4</number>
<logs>
<log>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.</log>
<log>Pagina di diagnostica /debug.html per verificare i confini del viewport sul dispositivo.</log>
</logs>
</version>
<version>
<number>3.0.3</number>
<logs>
<log>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.</log>
</logs>
</version>
<version>
<number>3.0.1</number>
<logs>
<log>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.</log>
<log>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.</log>
<log>Player a tutta larghezza agganciato in basso; griglia TV con anteprime più grandi; accessi rapidi della home a righe su telefono.</log>
</logs>
</version>
<version>
<number>3.0.0</number>
<logs>
-58
View File
@@ -1,58 +0,0 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8">
<title>RPIGroup Play - diagnostica viewport</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#1c2555">
<style>
html, body { margin: 0; height: 100%; background: #0b0e20; color: #fff; font: 13px/1.4 -apple-system, system-ui, sans-serif; overflow: hidden; }
/* Riquadri con i confini di ogni misura: dove finiscono, lì finisce quella misura */
.box { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; box-sizing: border-box; }
#fixed { position: fixed; inset: 0; border: 4px solid #e53935; } /* rosso: position fixed inset 0 */
#dvh { height: 100dvh; border: 4px dashed #43a047; margin: 8px; } /* verde: 100dvh */
#vh { height: 100vh; border: 4px dotted #1e88e5; margin: 16px; } /* blu: 100vh */
#safe { position: fixed; inset: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#safe::before { content: ""; display: block; height: 100%; border: 3px solid #fdd835; box-sizing: border-box; } /* giallo: area sicura */
#bottom { position: fixed; left: 0; right: 0; bottom: 0; background: #e53935; text-align: center; padding: 4px; font-weight: 700; }
#info { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.85); padding: 12px 14px; border-radius: 10px; white-space: pre; font-family: ui-monospace, Menlo, monospace; font-size: 12px; z-index: 10; }
#legend { position: fixed; top: 70px; left: 24px; right: 24px; z-index: 10; font-size: 12px; }
</style>
</head>
<body>
<div id="fixed" class="box"></div>
<div id="dvh" class="box"></div>
<div id="vh" class="box"></div>
<div id="safe"></div>
<div id="bottom">position: fixed; bottom: 0</div>
<div id="legend">rosso = fixed inset 0 · verde = 100dvh · blu = 100vh · giallo = area sicura</div>
<pre id="info">misuro…</pre>
<script>
function probe() {
var cs = getComputedStyle(document.getElementById('safe'));
var vv = window.visualViewport;
var standalone = navigator.standalone === true || matchMedia('(display-mode: standalone)').matches;
var righe = [
'UA: ' + navigator.userAgent.replace(/^Mozilla\/5\.0 /, '').slice(0, 60),
'standalone: ' + standalone + ' display-mode standalone: ' + matchMedia('(display-mode: standalone)').matches,
'inner: ' + window.innerWidth + ' x ' + window.innerHeight,
'outer: ' + window.outerWidth + ' x ' + window.outerHeight,
'screen: ' + screen.width + ' x ' + screen.height + ' avail: ' + screen.availWidth + ' x ' + screen.availHeight,
'documentElement.clientHeight: ' + document.documentElement.clientHeight,
'visualViewport: ' + (vv ? Math.round(vv.width) + ' x ' + Math.round(vv.height) + ' offsetTop ' + Math.round(vv.offsetTop) + ' scale ' + vv.scale : 'n/d'),
'safe-area top/right/bottom/left: ' + [cs.paddingTop, cs.paddingRight, cs.paddingBottom, cs.paddingLeft].join(' / '),
'100dvh box: ' + document.getElementById('dvh').getBoundingClientRect().height + ' 100vh box: ' + document.getElementById('vh').getBoundingClientRect().height,
'fixed box bottom: ' + Math.round(document.getElementById('fixed').getBoundingClientRect().bottom),
'devicePixelRatio: ' + window.devicePixelRatio
];
document.getElementById('info').textContent = righe.join('\n');
}
probe();
window.addEventListener('resize', probe);
if (window.visualViewport) window.visualViewport.addEventListener('resize', probe);
setTimeout(probe, 800);
</script>
</body>
</html>
+2 -30
View File
@@ -758,7 +758,7 @@
'<button type="button" class="btn btn-accent btn-lg offline-btn" id="offlineRetryBtn">' +
'<svg class="icon" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/></svg>' +
'<span>Riprova</span></button></div>';
(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();
+1 -16
View File
@@ -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;
+1
View File
@@ -6,6 +6,7 @@
"start_url": "./?app=true",
"scope": "./",
"display": "standalone",
"display_override": ["standalone", "minimal-ui"],
"background_color": "#1c2555",
"theme_color": "#1c2555",
"orientation": "any",
+1 -2
View File
@@ -120,6 +120,7 @@ $legal = rpi_legal_links();
<audio id="radio-audio" preload="none"></audio>
</aside>
</div>
<!-- PWA: invito a installare (telefono) -->
<div id="pwa-install-banner" class="pwa-install-banner" hidden>
@@ -161,5 +162,3 @@ $legal = rpi_legal_links();
</div>
</div>
</div>
</div><!-- /.app-shell -->
+1 -22
View File
@@ -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) {