feat: error connections

This commit is contained in:
2026-03-11 23:05:09 +01:00
parent e79821bd81
commit 48dcf38e01
6 changed files with 112 additions and 5 deletions

View File

@@ -52,6 +52,8 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
const setFullscreenNodeId = flowContext?.setFullscreenNodeId
const startConnectionPathUpdate = flowContext?.startConnectionPathUpdate
const endConnectionPathUpdate = flowContext?.endConnectionPathUpdate
const addConnectionPathError = flowContext?.addConnectionPathError
const removeConnectionPathError = flowContext?.removeConnectionPathError
const supportsFullscreen = getNodeType('render')?.supportsFullscreen
const [renderedContent, setRenderedContent] = useState<string | null>(null)
const [resolvedContent, setResolvedContent] = useState<string | null>(null)
@@ -78,6 +80,15 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
const sourceContent = srcNode?.type === 'config' ? getConfigContent((srcNode.data ?? undefined) as Record<string, unknown> | undefined) : isAgentSource ? agentOutputMarkdown : ''
const srcData = srcNode?.data ?? {}
useEffect(() => {
if (!addConnectionPathError || !removeConnectionPathError) return
if (error != null) {
addConnectionPathError(id)
return () => removeConnectionPathError(id)
}
removeConnectionPathError(id)
}, [id, error, addConnectionPathError, removeConnectionPathError])
/** Set of node IDs that can affect this render node (configs in the chain + variables/functions feeding them) */
const connectedNodeIds = useMemo(() => {
const out = new Set<string>()