Implement Progression Comparison Logic and Refactor Fetching Methods
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m13s
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m13s
- Introduced `buildProgressionComparePayload` to create a structured comparison response from baseline and proposed evaluation results, enhancing clarity in slot differences. - Refactored `fetchMatchCompare` to `fetchFullMatch` for improved clarity and functionality in fetching progression paths. - Updated `runMatchCompareFlow` to streamline the evaluation process, integrating baseline and match results for a comprehensive comparison. - Enhanced utility functions for managing slot differences and gap fill offers, improving overall data handling in the progression graph editor. - Adjusted frontend components to reflect these changes, ensuring a more intuitive user experience in managing progression paths.
This commit is contained in:
1 parent
53f1c7161f
commit
cec96ae473
2 files changed
+124
-14
No files matched your search
@@ -28,6 +28,7 @@ import {
|
||||
applyEvaluateResponseToDraft,
|
||||
applyGapOfferToDraft,
|
||||
applySelectedCompareSteps,
|
||||
buildProgressionComparePayload,
|
||||
compareSlotDiffs,
|
||||
collectGapOffersFromApiResponse,
|
||||
dedupeGapOffersBySlot,
|
||||
@@ -489,26 +490,26 @@ export default function ProgressionGraphEditor({ graphId, embedded = false, onSa
|
||||
}
|
||||
}
|
||||
|
||||
const fetchMatchCompare = async (synced) => {
|
||||
const res = await api.suggestProgressionPath({
|
||||
const fetchFullMatch = async (synced) =>
|
||||
api.suggestProgressionPath({
|
||||
...buildMatchRequestBase(synced),
|
||||
evaluate_steps: slotsToEvaluateSteps(synced),
|
||||
compare_with_assignments: true,
|
||||
preserve_slot_assignments: false,
|
||||
include_llm_intent: false,
|
||||
include_llm_path_qa: false,
|
||||
})
|
||||
if (!res?.comparison_mode) {
|
||||
throw new Error('Kein Vergleich in der Antwort')
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
const runMatchCompareFlow = async (synced, { source = 'match' } = {}) => {
|
||||
const res = await fetchMatchCompare(synced)
|
||||
setGapFillOffers(mergeGapOffersForDraft(synced, res))
|
||||
presentMatchCompare(res, { source })
|
||||
setPathQa(res?.baseline_path_qa || null)
|
||||
return res
|
||||
setMatchNotice('Schritt 1/2: Aktuellen Pfad bewerten…')
|
||||
const baselineRes = await fetchPathEvaluate(synced)
|
||||
setPathQa(baselineRes?.path_qa || null)
|
||||
|
||||
setMatchNotice('Schritt 2/2: Match für alle Slots (Bibliothek + Lücken)…')
|
||||
const matchRes = await fetchFullMatch(synced)
|
||||
|
||||
const compareRes = buildProgressionComparePayload(baselineRes, matchRes)
|
||||
setGapFillOffers(mergeGapOffersForDraft(synced, baselineRes, matchRes))
|
||||
presentMatchCompare(compareRes, { source })
|
||||
return compareRes
|
||||
}
|
||||
|
||||
const presentMatchCompare = (res, { source = 'manual' } = {}) => {
|
||||
|
||||
Reference in new issue
Block a user