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
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:
1 parent
ce63d46cf4
commit
38d84ecdf6
7 files changed
+306
-80
No files matched your search
@@ -10,9 +10,28 @@ import {
|
||||
combinationArchetypeLabel,
|
||||
sortCombinationSlotsForDisplay,
|
||||
} from '../constants/combinationArchetypes'
|
||||
import { readSlotProfilesV1 } from '../utils/combinationMethodProfileUi'
|
||||
|
||||
function summarizeSlotProfilesRow(r) {
|
||||
if (!r) return null
|
||||
const adv = r.advance_mode || 'timed'
|
||||
const bits = []
|
||||
if (adv === 'timed') {
|
||||
bits.push('Zeit')
|
||||
if (r.load_sec != null) bits.push(`${r.load_sec}s Arbeit`)
|
||||
} else if (adv === 'rep') {
|
||||
bits.push('Ziel‑Wdh.')
|
||||
if (r.consecutive_reps != null) bits.push(`${r.consecutive_reps}×`)
|
||||
} else {
|
||||
bits.push('Coach')
|
||||
if (r.consecutive_reps != null) bits.push(`Richtwert ${r.consecutive_reps}×`)
|
||||
}
|
||||
if (r.intra_rep_rest_sec != null) bits.push(`Pause ${r.intra_rep_rest_sec}s`)
|
||||
if (r.transition_after_sec != null) bits.push(`Wechsel ${r.transition_after_sec}s`)
|
||||
return bits.join(' · ')
|
||||
}
|
||||
|
||||
export default function CombinationCoachSlots({ combinationSlots, methodArchetype, methodProfile }) {
|
||||
const slots = useMemo(() => sortCombinationSlotsForDisplay(combinationSlots), [combinationSlots])
|
||||
|
||||
const candidateIds = useMemo(() => {
|
||||
const set = new Set()
|
||||
@@ -76,6 +95,23 @@ export default function CombinationCoachSlots({ combinationSlots, methodArchetyp
|
||||
const archeKey = methodArchetype != null ? String(methodArchetype).trim() : ''
|
||||
const archDisplay = archeKey ? combinationArchetypeLabel(archeKey) : null
|
||||
|
||||
const slotTimingByIx = useMemo(() => {
|
||||
if (!methodProfile || typeof methodProfile !== 'object' || Array.isArray(methodProfile)) return new Map()
|
||||
const rows = readSlotProfilesV1(methodProfile)
|
||||
const m = new Map()
|
||||
for (const r of rows) {
|
||||
m.set(Number(r.slot_index), r)
|
||||
}
|
||||
return m
|
||||
}, [methodProfile])
|
||||
|
||||
const methodProfileKvSansSlots = useMemo(() => {
|
||||
if (!methodProfile || typeof methodProfile !== 'object' || Array.isArray(methodProfile)) return []
|
||||
return Object.entries(methodProfile)
|
||||
.filter(([k]) => k !== 'slot_profiles_v1')
|
||||
.sort(([a], [b]) => a.localeCompare(b, 'de'))
|
||||
}, [methodProfile])
|
||||
|
||||
return (
|
||||
<section
|
||||
className="card"
|
||||
@@ -124,10 +160,13 @@ export default function CombinationCoachSlots({ combinationSlots, methodArchetyp
|
||||
<div style={{ fontSize: '0.7rem', fontWeight: 700, color: 'var(--text3)', textTransform: 'uppercase', marginBottom: '6px' }}>
|
||||
Geplantes Ablaufprofil (Katalog)
|
||||
</div>
|
||||
<dl style={{ margin: 0, fontSize: '0.82rem', lineHeight: 1.45 }}>
|
||||
{Object.entries(methodProfile)
|
||||
.sort(([a], [b]) => a.localeCompare(b, 'de'))
|
||||
.map(([k, val]) => (
|
||||
{methodProfileKvSansSlots.length === 0 ? (
|
||||
<p style={{ margin: 0, fontSize: '0.82rem', color: 'var(--text3)', lineHeight: 1.42 }}>
|
||||
Nur stationsbezogene Daten (Zeiten/Zähl‑Steuerung) — siehe je Station unter der Überschrift „Plan:“.
|
||||
</p>
|
||||
) : (
|
||||
<dl style={{ margin: 0, fontSize: '0.82rem', lineHeight: 1.45 }}>
|
||||
{methodProfileKvSansSlots.map(([k, val]) => (
|
||||
<div key={k} style={{ marginBottom: '4px', display: 'grid', gridTemplateColumns: 'minmax(72px,1fr) minmax(0,2fr)', gap: '6px 10px' }}>
|
||||
<dt style={{ margin: 0, fontWeight: 600, color: 'var(--text3)', wordBreak: 'break-all' }}>{k}</dt>
|
||||
<dd style={{ margin: 0, color: 'var(--text1)' }}>
|
||||
@@ -143,7 +182,8 @@ export default function CombinationCoachSlots({ combinationSlots, methodArchetyp
|
||||
</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
</dl>
|
||||
)}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -162,11 +202,19 @@ export default function CombinationCoachSlots({ combinationSlots, methodArchetyp
|
||||
(candIds.length <= 1 && slot.candidates?.[0]?.title) ||
|
||||
`Station ${slot.slot_index != null ? Number(slot.slot_index) + 1 : si + 1}`
|
||||
|
||||
const ix = slot.slot_index != null ? Number(slot.slot_index) : si
|
||||
const timingSummary = summarizeSlotProfilesRow(slotTimingByIx.get(ix))
|
||||
|
||||
return (
|
||||
<li key={`${slot.slot_index ?? si}-${slotTitle}`} style={{ lineHeight: 1.45 }}>
|
||||
<div style={{ fontWeight: 700, fontSize: '0.92rem', marginBottom: candIds.length > 1 ? '6px' : '8px' }}>
|
||||
<div style={{ fontWeight: 700, fontSize: '0.92rem', marginBottom: timingSummary ? '4px' : candIds.length > 1 ? '6px' : '8px' }}>
|
||||
{slotTitle}
|
||||
</div>
|
||||
{timingSummary ? (
|
||||
<p style={{ margin: '0 0 8px', fontSize: '0.78rem', color: 'var(--text2)', lineHeight: 1.42 }}>
|
||||
Plan: <span style={{ color: 'var(--text1)', fontWeight: 600 }}>{timingSummary}</span>
|
||||
</p>
|
||||
) : null}
|
||||
{candIds.length === 0 ? (
|
||||
<p style={{ margin: 0, color: 'var(--text3)', fontSize: '0.86rem' }}>Keine Übung zugeordnet.</p>
|
||||
) : (
|
||||
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
patchMethodProfile,
|
||||
readSlotProfilesV1,
|
||||
patchSlotTimingField,
|
||||
patchSlotAdvanceMode,
|
||||
normalizeAdvanceMode,
|
||||
applyCircuitRotateQuickRatio,
|
||||
applyIntervalDomainQuickRatio,
|
||||
} from '../utils/combinationMethodProfileUi'
|
||||
@@ -105,6 +107,15 @@ export default function CombinationMethodProfileEditor({
|
||||
setPresetHint(null)
|
||||
}
|
||||
|
||||
const onSlotAdvanceChange = (slotIx, rawMode) => {
|
||||
const patched = patchMethodProfile(methodProfileJson || '{}', (d) =>
|
||||
patchSlotAdvanceMode(d, slotIx, rawMode)
|
||||
)
|
||||
if (!patched.ok) return
|
||||
onChangeMethodProfileJson(patched.json)
|
||||
setPresetHint(null)
|
||||
}
|
||||
|
||||
const runCircuitPreset = (presetId) => {
|
||||
const r = patchMethodProfile(methodProfileJson || '{}', (draft) => {
|
||||
const pr = applyCircuitRotateQuickRatio(draft, presetId)
|
||||
@@ -265,12 +276,12 @@ export default function CombinationMethodProfileEditor({
|
||||
}}
|
||||
>
|
||||
<div style={{ fontSize: '0.88rem', fontWeight: 700, marginBottom: '10px', color: 'var(--text1)' }}>
|
||||
Pro Station / Slot (Zeiten in Sekunden)
|
||||
Pro Station / Slot — Steuerung & Sekunden
|
||||
</div>
|
||||
<p style={{ fontSize: '11px', color: 'var(--text3)', margin: '0 0 12px', lineHeight: 1.45 }}>
|
||||
Belastungsdauer, wie oft die Übung an der gleichen Station hintereinander, kurze Pause dazwischen, Zeit bis
|
||||
zur nächsten Station. Felder können leer bleiben — z. B. nutzt der Zirkel oben erst die globalen Arbeit‑/
|
||||
Rotations‑Sekunden.
|
||||
<strong>Steuerung:</strong> zeitlich (Arbeits‑Countdown), Zielzahl Wiederholungen oder Coach‑geführt ohne
|
||||
Arbeitsuhr. Pausen/Wechsel bleiben unabhängig planbar. Felder können leer bleiben — z. B. nutzt der
|
||||
Zirkel erst die globalen Arbeit‑Sekunden.
|
||||
</p>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
|
||||
{outlineSorted.map((slot) => {
|
||||
@@ -280,6 +291,9 @@ export default function CombinationMethodProfileEditor({
|
||||
if (!Number.isFinite(si)) return null
|
||||
const row = lookupSlotTiming(si)
|
||||
const ttl = ((slot.title || '').trim() || `Station ${si}`).trim()
|
||||
const slotAdv = normalizeAdvanceMode(row.advance_mode)
|
||||
const serieLabel =
|
||||
slotAdv === 'timed' ? 'Wdh. ohne Wechsel' : slotAdv === 'rep' ? 'Ziel‑Wdh.' : 'Richtwert'
|
||||
return (
|
||||
<div
|
||||
key={`slot-timing-${si}`}
|
||||
@@ -294,36 +308,53 @@ export default function CombinationMethodProfileEditor({
|
||||
Station {si}
|
||||
<span style={{ fontWeight: 400, marginLeft: 8, color: 'var(--text2)', fontSize: '0.86rem' }}>{ttl}</span>
|
||||
</div>
|
||||
<div className="form-row" style={{ marginBottom: '10px', maxWidth: '22rem' }}>
|
||||
<label className="form-label" style={{ fontSize: '11px' }}>
|
||||
Steuerung
|
||||
</label>
|
||||
<select
|
||||
className="form-input"
|
||||
style={{ fontSize: '0.8125rem' }}
|
||||
value={slotAdv}
|
||||
onChange={(e) => onSlotAdvanceChange(si, e.target.value)}
|
||||
>
|
||||
<option value="timed">Zeit (Arbeit in Sekunden)</option>
|
||||
<option value="rep">Wiederholungen (Ziel)</option>
|
||||
<option value="manual">Coach (ohne Arbeitsuhr)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'repeat(auto-fill, minmax(140px, 1fr))',
|
||||
gridTemplateColumns: 'repeat(auto-fill, minmax(120px, 1fr))',
|
||||
gap: '10px',
|
||||
alignItems: 'end',
|
||||
}}
|
||||
>
|
||||
{slotAdv === 'timed' ? (
|
||||
<div className="form-row" style={{ marginBottom: 0 }}>
|
||||
<label className="form-label" style={{ fontSize: '11px' }}>
|
||||
Belastung (s)
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
min={0}
|
||||
className="form-input"
|
||||
placeholder="–"
|
||||
value={row.load_sec != null ? String(row.load_sec) : ''}
|
||||
onChange={(e) => onSlotField(si, 'load_sec', e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
<div className="form-row" style={{ marginBottom: 0 }}>
|
||||
<label className="form-label" style={{ fontSize: '11px' }}>
|
||||
Belastung (s)
|
||||
{serieLabel}
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
min={0}
|
||||
min={slotAdv === 'rep' ? 1 : undefined}
|
||||
className="form-input"
|
||||
placeholder="–"
|
||||
value={row.load_sec != null ? String(row.load_sec) : ''}
|
||||
onChange={(e) => onSlotField(si, '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"
|
||||
placeholder={slotAdv === 'manual' ? 'optional' : 'oft 1'}
|
||||
value={row.consecutive_reps != null ? String(row.consecutive_reps) : ''}
|
||||
onChange={(e) => onSlotField(si, 'consecutive_reps', e.target.value)}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user