From 117d32fcc379693ba87ba4aec0f7d823e7fec638 Mon Sep 17 00:00:00 2001 From: rene Date: Wed, 29 Apr 2026 09:39:54 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20=C3=9Cbung-des-Tages-Chip=20scrollt=20di?= =?UTF-8?q?rekt=20zur=20=C3=9Cbung=20(kategorie=20+=20name=20als=20init-pa?= =?UTF-8?q?rams)=20=E2=80=94=20SW=20by-v482,=20APP=5FVER=20459?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/static/js/app.js | 2 +- backend/static/js/pages/uebungen.js | 12 ++++++++++-- backend/static/js/pages/welcome.js | 15 ++++++++++++++- backend/static/sw.js | 2 +- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 0255aa4..ec1212e 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 = '458'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '459'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const App = (() => { diff --git a/backend/static/js/pages/uebungen.js b/backend/static/js/pages/uebungen.js index 3455c9f..dd3bff6 100644 --- a/backend/static/js/pages/uebungen.js +++ b/backend/static/js/pages/uebungen.js @@ -433,10 +433,18 @@ window.Page_uebungen = (() => { // ---------------------------------------------------------- // INIT // ---------------------------------------------------------- - async function init(container, appState) { + async function init(container, appState, params = {}) { _container = container; _appState = appState; + if (params.kategorie) _activeTab = params.kategorie; _render(); + if (params.name) { + // Nach Render + Progress-Load zur Übung scrollen + setTimeout(() => { + const card = _container.querySelector(`[data-exercise-name="${CSS.escape(params.name)}"]`); + if (card) card.scrollIntoView({ behavior: 'smooth', block: 'center' }); + }, 600); + } // Progress vom Server laden API.training.getProgress().then(rows => { @@ -937,7 +945,7 @@ window.Page_uebungen = (() => { const hasBody = u.schritte.length > 0 || u.fehler.length > 0 || u.steigerung; return ` -
+
diff --git a/backend/static/js/pages/welcome.js b/backend/static/js/pages/welcome.js index 875fbec..8b22aa4 100644 --- a/backend/static/js/pages/welcome.js +++ b/backend/static/js/pages/welcome.js @@ -362,7 +362,9 @@ window.Page_welcome = (() => { ${weightVal}
${ex ? ` -
+
Übung des Tages ${UI.escape(ex.name)} @@ -1138,6 +1140,17 @@ window.Page_welcome = (() => { btn.addEventListener('click', () => App.navigate(btn.dataset.nav)); }); + // Exercise-Chip: navigiert direkt zur spezifischen Übung + const exChip = _container.querySelector('#wc-chip-exercise'); + if (exChip) { + exChip.addEventListener('click', () => { + App.navigate('uebungen', true, { + name: exChip.dataset.exerciseName, + kategorie: exChip.dataset.exerciseKat, + }); + }); + } + // Hero-Rotation starten (nur Landing) if (!_appState?.user) _startHeroRotation(); } diff --git a/backend/static/sw.js b/backend/static/sw.js index 3da4473..a973334 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-v481'; +const CACHE_VERSION = 'by-v482'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten