feat(version): bump to 0.8.106 and enhance combination exercise features
Deploy Development / deploy (push) Successful in 38s
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 55s

- Updated app version to 0.8.106, reflecting recent improvements in combination exercise handling.
- Introduced `advance_mode` for slot profiles, allowing for flexible timing options (timed, repetitions, manual) in the CombinationMethodProfileEditor.
- Enhanced the CombinationCoachSlots component to display timing summaries based on the selected advance mode.
- Updated ExerciseFormPage to manage combination slots with new validation and user feedback for exercise selection.
- Documented changes in the changelog for better tracking of feature enhancements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 4.6 committed 2026-05-13 08:19:46 +02:00
1 parent ce63d46cf4
commit 38d84ecdf6
7 files changed
+306 -80

No files matched your search

+4 -1
View File
@@ -5,6 +5,7 @@
*/
import { stripHtmlToText } from './htmlUtils'
import { normalizeAdvanceMode } from './combinationMethodProfileUi'
const API_URL = import.meta.env.VITE_API_URL || ''
@@ -541,11 +542,13 @@ export function buildExerciseApiPayload(formData, extras = {}) {
for (let i = 0; i < slotRows.length; i += 1) {
const row = slotRows[i] || {}
const o = { slot_index: i }
const advanceMode = normalizeAdvanceMode(row.advance_mode)
if (advanceMode !== 'timed') o.advance_mode = advanceMode
const load = parseTimingField(row.load_sec)
const crs = parseTimingField(row.consecutive_reps)
const intra = parseTimingField(row.intra_rep_rest_sec)
const tran = parseTimingField(row.transition_after_sec)
if (load !== undefined && load >= 0) o.load_sec = Math.round(load)
if (advanceMode === 'timed' && load !== undefined && load >= 0) o.load_sec = Math.round(load)
if (crs !== undefined && crs >= 1) o.consecutive_reps = Math.round(crs)
if (intra !== undefined && intra >= 0) o.intra_rep_rest_sec = Math.round(intra)
if (tran !== undefined && tran >= 0) o.transition_after_sec = Math.round(tran)
@@ -5,6 +5,16 @@
const INT_MAX = 86400
/** Pro Station: zeitlich (Standard), mengenorientiert oder coachgeführt (ohne Arbeits-Countdown). */
export const SLOT_ADVANCE_MODES = Object.freeze(['timed', 'rep', 'manual'])
export function normalizeAdvanceMode(v) {
const s = typeof v === 'string' ? v.trim().toLowerCase() : ''
if (s === 'rep' || s === 'reps' || s === 'count') return 'rep'
if (s === 'manual' || s === 'coach' || s === 'coach_led') return 'manual'
return 'timed'
}
function parseProfileJson(raw) {
if (typeof raw !== 'string' || !raw.trim()) return { ok: true, obj: {} }
try {
@@ -209,13 +219,16 @@ export function readSlotProfilesV1(profileObj) {
return raw.map((row) => {
if (!row || typeof row !== 'object') return null
const si = Number(row.slot_index)
return {
const mode = normalizeAdvanceMode(row.advance_mode)
const out = {
slot_index: Number.isFinite(si) ? si : 0,
advance_mode: mode,
load_sec: normalizeOptionalNonNegInt(row.load_sec),
consecutive_reps: normalizeOptionalPositiveInt(row.consecutive_reps),
intra_rep_rest_sec: normalizeOptionalNonNegInt(row.intra_rep_rest_sec),
transition_after_sec: normalizeOptionalNonNegInt(row.transition_after_sec),
}
return out
}).filter(Boolean)
}
@@ -240,6 +253,55 @@ const SLOT_TIMING_FIELDS = /** @type {const} */ ([
'transition_after_sec',
])
function slotProfileRowShouldKeep(nextRow) {
if (!nextRow || typeof nextRow !== 'object') return false
const mode = normalizeAdvanceMode(nextRow.advance_mode)
if (mode !== 'timed') return true
return SLOT_TIMING_FIELDS.some((k) => nextRow[k] !== undefined && nextRow[k] !== null)
}
function writeSlotProfilesV1Arr(profileDraft, arr) {
const sorted = [...arr].sort((a, b) => Number(a.slot_index) - Number(b.slot_index))
if (sorted.length === 0) delete profileDraft.slot_profiles_v1
else profileDraft.slot_profiles_v1 = sorted
}
/** Steuert Ende der Arbeitsphase: Zeit, Wiederholungsziel oder nur manuell weiter. */
export function patchSlotAdvanceMode(profileDraft, slotIndex, modeRaw) {
const ix =
typeof slotIndex === 'number' && Number.isFinite(slotIndex)
? slotIndex
: parseInt(String(slotIndex), 10)
if (!Number.isFinite(ix)) return
const mode = normalizeAdvanceMode(modeRaw)
let arr = Array.isArray(profileDraft.slot_profiles_v1) ? [...profileDraft.slot_profiles_v1] : []
const found = arr.findIndex((r) => r && typeof r === 'object' && Number(r.slot_index) === ix)
const nextRow = {}
if (found >= 0 && arr[found] && typeof arr[found] === 'object') {
Object.assign(nextRow, arr[found])
}
nextRow.slot_index = ix
if (mode === 'timed') delete nextRow.advance_mode
else {
nextRow.advance_mode = mode
delete nextRow.load_sec
}
let nextArr
if (!slotProfileRowShouldKeep(nextRow)) {
nextArr = found >= 0 ? arr.filter((_, i) => i !== found) : arr
} else if (found >= 0) {
nextArr = [...arr]
nextArr[found] = nextRow
} else {
nextArr = [...arr, nextRow]
}
writeSlotProfilesV1Arr(profileDraft, nextArr)
}
/** '', null = Feld entfernen; sonst gültige Zahl setzen */
export function patchSlotTimingField(profileDraft, slotIndex, field, rawInput) {
if (!SLOT_TIMING_FIELDS.includes(field)) return
@@ -270,22 +332,19 @@ export function patchSlotTimingField(profileDraft, slotIndex, field, rawInput) {
else nextRow[field] = n
}
const hasTiming = SLOT_TIMING_FIELDS.some((k) => nextRow[k] !== undefined && nextRow[k] !== null)
const keep = slotProfileRowShouldKeep(nextRow)
if (found >= 0) {
if (!hasTiming) {
if (!keep) {
arr = arr.filter((_, i) => i !== found)
} else {
arr[found] = nextRow
}
} else if (hasTiming) {
} else if (keep) {
arr.push(nextRow)
}
arr.sort((a, b) => Number(a.slot_index) - Number(b.slot_index))
if (arr.length === 0) delete profileDraft.slot_profiles_v1
else profileDraft.slot_profiles_v1 = arr
writeSlotProfilesV1Arr(profileDraft, arr)
}
/** Rotierender Zirkel: typische Ableitungen (setzt Sekunden konkret). */