feat(training-unit-editor): enhance combo planning UI and functionality
Deploy Development / deploy (push) Successful in 39s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 11s
Test Suite / playwright-tests (push) Successful in 1m2s
Test Suite / pytest-backend (pull_request) Successful in 33s
Test Suite / lint-backend (pull_request) Successful in 0s
Test Suite / build-frontend (pull_request) Successful in 10s
Test Suite / playwright-tests (pull_request) Successful in 1m2s

- Updated CSS for the combo planning strip to improve layout and visual consistency.
- Refactored `compactComboPlanningCaption` to simplify the display of planning status.
- Introduced a new utility function to infer advance mode from stored slot rows, enhancing profile handling.
- Improved merging logic for slot profiles to ensure accurate representation of advance modes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 4.6 committed 2026-05-13 15:49:14 +02:00
1 parent 3898e8bc2c
commit 81fd7d9b3b
4 files changed
+96 -19

No files matched your search

@@ -1,5 +1,7 @@
/** Effektives Ablaufprofil für Kombination im Coach/in der Planung */
import { inferAdvanceModeFromStoredSlotRow } from './combinationMethodProfileUi'
/** Top-Level: null/undefined aus Planungs-Snapshot löschen keine Katalog-Felder (API liefert oft JSON-null). */
function omitNullUndefinedTop(planObj) {
const out = {}
@@ -11,16 +13,52 @@ function omitNullUndefinedTop(planObj) {
}
/** Je Slot-Zeile: null/undefined aus Planung überschreiben keine Katalog-Werte (z. B. consecutive_reps). */
function patchHasExplicitAdvanceMode(patch) {
return (
Object.prototype.hasOwnProperty.call(patch, 'advance_mode') &&
patch.advance_mode !== null &&
patch.advance_mode !== undefined &&
String(patch.advance_mode).trim() !== ''
)
}
/** Nach Merge: Rep/Manual ohne Sekunden-Arbeit; Zeit ohne advance_mode-Schlüssel. */
function coerceMergedSlotProfileRow(row) {
if (!row || typeof row !== 'object') return row
const inferred = inferAdvanceModeFromStoredSlotRow(row)
if (inferred === 'rep' || inferred === 'manual') {
delete row.load_sec
row.advance_mode = inferred
} else {
delete row.advance_mode
}
return row
}
function mergeSlotProfileFields(prev, patch) {
const base = prev && typeof prev === 'object' ? { ...prev } : {}
if (!patch || typeof patch !== 'object') return base
if (!patch || typeof patch !== 'object') return coerceMergedSlotProfileRow(base)
for (const [k, v] of Object.entries(patch)) {
if (v === null || v === undefined) continue
base[k] = v
}
const loadExplicit =
Object.prototype.hasOwnProperty.call(patch, 'load_sec') &&
patch.load_sec !== null &&
patch.load_sec !== undefined &&
String(patch.load_sec).trim() !== ''
// Nur Arbeitsssekunden aus Planung → Zeitmodus soll Katalog‑advance_mode rep nicht „festhalten“
if (loadExplicit && !patchHasExplicitAdvanceMode(patch)) {
delete base.advance_mode
}
const ix = Number(base.slot_index)
if (Number.isFinite(ix)) base.slot_index = ix
return base
return coerceMergedSlotProfileRow(base)
}
/**