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)
This commit is contained in:
1 parent
7d22b052dd
commit
2f70a39052
4 files changed
+30
-27
No files matched your search
@@ -41,7 +41,8 @@ export function WorkflowCanvas({
|
||||
maxZoom={2}
|
||||
defaultEdgeOptions={{
|
||||
animated: false,
|
||||
style: { strokeWidth: 2 }
|
||||
style: { strokeWidth: 2 },
|
||||
deletable: true
|
||||
}}
|
||||
>
|
||||
<Background
|
||||
|
||||
@@ -4,15 +4,22 @@
|
||||
* Props:
|
||||
* - node: React Flow Node object
|
||||
* - edges: Array of React Flow edges
|
||||
* - nodes: Array of React Flow nodes (for label lookup)
|
||||
* - onChange: (nodeId, updates) => void
|
||||
*/
|
||||
export function FallbackConfig({ node, edges, onChange }) {
|
||||
export function FallbackConfig({ node, edges, nodes, onChange }) {
|
||||
const fallbackStrategy = node.data.fallback_strategy || 'conservative_skip'
|
||||
const fallbackEdge = node.data.fallback_edge || null
|
||||
|
||||
// Outgoing Edges von diesem Node
|
||||
const outgoingEdges = edges.filter(e => e.source === node.id)
|
||||
|
||||
// Helper: Get node label by ID
|
||||
const getNodeLabel = (nodeId) => {
|
||||
const targetNode = nodes.find(n => n.id === nodeId)
|
||||
return targetNode?.data?.label || nodeId
|
||||
}
|
||||
|
||||
const handleStrategyChange = (e) => {
|
||||
const strategy = e.target.value
|
||||
onChange(node.id, { fallback_strategy: strategy })
|
||||
@@ -53,7 +60,7 @@ export function FallbackConfig({ node, edges, onChange }) {
|
||||
<option value="">-- Kante wählen --</option>
|
||||
{outgoingEdges.map(e => (
|
||||
<option key={e.id} value={e.id}>
|
||||
{e.data?.label || `Edge → ${e.target}`}
|
||||
{e.data?.label || `Edge → ${getNodeLabel(e.target)}`}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
Reference in new issue
Block a user