Fix primitive assets (#8879)

#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 |
| ------ | ----- |
| <img width="360" alt="before"
src="https://github.com/user-attachments/assets/f1abfbd1-2502-4b82-841c-7ef697b3a431"
/> | <img width="360" alt="after"
src="https://github.com/user-attachments/assets/099cd511-0101-496c-b24e-ee2c19f23384"/>|

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)
This commit is contained in:
AustinMroz
2026-02-14 12:49:54 -08:00
committed by GitHub
parent fcb4341c98
commit ba7f622fbd
3 changed files with 5 additions and 14 deletions

View File

@@ -105,7 +105,10 @@ export function createAssetWidget(
})
}
const options: IWidgetAssetOptions = { openModal }
const options: IWidgetAssetOptions = {
openModal,
nodeType: nodeTypeForBrowser
}
return node.addWidget('asset', widgetName, displayLabel, () => {}, options)
}