Enhance Gap Fill Offer with Context Preview and Update Version
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m14s
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m14s
- Added `context_preview` to the `build_gap_fill_offer` function, providing a structured overview of the roadmap snapshot. - Introduced `gapOfferContextDisplayLines` utility to format context information for UI display, improving clarity for users. - Updated `ExerciseProgressionPathBuilder` and related components to utilize the new context preview, enhancing the user experience. - Incremented application version to 0.8.213 to reflect these changes.
This commit is contained in:
1 parent
f2650dac57
commit
d4b1780193
6 files changed
+136
-12
No files matched your search
@@ -132,3 +132,31 @@ export function buildPathGapPlanningContextForAi({
|
||||
}
|
||||
return Object.fromEntries(Object.entries(ctx).filter(([, v]) => v != null && v !== ''))
|
||||
}
|
||||
|
||||
/** Lesbare Zeilen für UI — aus API context_preview oder lokal berechnet. */
|
||||
export function gapOfferContextDisplayLines(offer, fallbackParams = null) {
|
||||
const raw =
|
||||
offer?.context_preview ||
|
||||
(fallbackParams ? buildPathGapPlanningContextForAi({ offer, ...fallbackParams }) : null)
|
||||
if (!raw) return []
|
||||
const lines = []
|
||||
const push = (label, value) => {
|
||||
const v = String(value || '').trim()
|
||||
if (v) lines.push({ label, value: v })
|
||||
}
|
||||
push('Ausgangslage (Pfad)', raw.start_situation)
|
||||
push('Gesamtziel (Pfad)', raw.target_state)
|
||||
push('Ergänzungen', raw.roadmap_notes)
|
||||
push('Stufen-Lernziel', raw.stage_learning_goal || raw.roadmap_learning_goal)
|
||||
if (raw.stage_phase) push('Phase', raw.stage_phase)
|
||||
if (Array.isArray(raw.stage_load_profile) && raw.stage_load_profile.length) {
|
||||
push('Belastung', raw.stage_load_profile.join(', '))
|
||||
}
|
||||
if (Array.isArray(raw.stage_success_criteria) && raw.stage_success_criteria.length) {
|
||||
push('Erfolgskriterien', raw.stage_success_criteria.slice(0, 3).join(' · '))
|
||||
}
|
||||
if (Array.isArray(raw.skill_hints) && raw.skill_hints.length) {
|
||||
push('Fähigkeiten-Fokus', raw.skill_hints.slice(0, 3).join(' · '))
|
||||
}
|
||||
return lines
|
||||
}
|
||||
Reference in new issue
Block a user