fix: Phase 5 - Workflow save + node persistence bugs
Deploy Development / deploy (push) Successful in 47s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s

KRITISCHE FIXES:

1. Backend: Workflow-Type Support
   - models.py: graph_data Feld hinzugefügt
   - models.py: slug Optional (auto-generiert)
   - prompts.py: 'workflow' in erlaubten Typen
   - prompts.py: graph_data in INSERT/UPDATE
   - prompts.py: Auto-Slug-Generierung aus Name
   - FIX: "Field required: slug" Error behoben

2. Frontend: Node-Updates Persistence
   - selectedNode sync mit nodes array (useEffect)
   - FIX: Änderungen gingen verloren (stale state)
   - FIX: Prompt-Auswahl nicht sichtbar nach Edit
   - FIX: Fallback-Strategy nicht gespeichert
   - FIX: Node-Name Änderungen nicht übernommen

BEHOBEN:
- ❌ Save fehlgeschlagen → ✅ Workflows speicherbar
- ❌ Node-Name ignoriert → ✅ Live-Update
- ❌ Prompt verschwindet → ✅ Bleibt sichtbar
- ❌ Fallback nicht saved → ✅ Persistiert

Tested: Backend API akzeptiert jetzt type='workflow'

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 4.6 committed 2026-04-04 19:17:41 +02:00
1 parent e3ef18674a
commit 7d22b052dd
3 files changed
+44 -11

No files matched your search

+7 -3
View File
@@ -177,12 +177,12 @@ class StageCreate(BaseModel):
class UnifiedPromptCreate(BaseModel):
"""Create a new unified prompt (base or pipeline type)"""
"""Create a new unified prompt (base, pipeline, or workflow type)"""
name: str
slug: str
slug: Optional[str] = None # Auto-generated from name if not provided
display_name: Optional[str] = None
description: Optional[str] = None
type: str # 'base' or 'pipeline'
type: str # 'base' | 'pipeline' | 'workflow'
category: str = 'ganzheitlich'
active: bool = True
sort_order: int = 0
@@ -195,6 +195,9 @@ class UnifiedPromptCreate(BaseModel):
# For pipeline prompts (multi-stage workflow)
stages: Optional[list[StageCreate]] = None # Required if type='pipeline'
# For workflow prompts (visual graph editor)
graph_data: Optional[dict] = None # Required if type='workflow'
class UnifiedPromptUpdate(BaseModel):
"""Update an existing unified prompt"""
@@ -209,6 +212,7 @@ class UnifiedPromptUpdate(BaseModel):
output_format: Optional[str] = None
output_schema: Optional[dict] = None
stages: Optional[list[StageCreate]] = None
graph_data: Optional[dict] = None # For workflow type
# ── Pipeline Config Models (Issue #28) ─────────────────────────────────────