Give a connector node an icon that is not a code icon

A device read over a proprietary protocol was showing the fallback used
for a function node. A connector's type cannot be in the built-in icon
map — that is the point of it being a connector — so they share a plug.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LF61rxW1FG5YCD2J9YqjY
This commit is contained in:
2026-08-16 11:14:35 +02:00
co-authored by Claude Fable 5
parent 4de3cd7c66
commit 42075a6dae
3 changed files with 72 additions and 3 deletions
+22 -1
View File
@@ -303,6 +303,18 @@ function FlowEditorInner({
[nodeTypeInfo],
)
// Which types came from an installed connector rather than the engine. They
// cannot be in the icon map, so they share one.
const pluginTypes = useMemo(
() =>
new Set(
(nodeTypeInfo ?? [])
.filter((info) => info.plugin)
.map((info) => info.type),
),
[nodeTypeInfo],
)
const issuesByNode = useMemo(() => {
const map = new Map<string, string[]>()
for (const issue of issues) {
@@ -328,11 +340,20 @@ function FlowEditorInner({
flow: flowName,
typeLabel:
typeLabels.get(definition?.type ?? "") ?? definition?.type ?? "",
isPlugin: pluginTypes.has(definition?.type ?? ""),
issueText: nodeIssues.join("\n"),
} satisfies FlowNodeData,
}
}),
[canvasNodes, definitions, flowName, issuesByNode, selectedId, typeLabels],
[
canvasNodes,
definitions,
flowName,
issuesByNode,
pluginTypes,
selectedId,
typeLabels,
],
)
// A cheap fingerprint of the wiring: it changes when a name does, but not
+9 -2
View File
@@ -10,6 +10,7 @@ import {
Globe,
Merge,
Play,
Plug,
Radio,
Shuffle,
Split,
@@ -58,6 +59,7 @@ export type FlowNodeData = {
definition: NodeDef_Input
flow: string
typeLabel: string
isPlugin?: boolean
issueText: string
[key: string]: unknown
}
@@ -101,10 +103,15 @@ function PortHandles({
}
function FlowNodeComponent({ data, selected }: NodeProps) {
const { definition, flow, typeLabel, issueText } = data as FlowNodeData
const { definition, flow, typeLabel, isPlugin, issueText } =
data as FlowNodeData
const live = useNodeStatus(`${flow}.${definition.id}`)
const emits = useNodeEmits(`${flow}.${definition.id}`)
const Icon = NODE_ICONS[definition.type as keyof typeof NODE_ICONS] ?? Code2
const Icon =
NODE_ICONS[definition.type as keyof typeof NODE_ICONS] ??
// A connector's own type cannot be in the map above, and a device is
// not a piece of code.
(isPlugin ? Plug : Code2)
// Whatever is wrong — it failed to load, it failed to run, or the graph
// around it does not add up — is the same red dot with the same explanation.