diff --git a/frontend/src/components/workflow/panels/EndNodeConfig.jsx b/frontend/src/components/workflow/panels/EndNodeConfig.jsx index fcaedf6..7a596f2 100644 --- a/frontend/src/components/workflow/panels/EndNodeConfig.jsx +++ b/frontend/src/components/workflow/panels/EndNodeConfig.jsx @@ -1,3 +1,5 @@ +import { useRef } from 'react' + /** * EndNodeConfig - Konfiguration für End Nodes * @@ -5,12 +7,17 @@ * - node: React Flow Node object (type='end') * - onChange: (nodeId, updates) => void * - onOpenPlaceholderPicker: () => void (optional, für späteren Placeholder Picker) + * - textareaRef: React ref für Textarea (für Cursor-Position beim Einfügen) * * Features: * - Output Mode: AUTO (concatenate all analyses) vs. TEMPLATE (custom Jinja2 template) * - Template Editor (Textarea für Jinja2 syntax) + * - Cursor-Positionserhaltung beim Platzhalter-Einfügen */ -export function EndNodeConfig({ node, onChange, onOpenPlaceholderPicker }) { +export function EndNodeConfig({ node, onChange, onOpenPlaceholderPicker, textareaRef }) { + const localTextareaRef = useRef(null) + const activeRef = textareaRef || localTextareaRef + const outputMode = node.data.output_mode || 'auto' const template = node.data.template || '' @@ -99,6 +106,7 @@ export function EndNodeConfig({ node, onChange, onOpenPlaceholderPicker }) { )}