ba773e677b34b08737722bc6f3d9c12d0b790044
19
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ba773e677b |
fix(workflow): Test-Suite Fixes - Issues #5, #8, #9, #11, #12
Addressed test results from Test_status_Wkf.md: **Issue #5: End-Node Überschriften** - Fixed aggregate_results to show node labels instead of "Node 10" - Added graph lookup to get node.data.label from node objects - Modified backend/workflow_executor.py (2 locations) **Issue #8: Löschen-Taste funktioniert nicht** - Added Delete key support to WorkflowCanvas - Set deleteKeyCode={['Backspace', 'Delete']} - Frontend: WorkflowCanvas.jsx **Issue #9: Mehrere End-Nodes verhindern** - Added validation error when multiple End-Nodes exist - Backend supports only 1 End-Node (aggregate_results takes last) - Frontend: workflowValidation.js **Issue #11: Export Fehler "Internal Server Error"** - Added missing fields to export-all endpoint: - graph_data (workflow node graph) - question_augmentations (analysis prompts) - Added missing fields to import endpoint - Proper JSON serialization for all JSONB fields - Backend: routers/prompts.py **Issue #12: Workflow duplizieren funktioniert nicht** - Fixed duplicate endpoint to include all prompt fields: - type, stages, output_format, output_schema - question_augmentations, graph_data (critical for workflows!) - Backend: routers/prompts.py Files changed: - backend/workflow_executor.py: Node label lookup in aggregate_results - backend/routers/prompts.py: Export/import/duplicate fixes - frontend/src/components/workflow/WorkflowCanvas.jsx: Delete key - frontend/src/utils/workflowValidation.js: Max 1 End-Node validation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
4c9e0e3c98 |
refactor: Simplify StartNode component to improve clarity
- Removed the trimming of the analysis title, now displaying only the node label or defaulting to 'Start'. - Updated documentation to clarify the purpose of properties, specifically distinguishing between display on the canvas and analysis metadata. These changes enhance the readability and maintainability of the StartNode component in the workflow editor. |
||
|
|
0ce98e8973 |
feat: Enhance StartNode and Workflow Editor with analysis metadata
- Updated StartNode to display a trimmed analysis title if available, falling back to the label or 'Start'. - Refactored WorkflowEditorPage to include analysis metadata (title, description, category) in the start node configuration. - Improved serialization and deserialization of workflow graphs to handle new analysis fields. - Enhanced user interface to allow setting and displaying analysis metadata for better clarity in the workflow editor. These changes improve the user experience by providing clearer metadata handling in workflows and ensuring consistent display in analysis components. |
||
|
|
8d89b23db1 |
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
|
||
|
|
c0525cf2d2 |
feat: Extend JoinNode to support 8 input paths
- Increased from 3 to 8 input handles (path_1 through path_8) - Evenly distributed across top edge (11%, 22%, 33%, ..., 89%) - Backend already supports unlimited inputs dynamically - Unused handles are ignored (no edges = no check) Join strategies for missing inputs: - wait_all: Fails if any connected path fails - wait_any: Succeeds if at least 1 path succeeds - best_effort: Always succeeds User can still chain multiple Joins if >8 inputs needed. Part 3: Inline Prompts - workflow flexibility |
||
|
|
8f6d60681e |
fix: Inline Prompts - UX-Verbesserungen
Problem 1: Selbst-Referenzierung verhindern - PlaceholderPicker erhält currentNodeId prop - Node kann sich nicht mehr selbst in Placeholders sehen - extractWorkflowPlaceholders() filtert aktuellen Node aus Problem 2: Radio-Button State-Management - IIFE mit Helper-Funktion für Mode-Bestimmung - isInlineMode/isReferenceMode basierend auf data.inline_template - Korrekte Conditional Rendering Logic - Beim Wechsel Reference→Inline bleibt prompt_slug erhalten - Beim Wechsel Inline→Reference bleibt inline_template erhalten Problem 3: Layout-Breite optimiert - Sidebar: 250px → 220px (schmaler) - Config Panel: 400px → 520px (breiter für bessere Lesbarkeit) - Responsive: Config Panel bei <1200px: 450px statt 350px Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
a1723db387 |
feat: Workflow Engine Part 3 - Inline Prompts (v0.9q)
Ermöglicht Analysis Nodes zwischen zwei Prompt-Modi zu wählen: - Reference Mode: Basis-Prompt aus DB referenzieren (bestehend) - Inline Mode: Template direkt im Node editieren (NEU) Frontend: - InlineTemplateEditor Component (~80 Zeilen) - Radio Buttons in WorkflowEditorPage für Mode-Auswahl - Placeholder Picker für beide Modi (End Node + Inline Template) - Cursor-Position Tracking mit textareaRef - Conditional Rendering basierend auf promptSource - Validation: Entweder prompt_slug ODER inline_template Backend: - load_prompt_template() akzeptiert ganzen WorkflowNode (statt nur slug) - Unterstützt inline_template (Mode 1) und prompt_slug (Mode 2) - WorkflowNode.inline_template Feld hinzugefügt - Validation: HTTPException wenn weder slug noch template Serialization: - inline_template in graph_data speichern/laden - Backward-compatible mit bestehenden Workflows Version: 0.9q Module: workflow 0.7.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
3b4902dc11 |
fix: CRITICAL - Use question ID in placeholders, not type
Root Cause:
- Multiple questions with same type (e.g. "unsicherheit") created duplicate placeholders
- {{ node_4.signal_unsicherheit }} could refer to q21 OR q22
- Later signal overwrote earlier one in template context
Solution:
- Placeholders now use question ID: {{ node_4.signal_q21 }}
- Unique even with multiple questions of same type
Frontend PlaceholderPicker.jsx:
- Changed placeholder: signal_${questionType} → signal_${questionId}
- Changed placeholder: question_${questionType} → question_${questionId}
- Description shows both: "q21 (unsicherheit): Question text"
Backend workflow_executor.py:
- Build question_type → question_id mapping from graph
- Map normalized_signals (by type) to question IDs
- Handles duplicate types with index tracking
- Creates signal_${id} and question_${id} in template context
Example:
Questions configured:
- q21: type="unsicherheit", question="Ist Protein unsicher?"
- q22: type="unsicherheit", question="Ist Energie unsicher?"
Placeholders generated:
- {{ node_4.signal_q21 }} → "nein"
- {{ node_4.signal_q22 }} → "ja"
- {{ node_4.question_q21 }} → "Ist Protein unsicher?"
- {{ node_4.question_q22 }} → "Ist Energie unsicher?"
Issue: Duplicate question types cause placeholder conflicts
Version: 0.9p (workflow module)
Part 3: End Node Template Engine - CRITICAL FIX
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
||
|
|
f9c244bf48 |
improve: Show question ID in placeholder descriptions
Frontend PlaceholderPicker.jsx:
- Placeholder descriptions now include question ID (q.id)
- Format: "NodeLabel (q21) - Signal type: Question text"
- Makes it easier to identify which question a placeholder belongs to
Example:
Before: "Analysis 4 - Signal: Wie ist die Kalorienbilanz?"
After: "Analysis 4 (q21) - Signal kalorienbilanz: Wie ist die Kalorienbilanz?"
Shows:
- Node label: "Analysis 4"
- Question ID: "(q21)" ← User-assigned ID
- Question type: "kalorienbilanz" ← Used in placeholder
- Question text: "Wie ist..."
Placeholder stays: {{ node_4.signal_kalorienbilanz }}
But description shows q21 for better identification
Version: 0.9p (workflow module)
Part 3: End Node Template Engine - UX Improvement
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
||
|
|
3e93dbbc89 |
fix: Placeholder field name mismatch + debug logging
Root Cause:
- PlaceholderPicker used q.id for signal placeholders
- Backend template context used question_type
- Placeholders never matched → empty values
Frontend PlaceholderPicker.jsx:
- Changed signal_${q.id} → signal_${q.type} (matches backend)
- Added question_${q.type} placeholders (question texts)
- New category: "Workflow - Questions"
Backend workflow_executor.py:
- Added extensive debug logging for template context
- Logs all signal_* and question_* keys + values
- Helps diagnose template rendering issues
Example:
- Question configured with type="kalorienbilanz"
- Frontend now shows: {{ node_4.signal_kalorienbilanz }}
- Frontend now shows: {{ node_4.question_kalorienbilanz }}
- Backend creates: template_context['node_4']['signal_kalorienbilanz']
- Should match and render correctly
Issue: Signal placeholders show empty values
Version: 0.9p (workflow module)
Part 3: End Node Template Engine - Field Name Fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
||
|
|
76b4b36617 |
feat: End Node template placeholders + clean output display
Three major improvements for workflow templates:
1. **Normalized Signal Placeholders:**
- Signals now available as {{ node_4.signal_kalorienbilanz }}
- Uses normalized_value (not raw decision_signals)
- Enables structured decision-based outputs
2. **Question Text Placeholders:**
- Question texts available as {{ node_4.question_kalorienbilanz }}
- Extracted from workflow graph (question_augmentations)
- Allows displaying questions alongside answers
3. **Clean End Node Output:**
- End Node output no longer duplicated with "## node_4" headers
- aggregate_results() detects End Nodes via graph.nodes
- Only shows final template-rendered output
- Backward compatible: Falls back to combined_analysis if no End Node
Backend workflow_executor.py:
- execute_end_node(): Added normalized signals to template context
- execute_end_node(): Added question texts to template context
- execute_workflow(): Added graph to context for End Node access
- aggregate_results(): Signature change to accept graph
- aggregate_results(): Detects End Nodes and uses only their output
Frontend WorkflowResultViewer.jsx:
- Now uses aggregated.analysis_core (primary output)
- Removed fallback to combined_analysis (was showing duplicates)
Example Template:
```jinja2
**Frage:** {{ node_4.question_kalorienbilanz }}
**Antwort:** {{ node_4.signal_kalorienbilanz }}
---
{{ node_4.analysis_core }}
```
Issue: Signal placeholders empty, question texts unavailable, duplicate output
Version: 0.9p (workflow module)
Part 3: End Node Template Engine - Complete
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
||
|
|
9c8859b1ae |
fix: React error #31 - Cannot render signal objects directly
Root Cause: - WorkflowResultViewer tried to render NormalizedSignal objects directly - React Error #31: "Objects are not valid as a React child" - Caused white screen crash after workflow execution Frontend WorkflowResultViewer.jsx: - Fixed signal rendering in "All Signals" section - Now displays: question_type: normalized_value (status) - Proper formatting for signal objects Before: • {signal} ❌ renders [object Object] After: • protein_intake: optimal (valid) ✅ Impact: - Workflow execution no longer crashes the UI - Signals are properly displayed - Users can see normalized decision signals Issue: White screen after workflow execution Version: 0.9p (workflow module) Part 3: End Node Template Engine - UI Fix Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
d2eaab277e |
debug: Add extensive logging to PlaceholderPicker
**Issue Investigation:** User reports: 1. Backend placeholders (120+) not appearing 2. Node names showing as 'node_2' instead of 'Körper-Analyse (node_2)' **Debug Changes:** - Console logging for backend API call - Log catalog structure and keys - Log flattened placeholders count - Error state displayed in UI (not just console) - Log each node extraction with label/data - Safe navigation operator for node.data?.label **Expected Console Output:** 🔄 Loading placeholders from backend... ✅ Catalog received: {...} 📊 Catalog keys: ['Profil', 'Körper', ...] 📁 Category "Profil": 10 items ✅ Loaded 120 system placeholders 🔍 Extracting workflow placeholders from nodes: [...] 📦 Node node_2: {label: 'Körper-Analyse', ...} ➕ Adding placeholder: {{ node_2.analysis_core }} → "Körper-Analyse (node_2) - Hauptausgabe" Next: Check browser console for error messages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
b779c2f2a8 |
fix: Part 3 - PlaceholderPicker enhancements (4 critical fixes)
**User Feedback Issues Fixed:** 1. **Registrierte Platzhalter fehlten** ❌ → ✅ - PlaceholderPicker lädt jetzt ~120+ Platzhalter vom Backend - Endpoint: GET /api/prompts/placeholders (get_placeholder_catalog) - Kategorisiert nach: Profil, Körper, Ernährung, Training, etc. - Icons pro Kategorie (👤 💪 🍎 🏃 😴 ❤️ 🎯) 2. **Node-Namen nicht sichtbar** ❌ → ✅ - Vorher: "{{ node_2.analysis_core }}" - Jetzt: "Körper-Analyse (node_2) - Hauptausgabe" - Node-Label wird in Beschreibung angezeigt 3. **Cursor-Position ignoriert** ❌ → ✅ - Platzhalter werden jetzt an Cursor-Position eingefügt - textareaRef von WorkflowEditorPage an EndNodeConfig übergeben - textarea.selectionStart/End für exakte Position - Cursor wird nach Einfügen an korrekte Stelle gesetzt - Focus zurück auf Textarea 4. **Fragen-Kontext unklar** ⚠️ → ✅ - Signal-Platzhalter zeigen jetzt Frage-Text - Format: "Körper-Analyse - Signal: Ist Gewichtstrend positiv?" - Frage wird auf 50 Zeichen gekürzt wenn zu lang **Komponenten-Änderungen:** PlaceholderPicker.jsx: - useEffect zum Laden von Backend-Platzhaltern - Gruppierung nach Kategorien (System + Workflow) - System-Platzhalter: ~120+ aus placeholder_registrations - Workflow-Platzhalter: Node Outputs + Signals - Bessere Beschreibungen mit Node-Label - Stats-Anzeige: "X Platzhalter gefunden (Y Workflow, Z System)" - Loading State während Backend-Call EndNodeConfig.jsx: - useRef für Textarea - textareaRef Prop (optional, Fallback zu lokalem ref) - ref an Textarea gebunden WorkflowEditorPage.jsx: - useRef Hook importiert - endNodeTextareaRef erstellt - handlePlaceholderSelect umgebaut: - Liest selectionStart vom Textarea - Fügt an Cursor-Position ein (before + placeholder + after) - Setzt Cursor nach Platzhalter - Fokussiert Textarea wieder - Fallback: Am Ende einfügen wenn ref nicht verfügbar - textareaRef an EndNodeConfig übergeben **UX-Verbesserungen:** - Suchfunktion durchsucht jetzt auch Kategorie-Namen - Sticky Category Headers beim Scrollen - Example-Werte in Beschreibung (wenn vorhanden) - AutoFocus auf Suchfeld beim Öffnen - Gruppiert: Workflow-Outputs immer oben, dann System-Platzhalter **Testing Required:** - [ ] End Node öffnen → Template Mode → Platzhalter-Button klicken - [ ] Prüfen: ~120+ Platzhalter sichtbar (nicht nur 2-3 Workflow-Outputs) - [ ] Prüfen: Node-Namen in Beschreibungen ("Körper-Analyse (node_2)") - [ ] Cursor an beliebige Stelle setzen → Platzhalter einfügen - [ ] Prüfen: Einfügen an Cursor-Position (nicht am Ende) Part 3 Bugfixes - User Feedback Complete Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
228010a6d3 |
feat: Part 3 - End Node Template Editor
**Neue Features:** - End Node Output Mode: AUTO vs. TEMPLATE - Jinja2 Template Editor mit Syntax-Beispiel - Placeholder Picker Modal (dynamische Node-Liste) - Template Serialisierung/Deserialisierung **Komponenten (NEU):** 1. EndNodeConfig.jsx (~150 Zeilen) - Output Mode Toggle (AUTO/TEMPLATE) - Template Textarea (monospace, 12 Zeilen) - Placeholder-Button (öffnet Picker) - Help-Text mit Beispiel-Syntax - Auto-Insert Default Template beim Wechsel zu TEMPLATE 2. PlaceholderPicker.jsx (~260 Zeilen) - Modal mit Suchfunktion - Dynamische Placeholder-Liste aus Workflow-Nodes - Kategorien: Global, Node Outputs, Signals - Click-to-Insert (schließt Modal automatisch) - Icons pro Node-Typ (🚀🤖⚡🔀🏁) **Integration:** - WorkflowEditorPage.jsx - EndNodeConfig im Config Panel (wenn type='end') - PlaceholderPicker State + Modal - handlePlaceholderSelect (fügt in Template ein) **Serialisierung:** - workflowSerializer.js - Serialize: output_mode + template für End Nodes - Deserialize: output_mode + template laden - Fallback: auto Mode wenn nicht gesetzt **Backend Status:** - ✅ Backend bereits fertig (execute_end_node() in workflow_executor.py) - ✅ Beide Modi (AUTO/TEMPLATE) funktionieren - ✅ Jinja2 Template Rendering implementiert **Part 3 Status:** Frontend Complete - ✅ End Node Config UI - ✅ Template Editor - ✅ Placeholder Picker - ⏸️ Testing ausstehend **Nächster Schritt:** Browser-Test auf dev.mitai.jinkendo.de Version: v0.9p Date: 2026-04-09 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
2994df54ad |
fix: Complete prompt_id → prompt_slug migration
**Remaining Issues Found:**
1. Validierung prüfte noch prompt_id → Speichern blockiert
2. AnalysisNode zeigte noch prompt_id → "Kein Prompt" obwohl gesetzt
3. Deserializer hatte keinen Fallback für alte Workflows
**Fixes:**
- workflowValidation.js: Line 91
- if (!node.data.prompt_slug) statt prompt_id
- AnalysisNode.jsx: Line 15
- Verwendet jetzt data.prompt_slug
- Fallback: "Prompt: ${slug}" statt "Prompt #${id}"
- Kommentar aktualisiert (data.prompt_slug statt prompt_id)
- workflowSerializer.js: Line 81
- Fallback: node.prompt_slug || node.prompt_id || null
- Backwards-compatible für alte Workflows
**Testing:**
1. Neuen Workflow erstellen
2. Analysis Node hinzufügen
3. Prompt auswählen
4. Node sollte Prompt-Namen zeigen
5. Beim Öffnen: Dropdown sollte Wert anzeigen
6. Speichern sollte funktionieren (keine Validierungsfehler)
7. Execute sollte funktionieren (kein "Prompt not found")
Part 2 Complete Bugfix - Workflow Execution
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
||
|
|
46d39bad38 |
feat: Part 2 - Workflow Frontend Execute Integration
Frontend-Komponenten für Workflow-Ausführung implementiert: **Neue Komponenten:** - WorkflowExecutePanel.jsx (~140 Zeilen) - Execute Button mit Loading State - Debug Mode Toggle - Error Handling Display - WorkflowResultViewer.jsx (~300 Zeilen) - Fixed Panel (rechts, 600px) - Final Output mit Copy-Button - Node States (collapsible, Debug Mode) - All Signals Display - Error Display **Integration:** - WorkflowEditorPage.jsx - ExecutePanel in Toolbar - executionResult State - handleExecutionComplete Handler - Slug wird beim Erstellen gespeichert **API:** - api.executeWorkflow(slug, variables, debug, save) - Nutzt /prompts/execute Endpoint - Debug Mode Default: true **Part 2 Status:** ~80% abgeschlossen - ✅ Execute Button - ✅ Result Viewer - ⏸️ Execution History (später entscheiden) Version: v0.9o Date: 2026-04-09 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|
|
2f70a39052 |
fix: Phase 5 - Workflow Editor UX Fixes (Round 3)
Frontend Fixes: - AdminPromptsPage: Edit button navigates to workflow-editor for workflow type prompts - WorkflowEditorPage: Fixed save navigation (alert before navigate) - WorkflowEditorPage: selectedNode derived from selectedNodeId (eliminates stale state) - FallbackConfig: Show node labels instead of IDs in fallback edge dropdown - WorkflowCanvas: Enable edge deletion with deletable: true - WorkflowEditorPage: Hide sidebar when config panel is open Bugs Fixed: - C1: Save error "Method Not Allowed" after success - C2: Edit button in admin doesn't open workflow editor - H1: Prompt selection not displayed when re-editing node - H2: Fallback edge dropdown shows node_1/node_2 instead of names - H3: Cannot delete edges - M1: Sidebar takes space when config panel open Technical Changes: - Replaced useState(selectedNode) with useState(selectedNodeId) + derived selectedNode - Removed sync useEffect (no longer needed with derived state) - Added nodes prop to FallbackConfig for label lookup - Swapped alert/navigate order to prevent navigation errors Testing: Manual testing required (see manual test cases) |
||
|
|
dc59596f01 |
feat: Phase 5 - Visual Workflow Editor (Option B)
Backend (Mini-Backend 1-2h): - Migration 016: ai_prompts.graph_data JSONB column - workflow_executor: graph_data parameter support (backward-compatible) - prompt_executor: execute_workflow_prompt uses graph_data Frontend (Main effort 25-35h): - WorkflowCanvas: React Flow wrapper component - 5 Custom Nodes: Start, End, Analysis, Logic, Join - 4 Config Panels: QuestionAugmentation, LogicExpression, Fallback, Join - workflowValidation: Structural + logical validation - workflowSerializer: Canvas ↔ JSONB conversion - WorkflowEditorPage: Main orchestration (420 LOC) - Route: /workflow-editor/:id - CSS: workflowEditor.css (300 LOC) Architecture: - Option B: ai_prompts.type='workflow' (not separate table) - panels/ subdirectory for clean separation - WorkflowCanvas reusable component - User GUI identical (Workflows = Prompts) - Backward-compatible (type='pipeline' unchanged) Version: v0.9m → v0.9n (Phase 5 complete) Module: workflow 0.5.0 → 0.6.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |