Update version to 0.8.217 and enhance Exercise Progression Path Builder with planning roadmap features
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m15s
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m15s
- Incremented application version to 0.8.217 to reflect recent changes. - Added support for a planning roadmap in the Exercise Progression Path Builder, allowing users to save and load structured planning artifacts. - Enhanced the persistence logic for the planning roadmap, ensuring updates are correctly handled during graph modifications. - Improved the user interface to display saved planning hints, enriching the user experience and interaction with the progression graphs.
This commit is contained in:
1 parent
98b279fa89
commit
5692931d07
6 files changed
+268
-11
No files matched your search
@@ -233,6 +233,31 @@ function formatExpectedSkillNames(skillExpectations, limit = 4) {
|
||||
.slice(0, limit)
|
||||
}
|
||||
|
||||
const PLANNING_ARTIFACT_SCHEMA = 1
|
||||
|
||||
function buildPlanningRoadmapArtifactSnapshot({
|
||||
goalQuery,
|
||||
startSituation,
|
||||
targetState,
|
||||
roadmapNotes,
|
||||
maxSteps,
|
||||
progressionRoadmap,
|
||||
pathSkillExpectations,
|
||||
}) {
|
||||
const q = (goalQuery || '').trim()
|
||||
if (!q && !progressionRoadmap) return null
|
||||
return {
|
||||
schema_version: PLANNING_ARTIFACT_SCHEMA,
|
||||
goal_query: q,
|
||||
start_situation: (startSituation || '').trim() || null,
|
||||
target_state: (targetState || '').trim() || null,
|
||||
roadmap_notes: (roadmapNotes || '').trim() || null,
|
||||
max_steps: Number(maxSteps) || 5,
|
||||
progression_roadmap: progressionRoadmap || null,
|
||||
path_skill_expectations: pathSkillExpectations || null,
|
||||
}
|
||||
}
|
||||
|
||||
/** Einfügen wächst den Pfad; Ersetzen (replace_step_index) nicht. */
|
||||
function offerGrowsPath(offer) {
|
||||
const replaceIdx = offer?.replace_step_index
|
||||
@@ -329,6 +354,93 @@ export default function ExerciseProgressionPathBuilder({
|
||||
const [gapPrepSupplements, setGapPrepSupplements] = useState('')
|
||||
const [gapPrepFocusAreaId, setGapPrepFocusAreaId] = useState('')
|
||||
const [gapPrepError, setGapPrepError] = useState('')
|
||||
const [loadedPlanningHint, setLoadedPlanningHint] = useState(false)
|
||||
|
||||
const buildPlanningArtifact = useCallback(
|
||||
() =>
|
||||
buildPlanningRoadmapArtifactSnapshot({
|
||||
goalQuery,
|
||||
startSituation,
|
||||
targetState,
|
||||
roadmapNotes,
|
||||
maxSteps,
|
||||
progressionRoadmap,
|
||||
pathSkillExpectations,
|
||||
}),
|
||||
[
|
||||
goalQuery,
|
||||
startSituation,
|
||||
targetState,
|
||||
roadmapNotes,
|
||||
maxSteps,
|
||||
progressionRoadmap,
|
||||
pathSkillExpectations,
|
||||
],
|
||||
)
|
||||
|
||||
const persistPlanningRoadmapToGraph = useCallback(async () => {
|
||||
if (!graphId) return
|
||||
const artifact = buildPlanningArtifact()
|
||||
if (!artifact?.goal_query && !artifact?.progression_roadmap) return
|
||||
try {
|
||||
await api.updateExerciseProgressionGraph(Number(graphId), { planning_roadmap: artifact })
|
||||
} catch (e) {
|
||||
console.warn('Planungs-Artefakt konnte nicht gespeichert werden', e)
|
||||
}
|
||||
}, [graphId, buildPlanningArtifact])
|
||||
|
||||
useEffect(() => {
|
||||
if (!graphId) return
|
||||
let cancelled = false
|
||||
setLoadedPlanningHint(false)
|
||||
setPathSteps([])
|
||||
setTargetSummary(null)
|
||||
setSemanticBrief(null)
|
||||
setPathQa(null)
|
||||
setGapFillOffers([])
|
||||
setPathSkillExpectations(null)
|
||||
setEditableMajorSteps([])
|
||||
setProgressionRoadmap(null)
|
||||
setRoadmapDirty(false)
|
||||
setStartTargetAnalyzed(false)
|
||||
setError('')
|
||||
|
||||
api
|
||||
.getExerciseProgressionGraph(Number(graphId))
|
||||
.then((g) => {
|
||||
if (cancelled) return
|
||||
const art = g?.planning_roadmap
|
||||
if (!art) return
|
||||
if (art.goal_query) setGoalQuery(String(art.goal_query))
|
||||
if (art.start_situation) setStartSituation(String(art.start_situation))
|
||||
if (art.target_state) setTargetState(String(art.target_state))
|
||||
if (art.roadmap_notes) setRoadmapNotes(String(art.roadmap_notes))
|
||||
if (art.max_steps) setMaxSteps(Number(art.max_steps))
|
||||
if (art.path_skill_expectations) setPathSkillExpectations(art.path_skill_expectations)
|
||||
if (art.progression_roadmap) {
|
||||
setProgressionRoadmap(art.progression_roadmap)
|
||||
const majors = mapMajorStepsFromApi(art.progression_roadmap)
|
||||
if (majors.length >= 2) {
|
||||
setEditableMajorSteps(majors)
|
||||
}
|
||||
}
|
||||
if (
|
||||
art.start_situation ||
|
||||
art.target_state ||
|
||||
art.progression_roadmap?.resolved_structured
|
||||
) {
|
||||
setStartTargetAnalyzed(true)
|
||||
}
|
||||
setLoadedPlanningHint(true)
|
||||
})
|
||||
.catch((e) => {
|
||||
console.warn(e)
|
||||
})
|
||||
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
}, [graphId])
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
@@ -783,7 +895,7 @@ export default function ExerciseProgressionPathBuilder({
|
||||
const res = await api.suggestProgressionPath({
|
||||
query: q,
|
||||
max_steps: Number(maxSteps),
|
||||
include_llm_intent: false,
|
||||
include_llm_intent: true,
|
||||
include_path_qa: false,
|
||||
include_llm_path_qa: false,
|
||||
include_path_reorder: false,
|
||||
@@ -818,6 +930,8 @@ export default function ExerciseProgressionPathBuilder({
|
||||
setGapFillOffers([])
|
||||
setPathSkillExpectations(null)
|
||||
setRoadmapDirty(false)
|
||||
setLoadedPlanningHint(false)
|
||||
await persistPlanningRoadmapToGraph()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
setError(e.message || 'Roadmap-Vorschlag fehlgeschlagen')
|
||||
@@ -865,6 +979,8 @@ export default function ExerciseProgressionPathBuilder({
|
||||
})
|
||||
applyPathMatchResponse(res, q)
|
||||
setMaxSteps(validSteps.length)
|
||||
setLoadedPlanningHint(false)
|
||||
await persistPlanningRoadmapToGraph()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
setError(e.message || 'Übungs-Match fehlgeschlagen')
|
||||
@@ -899,12 +1015,14 @@ export default function ExerciseProgressionPathBuilder({
|
||||
setSaving(true)
|
||||
setError('')
|
||||
try {
|
||||
const planningArtifact = buildPlanningArtifact()
|
||||
await api.createExerciseProgressionSequence(Number(graphId), {
|
||||
steps: steps.map((s) => ({
|
||||
exercise_id: s.exerciseId,
|
||||
variant_id: s.variantId || null,
|
||||
})),
|
||||
segment_notes,
|
||||
...(planningArtifact ? { planning_roadmap: planningArtifact } : {}),
|
||||
})
|
||||
setPathSteps([])
|
||||
setTargetSummary(null)
|
||||
@@ -942,6 +1060,22 @@ export default function ExerciseProgressionPathBuilder({
|
||||
Zuerst didaktische Roadmap vorschlagen und anpassen, dann Übungen je Major Step aus der Bibliothek matchen.
|
||||
Lücken können mit KI als Übung angelegt werden.
|
||||
</p>
|
||||
{loadedPlanningHint && editableMajorSteps.length > 0 && pathSteps.length === 0 ? (
|
||||
<p
|
||||
style={{
|
||||
fontSize: '12px',
|
||||
color: 'var(--accent-dark)',
|
||||
margin: '0 0 10px',
|
||||
padding: '8px 10px',
|
||||
borderRadius: '8px',
|
||||
background: 'color-mix(in srgb, var(--accent) 8%, var(--surface))',
|
||||
lineHeight: 1.45,
|
||||
}}
|
||||
>
|
||||
Gespeicherte Planung für diesen Graph geladen — Roadmap anpassen und erneut matchen, oder neuen Vorschlag
|
||||
starten.
|
||||
</p>
|
||||
) : null}
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '10px', alignItems: 'flex-end' }}>
|
||||
<div className="form-row" style={{ flex: '2 1 240px', marginBottom: 0 }}>
|
||||
<label className="form-label">Ziel / Entwicklungsrichtung</label>
|
||||
|
||||
Reference in new issue
Block a user