diff --git a/backend/main.py b/backend/main.py index 97980e2..f2aa6fd 100644 --- a/backend/main.py +++ b/backend/main.py @@ -410,7 +410,7 @@ async def serve_media(path: str, request: _Request): raise _HE(404, "Nicht gefunden.") return _media_response(filepath) -APP_VER = "1080" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "1081" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/static/css/components.css b/backend/static/css/components.css index df695bc..ee3a382 100644 --- a/backend/static/css/components.css +++ b/backend/static/css/components.css @@ -8891,8 +8891,9 @@ svg.empty-state-icon { z-index: 61; /* knapp über dem FAB (60), unter Modals */ transition: transform 0.12s, box-shadow 0.12s; } -/* Welten aktiv → Indikator sichtbar */ -#worlds-overlay.worlds-visible ~ #offline-indicator { display: flex; } +/* Welten aktiv → Indikator sichtbar (CSS-Sibling + JS-Klasse als Fallback) */ +#worlds-overlay.worlds-visible ~ #offline-indicator, +#offline-indicator.visible { display: flex; } [data-theme="dark"] #offline-indicator { background: rgba(31,41,55,0.85); diff --git a/backend/static/index.html b/backend/static/index.html index eb8d064..017d122 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -101,9 +101,9 @@ - - - + + +
@@ -630,11 +630,11 @@ - - - - - + + + + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 76397eb..789a149 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '1080'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '1081'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen. diff --git a/backend/static/js/offline-indicator.js b/backend/static/js/offline-indicator.js index 36d90c4..802fd04 100644 --- a/backend/static/js/offline-indicator.js +++ b/backend/static/js/offline-indicator.js @@ -188,14 +188,32 @@ window.OfflineIndicator = (() => { await Promise.all(tasks); } + // ---------------------------------------------------------- + // Sichtbarkeit an Welten-Overlay koppeln + // ---------------------------------------------------------- + function _syncVisibility() { + if (!_btn) return; + const ov = document.getElementById('worlds-overlay'); + const inWorlds = !!ov?.classList.contains('worlds-visible'); + _btn.classList.toggle('visible', inWorlds); + } + // ---------------------------------------------------------- // Init // ---------------------------------------------------------- function init() { _btn = document.getElementById('offline-indicator'); - if (!_btn) return; + if (!_btn) { console.warn('[OfflineIndicator] #offline-indicator nicht im DOM'); return; } _svg = _btn.querySelector('.offline-paw'); _btn.addEventListener('click', _openModal); + + // MutationObserver: Welten-Overlay Klassenänderung → Indikator zeigen/verstecken + const ov = document.getElementById('worlds-overlay'); + if (ov) { + _syncVisibility(); + new MutationObserver(_syncVisibility).observe(ov, { attributes: true, attributeFilter: ['class', 'style'] }); + } + refresh(); // bei SW-Updates und alle 60s neu prüfen diff --git a/backend/static/sw.js b/backend/static/sw.js index c5bfe25..7259411 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -4,7 +4,7 @@ ============================================================ */ // ← EINZIGE Stelle für die Version — STATIC_ASSETS und CACHE_VERSION leiten sich ab -const VER = '1080'; +const VER = '1081'; const CACHE_VERSION = `by-v${VER}`; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten