Enhance Exercise Progression Graph Panel and Editor with New Features
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 33s
Test Suite / playwright-tests (push) Successful in 1m26s
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 33s
Test Suite / playwright-tests (push) Successful in 1m26s
- Refactored `ExerciseProgressionGraphPanel` to support a create dialog for new progression graphs, improving user experience. - Integrated `ProgressionGraphListCard` for better visualization of existing graphs and streamlined management. - Updated `ProgressionGraphEditor` to handle start/target analysis and improved draft hydration with AI suggestions. - Added utility functions for managing structured responses from AI, enhancing the planning process. - Incremented application version to reflect these updates.
This commit is contained in:
1 parent
3b483346de
commit
48d51c07c5
5 files changed
+687
-276
No files matched your search
@@ -4,8 +4,53 @@
|
||||
|
||||
export const ROADMAP_PHASES = ['einstieg', 'grundlage', 'vertiefung', 'anwendung', 'perfektion']
|
||||
export const SLOT_MAX = 10
|
||||
export const SLOT_MIN = 2
|
||||
export const PLANNING_ARTIFACT_SCHEMA = 1
|
||||
|
||||
/** Start/Ziel/Ergänzungen aus KI-Roadmap-Antwort (resolved_structured). */
|
||||
export function resolvedStructuredFromRoadmap(progressionRoadmap) {
|
||||
const rs = progressionRoadmap?.resolved_structured
|
||||
if (!rs) return null
|
||||
const patch = {}
|
||||
if (rs.start_situation) patch.startSituation = String(rs.start_situation)
|
||||
if (rs.target_state) patch.targetState = String(rs.target_state)
|
||||
if (rs.roadmap_notes) patch.roadmapNotes = String(rs.roadmap_notes)
|
||||
return Object.keys(patch).length ? patch : null
|
||||
}
|
||||
|
||||
export function applyResolvedStructuredToDraft(draft, progressionRoadmap, { onlyIfEmpty = false } = {}) {
|
||||
const patch = resolvedStructuredFromRoadmap(progressionRoadmap)
|
||||
if (!patch) return draft
|
||||
const next = { ...draft }
|
||||
if (patch.startSituation && (!onlyIfEmpty || !(draft.startSituation || '').trim())) {
|
||||
next.startSituation = patch.startSituation
|
||||
}
|
||||
if (patch.targetState && (!onlyIfEmpty || !(draft.targetState || '').trim())) {
|
||||
next.targetState = patch.targetState
|
||||
}
|
||||
if (patch.roadmapNotes && (!onlyIfEmpty || !(draft.roadmapNotes || '').trim())) {
|
||||
next.roadmapNotes = patch.roadmapNotes
|
||||
}
|
||||
return { ...next, dirty: true }
|
||||
}
|
||||
|
||||
export function graphGoalQueryFromRow(graph) {
|
||||
const art = graph?.planning_roadmap
|
||||
if (!art || typeof art !== 'object') return ''
|
||||
return (art.goal_query || '').trim()
|
||||
}
|
||||
|
||||
export function graphSlotCountFromRow(graph) {
|
||||
const art = graph?.planning_roadmap
|
||||
if (!art || typeof art !== 'object') return null
|
||||
const slots = art.slot_contents
|
||||
if (Array.isArray(slots) && slots.length) return slots.length
|
||||
const majors = art.progression_roadmap?.roadmap?.major_steps
|
||||
if (Array.isArray(majors) && majors.length) return majors.length
|
||||
const ms = Number(art.max_steps)
|
||||
return Number.isFinite(ms) && ms > 0 ? ms : null
|
||||
}
|
||||
|
||||
const OFFER_SOURCE_LABELS = {
|
||||
unfilled_gap: 'Lücke',
|
||||
off_topic: 'Themenfremd',
|
||||
|
||||
Reference in new issue
Block a user