Fix asset browser on subgraph nodes (#6240)

When a widget is linked to a subgraph, the subgraph creates a copy of
the widget. The callback used by the asset browser to update the widget
still refers to the widget that lives inside the subgraph, but at time
of execution, this is overwritten by the unchanged value of the copy.

This is fixed by instead updating the value of the caller. It's a little
hacky, and may need future review.

See also #6237

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6240-Fix-asset-browser-on-subgraph-nodes-2956d73d365081b49bd1cd1a7a254763)
by [Unito](https://www.unito.io)
This commit is contained in:
AustinMroz
2025-10-23 15:28:08 -07:00
committed by GitHub
parent 68f98e2624
commit 671e33cf09

View File

@@ -76,7 +76,7 @@ const addComboWidget = (
'asset',
inputSpec.name,
displayLabel,
async () => {
async function (this: IBaseWidget) {
if (!isAssetWidget(widget)) {
throw new Error(`Expected asset widget but received ${widget.type}`)
}
@@ -111,7 +111,7 @@ const addComboWidget = (
}
const oldValue = widget.value
widget.value = validatedFilename.data
this.value = validatedFilename.data
node.onWidgetChanged?.(
widget.name,
validatedFilename.data,