From c15f1b10d001bfa26fd254364ebd63337fe27ee0 Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 13 May 2026 18:19:16 +0200 Subject: [PATCH] UX: Breeder-Profil Back-FAB unten rechts + destroy() Hook in navigate() (SW by-v898) --- backend/main.py | 2 +- backend/static/index.html | 8 ++++---- backend/static/js/app.js | 11 +++++++++-- backend/static/js/pages/breeder.js | 28 +++++++++++++++++++--------- backend/static/sw.js | 2 +- 5 files changed, 34 insertions(+), 17 deletions(-) diff --git a/backend/main.py b/backend/main.py index 46036e9..02a8216 100644 --- a/backend/main.py +++ b/backend/main.py @@ -406,7 +406,7 @@ async def serve_media(path: str, request: _Request): raise _HE(404, "Nicht gefunden.") return _media_response(filepath) -APP_VER = "897" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "898" # 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 43d91c7..b95c0b4 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -591,10 +591,10 @@ - - - - + + + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 518cb11..c50ddd6 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 = '897'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '898'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.1'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; // Cache-Bust-Parameter nach Update-Reload sofort entfernen @@ -134,8 +134,15 @@ const App = (() => { } if (window.Worlds?._visible) window.Worlds.hide(); + // destroy() der aktuellen Seite aufrufen (z.B. FABs aufräumen) + const activePage = document.querySelector('.page.active'); + if (activePage) { + const activeId = activePage.id?.replace('page-', ''); + if (activeId && pages[activeId]?.module?.destroy) pages[activeId].module.destroy(); + } + // Aktive Seite ausblenden - document.querySelector('.page.active')?.classList.remove('active'); + activePage?.classList.remove('active'); document.querySelectorAll('.nav-item.active, .sidebar-item.active') .forEach(el => el.classList.remove('active')); diff --git a/backend/static/js/pages/breeder.js b/backend/static/js/pages/breeder.js index 3fefde6..5c50ec4 100644 --- a/backend/static/js/pages/breeder.js +++ b/backend/static/js/pages/breeder.js @@ -27,16 +27,23 @@ window.Page_breeder = (() => { } container.innerHTML = ` -
- -
-
+
${UI.skeleton(3)} -
`; +
+ `; - document.getElementById('breeder-back-btn') + document.getElementById('breeder-back-fab') ?.addEventListener('click', () => App.navigate('wurfboerse')); try { @@ -219,7 +226,10 @@ window.Page_breeder = (() => { function refresh() {} function onDogChange() {} + function destroy() { + document.getElementById('breeder-back-fab')?.remove(); + } - return { init, refresh, onDogChange }; + return { init, refresh, onDogChange, destroy }; })(); diff --git a/backend/static/sw.js b/backend/static/sw.js index 01e8ef2..724fef8 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-v897'; +const CACHE_VERSION = 'by-v898'; 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