mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 15:24:09 +00:00
## Summary Extract duplicated asset-browser eligibility guard into `shouldUseAssetBrowser()`, fix a missing parameter bug, and sanitize a log statement. ## Changes - **What**: - DRY: Extract the repeated 3-condition guard (`isCloud && isUsingAssetAPI && isAssetBrowserEligible`) into `assetService.shouldUseAssetBrowser()`, used by `widgetInputs.ts` and `useComboWidget.ts` - Bug fix: `createAssetBrowserWidget()` in `useComboWidget.ts` was missing the `inputNameForBrowser` parameter, which could show wrong assets for nodes with multiple model inputs - Security: `createAssetWidget.ts` no longer logs the full raw asset object on validation failure - `WidgetSelect.vue` keeps an inline guard because it has a special `widget.type === "asset"` fallback that must stay gated behind `isUsingAssetAPI` ## Review Focus - `shouldUseAssetBrowser()` correctly combines the three conditions that were previously duplicated - `WidgetSelect.vue` preserves exact behavioral equivalence (a widget can have `type === "asset"` when the setting is off if a user toggles the setting after creating asset widgets) Fixes #8744 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8867-refactor-extract-shouldUseAssetBrowser-fix-missing-inputNameForBrowser-sanitize-logs-3076d73d3650818cabdcd76a351dac31) by [Unito](https://www.unito.io)