Increment application version to 0.8.166 and update changelog for new features in AI exercise creation
Deploy Development / deploy (push) Successful in 41s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m15s
Deploy Development / deploy (push) Successful in 41s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m15s
- Updated APP_VERSION to 0.8.166 and modified BUILD_DATE to reflect recent changes. - Enhanced AI exercise creation process with a new quick create feature, allowing users to generate exercises based on search input. - Introduced a rich text editor for editing AI-generated drafts, improving user experience in exercise creation. - Updated ExercisePickerModal and related components to support the new quick create functionality, including error handling and input validation. - Added new utility functions for parsing search queries and building exercise payloads from drafts.
This commit is contained in:
1 parent
675cfa85f0
commit
294740b780
8 files changed
+592
-397
No files matched your search
@@ -0,0 +1,118 @@
|
||||
import React from 'react'
|
||||
|
||||
/**
|
||||
* Inline-Angebot: aus Suchstring neue Übung per KI anlegen (Fokusbereich + optional Titel/Skizze).
|
||||
*/
|
||||
export default function ExerciseAiQuickCreateOffer({
|
||||
searchLabel,
|
||||
title,
|
||||
onTitleChange,
|
||||
sketch,
|
||||
onSketchChange,
|
||||
focusAreaId,
|
||||
onFocusAreaChange,
|
||||
focusAreas = [],
|
||||
catalogsReady = true,
|
||||
busy = false,
|
||||
error = '',
|
||||
onRunAi,
|
||||
showSketchField = false,
|
||||
hint,
|
||||
}) {
|
||||
const canRun =
|
||||
!busy &&
|
||||
(title || '').trim().length >= 3 &&
|
||||
(sketch || '').trim().length > 0 &&
|
||||
focusAreaId
|
||||
|
||||
return (
|
||||
<div
|
||||
className="card"
|
||||
style={{
|
||||
padding: '14px 16px',
|
||||
marginBottom: '12px',
|
||||
borderColor: 'var(--accent-dark, rgba(29,158,117,0.35))',
|
||||
background: 'var(--surface2)',
|
||||
}}
|
||||
>
|
||||
<strong style={{ display: 'block', marginBottom: '6px', fontSize: '0.95rem' }}>
|
||||
Keine passende Übung gefunden
|
||||
</strong>
|
||||
<p style={{ margin: '0 0 12px', fontSize: '13px', color: 'var(--text2)', lineHeight: 1.45 }}>
|
||||
{hint ||
|
||||
(searchLabel
|
||||
? `Für „${searchLabel}“ lässt sich eine neue Übung mit KI vorschlagen — Texte danach bearbeiten und speichern.`
|
||||
: 'Neue Übung mit KI vorschlagen — Texte danach bearbeiten und speichern.')}
|
||||
</p>
|
||||
|
||||
<div style={{ display: 'grid', gap: '10px' }}>
|
||||
<div>
|
||||
<label className="form-label" htmlFor="ex-ai-quick-title">
|
||||
Titel *
|
||||
</label>
|
||||
<input
|
||||
id="ex-ai-quick-title"
|
||||
type="text"
|
||||
className="form-input"
|
||||
value={title}
|
||||
onChange={(e) => onTitleChange(e.target.value)}
|
||||
autoComplete="off"
|
||||
maxLength={300}
|
||||
placeholder="Titel der neuen Übung"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="form-label" htmlFor="ex-ai-quick-focus">
|
||||
Fokusbereich *
|
||||
</label>
|
||||
<select
|
||||
id="ex-ai-quick-focus"
|
||||
className="form-input"
|
||||
value={focusAreaId}
|
||||
onChange={(e) => onFocusAreaChange(e.target.value)}
|
||||
disabled={!catalogsReady}
|
||||
>
|
||||
<option value="">— wählen —</option>
|
||||
{(focusAreas || []).map((fa) => (
|
||||
<option key={fa.id} value={String(fa.id)}>
|
||||
{`${fa.icon ? `${fa.icon} ` : ''}${fa.name || `#${fa.id}`}`.trim()}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{showSketchField ? (
|
||||
<div>
|
||||
<label className="form-label" htmlFor="ex-ai-quick-sketch">
|
||||
Skizze / Idee *
|
||||
</label>
|
||||
<textarea
|
||||
id="ex-ai-quick-sketch"
|
||||
className="form-input"
|
||||
rows={3}
|
||||
value={sketch}
|
||||
onChange={(e) => onSketchChange(e.target.value)}
|
||||
placeholder="Kurze Beschreibung für die KI …"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p style={{ margin: 0, fontSize: '12px', color: 'var(--text3)' }}>
|
||||
Ausgangstext: {(sketch || '').trim().slice(0, 160)}
|
||||
{(sketch || '').trim().length > 160 ? '…' : ''}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{error ? (
|
||||
<p style={{ margin: 0, fontSize: '13px', color: 'var(--danger)' }}>{error}</p>
|
||||
) : null}
|
||||
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||
<button type="button" className="btn btn-primary" disabled={!canRun} onClick={() => onRunAi()}>
|
||||
{busy ? 'KI erzeugt Vorschlag…' : 'Mit KI anlegen'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user