From ba7f622fbd733418660efdef7eed16e27a883e60 Mon Sep 17 00:00:00 2001 From: AustinMroz Date: Sat, 14 Feb 2026 12:49:54 -0800 Subject: [PATCH] Fix primitive assets (#8879) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #8598 made primitve widgets connected to an asset have the asset type, but the `nodeType` parameter required to actually resolve valid models wasn't getting passed correctly. This `nodeType`, introduced by me back in #7576, was a mistake. I'm pulling it out now and instead passing nodeType as an option. Of note: code changes are only required to pass the option, not to utilize it. | Before | After | | ------ | ----- | | before | after| The backport PR was made first in #8878. Fixing the bug was time sensitive and backport would not be clean due to the `widget.value` changes. Changes were still simpler than expected. I probably should have made this PR first and then backported, but I misjudged the complexity of conflict resolution. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8879-Fix-primitive-assets-3076d73d365081b89ed4e6400dbf8e74) by [Unito](https://www.unito.io) --- src/composables/graph/useGraphNodeManager.ts | 13 +------------ src/platform/assets/utils/createAssetWidget.ts | 5 ++++- .../extensions/vueNodes/components/NodeWidgets.vue | 1 - 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/composables/graph/useGraphNodeManager.ts b/src/composables/graph/useGraphNodeManager.ts index 3ad3a06304..d1a08a5459 100644 --- a/src/composables/graph/useGraphNodeManager.ts +++ b/src/composables/graph/useGraphNodeManager.ts @@ -54,8 +54,6 @@ export interface SafeWidgetData { hasLayoutSize?: boolean /** Whether widget is a DOM widget */ isDOMWidget?: boolean - /** Node type (for subgraph promoted widgets) */ - nodeType?: string /** * Widget options needed for render decisions. * Note: Most metadata should be accessed via widgetValueStore.getWidget(). @@ -121,12 +119,6 @@ function getControlWidget(widget: IBaseWidget): SafeControlWidget | undefined { } } -function getNodeType(node: LGraphNode, widget: IBaseWidget) { - if (!node.isSubgraphNode() || !isProxyWidget(widget)) return undefined - const subNode = node.subgraph.getNodeById(widget._overlay.nodeId) - return subNode?.type -} - /** * Shared widget enhancements used by both safeWidgetMapper and Right Side Panel */ @@ -135,8 +127,6 @@ interface SharedWidgetEnhancements { controlWidget?: SafeControlWidget /** Input specification from node definition */ spec?: InputSpec - /** Node type (for subgraph promoted widgets) */ - nodeType?: string } /** @@ -152,8 +142,7 @@ export function getSharedWidgetEnhancements( return { controlWidget: getControlWidget(widget), - spec: nodeDefStore.getInputSpecForWidget(node, widget.name), - nodeType: getNodeType(node, widget) + spec: nodeDefStore.getInputSpecForWidget(node, widget.name) } } diff --git a/src/platform/assets/utils/createAssetWidget.ts b/src/platform/assets/utils/createAssetWidget.ts index ed48ab2b79..f6bbaa4f12 100644 --- a/src/platform/assets/utils/createAssetWidget.ts +++ b/src/platform/assets/utils/createAssetWidget.ts @@ -105,7 +105,10 @@ export function createAssetWidget( }) } - const options: IWidgetAssetOptions = { openModal } + const options: IWidgetAssetOptions = { + openModal, + nodeType: nodeTypeForBrowser + } return node.addWidget('asset', widgetName, displayLabel, () => {}, options) } diff --git a/src/renderer/extensions/vueNodes/components/NodeWidgets.vue b/src/renderer/extensions/vueNodes/components/NodeWidgets.vue index 8b8b616568..6c60c66663 100644 --- a/src/renderer/extensions/vueNodes/components/NodeWidgets.vue +++ b/src/renderer/extensions/vueNodes/components/NodeWidgets.vue @@ -214,7 +214,6 @@ const processedWidgets = computed((): ProcessedWidget[] => { callback: widget.callback, controlWidget: widget.controlWidget, label: widgetState?.label, - nodeType: widget.nodeType, options: widgetOptions, spec: widget.spec }