Skip to content

Commit 3eedff3

Browse files
authored
Fix untyped subgraph node outputs in vue mode (#5930)
Under some infrequent circumstances, the node outputs of subgraphNodes lack the boundingRect property. As this is a required property of `INodeSlot`s, it's presence is required to satisfy isSlotObject and the type information is discarded to instead display a placeholder output. This boundingRect property is not used by vue nodes and the type of nodeData.outputs already satisfies INodeSlot, so this entire typeguard and computed can be removed. <img width="405" height="209" alt="image" src="https://github.com/user-attachments/assets/8563abb7-b619-495e-b9ec-e3274e7668cf" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5930-Fix-untyped-subgraph-node-outputs-in-vue-mode-2836d73d3650814f993fc71590eca79b) by [Unito](https://www.unito.io)
1 parent 349f351 commit 3eedff3

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/renderer/extensions/vueNodes/components/NodeSlots.vue

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
/>
1515
</div>
1616

17-
<div v-if="filteredOutputs.length" class="flex flex-col gap-1 ml-auto">
17+
<div v-if="nodeData?.outputs?.length" class="flex flex-col gap-1 ml-auto">
1818
<OutputSlot
19-
v-for="(output, index) in filteredOutputs"
19+
v-for="(output, index) in nodeData.outputs"
2020
:key="`output-${index}`"
2121
:slot-data="output"
2222
:node-type="nodeData?.type || ''"
@@ -68,20 +68,6 @@ const filteredInputs = computed(() => {
6868
)
6969
})
7070
71-
// Outputs don't have widgets, so we don't need to filter them
72-
const filteredOutputs = computed(() => {
73-
const outputs = nodeData?.outputs || []
74-
return outputs.map((output) =>
75-
isSlotObject(output)
76-
? output
77-
: ({
78-
name: typeof output === 'string' ? output : '',
79-
type: 'any',
80-
boundingRect: [0, 0, 0, 0] as [number, number, number, number]
81-
} as INodeSlot)
82-
)
83-
})
84-
8571
// Get the actual index of an input slot in the node's inputs array
8672
// (accounting for filtered widget slots)
8773
const getActualInputIndex = (

0 commit comments

Comments
 (0)