This commit is contained in:
team3
2026-06-22 15:23:39 +02:00
parent 0951337a29
commit 36b7aabdb0
5 changed files with 69 additions and 23 deletions

View File

@@ -9,6 +9,7 @@ const props = defineProps({
stats: { type: Object, default: null },
fortschritt: { type: Object, default: () => ({}) },
locks: { type: Object, default: () => ({}) },
guideStepsDone: { type: Object, default: () => ({}) }, // höchster fertiger Schritt je Format (-1 = keiner)
uiError: { type: String, default: null },
doneByFormat: { type: Object, default: () => ({}) },
latestByFormat: { type: Object, default: () => ({}) },
@@ -121,35 +122,26 @@ function guideStatus(format) {
// Schritt-Kugeln der Guide-Pipeline
const GUIDE_STEPS = ['Auswahl', 'Gliederung', 'Inhalte', 'Inhalts-Check', 'Schreiben', 'Lese-Prüfung']
// Kugeln werden wie bei den Bausteinen immer angezeigt:
// fertig = alle grün, laufend = live, abgebrochen = Teilfortschritt, sonst grau
// Kugeln aus dem artefakt-basierten „fertig"-Marker (wie Bausteine, nicht aus dem DB-Zähler):
// fertig = done. Läuft gerade → der nächste Schritt (fertig+1) ist aktiv.
function guideSteps(format) {
const labels = GUIDE_STEPS
const fertig = props.guideStepsDone[format] ?? -1
const st = guideStatus(format)
if (st === 'generating' || st === 'queued') {
// Clamp: alte DB-Läufe können step-Werte oberhalb der neuen Listen haben
const step = Math.min(props.latestByFormat[format]?.step ?? -1, labels.length - 1)
return labels.map((label, i) => ({
label,
state: i < step ? 'done' : i === step ? 'active' : 'pending',
}))
}
if (props.doneByFormat[format]) {
return labels.map((label) => ({ label, state: 'done' }))
}
if (abgebrochen(format)) {
const step = Math.min(props.latestByFormat[format]?.step ?? 0, labels.length)
return labels.map((label, i) => ({ label, state: i < step ? 'done' : 'pending' }))
}
return labels.map((label) => ({ label, state: 'pending' }))
const aktiv = st === 'generating' || st === 'queued' ? fertig + 1 : -1
return labels.map((label, i) => ({
label,
state: i <= fertig ? 'done' : i === aktiv ? 'active' : 'pending',
}))
}
// Re-Run ab Guide-Schritt (1-basierte Kugel je Format). null = voll/Resume.
const gewaehlterStep = reactive({})
// Kugeln klickbar, sobald der Guide (teil-)gebaut ist und gerade nicht generiert wird.
// Kugeln klickbar, sobald Artefakte existieren (Marker ≥ 0 oder fertig) und nicht generiert wird.
function guideWaehlbar(format) {
const st = guideStatus(format)
return (st === 'done' || abgebrochen(format)) && st !== 'generating' && st !== 'queued'
if (st === 'generating' || st === 'queued') return false
return (props.guideStepsDone[format] ?? -1) >= 0 || st === 'done'
}
function guideStepKlick(format, n) {
if (!guideWaehlbar(format)) return