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

+117 -41
View File
@@ -17,7 +17,7 @@ import { autoScrollForDragNearEdges } from '../utils/dragAutoScroll'
import { SKILL_LEVEL_OPTIONS, normalizeSkillLevelSlug } from '../constants/skillLevels'
import { useAuth } from '../context/AuthContext'
import { COMBINATION_ARCHETYPE_OPTIONS } from '../constants/combinationArchetypes'
import { readSlotProfilesV1 } from '../utils/combinationMethodProfileUi'
import { readSlotProfilesV1, normalizeAdvanceMode } from '../utils/combinationMethodProfileUi'
import { GripVertical } from 'lucide-react'
const INTENSITY_OPTIONS = [
@@ -38,11 +38,23 @@ const VARIANT_DIFFICULTY = [
/** HTML5-DnD für Kombi-Stationen (Reihenfolge = Ablauf). */
const DND_EXERCISE_COMBO_STATION = 'application/x-shinkan-exercise-combo-station-v1'
/** Pro Station meist 1 Übung; bis zu 3 wenn kurzer Auswahl-Pool sinnvoll ist. */
const MAX_COMBO_CANDIDATES_PER_STATION = 3
const comboTinyNumberInputSx = {
width: '3.5rem',
maxWidth: '100%',
padding: '4px 6px',
fontSize: '0.8125rem',
textAlign: 'center',
}
function emptyComboSlotRow() {
return {
title: '',
candidate_exercise_ids: [],
exercise_title_by_id: {},
advance_mode: 'timed',
load_sec: '',
consecutive_reps: '',
intra_rep_rest_sec: '',
@@ -75,6 +87,7 @@ function comboSlotsFromDetail(exercise) {
title: s.title != null ? String(s.title) : '',
candidate_exercise_ids: cands,
exercise_title_by_id: {},
advance_mode: normalizeAdvanceMode(st.advance_mode),
load_sec: st.load_sec != null ? String(st.load_sec) : '',
consecutive_reps: st.consecutive_reps != null ? String(st.consecutive_reps) : '',
intra_rep_rest_sec: st.intra_rep_rest_sec != null ? String(st.intra_rep_rest_sec) : '',
@@ -651,22 +664,38 @@ function ExerciseFormPage() {
const mergePickedExercisesIntoSlot = (slotIdx, pickedList) => {
if (!Array.isArray(pickedList) || !pickedList.length) return
const rowNow = (formData.combination_slots || [])[slotIdx] || emptyComboSlotRow()
const existingIds = Array.isArray(rowNow.candidate_exercise_ids)
? rowNow.candidate_exercise_ids.map((n) => Number(n)).filter((n) => Number.isFinite(n))
: []
const ordered = [...existingIds]
pickedList.forEach((ex) => {
if (ex?.id == null) return
const id = Number(ex.id)
if (!Number.isFinite(id)) return
if (!ordered.includes(id)) ordered.push(id)
})
let nextIds = ordered
if (nextIds.length > MAX_COMBO_CANDIDATES_PER_STATION) {
window.alert(
`Pro Station höchstens ${MAX_COMBO_CANDIDATES_PER_STATION} Übungen — üblich eine feste Übung; zwei bis drei nur als kleiner Wechsel‑Pool. Überschüssige Auswahl wurde abgeschnitten.`,
)
nextIds = nextIds.slice(0, MAX_COMBO_CANDIDATES_PER_STATION)
}
setFormDirty(true)
setFormData((prev) => {
const rows = [...(prev.combination_slots || [])]
const row = rows[slotIdx] || emptyComboSlotRow()
const nextSet = new Set((row.candidate_exercise_ids || []).map((n) => Number(n)))
const labels =
row.exercise_title_by_id && typeof row.exercise_title_by_id === 'object' ? { ...row.exercise_title_by_id } : {}
pickedList.forEach((ex) => {
if (ex && ex.id != null) {
const id = Number(ex.id)
nextSet.add(id)
const t = (ex.title || '').trim()
if (t) labels[id] = t
}
})
rows[slotIdx] = { ...row, candidate_exercise_ids: [...nextSet], exercise_title_by_id: labels }
rows[slotIdx] = { ...row, candidate_exercise_ids: nextIds, exercise_title_by_id: labels }
return { ...prev, combination_slots: rows }
})
}
@@ -1154,16 +1183,22 @@ function ExerciseFormPage() {
) : null}
<div style={{ paddingTop: '4px', borderTop: '1px dashed var(--border)', marginBottom: '12px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', gap: '8px', flexWrap: 'wrap' }}>
<strong style={{ fontSize: '14px' }}>Stationen und Übungs‑Pool</strong>
<strong style={{ fontSize: '14px' }}>Stationen</strong>
<span style={{ fontSize: '11px', color: 'var(--text3)' }}>
Reihenfolge = Ablauf · ziehen oder Pfeile · nur Einzelübungen wählbar
Ablauf = Reihenfolge · ziehen / Pfeile · Einzelübungen · max. {MAX_COMBO_CANDIDATES_PER_STATION}/Station
</span>
</div>
<p style={{ fontSize: '12px', color: 'var(--text2)', margin: '6px 0 12px', lineHeight: 1.48 }}>
Jede Station: Titel (optional), am Ort wählbare <strong>Einzelübungen</strong> sowie die typischen Zeiten für genau diese Station (Belastungsdauer, Wiederholungsbündel, Pausen).
Pro Station oft <strong>eine</strong> feste Übung; höchstens <strong>drei</strong> als kleiner Auswahl‑Pool.
Unter <strong>Steuerung</strong> wählen: zeitlich, nach Wiederholungszahl oder ohne Arbeitsuhr (Coach führt).
</p>
{(formData.combination_slots || []).map((row, idx) => {
const candIds = Array.isArray(row.candidate_exercise_ids) ? row.candidate_exercise_ids : []
const comboPoolFull = candIds.length >= MAX_COMBO_CANDIDATES_PER_STATION
const slotAdv = normalizeAdvanceMode(row.advance_mode)
const serieLabel =
slotAdv === 'timed' ? 'Serie' : slotAdv === 'rep' ? 'Ziel‑Wdh.' : 'Richtwert'
const seriePlaceholder = slotAdv === 'rep' ? '10' : slotAdv === 'manual' ? '–' : '1'
const lbl =
row.exercise_title_by_id && typeof row.exercise_title_by_id === 'object'
? row.exercise_title_by_id
@@ -1234,13 +1269,13 @@ function ExerciseFormPage() {
</div>
<div className="form-row" style={{ flex: '1 1 200px', marginBottom: 0 }}>
<label className="form-label" style={{ fontSize: '12px' }}>
Station {idx + 1} — Titel
Name (St.&nbsp;{idx + 1})
</label>
<input
type="text"
className="form-input"
value={row.title || ''}
placeholder={`z. B. Station ${idx + 1}`}
placeholder="z.&nbsp;B. Liegestütz"
onChange={(e) => patchComboSlotRow(idx, { title: e.target.value })}
/>
</div>
@@ -1248,31 +1283,39 @@ function ExerciseFormPage() {
<button
type="button"
className="btn btn-secondary framework-ctrl framework-ctrl--xs"
disabled={comboPoolFull}
title={
comboPoolFull
? `Max. ${MAX_COMBO_CANDIDATES_PER_STATION} Übungen — eine entfernen, um weitere zu wählen.`
: 'Einzelübung zur Station hinzufügen'
}
onClick={() => setComboStationPickerIx(idx)}
>
Einzelübungen wählen…
+ Übung
</button>
<button
type="button"
className="btn framework-ctrl framework-ctrl--xs"
style={{ fontSize: '12px' }}
title="Station entfernen"
title="Diese Station entfernen"
onClick={() => {
const prev = formData.combination_slots || []
const next = prev.filter((_, j) => j !== idx)
updateFormField('combination_slots', next.length ? next : [emptyComboSlotRow()])
}}
>
Station entfernen
Entfernen
</button>
</div>
</div>
<div style={{ marginBottom: '12px' }}>
<span className="form-label" style={{ fontSize: '11px', display: 'block', marginBottom: '6px' }}>
Gewählte Einzelübungen (Pool für diese Station)
Übungen ({candIds.length}/{MAX_COMBO_CANDIDATES_PER_STATION})
</span>
{candIds.length === 0 ? (
<p style={{ fontSize: '12px', color: 'var(--text3)', margin: 0 }}>Noch keine Übung gewählt — mindestens eine erforderlich zum Speichern.</p>
<p style={{ fontSize: '12px', color: 'var(--text3)', margin: 0 }}>
Mindestens eine Übung — mit „+ Übung“ wählen.
</p>
) : (
<ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexWrap: 'wrap', gap: '6px' }}>
{candIds.map((id) => (
@@ -1306,62 +1349,95 @@ function ExerciseFormPage() {
</ul>
)}
</div>
<div className="form-row" style={{ marginBottom: '8px', maxWidth: '22rem' }}>
<label className="form-label" style={{ fontSize: '11px' }}>
Steuerung
</label>
<select
className="form-input"
style={{ fontSize: '0.8125rem' }}
value={slotAdv}
onChange={(e) => {
const m = normalizeAdvanceMode(e.target.value)
const patch = { advance_mode: m }
if (m !== 'timed') patch.load_sec = ''
patchComboSlotRow(idx, patch)
}}
>
<option value="timed">Zeit (Arbeit in Sekunden)</option>
<option value="rep">Wiederholungen (Ziel)</option>
<option value="manual">Coach (Weiter nach Freigabe)</option>
</select>
</div>
<p style={{ fontSize: '11px', color: 'var(--text3)', margin: '0 0 10px', lineHeight: 1.42 }}>
{slotAdv === 'timed'
? 'Arbeit (s): geplantes Ende nach Countdown möglich. Serie: Wiederholungen ohne Stationswechsel innerhalb einer Phase.'
: slotAdv === 'rep'
? 'Ohne Pflicht-Arbeits-Timer: Ziel über Wiederholungen; Pause/Wechsel können weiter automatisch unterstützt werden.'
: 'Ohne feste Arbeitsuhr auf dieser Station — Fortschritt im Coach später per Tippschritt; Pause/Wechsel optional weiter mit Sekunden.'}
</p>
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(140px, 1fr))',
gap: '10px',
gridTemplateColumns: 'repeat(auto-fill, minmax(5.25rem, 1fr))',
gap: '8px 10px',
alignItems: 'end',
}}
>
{slotAdv === 'timed' ? (
<div className="form-row" style={{ marginBottom: 0 }}>
<label className="form-label" style={{ fontSize: '10px' }}>
Arbeit (s)
</label>
<input
type="number"
min={0}
className="form-input"
style={comboTinyNumberInputSx}
placeholder="–"
value={row.load_sec || ''}
onChange={(e) => patchComboSlotRow(idx, { load_sec: e.target.value })}
/>
</div>
) : null}
<div className="form-row" style={{ marginBottom: 0 }}>
<label className="form-label" style={{ fontSize: '11px' }}>
Belastung an Station (s)
<label className="form-label" style={{ fontSize: '10px' }}>
{serieLabel}
</label>
<input
type="number"
min={0}
min={slotAdv === 'rep' ? 1 : undefined}
className="form-input"
placeholder="optional"
value={row.load_sec || ''}
onChange={(e) => patchComboSlotRow(idx, { load_sec: e.target.value })}
/>
</div>
<div className="form-row" style={{ marginBottom: 0 }}>
<label className="form-label" style={{ fontSize: '11px' }}>
Wdh. ohne Wechsel
</label>
<input
type="number"
min={1}
className="form-input"
placeholder="oft 1"
style={comboTinyNumberInputSx}
placeholder={seriePlaceholder}
value={row.consecutive_reps || ''}
onChange={(e) => patchComboSlotRow(idx, { consecutive_reps: e.target.value })}
/>
</div>
<div className="form-row" style={{ marginBottom: 0 }}>
<label className="form-label" style={{ fontSize: '11px' }}>
Pause zwischen Wdh. (s)
<label className="form-label" style={{ fontSize: '10px' }}>
Pause (s)
</label>
<input
type="number"
min={0}
className="form-input"
placeholder="optional"
style={comboTinyNumberInputSx}
placeholder="–"
value={row.intra_rep_rest_sec || ''}
onChange={(e) => patchComboSlotRow(idx, { intra_rep_rest_sec: e.target.value })}
/>
</div>
<div className="form-row" style={{ marginBottom: 0 }}>
<label className="form-label" style={{ fontSize: '11px' }}>
Pause / nächste Station (s)
<label className="form-label" style={{ fontSize: '10px' }}>
Wechsel (s)
</label>
<input
type="number"
min={0}
className="form-input"
placeholder="optional"
style={comboTinyNumberInputSx}
placeholder="–"
value={row.transition_after_sec || ''}
onChange={(e) => patchComboSlotRow(idx, { transition_after_sec: e.target.value })}
/>
@@ -1403,11 +1479,11 @@ function ExerciseFormPage() {
style={{ fontSize: '12px', marginTop: '4px' }}
onClick={() => updateFormField('combination_slots', [...(formData.combination_slots || []), emptyComboSlotRow()])}
>
+ Station hinzufügen
+ Station
</button>
</div>
<div className="form-row">
<label className="form-label">Ablaufprofil (Globale Zeiten &amp; Gesamtdurchläufe)</label>
<label className="form-label">Ablaufprofil (Runden &amp; global)</label>
<CombinationMethodProfileEditor
methodArchetype={formData.method_archetype || ''}
methodProfileJson={formData.method_profile_json || '{}'}