Enhance Gap Planning Context with Stage Overrides and Trainer Supplements
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 42s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m25s
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 42s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m25s
- Added `stage_learning_goal_override` and `gap_trainer_supplements` parameters to `build_progression_path_gap_planning_context`, allowing for customized learning goals and additional trainer notes. - Updated `gapOfferContextDisplayLines` to include trainer supplements in the context display. - Enhanced `ExerciseProgressionPathBuilder` to utilize new parameters for improved gap fill offer handling. - Incremented application version to 0.8.214 to reflect these changes.
This commit is contained in:
1 parent
d4b1780193
commit
0adf20c9e1
6 files changed
+323
-30
No files matched your search
@@ -0,0 +1,186 @@
|
||||
import React, { useEffect } from 'react'
|
||||
|
||||
/**
|
||||
* Vorbereitung vor KI-Übungsanlage aus Pfad-Lücke: Kontext prüfen, Ergänzungen mitgeben.
|
||||
*/
|
||||
export default function ExerciseGapFillPrepModal({
|
||||
open,
|
||||
onClose,
|
||||
offer = null,
|
||||
contextLines = [],
|
||||
title = '',
|
||||
onTitleChange,
|
||||
stageLearningGoal = '',
|
||||
onStageLearningGoalChange,
|
||||
supplements = '',
|
||||
onSupplementsChange,
|
||||
focusAreaId = '',
|
||||
onFocusAreaChange,
|
||||
focusAreas = [],
|
||||
busy = false,
|
||||
error = '',
|
||||
onSubmit,
|
||||
}) {
|
||||
useEffect(() => {
|
||||
if (!open) return undefined
|
||||
const onKey = (e) => {
|
||||
if (e.key === 'Escape' && !busy) {
|
||||
e.preventDefault()
|
||||
onClose()
|
||||
}
|
||||
}
|
||||
window.addEventListener('keydown', onKey)
|
||||
return () => window.removeEventListener('keydown', onKey)
|
||||
}, [open, busy, onClose])
|
||||
|
||||
if (!open || !offer) return null
|
||||
|
||||
const readOnlyLines = (contextLines || []).filter(
|
||||
(line) => line.label !== 'Stufen-Lernziel',
|
||||
)
|
||||
|
||||
return (
|
||||
<div
|
||||
className="admin-modal-backdrop"
|
||||
role="presentation"
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget && !busy) onClose()
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="admin-modal-sheet"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="gap-fill-prep-title"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
style={{ maxWidth: '680px' }}
|
||||
>
|
||||
<div className="admin-modal-sheet__header">
|
||||
<h3 id="gap-fill-prep-title" className="admin-modal-sheet__title">
|
||||
Übung mit KI vorbereiten
|
||||
</h3>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary admin-modal-sheet__close"
|
||||
disabled={busy}
|
||||
onClick={onClose}
|
||||
>
|
||||
Schließen
|
||||
</button>
|
||||
</div>
|
||||
<div className="admin-modal-sheet__body">
|
||||
<p className="muted" style={{ marginTop: 0, marginBottom: '12px', lineHeight: 1.45 }}>
|
||||
Prüfen und anpassen, was an die KI geht. Ergänzungen fließen in Ziel, Trainerhinweise und
|
||||
Planungskontext ein — erst danach wird der Entwurf erzeugt.
|
||||
</p>
|
||||
|
||||
{readOnlyLines.length > 0 ? (
|
||||
<div
|
||||
style={{
|
||||
marginBottom: '14px',
|
||||
padding: '10px 12px',
|
||||
borderRadius: '8px',
|
||||
border: '1px solid var(--border)',
|
||||
background: 'var(--surface2)',
|
||||
fontSize: '12px',
|
||||
}}
|
||||
>
|
||||
<strong style={{ display: 'block', marginBottom: '6px' }}>Pfad-Kontext (aus Roadmap)</strong>
|
||||
<dl style={{ margin: 0, display: 'grid', gap: '6px' }}>
|
||||
{readOnlyLines.map(({ label, value }) => (
|
||||
<div key={label}>
|
||||
<dt style={{ margin: 0, fontSize: '11px', color: 'var(--text3)' }}>{label}</dt>
|
||||
<dd style={{ margin: '2px 0 0', lineHeight: 1.45, color: 'var(--text2)' }}>{value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<div style={{ display: 'grid', gap: '12px' }}>
|
||||
<div>
|
||||
<label className="form-label" htmlFor="gap-prep-title">
|
||||
Titel-Vorschlag *
|
||||
</label>
|
||||
<input
|
||||
id="gap-prep-title"
|
||||
className="form-input"
|
||||
value={title}
|
||||
onChange={(e) => onTitleChange(e.target.value)}
|
||||
disabled={busy}
|
||||
maxLength={280}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="form-label" htmlFor="gap-prep-stage-goal">
|
||||
Stufen-Lernziel (anpassbar)
|
||||
</label>
|
||||
<textarea
|
||||
id="gap-prep-stage-goal"
|
||||
className="form-input"
|
||||
rows={2}
|
||||
value={stageLearningGoal}
|
||||
onChange={(e) => onStageLearningGoalChange(e.target.value)}
|
||||
disabled={busy}
|
||||
placeholder="Was soll diese Übung in der Roadmap-Stufe leisten?"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="form-label" htmlFor="gap-prep-supplements">
|
||||
Ergänzungen / Anpassungen für die KI
|
||||
</label>
|
||||
<textarea
|
||||
id="gap-prep-supplements"
|
||||
className="form-input"
|
||||
rows={3}
|
||||
value={supplements}
|
||||
onChange={(e) => onSupplementsChange(e.target.value)}
|
||||
disabled={busy}
|
||||
placeholder="z. B. nur Partnerübung, 10–12 Jahre, Fokus auf Reaktion unter Druck, keine Sprünge …"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="form-label" htmlFor="gap-prep-focus">
|
||||
Fokusbereich *
|
||||
</label>
|
||||
<select
|
||||
id="gap-prep-focus"
|
||||
className="form-input"
|
||||
value={focusAreaId}
|
||||
onChange={(e) => onFocusAreaChange(e.target.value)}
|
||||
disabled={busy}
|
||||
>
|
||||
<option value="">Bitte wählen …</option>
|
||||
{(focusAreas || []).map((fa) => (
|
||||
<option key={fa.id} value={fa.id}>
|
||||
{fa.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{offer.from_title && offer.to_title ? (
|
||||
<p style={{ fontSize: '11px', color: 'var(--text3)', margin: '12px 0 0' }}>
|
||||
Einordnung: zwischen „{offer.from_title}“ und „{offer.to_title}“
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{error ? (
|
||||
<p className="form-error" style={{ marginTop: '12px' }}>
|
||||
{error}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="admin-modal-sheet__footer" style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>
|
||||
<button type="button" className="btn btn-secondary" disabled={busy} onClick={onClose}>
|
||||
Abbrechen
|
||||
</button>
|
||||
<button type="button" className="btn btn-primary" disabled={busy} onClick={onSubmit}>
|
||||
{busy ? 'KI erstellt Entwurf …' : 'KI-Entwurf erstellen'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user