feat(version): bump to 0.8.109 and enhance combination exercise features
Deploy Development / deploy (push) Successful in 42s
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 56s
Deploy Development / deploy (push) Successful in 42s
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 56s
- Updated app version to 0.8.109, reflecting recent improvements in combination exercise handling. - Introduced `rep_series_count` for slot profiles, allowing for multiple series in `rep` and `manual` modes, enhancing flexibility in exercise configurations. - Updated the CombinationMethodProfileEditor and CombinationCoachSlots components to support and display the new series count feature. - Enhanced ExerciseFormPage to manage series count and intra-series pauses effectively, improving user experience. - 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:
1 parent
38d84ecdf6
commit
cf9932990e
9 files changed
+251
-48
No files matched your search
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { stripHtmlToText } from './htmlUtils'
|
||||
import { normalizeAdvanceMode } from './combinationMethodProfileUi'
|
||||
import { normalizeAdvanceMode, parseComboRepSeriesCountUi } from './combinationMethodProfileUi'
|
||||
|
||||
const API_URL = import.meta.env.VITE_API_URL || ''
|
||||
|
||||
@@ -546,11 +546,24 @@ export function buildExerciseApiPayload(formData, extras = {}) {
|
||||
if (advanceMode !== 'timed') o.advance_mode = advanceMode
|
||||
const load = parseTimingField(row.load_sec)
|
||||
const crs = parseTimingField(row.consecutive_reps)
|
||||
const rsc = parseTimingField(row.rep_series_count)
|
||||
const intra = parseTimingField(row.intra_rep_rest_sec)
|
||||
const tran = parseTimingField(row.transition_after_sec)
|
||||
const serienUi = parseComboRepSeriesCountUi(row.rep_series_count)
|
||||
const allowInterSeriesPause =
|
||||
advanceMode === 'timed' ||
|
||||
((advanceMode === 'rep' || advanceMode === 'manual') && serienUi >= 2)
|
||||
|
||||
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 (
|
||||
rsc !== undefined &&
|
||||
rsc >= 1 &&
|
||||
(advanceMode === 'rep' || advanceMode === 'manual')
|
||||
) {
|
||||
o.rep_series_count = Math.round(rsc)
|
||||
}
|
||||
if (intra !== undefined && intra >= 0 && allowInterSeriesPause) o.intra_rep_rest_sec = Math.round(intra)
|
||||
if (tran !== undefined && tran >= 0) o.transition_after_sec = Math.round(tran)
|
||||
if (Object.keys(o).length > 1) slot_profiles_v1_next.push(o)
|
||||
}
|
||||
|
||||
@@ -15,6 +15,15 @@ export function normalizeAdvanceMode(v) {
|
||||
return 'timed'
|
||||
}
|
||||
|
||||
/** UI: Serien-Anzahl aus Formularfeld; leer/ungültig ⇒ 1 (eine Serie). */
|
||||
export function parseComboRepSeriesCountUi(raw) {
|
||||
if (raw === '' || raw === undefined || raw === null) return 1
|
||||
const n =
|
||||
typeof raw === 'number' && Number.isFinite(raw) ? Math.round(raw) : parseInt(String(raw).trim(), 10)
|
||||
if (!Number.isFinite(n) || n < 1) return 1
|
||||
return n
|
||||
}
|
||||
|
||||
function parseProfileJson(raw) {
|
||||
if (typeof raw !== 'string' || !raw.trim()) return { ok: true, obj: {} }
|
||||
try {
|
||||
@@ -225,6 +234,7 @@ export function readSlotProfilesV1(profileObj) {
|
||||
advance_mode: mode,
|
||||
load_sec: normalizeOptionalNonNegInt(row.load_sec),
|
||||
consecutive_reps: normalizeOptionalPositiveInt(row.consecutive_reps),
|
||||
rep_series_count: normalizeOptionalPositiveInt(row.rep_series_count),
|
||||
intra_rep_rest_sec: normalizeOptionalNonNegInt(row.intra_rep_rest_sec),
|
||||
transition_after_sec: normalizeOptionalNonNegInt(row.transition_after_sec),
|
||||
}
|
||||
@@ -249,6 +259,7 @@ function normalizeOptionalPositiveInt(v) {
|
||||
const SLOT_TIMING_FIELDS = /** @type {const} */ ([
|
||||
'load_sec',
|
||||
'consecutive_reps',
|
||||
'rep_series_count',
|
||||
'intra_rep_rest_sec',
|
||||
'transition_after_sec',
|
||||
])
|
||||
@@ -322,7 +333,7 @@ export function patchSlotTimingField(profileDraft, slotIndex, field, rawInput) {
|
||||
|
||||
if (rawInput === null || rawInput === undefined || String(rawInput).trim() === '') {
|
||||
delete nextRow[field]
|
||||
} else if (field === 'consecutive_reps') {
|
||||
} else if (field === 'consecutive_reps' || field === 'rep_series_count') {
|
||||
const n = normalizeOptionalPositiveInt(rawInput)
|
||||
if (n === undefined) delete nextRow[field]
|
||||
else nextRow[field] = n
|
||||
|
||||
Reference in new issue
Block a user