Enhance Progression Path Suggestion Logic and UI Feedback
Test Suite / pytest-backend (push) Successful in 41s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m18s
Deploy Development / deploy (push) Successful in 44s

- Updated `suggest_progression_path` to include AI-generated gap fill offers when exercises are missing, improving the relevance of suggested paths.
- Introduced a match summary to provide insights on library matches and gap fill offers, enhancing user feedback in the `ProgressionGraphEditor`.
- Refined the `pick_best_path_hit` function to ensure proper handling of roadmap stage matches based on primary topics.
- Added tests to validate the new gap fill offer logic and match summary functionality, ensuring robustness in path suggestion features.
This commit is contained in:
Lars committed 2026-06-11 11:17:53 +02:00
1 parent 044ce2ee60
commit 8f1dad53ab
5 files changed
+121 -8

No files matched your search

+12 -6
View File
@@ -245,7 +245,7 @@ export function filterGapOffersForUnfilledSlots(draft, offers) {
if (idx == null || idx < 0 || idx >= (draft?.slots?.length || 0)) return true
const p = draft.slots[idx]?.primary
if (p?.kind === 'library' && p.exerciseId != null) return false
if (p?.kind === 'proposal') return false
if (p?.kind === 'proposal' && p.aiSuggestion) return false
return true
})
}
@@ -407,13 +407,13 @@ export function majorStepsToOverridePayload(rows) {
major_steps: indexed.map((row) => ({
index: row.index,
phase: row.phase || 'vertiefung',
learning_goal: row.learning_goal.trim(),
learning_goal: (row.learning_goal || '').trim(),
consolidates: row.consolidates || [],
rationale: row.rationale || '',
})),
stage_specs: indexed.map((row, i) => ({
major_step_index: i,
learning_goal: row.learning_goal.trim(),
learning_goal: (row.learning_goal || '').trim(),
load_profile: Array.isArray(row.load_profile) ? row.load_profile : [],
exercise_type: (row.exercise_type || '').trim(),
success_criteria: Array.isArray(row.success_criteria) ? row.success_criteria : [],
@@ -521,9 +521,12 @@ function buildSlotsFromSources({ majorSteps, slotContents, primaryChain, sibling
? slotContents.find((s) => Number(s.major_step_index) === i)
: null
const hasSavedSlotContents = Array.isArray(slotContents) && slotContents.length > 0
let primary = saved?.primary
? slotExerciseFromApi(saved.primary)
: chainNodeToLibrary(primaryChain?.nodes?.[i])
: hasSavedSlotContents
? emptySlotExercise()
: chainNodeToLibrary(primaryChain?.nodes?.[i])
if (primary.kind === 'empty' && saved?.primary) {
primary = slotExerciseFromApi(saved.primary)
@@ -760,7 +763,10 @@ export function applyMatchStepsToSlots(draft, apiSteps) {
touchedMajors.add(idx)
const isProposal = Boolean(step.is_ai_proposal) || step.exercise_id == null
if (isProposal) {
const hasAiPayload = Boolean(step.ai_suggestion) || Boolean(step.proposal_key)
if (isProposal && !hasAiPayload) {
nextSlots[idx].primary = emptySlotExercise()
} else if (isProposal) {
nextSlots[idx].primary = proposalSlotExercise({
title: step.title || nextSlots[idx].learning_goal,
proposalKey: step.proposal_key,
@@ -804,7 +810,7 @@ export function applyGapOffersFromResponse(draft, res, { replaceOffTopicSlots =
offer?.replace_step_index != null
if (!isOffTopicReplace) {
if (primary?.kind === 'library' && primary.exerciseId != null) continue
if (primary?.kind === 'proposal') continue
if (primary?.kind === 'proposal' && primary.aiSuggestion) continue
}
next = applyGapOfferToSlot(next, idx, offer)