feat(version): bump to 0.8.110 and enhance combination exercise features
- Updated app version to 0.8.110, reflecting recent improvements in combination exercise handling. - Introduced `load_combination_slots_for_exercise` function to streamline fetching combination slots for exercises. - Enhanced `TrainingPlanningPage` and `ExercisePeekModal` to utilize the new combination slots functionality, improving user experience. - Updated changelog to document the latest changes and feature enhancements. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
5dc93d9a8c
commit
a8942a9e4e
10 files changed
+475
-84
No files matched your search
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* Kombination: konsolidierte Darstellung globales Profil + Stationen mit Zeiten (Vorschau, Plan-Ansicht, Druck).
|
||||
*/
|
||||
import React, { useMemo } from 'react'
|
||||
import {
|
||||
archetypeCoachHint,
|
||||
combinationArchetypeLabel,
|
||||
sortCombinationSlotsForDisplay,
|
||||
} from '../constants/combinationArchetypes'
|
||||
import { describeGlobalComboProfile, readSlotProfilesV1, summarizeSlotProfileBrief } from '../utils/combinationMethodProfileUi'
|
||||
|
||||
function candidateLine(slot) {
|
||||
const cands = slot.candidates
|
||||
if (Array.isArray(cands) && cands.length > 0) {
|
||||
return cands
|
||||
.map((c) =>
|
||||
((c.title || '').trim() || (c.exercise_id != null ? `Übung #${c.exercise_id}` : '')).trim(),
|
||||
)
|
||||
.filter(Boolean)
|
||||
.join(' ↔ ')
|
||||
}
|
||||
const ids = slot.candidate_exercise_ids || []
|
||||
return ids
|
||||
.map((raw) => {
|
||||
const n = typeof raw === 'number' ? raw : parseInt(String(raw), 10)
|
||||
return Number.isFinite(n) ? `Übung #${n}` : ''
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join(' ↔ ')
|
||||
}
|
||||
|
||||
export default function CombinationPlanBracket({
|
||||
methodArchetype,
|
||||
methodProfile,
|
||||
combinationSlots,
|
||||
planningAdjusted = false,
|
||||
}) {
|
||||
const arch = typeof methodArchetype === 'string' ? methodArchetype.trim() : ''
|
||||
const archLabel = arch ? combinationArchetypeLabel(arch) : null
|
||||
const globals = describeGlobalComboProfile(arch, methodProfile || {})
|
||||
const slotsSorted = useMemo(() => sortCombinationSlotsForDisplay(combinationSlots || []), [combinationSlots])
|
||||
const timingByIx = useMemo(() => {
|
||||
const mp = methodProfile || {}
|
||||
const rows = readSlotProfilesV1(mp)
|
||||
const m = new Map()
|
||||
for (const r of rows) {
|
||||
m.set(Number(r.slot_index), r)
|
||||
}
|
||||
return m
|
||||
}, [methodProfile])
|
||||
|
||||
const coachHint = arch ? archetypeCoachHint(arch) : ''
|
||||
|
||||
return (
|
||||
<div className="combo-plan-bracket">
|
||||
<div className="combo-plan-bracket__accent" aria-hidden />
|
||||
<div className="combo-plan-bracket__body">
|
||||
<header className="combo-plan-bracket__head">
|
||||
<div className="combo-plan-bracket__head-main">
|
||||
<span className="combo-plan-bracket__kicker">Kombinations‑Plan</span>
|
||||
<span className="combo-plan-bracket__archetype">
|
||||
{archLabel || arch || 'Archetyp'}
|
||||
{arch && archLabel && archLabel !== arch ? (
|
||||
<span className="combo-plan-bracket__archetype-id"> ({arch})</span>
|
||||
) : null}
|
||||
</span>
|
||||
{planningAdjusted ? (
|
||||
<span className="combo-plan-bracket__badge">Planung angepasst</span>
|
||||
) : null}
|
||||
</div>
|
||||
{coachHint ? <p className="combo-plan-bracket__hint">{coachHint}</p> : null}
|
||||
</header>
|
||||
|
||||
{globals.length > 0 ? (
|
||||
<section className="combo-plan-bracket__globals" aria-label="Globale Eckdaten">
|
||||
<div className="combo-plan-bracket__globals-title">Runden · Zeiten · Pausen (global)</div>
|
||||
<ul className="combo-plan-bracket__chip-row">
|
||||
{globals.map((g) => (
|
||||
<li key={g.key} className="combo-plan-bracket__chip" title={g.detailLabel}>
|
||||
<span className="combo-plan-bracket__chip-cap">{g.caption}</span>
|
||||
<span className="combo-plan-bracket__chip-val">{g.value}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
) : (
|
||||
<p className="combo-plan-bracket__globals-empty">
|
||||
Keine globalen Zahlenfelder gesetzt — Steuerung erfolgt nur je Station oder über den Freitext der Kombination.
|
||||
</p>
|
||||
)}
|
||||
|
||||
<ol className="combo-plan-bracket__stations">
|
||||
{slotsSorted.map((slot, si) => {
|
||||
const siRaw = slot.slot_index
|
||||
const ixParsed =
|
||||
siRaw === '' || siRaw == null ? si : typeof siRaw === 'number' ? siRaw : parseInt(String(siRaw), 10)
|
||||
const stationIx = Number.isFinite(ixParsed) ? ixParsed : si
|
||||
const stationTitle = ((slot.title || '').trim() || `Station ${stationIx}`).trim()
|
||||
const names = candidateLine(slot)
|
||||
const timing = summarizeSlotProfileBrief(timingByIx.get(stationIx))
|
||||
|
||||
return (
|
||||
<li key={`slot-${stationIx}-${si}`} className="combo-plan-bracket__station">
|
||||
<div className="combo-plan-bracket__station-index" title={`slot_index ${stationIx}`}>
|
||||
S{stationIx}
|
||||
</div>
|
||||
<div className="combo-plan-bracket__station-main">
|
||||
<div className="combo-plan-bracket__station-title">{stationTitle}</div>
|
||||
<div className="combo-plan-bracket__station-exercises">{names || '(keine Einzelübung)'}</div>
|
||||
{timing ? (
|
||||
<div className="combo-plan-bracket__station-timing">
|
||||
<span className="combo-plan-bracket__timing-label">Zeit / Steuerung</span>
|
||||
<span>{timing}</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="combo-plan-bracket__station-timing combo-plan-bracket__station-timing--muted">
|
||||
Keine eigene Stations‑Zeit im Profil — ggf. nur globale Vorgaben oder Freitext.
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import React, { useEffect, useMemo, useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import api from '../utils/api'
|
||||
import ExerciseRichTextBlock from './ExerciseRichTextBlock'
|
||||
import CombinationCoachSlots from './CombinationCoachSlots'
|
||||
import { combinationArchetypeLabel } from '../constants/combinationArchetypes'
|
||||
import CombinationPlanBracket from './CombinationPlanBracket'
|
||||
import { effectiveComboMethodProfile } from '../utils/comboPlanningMethodProfile'
|
||||
|
||||
function TagMini({ exercise }) {
|
||||
@@ -100,7 +99,7 @@ export default function ExercisePeekModal({
|
||||
aria-modal="true"
|
||||
aria-labelledby="exercise-peek-title"
|
||||
style={{
|
||||
maxWidth: sheetWide ? 'min(760px, 96vw)' : '620px',
|
||||
maxWidth: sheetWide ? 'min(840px, 96vw)' : '620px',
|
||||
width: '100%',
|
||||
maxHeight: '88vh',
|
||||
display: 'flex',
|
||||
@@ -128,42 +127,17 @@ export default function ExercisePeekModal({
|
||||
<>
|
||||
{isCombination ? (
|
||||
<>
|
||||
<div
|
||||
style={{
|
||||
marginBottom: '12px',
|
||||
padding: '8px 10px',
|
||||
borderRadius: '8px',
|
||||
background: 'var(--surface2)',
|
||||
border: '1px solid var(--border)',
|
||||
fontSize: '0.82rem',
|
||||
color: 'var(--text2)',
|
||||
lineHeight: 1.45,
|
||||
}}
|
||||
>
|
||||
<strong style={{ color: 'var(--text1)' }}>Kombination</strong>
|
||||
<span style={{ marginLeft: 8 }}>
|
||||
{(() => {
|
||||
const ak = String(exercise.method_archetype || '').trim()
|
||||
const lbl = ak ? combinationArchetypeLabel(ak) : null
|
||||
return lbl || ak || 'Archetyp nicht gesetzt'
|
||||
})()}
|
||||
</span>
|
||||
{peekExtras?.planning_method_profile != null &&
|
||||
typeof peekExtras.planning_method_profile === 'object' &&
|
||||
!Array.isArray(peekExtras.planning_method_profile) ? (
|
||||
<span style={{ marginLeft: 8, color: 'var(--accent-dark)', fontWeight: 600 }}>
|
||||
· Planung angepasst
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<CombinationCoachSlots
|
||||
<CombinationPlanBracket
|
||||
methodArchetype={exercise.method_archetype || ''}
|
||||
methodProfile={comboMethodProfileEffective}
|
||||
combinationSlots={
|
||||
Array.isArray(exercise.combination_slots) ? exercise.combination_slots : []
|
||||
}
|
||||
methodArchetype={exercise.method_archetype || ''}
|
||||
methodProfile={comboMethodProfileEffective}
|
||||
compactPlanningView
|
||||
omitGlobalKeyValueBlock={false}
|
||||
planningAdjusted={
|
||||
peekExtras?.planning_method_profile != null &&
|
||||
typeof peekExtras.planning_method_profile === 'object' &&
|
||||
!Array.isArray(peekExtras.planning_method_profile)
|
||||
}
|
||||
/>
|
||||
<hr style={{ border: 'none', borderTop: '1px solid var(--border)', margin: '1rem 0' }} />
|
||||
</>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react'
|
||||
import { GripVertical, Pencil } from 'lucide-react'
|
||||
import CombinationMethodProfileEditor from './CombinationMethodProfileEditor'
|
||||
import CombinationCoachSlots from './CombinationCoachSlots'
|
||||
import CombinationPlanBracket from './CombinationPlanBracket'
|
||||
import { comboPlanningProfileJsonForEditor, effectiveComboMethodProfile } from '../utils/comboPlanningMethodProfile'
|
||||
import { combinationArchetypeLabel, sortCombinationSlotsForDisplay } from '../constants/combinationArchetypes'
|
||||
import {
|
||||
@@ -1611,12 +1611,15 @@ export default function TrainingUnitSectionsEditor({
|
||||
</p>
|
||||
{comboPlanningResolvedSlots.length > 0 ? (
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
<CombinationCoachSlots
|
||||
combinationSlots={comboPlanningResolvedSlots}
|
||||
<CombinationPlanBracket
|
||||
methodArchetype={(comboPlanningModalItem.catalog_method_archetype || '').trim()}
|
||||
methodProfile={comboPlanningEffectiveProfile}
|
||||
compactPlanningView
|
||||
omitGlobalKeyValueBlock
|
||||
combinationSlots={comboPlanningResolvedSlots}
|
||||
planningAdjusted={
|
||||
comboPlanningModalItem.planning_method_profile != null &&
|
||||
typeof comboPlanningModalItem.planning_method_profile === 'object' &&
|
||||
!Array.isArray(comboPlanningModalItem.planning_method_profile)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
Reference in new issue
Block a user