Workflow V1 #72

Merged
Lars merged 10 commits from develop into main 2026-04-11 10:59:39 +02:00
2 changed files with 11 additions and 5 deletions
Showing only changes of commit 8d89b23db1 - Show all commits

View File

@ -5,16 +5,22 @@ import { Handle, Position } from 'reactflow'
* *
* Properties: * Properties:
* - data.label: Node-Label * - data.label: Node-Label
* - data.prompt_slug: Slug des referenzierten Basis-Prompts * - data.prompt_slug: Slug des referenzierten Basis-Prompts (Reference Mode)
* - data.inline_template: Inline Prompt-Template (Inline Mode)
* - data.prompt_name: Name des Prompts (optional, für Display) * - data.prompt_name: Name des Prompts (optional, für Display)
* - data.questions: Array von Question Augmentations * - data.questions: Array von Question Augmentations
* - selected: Boolean * - selected: Boolean
*/ */
export function AnalysisNode({ data, selected }) { export function AnalysisNode({ data, selected }) {
const hasQuestions = data.questions?.length > 0 const hasQuestions = data.questions?.length > 0
const promptName = data.prompt_name || (data.prompt_slug ? `Prompt: ${data.prompt_slug}` : 'Kein Prompt')
const questionCount = data.questions?.length || 0 const questionCount = data.questions?.length || 0
// Part 3: Inline Prompts - Zeige "Inline-Template" oder Prompt-Namen
const isInlineMode = data.inline_template !== null && data.inline_template !== undefined
const promptName = isInlineMode
? '✏️ Inline-Template'
: (data.prompt_name || (data.prompt_slug ? `Prompt: ${data.prompt_slug}` : 'Kein Prompt'))
return ( return (
<div className={`workflow-node analysis-node ${selected ? 'selected' : ''}`}> <div className={`workflow-node analysis-node ${selected ? 'selected' : ''}`}>
<div className="node-header"> <div className="node-header">

View File

@ -520,9 +520,9 @@ export default function WorkflowEditorPage() {
checked={isInlineMode} checked={isInlineMode}
onChange={() => { onChange={() => {
// Wechsel zu Inline Mode // Wechsel zu Inline Mode
// WICHTIG: prompt_slug NICHT löschen, damit er beim Zurückwechseln noch da ist
handleNodeUpdate(selectedNode.id, { handleNodeUpdate(selectedNode.id, {
prompt_slug: null, // Reference löschen inline_template: selectedNode.data.inline_template || '' // Aktiviere Inline Mode
inline_template: selectedNode.data.inline_template || '' // Behalte existierendes template
}) })
}} }}
style={{ marginRight: '8px' }} style={{ marginRight: '8px' }}
@ -542,7 +542,7 @@ export default function WorkflowEditorPage() {
const promptSlug = e.target.value const promptSlug = e.target.value
const selectedPrompt = availablePrompts.find(p => p.slug === promptSlug) const selectedPrompt = availablePrompts.find(p => p.slug === promptSlug)
handleNodeUpdate(selectedNode.id, { handleNodeUpdate(selectedNode.id, {
prompt_slug: promptSlug || '', prompt_slug: promptSlug,
prompt_name: selectedPrompt?.name || null, prompt_name: selectedPrompt?.name || null,
inline_template: null inline_template: null
}) })