Fix: Hilfe-? inline neben 'Dein Plan für heute' statt absolut oben rechts (SW by-v663)

This commit is contained in:
rene 2026-05-03 21:13:10 +02:00
parent 0413483692
commit 1d1171e5f2
6 changed files with 30 additions and 25 deletions

View file

@ -6553,25 +6553,20 @@ html.modal-open {
/* ============================================================
PAGE INFO generische Seiten-Hilfe (UI.pageInfo)
============================================================ */
.pinfo-trigger {
position: absolute;
top: calc(env(safe-area-inset-top, 0px) + 10px);
right: var(--space-4);
width: 32px; height: 32px;
.pinfo-trigger-inline {
width: 26px; height: 26px;
border-radius: 50%;
background: var(--c-surface-2);
border: 1px solid var(--c-border-light);
color: var(--c-text-secondary);
cursor: pointer;
display: flex;
display: inline-flex;
align-items: center;
justify-content: center;
z-index: 50;
flex-shrink: 0;
box-shadow: var(--shadow-sm);
transition: background .15s, color .15s;
}
.pinfo-trigger:hover { background: var(--c-primary-subtle, rgba(196,132,58,.1)); color: var(--c-primary); }
.pinfo-trigger-inline:hover { background: var(--c-primary-subtle, rgba(196,132,58,.1)); color: var(--c-primary); }
.pinfo-banner {
margin: var(--space-3) var(--space-4) 0;
@ -6645,8 +6640,6 @@ html.modal-open {
}
.pinfo-tip .ph-icon { color: var(--c-primary); flex-shrink: 0; margin-top: 1px; }
/* Container braucht position:relative für den absoluten Trigger-Button */
.page-body { position: relative; }
.by-help-btn {
display: inline-flex;

View file

@ -93,9 +93,9 @@
</script>
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
<link rel="stylesheet" href="/css/design-system.css?v=662">
<link rel="stylesheet" href="/css/layout.css?v=662">
<link rel="stylesheet" href="/css/components.css?v=662">
<link rel="stylesheet" href="/css/design-system.css?v=663">
<link rel="stylesheet" href="/css/layout.css?v=663">
<link rel="stylesheet" href="/css/components.css?v=663">
</head>
<body>
@ -562,7 +562,7 @@
<script src="/js/api.js?v=94"></script>
<script src="/js/ui.js?v=94"></script>
<script src="/js/app.js?v=94"></script>
<script src="/js/worlds.js?v=662"></script>
<script src="/js/worlds.js?v=663"></script>
<!-- Feature-Seiten werden lazy geladen -->

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '662'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '663'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VERSION = '1.3.0'; // ← semantische Version, wird bei make release gesetzt
const IS_STAGING = location.hostname === 'staging.banyaro.app';

View file

@ -34,6 +34,7 @@ window.Page_uebungen = (() => {
// ----------------------------------------------------------
// STATS STATE
// ----------------------------------------------------------
let _helpHandle = null; // Rückgabe von UI.pageInfo — für inline Trigger-Button
let _statsData = null; // cached stats from /api/training/stats
let _badgesData = null; // cached badges from /api/achievements
let _exercisesByTab = {}; // aus API geladen
@ -476,7 +477,7 @@ window.Page_uebungen = (() => {
if (_VALID_TABS.has(mapped)) _activeTab = mapped;
}
_render();
UI.pageInfo(_container, {
_helpHandle = UI.pageInfo(_container, {
pageId: 'uebungen',
title: 'Übungsbibliothek',
icon: 'graduation-cap',
@ -747,10 +748,14 @@ window.Page_uebungen = (() => {
<span style="font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--c-text)">
Dein Plan für heute
</span>
<span id="ueb-help-anchor" style="margin-left:auto"></span>
</div>
<div style="display:flex;flex-direction:column;gap:var(--space-2)">
${cards.join('')}
</div>`;
if (_helpHandle) {
document.getElementById('ueb-help-anchor')?.appendChild(_helpHandle.makeTriggerBtn());
}
el.querySelectorAll('.ueb-trainer-btn').forEach(btn => {
btn.addEventListener('click', () => {

View file

@ -313,13 +313,8 @@ const UI = (() => {
});
}
// Kleiner ? Button oben rechts — immer sichtbar
const headerBtn = document.createElement('button');
headerBtn.className = 'pinfo-trigger';
headerBtn.setAttribute('aria-label', 'Hilfe');
headerBtn.innerHTML = _svgIcon('question');
headerBtn.addEventListener('click', _openModal);
container.appendChild(headerBtn);
// Kein automatischer absolut-positionierter Trigger mehr.
// Aufrufer kann openModal() nutzen und den Button selbst platzieren.
// Banner beim ersten Besuch
if (!seen) {
@ -340,6 +335,18 @@ const UI = (() => {
banner.querySelector('.pinfo-banner-more').addEventListener('click', () => { banner.remove(); _openModal(); });
container.insertAdjacentElement('afterbegin', banner);
}
// Inline-Trigger-Button (für Aufrufer zum Einbetten)
function makeTriggerBtn() {
const btn = document.createElement('button');
btn.className = 'pinfo-trigger-inline';
btn.setAttribute('aria-label', 'Hilfe');
btn.innerHTML = _svgIcon('question');
btn.addEventListener('click', _openModal);
return btn;
}
return { openModal: _openModal, makeTriggerBtn };
}
// ----------------------------------------------------------

View file

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