fix: UX improvements for inline template mode switching
**Issue 1: Prompt selector loses value**
- When switching Reference→Inline→Reference, the dropdown was empty
- Root cause: Switching to Inline deleted prompt_slug
- Fix: Keep prompt_slug when activating inline_template
- Now: Both modes preserve their values independently
**Issue 2: Workflow overview shows 'kein Prompt'**
- Nodes with inline templates showed misleading 'kein Prompt' text
- Root cause: AnalysisNode only checked prompt_name/prompt_slug
- Fix: Check inline_template and display '✏️ Inline-Template'
- Now: Clear visual distinction between modes
Files:
- WorkflowEditorPage.jsx: Preserve prompt_slug on mode switch
- AnalysisNode.jsx: Add isInlineMode detection and display
Part 3: Inline Prompts - UX polish
This commit is contained in:
1 parent
c0525cf2d2
commit
8d89b23db1
2 files changed
+11
-5
No files matched your search
@@ -520,9 +520,9 @@ export default function WorkflowEditorPage() {
|
||||
checked={isInlineMode}
|
||||
onChange={() => {
|
||||
// Wechsel zu Inline Mode
|
||||
// WICHTIG: prompt_slug NICHT löschen, damit er beim Zurückwechseln noch da ist
|
||||
handleNodeUpdate(selectedNode.id, {
|
||||
prompt_slug: null, // Reference löschen
|
||||
inline_template: selectedNode.data.inline_template || '' // Behalte existierendes template
|
||||
inline_template: selectedNode.data.inline_template || '' // Aktiviere Inline Mode
|
||||
})
|
||||
}}
|
||||
style={{ marginRight: '8px' }}
|
||||
@@ -542,7 +542,7 @@ export default function WorkflowEditorPage() {
|
||||
const promptSlug = e.target.value
|
||||
const selectedPrompt = availablePrompts.find(p => p.slug === promptSlug)
|
||||
handleNodeUpdate(selectedNode.id, {
|
||||
prompt_slug: promptSlug || '',
|
||||
prompt_slug: promptSlug,
|
||||
prompt_name: selectedPrompt?.name || null,
|
||||
inline_template: null
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user