diff --git a/frontend/src/components/workflow/panels/PlaceholderPicker.jsx b/frontend/src/components/workflow/panels/PlaceholderPicker.jsx index 6d2381f..dfd3414 100644 --- a/frontend/src/components/workflow/panels/PlaceholderPicker.jsx +++ b/frontend/src/components/workflow/panels/PlaceholderPicker.jsx @@ -6,17 +6,19 @@ import { api } from '../../../utils/api' * * Props: * - nodes: Array of workflow nodes (to extract workflow-specific placeholders) + * - currentNodeId: ID des aktuellen Nodes (wird aus Placeholders ausgeschlossen) * - onSelect: (placeholderString) => void - Callback when placeholder is selected * - onClose: () => void * * Features: * - LΓ€dt registrierte Platzhalter vom Backend (~120+) * - Extrahiert Workflow-spezifische Node-Outputs + * - Filtert Selbst-Referenzierung (Node kann sich nicht selbst referenzieren) * - Zeigt Node-Namen (nicht nur IDs) * - Kategorisiert: System + Workflow * - Suchfunktion ΓΌber alle Kategorien */ -export function PlaceholderPicker({ nodes, onSelect, onClose }) { +export function PlaceholderPicker({ nodes, currentNodeId, onSelect, onClose }) { const [searchQuery, setSearchQuery] = useState('') const [systemPlaceholders, setSystemPlaceholders] = useState([]) const [loading, setLoading] = useState(true) @@ -61,8 +63,8 @@ export function PlaceholderPicker({ nodes, onSelect, onClose }) { loadPlaceholders() }, []) - // Extrahiere Workflow-spezifische Platzhalter - const workflowPlaceholders = extractWorkflowPlaceholders(nodes) + // Extrahiere Workflow-spezifische Platzhalter (ohne aktuellen Node) + const workflowPlaceholders = extractWorkflowPlaceholders(nodes, currentNodeId) // Kombiniere beide Listen const allPlaceholders = [ @@ -341,14 +343,19 @@ export function PlaceholderPicker({ nodes, onSelect, onClose }) { /** * Extrahiert Workflow-spezifische Platzhalter aus Nodes + * + * @param {Array} nodes - Alle Workflow-Nodes + * @param {string} currentNodeId - ID des aktuellen Nodes (wird ausgeschlossen) */ -function extractWorkflowPlaceholders(nodes) { +function extractWorkflowPlaceholders(nodes, currentNodeId) { const placeholders = [] console.log('πŸ” Extracting workflow placeholders from nodes:', nodes) + console.log('🚫 Excluding current node:', currentNodeId) nodes.forEach(node => { if (node.type === 'end') return // End Node hat keine Outputs + if (node.id === currentNodeId) return // Selbst-Referenzierung verhindern const nodeId = node.id const nodeLabel = node.data?.label || nodeId diff --git a/frontend/src/pages/WorkflowEditorPage.jsx b/frontend/src/pages/WorkflowEditorPage.jsx index 39b6457..a00784a 100644 --- a/frontend/src/pages/WorkflowEditorPage.jsx +++ b/frontend/src/pages/WorkflowEditorPage.jsx @@ -486,101 +486,109 @@ export default function WorkflowEditorPage() { {/* Type-spezifische Konfiguration */} - {selectedNode.type === 'analysis' && ( - <> - {/* Prompt Source Selector */} -
- -
-
+ > + + {availablePrompts.map(prompt => ( + + ))} + + {selectedNode.data.prompt_slug && ( +
+ Prompt: {selectedNode.data.prompt_slug} ({selectedNode.data.prompt_name || 'unbekannt'}) +
+ )} +
+ )} - {/* Conditional Rendering: Reference oder Inline */} - {selectedNode.data.prompt_slug !== null && !selectedNode.data.inline_template && ( -
- - - {selectedNode.data.prompt_slug && ( -
- Prompt: {selectedNode.data.prompt_slug} ({selectedNode.data.prompt_name || 'unbekannt'}) -
- )} -
- )} - - {/* Inline Template Editor */} - {(selectedNode.data.inline_template !== null || !selectedNode.data.prompt_slug) && ( - handleNodeUpdate(selectedNode.id, { - inline_template: template, - prompt_slug: null - })} - onPlaceholderPick={() => { - setPlaceholderPickerTarget('inline') - setShowPlaceholderPicker(true) - }} - textareaRef={inlineTemplateTextareaRef} - /> - )} + textareaRef={inlineTemplateTextareaRef} + /> + )} + + ) + })()} @@ -661,6 +669,7 @@ export default function WorkflowEditorPage() { {showPlaceholderPicker && ( setShowPlaceholderPicker(false)} /> diff --git a/frontend/src/styles/workflowEditor.css b/frontend/src/styles/workflowEditor.css index 1ff2c0b..6d9012d 100644 --- a/frontend/src/styles/workflowEditor.css +++ b/frontend/src/styles/workflowEditor.css @@ -27,7 +27,7 @@ /* ── Sidebar (Node Palette) ─────────────────────────────────────────────── */ .workflow-sidebar { - width: 250px; + width: 220px; background: var(--surface); border-right: 1px solid var(--border); padding: 16px; @@ -268,7 +268,7 @@ /* ── Config Panel ────────────────────────────────────────────────────────── */ .workflow-config-panel { - width: 400px; + width: 520px; background: var(--surface); border-left: 1px solid var(--border); padding: 16px; @@ -453,7 +453,7 @@ } .workflow-config-panel { - width: 350px; + width: 450px; } }