feat: change circular reference detection from error to warning — loops are intentional
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -802,8 +802,8 @@ export const useTreeEditorStore = create<TreeEditorState>()(
|
|||||||
if (opt.next_node_id && detectCircularRefs(opt.next_node_id, new Set(visited))) {
|
if (opt.next_node_id && detectCircularRefs(opt.next_node_id, new Set(visited))) {
|
||||||
errors.push({
|
errors.push({
|
||||||
nodeId: node.id,
|
nodeId: node.id,
|
||||||
message: `Circular reference detected: "${opt.label}" creates a loop`,
|
message: `This path loops back to an earlier node via "${opt.label}"`,
|
||||||
severity: 'error'
|
severity: 'warning'
|
||||||
})
|
})
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -814,8 +814,8 @@ export const useTreeEditorStore = create<TreeEditorState>()(
|
|||||||
if (node.next_node_id && detectCircularRefs(node.next_node_id, new Set(visited))) {
|
if (node.next_node_id && detectCircularRefs(node.next_node_id, new Set(visited))) {
|
||||||
errors.push({
|
errors.push({
|
||||||
nodeId: node.id,
|
nodeId: node.id,
|
||||||
message: `Circular reference detected in node "${node.title || node.id}"`,
|
message: `This node loops back to an earlier node ("${node.title || node.id}")`,
|
||||||
severity: 'error'
|
severity: 'warning'
|
||||||
})
|
})
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user