feat: placeholder chips + convert to base prompt (Issue #28)
Deploy Development / deploy (push) Successful in 49s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s

New features:
1. Placeholder chips now visible in pipeline inline templates
   - Click to insert: weight_data, nutrition_data, activity_data, etc.
   - Same UX as base prompts

2. Convert to Base Prompt button
   - New icon (ArrowDownToLine) in actions column
   - Only visible for 1-stage pipeline prompts
   - Converts pipeline → base by extracting inline template
   - Validates: must be 1-stage, 1-prompt, inline source

This allows migrated prompts to be properly categorized as base prompts
for reuse in other pipelines.
This commit is contained in:
Lars committed 2026-03-25 21:59:43 +01:00
1 parent 7dda520c9b
commit b058b0fd6f
2 files changed
+94 -9

No files matched your search

+35 -8
View File
@@ -526,14 +526,41 @@ export default function UnifiedPromptModal({ prompt, onSave, onClose }) {
))}
</select>
) : (
<textarea
className="form-input"
value={p.template || ''}
onChange={e => updateStagePrompt(stage.stage, pIdx, 'template', e.target.value)}
rows={3}
placeholder="Inline-Template mit {{placeholders}}..."
style={{ width: '100%', fontSize: 12, textAlign: 'left', resize: 'vertical', fontFamily: 'monospace' }}
/>
<div>
<textarea
className="form-input"
value={p.template || ''}
onChange={e => updateStagePrompt(stage.stage, pIdx, 'template', e.target.value)}
rows={3}
placeholder="Inline-Template mit {{placeholders}}..."
style={{ width: '100%', fontSize: 12, textAlign: 'left', resize: 'vertical', fontFamily: 'monospace' }}
/>
<div style={{ fontSize: 10, color: 'var(--text3)', marginTop: 4 }}>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 4, marginTop: 4 }}>
{['weight_data', 'nutrition_data', 'activity_data', 'sleep_data', 'vitals_baseline', 'blood_pressure', 'profile_id', 'today'].map(ph => (
<code
key={ph}
onClick={() => {
const placeholder = `{{${ph}}}`
const currentValue = p.template || ''
updateStagePrompt(stage.stage, pIdx, 'template', currentValue + placeholder)
}}
style={{
padding: '2px 4px',
background: 'var(--surface2)',
borderRadius: 4,
fontSize: 9,
cursor: 'pointer',
border: '1px solid var(--border)'
}}
title="Klicken zum Einfügen"
>
{'{{'}{ph}{'}}'}
</code>
))}
</div>
</div>
</div>
)}
</div>
</div>