From effdf5ba5b6e4fb059c469828b729b2766ec449e Mon Sep 17 00:00:00 2001 From: rene Date: Sun, 10 May 2026 08:34:18 +0200 Subject: [PATCH] Fix: Android Statusleiste immer dunkel (#0f1623), kein Amber-Streifen mehr (SW by-v815) --- backend/main.py | 2 +- backend/static/index.html | 20 +++++++++++--------- backend/static/js/app.js | 6 ++++-- backend/static/sw.js | 2 +- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/backend/main.py b/backend/main.py index bda6ec5..8093a75 100644 --- a/backend/main.py +++ b/backend/main.py @@ -341,7 +341,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media") os.makedirs(MEDIA_DIR, exist_ok=True) app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media") -APP_VER = "814" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "815" # muss mit APP_VER in app.js übereinstimmen @app.get("/.well-known/assetlinks.json") async def assetlinks(): diff --git a/backend/static/index.html b/backend/static/index.html index 5488cbe..6161ab4 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -90,18 +90,20 @@ (function() { var t = localStorage.getItem('by_theme'); var isDark = t === 'dark' || (t !== 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches); + var isAndroid = /android/i.test(navigator.userAgent); if (t === 'dark') document.documentElement.setAttribute('data-theme', 'dark'); if (t === 'light') document.documentElement.setAttribute('data-theme', 'light'); - // Statusleisten-Farbe sofort setzen — kein Amber auf Samsung im Dark Mode + // Android: immer dunkel (Amber-Streifen nicht möglich transparent zu machen) + // iOS: black-translucent übernimmt das var m = document.getElementById('meta-theme-color'); - if (m) m.setAttribute('content', isDark ? '#0f1623' : '#C4843A'); + if (m) m.setAttribute('content', (isDark || isAndroid) ? '#0f1623' : '#C4843A'); })(); - - - + + + @@ -581,10 +583,10 @@ - - - - + + + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 47ab9c2..3a2267a 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 = '814'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '815'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen @@ -629,7 +629,9 @@ const App = (() => { } function _syncThemeColor() { - const isDark = document.documentElement.getAttribute('data-theme') === 'dark' + const isAndroid = /android/i.test(navigator.userAgent); + const isDark = isAndroid + || document.documentElement.getAttribute('data-theme') === 'dark' || (window.matchMedia('(prefers-color-scheme: dark)').matches && document.documentElement.getAttribute('data-theme') !== 'light'); document.getElementById('meta-theme-color')?.setAttribute('content', isDark ? '#0f1623' : '#C4843A'); diff --git a/backend/static/sw.js b/backend/static/sw.js index dfcade4..c8b62f6 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v814'; +const CACHE_VERSION = 'by-v815'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache