UX: Breeder-Profil Back-FAB unten rechts + destroy() Hook in navigate() (SW by-v898)

This commit is contained in:
rene 2026-05-13 18:19:16 +02:00
parent 822af64704
commit c15f1b10d0
5 changed files with 34 additions and 17 deletions

View file

@ -406,7 +406,7 @@ async def serve_media(path: str, request: _Request):
raise _HE(404, "Nicht gefunden.") raise _HE(404, "Nicht gefunden.")
return _media_response(filepath) 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") @app.get("/.well-known/assetlinks.json")
async def assetlinks(): async def assetlinks():

View file

@ -591,10 +591,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=897"></script> <script src="/js/api.js?v=898"></script>
<script src="/js/ui.js?v=897"></script> <script src="/js/ui.js?v=898"></script>
<script src="/js/app.js?v=897"></script> <script src="/js/app.js?v=898"></script>
<script src="/js/worlds.js?v=897"></script> <script src="/js/worlds.js?v=898"></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 = '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 APP_VERSION = '1.5.1'; // ← 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
@ -134,8 +134,15 @@ const App = (() => {
} }
if (window.Worlds?._visible) window.Worlds.hide(); 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 // Aktive Seite ausblenden
document.querySelector('.page.active')?.classList.remove('active'); activePage?.classList.remove('active');
document.querySelectorAll('.nav-item.active, .sidebar-item.active') document.querySelectorAll('.nav-item.active, .sidebar-item.active')
.forEach(el => el.classList.remove('active')); .forEach(el => el.classList.remove('active'));

View file

@ -27,16 +27,23 @@ window.Page_breeder = (() => {
} }
container.innerHTML = ` container.innerHTML = `
<div style="padding:var(--space-3) var(--space-4) 0"> <div id="breeder-profile-body" style="padding:var(--space-4) var(--space-4) calc(var(--space-16) + 24px)">
<button class="btn btn-ghost btn-sm" id="breeder-back-btn">
${UI.icon('arrow-left')} Zurück zur Wurfbörse
</button>
</div>
<div id="breeder-profile-body" style="padding:0 var(--space-4) var(--space-6);text-align:center">
${UI.skeleton(3)} ${UI.skeleton(3)}
</div>`; </div>
<button id="breeder-back-fab" aria-label="Zurück zur Wurfbörse"
style="position:fixed;bottom:calc(var(--safe-bottom,0px) + 20px);right:20px;
width:54px;height:54px;border-radius:50%;background:var(--c-primary);
border:none;color:#fff;cursor:pointer;z-index:200;
display:flex;align-items:center;justify-content:center;
box-shadow:0 4px 18px rgba(196,132,58,.45);
transition:transform .12s,box-shadow .12s;
-webkit-tap-highlight-color:transparent">
<svg style="width:22px;height:22px" viewBox="0 0 256 256">
<use href="/icons/phosphor.svg#arrow-left"></use>
</svg>
</button>`;
document.getElementById('breeder-back-btn') document.getElementById('breeder-back-fab')
?.addEventListener('click', () => App.navigate('wurfboerse')); ?.addEventListener('click', () => App.navigate('wurfboerse'));
try { try {
@ -219,7 +226,10 @@ window.Page_breeder = (() => {
function refresh() {} function refresh() {}
function onDogChange() {} function onDogChange() {}
function destroy() {
document.getElementById('breeder-back-fab')?.remove();
}
return { init, refresh, onDogChange }; return { init, refresh, onDogChange, destroy };
})(); })();

View file

@ -3,7 +3,7 @@
Offline-Cache + Push Notifications + Tile-Cache Offline-Cache + Push Notifications + Tile-Cache
============================================================ */ ============================================================ */
const CACHE_VERSION = 'by-v897'; const CACHE_VERSION = 'by-v898';
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