Implement Phase C2 Enhancements for Exercise Suggestions
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 18s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m14s
Test Suite / pytest-backend (pull_request) Successful in 38s
Test Suite / lint-backend (pull_request) Successful in 0s
Test Suite / build-frontend (pull_request) Successful in 13s
Test Suite / k6 /health Baseline (pull_request) Successful in 33s
Test Suite / playwright-tests (pull_request) Successful in 1m13s
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 18s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m14s
Test Suite / pytest-backend (pull_request) Successful in 38s
Test Suite / lint-backend (pull_request) Successful in 0s
Test Suite / build-frontend (pull_request) Successful in 13s
Test Suite / k6 /health Baseline (pull_request) Successful in 33s
Test Suite / playwright-tests (pull_request) Successful in 1m13s
- Incremented version to 0.8.184, reflecting the implementation of Phase C2 features. - Added support for displaying variant lists and suggested variant names in exercise suggestions. - Enhanced the ExercisePickerModal to allow selection of exercise variants and improved handling of variant IDs. - Updated backend logic to enrich planning hits with variant metadata, ensuring accurate exercise variant selection. - Documented changes in the changelog to highlight the new capabilities in planning AI functionality.
This commit is contained in:
1 parent
b2157d8a40
commit
a34e748be5
10 files changed
+280
-27
No files matched your search
@@ -0,0 +1,18 @@
|
||||
/** Varianten-Auswahl beim Übernehmen aus Planungs-KI-Treffern. */
|
||||
export function resolveExercisePickVariantId(exercise, overrideVariantId) {
|
||||
if (exercise == null) return null
|
||||
const raw =
|
||||
overrideVariantId !== undefined && overrideVariantId !== null && overrideVariantId !== ''
|
||||
? overrideVariantId
|
||||
: exercise.exercise_variant_id ?? exercise.suggested_variant_id
|
||||
if (raw == null || raw === '') return null
|
||||
const vid = Number(raw)
|
||||
return Number.isFinite(vid) && vid > 0 ? vid : null
|
||||
}
|
||||
|
||||
export function variantLabelForPick(variants, variantId) {
|
||||
if (variantId == null) return null
|
||||
const list = Array.isArray(variants) ? variants : []
|
||||
const row = list.find((v) => Number(v.id) === Number(variantId))
|
||||
return (row?.variant_name || '').trim() || null
|
||||
}
|
||||
@@ -325,6 +325,18 @@ export async function hydrateExercisePlanningRow(exercise) {
|
||||
row.exercise_variant_id = ''
|
||||
} else {
|
||||
row.variants = variants
|
||||
const pickVidRaw =
|
||||
exercise?.exercise_variant_id ?? exercise?.suggested_variant_id ?? null
|
||||
const pickVid =
|
||||
pickVidRaw != null && pickVidRaw !== '' ? Number(pickVidRaw) : NaN
|
||||
if (Number.isFinite(pickVid) && pickVid > 0) {
|
||||
const known = variants.some((v) => Number(v.id) === pickVid)
|
||||
if (known || !variants.length) row.exercise_variant_id = pickVid
|
||||
}
|
||||
if (row.exercise_variant_id !== '' && variants.length > 0) {
|
||||
const ok = variants.some((v) => Number(v.id) === Number(row.exercise_variant_id))
|
||||
if (!ok) row.exercise_variant_id = ''
|
||||
}
|
||||
}
|
||||
Object.assign(row, meta)
|
||||
if (row.exercise_kind === 'combination') {
|
||||
|
||||
Reference in new issue
Block a user