feat: add node calssification

This commit is contained in:
2026-03-10 21:34:39 +01:00
parent eed880e7ef
commit 87c46c25c6
8 changed files with 79 additions and 19 deletions

View File

@@ -2,7 +2,7 @@ import React, { useContext, useMemo } from 'react'
import FlowContext from '../../lib/flowContext'
import { ArrowDownLeft, ArrowUpRight } from 'lucide-react'
import { NodeHelpPopover } from './NodeHelpPopover'
import { getNodeType } from '../../lib/nodeRegistry'
import { getNodeType, getNodeClassificationLabel } from '../../lib/nodeRegistry'
type Props = {
nodeId: string
@@ -27,6 +27,7 @@ export function NodeFooterEdgeIndicators({ nodeId, nodeType, children }: Props)
const descriptor = getNodeType(nodeType)
const showInput = descriptor?.hasInput ?? false
const showOutput = descriptor?.hasOutput ?? false
const classificationLabel = getNodeClassificationLabel(nodeType)
return (
<div className="flex items-center gap-2 w-full text-xs text-muted-foreground">
@@ -48,6 +49,12 @@ export function NodeFooterEdgeIndicators({ nodeId, nodeType, children }: Props)
<span className="min-w-0 truncate">{children}</span>
</>
)}
{classificationLabel != null && (
<>
{(showInput || showOutput || children != null) && <span className="shrink-0">|</span>}
<span className="shrink-0" title="Node classification">{classificationLabel}</span>
</>
)}
<span className="shrink-0 ml-auto">
<NodeHelpPopover nodeType={nodeType} />
</span>