feat(combo-planning): enhance combination profile handling and UI improvements
Deploy Development / deploy (push) Successful in 36s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / playwright-tests (push) Successful in 59s

- Updated CombinationCoachSlots to integrate a new function for formatting inline profile values, improving data display consistency.
- Refactored CombinationMethodProfileEditor to streamline slot index handling and enhance title clarity.
- Improved CombinationPlanBracket by removing unnecessary elements for a cleaner UI.
- Enhanced ExerciseFullContent to support additional catalog method profile snapshots, improving exercise detail accuracy.
- Updated CSS for combo plan brackets to enhance visual presentation and alignment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 4.6 committed 2026-05-13 14:42:01 +02:00
1 parent 79dabbca5a
commit d3ddc52118
8 files changed
+142 -95

No files matched your search

@@ -10,7 +10,24 @@ import {
combinationArchetypeLabel,
sortCombinationSlotsForDisplay,
} from '../constants/combinationArchetypes'
import { effectiveStationTimingSummary, readSlotProfilesV1 } from '../utils/combinationMethodProfileUi'
import {
describeGlobalComboProfile,
effectiveStationTimingSummary,
METHOD_PROFILE_GUI_FIELDS,
readSlotProfilesV1,
} from '../utils/combinationMethodProfileUi'
function formatInlineProfileValue(val) {
if (val === null || val === undefined) return '—'
if (typeof val === 'boolean') return val ? 'ja' : 'nein'
if (typeof val === 'number' && Number.isFinite(val)) return String(val)
if (typeof val === 'string') return val.trim() === '' ? '—' : val
try {
return JSON.stringify(val)
} catch {
return String(val)
}
}
export default function CombinationCoachSlots({
combinationSlots,
@@ -93,12 +110,25 @@ export default function CombinationCoachSlots({
return m
}, [methodProfile])
const methodProfileKvSansSlots = useMemo(() => {
const globalComboRows = useMemo(
() => describeGlobalComboProfile(archeKey, methodProfile || {}),
[archeKey, methodProfile],
)
const profileExtraEntries = 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])
const known = new Set(['slot_profiles_v1'])
for (const f of METHOD_PROFILE_GUI_FIELDS[archeKey] || []) {
known.add(f.key)
}
const out = []
for (const [k, val] of Object.entries(methodProfile)) {
if (known.has(k)) continue
if (val === null || val === undefined || val === '') continue
out.push([k, val])
}
return out.sort((a, b) => String(a[0]).localeCompare(String(b[0]), 'de'))
}, [methodProfile, archeKey])
return (
<section
@@ -122,14 +152,7 @@ export default function CombinationCoachSlots({
{compactPlanningView ? 'Stationen & Einzelübungen (Katalog)' : 'Kombination · Stationen & Einzelübungen'}
</h3>
{archDisplay ? (
<p style={{ margin: '0 0 6px', fontSize: '0.95rem', fontWeight: 700 }}>
{archDisplay}
{archeKey && archDisplay !== archeKey ? (
<span style={{ marginLeft: 8, fontSize: '0.78rem', fontWeight: 500, color: 'var(--text3)' }}>
({archeKey})
</span>
) : null}
</p>
<p style={{ margin: '0 0 6px', fontSize: '0.95rem', fontWeight: 700 }}>{archDisplay}</p>
) : null}
{compactPlanningView ? null : (
<p style={{ margin: '0 0 14px', fontSize: '0.88rem', color: 'var(--text2)', lineHeight: 1.48 }}>
@@ -148,28 +171,40 @@ export default function CombinationCoachSlots({
}}
>
<div style={{ fontSize: '0.7rem', fontWeight: 700, color: 'var(--text3)', textTransform: 'uppercase', marginBottom: '6px' }}>
Geplantes Ablaufprofil (Katalog)
Globale Eckdaten (wie im Editor)
</div>
{methodProfileKvSansSlots.length === 0 ? (
{globalComboRows.length === 0 && profileExtraEntries.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:“.
Keine globalen Zahlenfelder gesetzt — Zeiten und Steuerung siehe je Station unter „Plan:“ (oder nur im Freitext der Kombination).
</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' }}>
{globalComboRows.map((row) => (
<div
key={row.key}
style={{
marginBottom: '6px',
display: 'grid',
gridTemplateColumns: 'minmax(88px,1fr) minmax(0,1.4fr)',
gap: '6px 10px',
}}
>
<dt style={{ margin: 0, fontWeight: 600, color: 'var(--text3)' }}>{row.detailLabel}</dt>
<dd style={{ margin: 0, color: 'var(--text1)', fontWeight: 600 }}>{row.value}</dd>
</div>
))}
{profileExtraEntries.map(([k, val]) => (
<div
key={k}
style={{
marginBottom: '4px',
display: 'grid',
gridTemplateColumns: 'minmax(88px,1fr) minmax(0,1.4fr)',
gap: '6px 10px',
}}
>
<dt style={{ margin: 0, fontWeight: 600, color: 'var(--text3)', wordBreak: 'break-all' }}>{k}</dt>
<dd style={{ margin: 0, color: 'var(--text1)' }}>
{typeof val === 'boolean'
? val
? 'ja'
: 'nein'
: typeof val === 'number'
? String(val)
: typeof val === 'string'
? val
: JSON.stringify(val)}
</dd>
<dd style={{ margin: 0, color: 'var(--text1)' }}>{formatInlineProfileValue(val)}</dd>
</div>
))}
</dl>