This commit is contained in:
team3
2026-06-24 11:56:12 +02:00
parent e985f07696
commit caa9314de5
15 changed files with 391 additions and 23 deletions

View File

@@ -95,6 +95,19 @@ function onBausteinStatus(baustein, status) {
if (neu !== alt) emit('progressChanged') // Stufenwechsel → Locks/Stats neu laden
}
// Section nach Prüfen/Beheben/Neu-Schreiben im Content ersetzen + Markdown-Cache leeren.
function onSectionUpdated({ title, kompakt, md }) {
if (!content.value) return
for (const ch of content.value.chapters) {
for (const s of ch.sections) {
if (s.title !== title) continue
s.md = md
s.kompakt = kompakt
for (const k of [...mdCache.keys()]) if (k.endsWith(`:${s.num}`)) mdCache.delete(k)
}
}
}
// --- Vollbild-Fokus: ein Baustein groß, Guide links + Prüfung rechts ---
const fokusIndex = ref(null) // Index in der flachen Baustein-Liste; null = zu
const fokusTab = ref('pruefung')
@@ -137,7 +150,7 @@ const fortschritt = computed(() => {
return z
})
// cap je Baustein = 2×relevante Subbausteine (vom Backend in lernstand[title].cap geliefert).
// cap je Baustein = 4×relevante Subbausteine (vom Backend in lernstand[title].cap geliefert).
function capVon(title) {
return lernstand.value[title]?.cap || 10
}
@@ -287,6 +300,7 @@ function extractContext() {
v-if="fokusBaustein"
:baustein="fokusBaustein"
:topic="previewGuide.topic"
:guide-id="previewGuide.id"
:provider="provider"
:fortschritt="fortschritt"
:status="lernstand[fokusBaustein.title]"
@@ -301,6 +315,7 @@ function extractContext() {
@set-ansicht="$emit('setAnsicht', $event)"
@status-changed="(st) => onBausteinStatus(st.baustein, st)"
@open-sidebar="$emit('openSidebar')"
@section-updated="onSectionUpdated"
/>
<button v-if="previewGuide && !chatOpen && fokusIndex === null" class="chat-fab" :class="{ shifted: elementsOpen }" title="Fragen zum Guide" @click="openChat">💬</button>