8f6d60681e
7 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 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> |
|||
| 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>
|
|||
| 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> |