feat: Show node.name from workflow editor in debug panel
- Add name field to WorkflowNode model - Add node_name field to NodeExecutionState - Set node_name in execute_workflow from node.name - Display priority: node_name > debug_prompt_slug > node_label > node_id User sees 'Qualitätseinschätzung' instead of 'node_abc123'
This commit is contained in:
parent
f97d15288d
commit
5fa2ea2e6b
|
|
@ -166,10 +166,13 @@ async def execute_workflow(
|
||||||
enable_debug=enable_debug
|
enable_debug=enable_debug
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add human-readable label to node_state for debug UI
|
# Add human-readable label and name to node_state for debug UI
|
||||||
node_label = node.prompt_slug if hasattr(node, 'prompt_slug') and node.prompt_slug else f"{node.type.value}-{node_id[:8]}"
|
node_label = node.prompt_slug if hasattr(node, 'prompt_slug') and node.prompt_slug else f"{node.type.value}-{node_id[:8]}"
|
||||||
if not node_state.debug_prompt_slug:
|
if not node_state.debug_prompt_slug:
|
||||||
node_state.debug_prompt_slug = node_label
|
node_state.debug_prompt_slug = node_label
|
||||||
|
# Set node_name from graph (user-defined name in editor)
|
||||||
|
if not node_state.node_name and hasattr(node, 'name'):
|
||||||
|
node_state.node_name = node.name
|
||||||
|
|
||||||
node_states.append(node_state)
|
node_states.append(node_state)
|
||||||
context["node_results"][node_id] = node_state
|
context["node_results"][node_id] = node_state
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,7 @@ class WorkflowNode(BaseModel):
|
||||||
"""
|
"""
|
||||||
id: str = Field(..., description="Eindeutige Knoten-ID")
|
id: str = Field(..., description="Eindeutige Knoten-ID")
|
||||||
type: NodeType = Field(..., description="Knotentyp")
|
type: NodeType = Field(..., description="Knotentyp")
|
||||||
|
name: Optional[str] = Field(None, description="Node-Name (vom Editor)")
|
||||||
position: Optional[Position] = Field(None, description="Position im visuellen Editor")
|
position: Optional[Position] = Field(None, description="Position im visuellen Editor")
|
||||||
|
|
||||||
# ANALYSIS-Knoten
|
# ANALYSIS-Knoten
|
||||||
|
|
@ -341,6 +342,7 @@ class NodeExecutionState(BaseModel):
|
||||||
Erweitert NodeState um Phase-1-Komponenten (analysis_core, decision_signals, etc.)
|
Erweitert NodeState um Phase-1-Komponenten (analysis_core, decision_signals, etc.)
|
||||||
"""
|
"""
|
||||||
node_id: str = Field(..., description="Knoten-ID")
|
node_id: str = Field(..., description="Knoten-ID")
|
||||||
|
node_name: Optional[str] = Field(None, description="Node-Name aus Workflow-Editor")
|
||||||
status: NodeStatus = Field(..., description="Ausführungsstatus")
|
status: NodeStatus = Field(..., description="Ausführungsstatus")
|
||||||
|
|
||||||
# Phase 1 Result Container
|
# Phase 1 Result Container
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ export function WorkflowResultViewer({ result, onClose }) {
|
||||||
{(node.debug_node_type || node.node_type) === 'join' && '🔀'}
|
{(node.debug_node_type || node.node_type) === 'join' && '🔀'}
|
||||||
{(node.debug_node_type || node.node_type) === 'end' && '🏁'}
|
{(node.debug_node_type || node.node_type) === 'end' && '🏁'}
|
||||||
{' '}
|
{' '}
|
||||||
{node.debug_prompt_slug || node.node_label || ((node.debug_node_type || node.node_type) ? `${node.debug_node_type || node.node_type}-${node.node_id.substring(0, 8)}` : node.node_id)}
|
{node.node_name || node.debug_prompt_slug || node.node_label || node.node_id}
|
||||||
{node.status === 'skipped' && (
|
{node.status === 'skipped' && (
|
||||||
<span style={{ color: 'var(--text3)', marginLeft: '8px' }}>
|
<span style={{ color: 'var(--text3)', marginLeft: '8px' }}>
|
||||||
(skipped)
|
(skipped)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user