Fix reactivity washing in refreshNodeSlots (#7802)

Creating a copy with spread resulted in a copy which was not reactive.

Solves a bug where all widgets on a node in vue mode would cease to be
reactive after any connection is made to the node.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7802-Fix-reactivity-washing-in-refreshNodeSlots-2d96d73d3650819e842ff46030bebfa1)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Alexander Brown <drjkl@comfy.org>
This commit is contained in:
AustinMroz
2026-01-10 23:01:34 -08:00
committed by GitHub
parent 23e9b39593
commit 44c317fd05
2 changed files with 52 additions and 10 deletions

View File

@@ -245,17 +245,10 @@ export function useGraphNodeManager(graph: LGraph): GraphNodeManager {
})
// Update only widgets with new slot metadata, keeping other widget data intact
const updatedWidgets = currentData.widgets?.map((widget) => {
for (const widget of currentData.widgets ?? []) {
const slotInfo = slotMetadata.get(widget.name)
return slotInfo ? { ...widget, slotMetadata: slotInfo } : widget
})
vueNodeData.set(nodeId, {
...currentData,
widgets: updatedWidgets,
inputs: nodeRef.inputs ? [...nodeRef.inputs] : undefined,
outputs: nodeRef.outputs ? [...nodeRef.outputs] : undefined
})
if (slotInfo) widget.slotMetadata = slotInfo
}
}
// Extract safe data from LiteGraph node for Vue consumption