Fix: Android Statusleiste immer dunkel (#0f1623), kein Amber-Streifen mehr (SW by-v815)

This commit is contained in:
rene 2026-05-10 08:34:18 +02:00
parent 5a30f657a1
commit effdf5ba5b
4 changed files with 17 additions and 13 deletions

View file

@ -341,7 +341,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media")
os.makedirs(MEDIA_DIR, exist_ok=True) os.makedirs(MEDIA_DIR, exist_ok=True)
app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media") 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") @app.get("/.well-known/assetlinks.json")
async def assetlinks(): async def assetlinks():

View file

@ -90,18 +90,20 @@
(function() { (function() {
var t = localStorage.getItem('by_theme'); var t = localStorage.getItem('by_theme');
var isDark = t === 'dark' || (t !== 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches); 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 === 'dark') document.documentElement.setAttribute('data-theme', 'dark');
if (t === 'light') document.documentElement.setAttribute('data-theme', 'light'); 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'); var m = document.getElementById('meta-theme-color');
if (m) m.setAttribute('content', isDark ? '#0f1623' : '#C4843A'); if (m) m.setAttribute('content', (isDark || isAndroid) ? '#0f1623' : '#C4843A');
})(); })();
</script> </script>
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung --> <!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
<link rel="stylesheet" href="/css/design-system.css?v=814"> <link rel="stylesheet" href="/css/design-system.css?v=815">
<link rel="stylesheet" href="/css/layout.css?v=814"> <link rel="stylesheet" href="/css/layout.css?v=815">
<link rel="stylesheet" href="/css/components.css?v=814"> <link rel="stylesheet" href="/css/components.css?v=815">
</head> </head>
<body> <body>
@ -581,10 +583,10 @@
<div id="modal-container"></div> <div id="modal-container"></div>
<!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features --> <!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features -->
<script src="/js/api.js?v=814"></script> <script src="/js/api.js?v=815"></script>
<script src="/js/ui.js?v=814"></script> <script src="/js/ui.js?v=815"></script>
<script src="/js/app.js?v=814"></script> <script src="/js/app.js?v=815"></script>
<script src="/js/worlds.js?v=814"></script> <script src="/js/worlds.js?v=815"></script>
<!-- Feature-Seiten werden lazy geladen --> <!-- Feature-Seiten werden lazy geladen -->

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung. 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 APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt
const IS_STAGING = location.hostname === 'staging.banyaro.app'; const IS_STAGING = location.hostname === 'staging.banyaro.app';
// Cache-Bust-Parameter nach Update-Reload sofort entfernen // Cache-Bust-Parameter nach Update-Reload sofort entfernen
@ -629,7 +629,9 @@ const App = (() => {
} }
function _syncThemeColor() { 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 || (window.matchMedia('(prefers-color-scheme: dark)').matches
&& document.documentElement.getAttribute('data-theme') !== 'light'); && document.documentElement.getAttribute('data-theme') !== 'light');
document.getElementById('meta-theme-color')?.setAttribute('content', isDark ? '#0f1623' : '#C4843A'); document.getElementById('meta-theme-color')?.setAttribute('content', isDark ? '#0f1623' : '#C4843A');

View file

@ -3,7 +3,7 @@
Offline-Cache + Push Notifications + Tile-Cache Offline-Cache + Push Notifications + Tile-Cache
============================================================ */ ============================================================ */
const CACHE_VERSION = 'by-v814'; const CACHE_VERSION = 'by-v815';
const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_STATIC = `${CACHE_VERSION}-static`;
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache