Skip to content

refactor(assets): delete isAssetAPIEnabled and Comfy.Assets.UseAssetAPI (FE-729) - #12322

Closed
dante01yoon wants to merge 20 commits into
mainfrom
jaewon/fe-729-delete-is-asset-api-enabled
Closed

dante01yoon wants to merge 20 commits into
mainfrom
jaewon/fe-729-delete-is-asset-api-enabled

Conversation

@dante01yoon

@dante01yoon dante01yoon commented May 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

FE-729 (L1.2 — L1 central). Asset API will be always available post-BE-786 (--enable-assets removed from OSS). Delete the gating function, the user-facing setting, the experimental warning, and the toggle command. Simplify caller sites to assume the asset API is available.

Draft — do not merge until BE-786 lands. This PR assumes OSS asset routes are unconditionally registered (which is BE-786's deliverable).

⚠️ MUST REVERT BEFORE MERGE
Commit e48dcd11f temporarily adds --enable-assets to .github/actions/start-comfyui-server/action.yaml so Playwright e2e can validate FE-729's intent (modelStore routes through assetService; legacy /api/models fallback is removed and 503s without the flag).
Once BE-786 lands and the CI ComfyUI image picks up "assets always-on" by default, revert commit e48dcd11f before flipping this PR Ready-for-review. This change must NOT ship to main.

Scope clarification

This PR is the routing-layer half of bringing the Asset Browser dialog to OSS:

  • ✅ Routing (sidebarTabStore.ts:81) — Model Library sidebar tab → Asset Browser dialog (always, not gated on a setting)
  • ✅ Central gate (assetService.ts:385) — isAssetAPIEnabled() deleted; shouldUseAssetBrowser simplified
  • ✅ Settings / commands cleanup — Comfy.Assets.UseAssetAPI setting + Comfy.ToggleAssetAPI command + EXPERIMENTAL_WARNING removed
  • ❌ Dialog content (modal data fetch, filter bar, delete actions): FE-732 (L1.5)
  • ❌ Store fetcher (assetsStore.ts:121, 324 Cloud-OSS fork): FE-730 (L1.3)

After this PR + BE-786 land, an OSS user sees the dialog when they click the Model Library sidebar tab, but model content will not be correct until FE-730 + FE-732 + BE-933 also merge. See the scope clarification comment on FE-729 for the full breakdown.

This PR maps directly to the Notion v3 Setting retirement plan (sites #2–#5 + EXPERIMENTAL_WARNING rewording) — see Asset FE Divergence Survey M1 Scope.

What OSS users gain immediately after BE-786 + this PR

Once OSS asset routes are unconditionally registered (BE-786) and this PR merges, OSS users see — without any opt-in — the same baseline asset surface Cloud has today:

  • ✅ Asset list + browse — Model Library sidebar tab opens the Asset Browser dialog (GET /api/assets)
  • ✅ Asset detail / metadata view — info panel for selected models (GET /api/assets/{id})
  • ✅ Asset delete + rename + metadata update — sidebar / context-menu / info panel (PUT /api/assets/{id}, DELETE /api/assets/{id})
  • ✅ Multipart upload — local file → asset registration (POST /api/assets)
  • ✅ Tag management — add / remove tags on assets (POST / DELETE /api/assets/{id}/tags)
  • ✅ OSS-only filesystem ops — local directory scanner (/api/assets/seed), prune, content streaming for local files

Cloud-specific features remain absent on OSS and are not delivered by this PR:

  • ❌ URL-based import (Civitai / Hugging Face) — Cloud uses /api/assets/download, /api/assets/remote-metadata, /api/assets/import-url; OSS has skeleton only
  • ❌ Server-side bulk export (ZIP) — Cloud uses /api/assets/export; OSS lacks the task system for backgrounded archiving
  • ❌ Model upload wizard UI — Cloud-only product surface (tag system + async upload + preview generation)

These three Cloud-only capabilities are described in Notion v3 §L2 as asset_url_import_enabled, asset_bulk_export_enabled, asset_model_wizard_enabled and tracked separately — they depend on additional BE work outside this PR's scope.

Changes

Two commits:

1. 7f6d354a8 — delete isAssetAPIEnabled + Comfy.Assets.UseAssetAPI

  • Delete isAssetAPIEnabled() from assetService.ts; simplify shouldUseAssetBrowser() to call isAssetBrowserEligible() directly.
  • Remove the EXPERIMENTAL_WARNING prefix from four asset-load error messages.
  • Drop the Comfy.Assets.UseAssetAPI setting (coreSettings.ts, apiSchema.ts).
  • Remove the Comfy.ToggleAssetAPI command outright. Keep Comfy.BrowseModelAssets but drop its setting-check / setting-set preamble and the Experimental: label prefix; the command now just opens the asset browser dialog.
  • modelStore, sidebarTabStore, assetPreviewUtil, WidgetSelect.vue caller-site simplifications.
  • Test mocks / expectations updated; assetService.test.ts drops the two now-meaningless cloud/setting branch cases.

2. b34026527 — remove isAssetPreviewSupported wrapper + simplify callers

  • Delete isAssetPreviewSupported() from assetPreviewUtil.ts (was a return true wrapper after commit 1).
  • Simplify 5 caller sites: Media3DTop.vue, saveMesh.ts (two blocks), FormDropdownMenuItem.vue, useLoad3d.ts.
  • Clean up 5 test files; remove now-meaningless "asset preview unsupported" branch tests.

Auto-fixed unrelated tailwind class-order lint errors in several files via pnpm lint:fix across both commits to keep CI green.

Review Focus

  • The decision to delete (not flag) was confirmed in Slack thread (2026-05-19) — Matt + Jacob aligned, no --enable-assets, no asset_api_enabled flag.
  • Comfy.BrowseModelAssets is not fully removed: it survives as the entry point that sidebarTabStore invokes when the model-library sidebar tab is clicked, and as a Command Palette entry. Removing it would require inlining the dialog-open logic into sidebarTabStore (couples a store to UI logic). Kept as a small command.
  • useCoreCommands.ts:1287 and :1330-1331 are the setting-check lines named in the FE-729 description.
  • The isAssetPreviewSupported cleanup (commit 2) is follow-up tightening that was originally listed as a follow-up PR; rolled into this PR since the wrapper was newly dead and the caller surface was small.

Done when (status)

  • isAssetAPIEnabled() function deleted
  • Comfy.Assets.UseAssetAPI setting + schema entry removed
  • Comfy.ToggleAssetAPI command removed; Comfy.BrowseModelAssets body simplified
  • EXPERIMENTAL_WARNING removed + 4 caller-site prefixes
  • All isAssetAPIEnabled / Comfy.Assets.UseAssetAPI caller sites simplified
  • Unit / component tests no longer mock the function or setting
  • Cloud-side smoke verified manually (Model Library tab → Asset Browser dialog opens, no regression) — see comment
  • OSS-side smoke — gated on BE-786 merge
  • Revert commit e48dcd11f (--enable-assets in CI action) before merge

Dependencies

  • Blocks-merge: BE-786 — OSS --enable-assets removal. Asset routes must be unconditionally registered before this PR can merge.
  • Coordinates with: BE-933 / BE-934 (L3 — unified asset response shape; required for FE-732's dialog content layer to behave correctly).

Refs

Screenshots (if applicable)

User-visible behavior changes after BE-786 + this PR merge:

  • Browse Model Assets command label no longer says "Experimental:".
  • The Comfy.Assets.UseAssetAPI hidden setting and the Comfy.ToggleAssetAPI command are no longer present in the command palette.
  • On OSS (post BE-786), clicking the Model Library sidebar tab opens the Asset Browser dialog instead of toggling a legacy sidebar panel.

See attached cloud-side verification screenshot in the comment thread.

FE-729 (L1.2 — L1 central). Asset API will be always available
post-BE-786 (`--enable-assets` removed from OSS). Delete the gating
function, the user-facing setting, the experimental warning, and the
toggle command. Simplify all caller sites to assume the asset API
is available.

Changes:
- Delete isAssetAPIEnabled() from assetService.ts; simplify
  shouldUseAssetBrowser() to call isAssetBrowserEligible() directly.
- Remove the EXPERIMENTAL_WARNING prefix from four asset-load error
  messages.
- Drop the Comfy.Assets.UseAssetAPI setting from coreSettings.ts and
  its schema entry in apiSchema.ts.
- Remove the Comfy.ToggleAssetAPI command outright. Keep
  Comfy.BrowseModelAssets but drop its setting-check / setting-set
  preamble and the "Experimental:" label prefix; the command now
  just opens the asset browser dialog.
- modelStore: drop the useAssetAPI fork in createGetModelsFunc and
  loadModelFolders; always route through assetService.
- sidebarTabStore: model-library tab click always routes through
  Comfy.BrowseModelAssets (no more setting check).
- assetPreviewUtil.isAssetPreviewSupported() returns true
  unconditionally; caller-site simplification deferred.
- WidgetSelect.vue: simplify isAssetMode to drop the
  isAssetAPIEnabled() arm of the disjunction.
- Test mocks/expectations updated.

Blocked-merge by BE-786 (OSS `--enable-assets` removal). PR opened
as draft.

Also auto-fixed unrelated tailwind class-order lint errors in four
files (VirtualGrid, RightSidePanel, Textarea, ModelInfoPanel,
WidgetSelectDefault) to keep CI green.
@coderabbitai

coderabbitai Bot commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ab229572-0bad-47e1-b276-8377b5073bbc

📥 Commits

Reviewing files that changed from the base of the PR and between 6e66bf0 and 2c6a730.

📒 Files selected for processing (1)
  • src/composables/useCoreCommands.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/composables/useCoreCommands.ts

📝 Walkthrough

Walkthrough

The PR removes the Comfy.Assets.UseAssetAPI toggle path, routes model browsing and folder loading through assetService, and removes preview-support gating from thumbnail and server-preview flows. Several tests and browser helpers were updated to match the new behavior.

Changes

Asset API Toggle Deprecation

Layer / File(s) Summary
Command and settings cleanup
src/composables/useCoreCommands.ts, src/stores/workspace/sidebarTabStore.ts, src/platform/settings/constants/coreSettings.ts, src/schemas/apiSchema.ts, .github/actions/start-comfyui-server/action.yaml
BrowseModelAssets now opens directly, ToggleAssetAPI is removed, the hidden UseAssetAPI setting is dropped from settings metadata and zSettings, zSettings adds three Vue-node booleans, and the server-start action keeps its --enable-assets note.
Asset service and model store
src/platform/assets/services/assetService.ts, src/platform/assets/services/assetService.test.ts, src/stores/modelStore.ts, src/stores/modelStore.test.ts
assetService no longer checks cloud/setting enablement or emits the experimental warning prefix in asset error paths, and useModelStore always loads folders and models through assetService with updated tests.
WidgetSelect asset mode
src/renderer/extensions/vueNodes/widgets/components/WidgetSelect.vue, src/renderer/extensions/vueNodes/widgets/components/WidgetSelect.test.ts, src/renderer/extensions/vueNodes/widgets/components/WidgetSelect.asset-mode.test.ts
WidgetSelect now enters asset mode when shouldUseAssetBrowser(...) is true or the widget type is asset, and the tests drop isAssetAPIEnabled mocks.
Thumbnail preview support
src/platform/assets/utils/assetPreviewUtil.ts, src/platform/assets/utils/assetPreviewUtil.test.ts, src/composables/useLoad3d.ts, src/composables/useLoad3d.test.ts, src/extensions/core/saveMesh.ts, src/extensions/core/saveMesh.test.ts
isAssetPreviewSupported() now returns true; useLoad3d and saveMesh always run thumbnail capture and persistence chains, and the related tests remove support-gating cases and mocks.
Server preview lookup
src/platform/assets/components/Media3DTop.vue, src/platform/assets/components/Media3DTop.test.ts, src/renderer/extensions/vueNodes/widgets/components/form/dropdown/FormDropdownMenuItem.vue, src/renderer/extensions/vueNodes/widgets/components/form/dropdown/FormDropdownMenuItem.test.ts
Media3DTop and FormDropdownMenuItem no longer gate server preview lookup on asset preview support, and their tests remove unsupported-preview cases.
Browser test updates
browser_tests/fixtures/helpers/BuilderSelectHelper.ts, browser_tests/tests/defaultKeybindings.spec.ts, browser_tests/tests/sidebar/modelLibrary.spec.ts
BuilderSelectHelper adds a fallback locator path for asset-mode widgets, the default keybinding tests drop the model-library shortcut entry, and the model-library Playwright spec is removed.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Comfy-Org/ComfyUI_frontend#12765: Both PRs change the Comfy.BrowseModelAssets flow in src/composables/useCoreCommands.ts, so they touch the same command wiring and execution path.

Suggested reviewers

  • AustinMroz
  • christian-byrne

Poem

I hopped through toggles, one by one,
and nibbled flags until they're gone.
The asset trails now sparkle bright,
with previews bouncing into light.
🐇 A tidy hop, a cleaner run.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing asset-API gating and the related setting/command.
Description check ✅ Passed It includes Summary, Changes, Review Focus, Screenshots, and Dependencies, covering the required content despite not using the exact bullet template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
End-To-End Regression Coverage For Fixes ✅ Passed PR is labeled refactor, not bug-fix language, so the regression-test gate doesn’t trigger; it also includes browser_tests changes and describes OSS smoke gating.
Adr Compliance For Entity/Litegraph Changes ✅ Passed No changed files touch src/lib/litegraph, src/ecs, or graph entity paths, so ADR 0003/0008 checks don’t apply.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jaewon/fe-729-delete-is-asset-api-enabled

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/composables/useCoreCommands.ts`:
- Line 1286: The label "Browse Model Assets" in the command definition inside
useCoreCommands.ts should be localized: import and use the composition API
useI18n() and replace the raw label value with a call to
t('main.browseModelAssets') (or similar key) in the command object where label
is defined, and add the corresponding "browseModelAssets" entry under the main
namespace in src/locales/en/main.json; ensure the key name matches exactly
between the t(...) call and the JSON entry.

In `@src/platform/assets/services/assetService.ts`:
- Line 229: Replace direct schema.parse()/throw of Zod error details with
schema.safeParse() in the asset service locations that currently throw "Invalid
asset response against zod schema" (the occurrences at the existing throw sites
around the message at lines 229 and 448); on failure, log the full Zod parse
error to your internal logger (e.g., processLogger or the module logger) for
debugging, but throw a generic, user-safe error message (e.g., "Invalid asset
response" or a localized equivalent) instead. Ensure the code path that
previously used schema.parse() now checks result.success and uses result.error
for logging only, and update any callers of those parse sites to expect the same
generic Error type.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8c90d715-72a7-4165-b3d1-83259c1091ea

📥 Commits

Reviewing files that changed from the base of the PR and between 448ad73 and 7f6d354.

📒 Files selected for processing (18)
  • src/components/common/VirtualGrid.vue
  • src/components/rightSidePanel/RightSidePanel.vue
  • src/components/ui/textarea/Textarea.vue
  • src/composables/useCoreCommands.ts
  • src/platform/assets/components/modelInfo/ModelInfoPanel.vue
  • src/platform/assets/services/assetService.test.ts
  • src/platform/assets/services/assetService.ts
  • src/platform/assets/utils/assetPreviewUtil.test.ts
  • src/platform/assets/utils/assetPreviewUtil.ts
  • src/platform/settings/constants/coreSettings.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetSelect.asset-mode.test.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetSelect.test.ts
  • src/renderer/extensions/vueNodes/widgets/components/WidgetSelect.vue
  • src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDefault.vue
  • src/schemas/apiSchema.ts
  • src/stores/modelStore.test.ts
  • src/stores/modelStore.ts
  • src/stores/workspace/sidebarTabStore.ts
💤 Files with no reviewable changes (2)
  • src/schemas/apiSchema.ts
  • src/platform/settings/constants/coreSettings.ts

id: 'Comfy.BrowseModelAssets',
icon: 'pi pi-folder-open',
label: 'Experimental: Browse Model Assets',
label: 'Browse Model Assets',

@coderabbitai coderabbitai Bot May 19, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize this command label via vue-i18n.

This user-facing label is a raw string and should go through i18n.

💡 Suggested change
-      label: 'Browse Model Assets',
+      label: () => t('commands.browseModelAssets'),
As per coding guidelines, "Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/composables/useCoreCommands.ts` at line 1286, The label "Browse Model
Assets" in the command definition inside useCoreCommands.ts should be localized:
import and use the composition API useI18n() and replace the raw label value
with a call to t('main.browseModelAssets') (or similar key) in the command
object where label is defined, and add the corresponding "browseModelAssets"
entry under the main namespace in src/locales/en/main.json; ensure the key name
matches exactly between the t(...) call and the JSON entry.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid finding, but the raw-string label is a pre-existing pattern on main — this PR only removed the Experimental: prefix, not the i18n gap. Full i18n migration for command labels is out of scope for FE-729 (which targets isAssetAPIEnabled() / Comfy.Assets.UseAssetAPI removal). Tracking as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description image shows the ComfyUI Model Library dialog — a dark-themed modal with a left sidebar listing model categories (BEN, BiRefNet, CogVideo, etc.) and a main grid displaying LORA model cards with thumbnails, file names, dates, and "Use" buttons, along with search and filter controls.


@dante01yoon Fair enough — the i18n gap is pre-existing and FE-729 is rightly scoped to the isAssetAPIEnabled / Comfy.Assets.UseAssetAPI removal. Would you like me to open a follow-up GitHub issue to track the full i18n migration for command labels in useCoreCommands.ts?


🧠 Learnings used
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).

Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7906
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:545-552
Timestamp: 2026-01-12T17:39:27.738Z
Learning: In Vue/TypeScript files (src/**/*.{ts,tsx,vue}), prefer if/else statements over ternary operators when performing side effects or actions (e.g., mutating state, calling methods with side effects). Ternaries should be reserved for computing and returning values.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 8248
File: src/platform/assets/schemas/assetSchema.ts:109-118
Timestamp: 2026-01-22T23:44:59.888Z
Learning: Do not export declarations (e.g., schemas, constants, types) unless they are actually used elsewhere in the codebase. Keep the public API surface minimal by exporting only items with concrete usage. This reduces coupling and keeps imports explicit. In src/platform/assets/schemas/assetSchema.ts, ensure only necessary exports are exposed; remove unused exports or switch to non-exported/internal where appropriate.

Learnt from: JemiloII
Repo: Comfy-Org/ComfyUI_frontend PR: 8282
File: src/composables/usePaste.test.ts:372-383
Timestamp: 2026-01-23T21:06:15.240Z
Learning: In paste/clipboard handling code, do not rely on ephemeral DataTransfer data across async boundaries. If an operation awaits async tasks (such as node creation) during a paste, clone the DataTransfer (e.g., using cloneDataTransfer) to persist files and string data before the paste event completes. This ensures clipboard contents remain available for subsequent processing.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 8722
File: src/composables/maskeditor/useBrushDrawing.ts:5-5
Timestamp: 2026-02-08T03:19:12.009Z
Learning: Treat unresolved import warnings caused by pnpm workspace catalog mappings (pnpm-workspace.yaml) and unplugin-typegpu in vite.config.mts as false positives. Do not flag these in PR reviews; they are expected in sandboxes without node_modules and are not indicative of actual missing dependencies in the TS codebase.

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 8966
File: src/extensions/core/load3d.ts:427-430
Timestamp: 2026-02-19T02:06:23.468Z
Learning: In TypeScript, you can use typeof SomeClass in type annotation positions (e.g., param: typeof LGraphNode) even when SomeClass is imported with import type. This is a type query that only exists at compile time and is erased in runtime, so it is safe to combine with type-only imports. Apply this pattern to TS files broadly when you need a type that references the shape of a class or constructor function without importing the value at runtime.

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 8966
File: src/extensions/core/uploadAudio.ts:91-94
Timestamp: 2026-02-19T02:06:38.395Z
Learning: In TypeScript files, you can use a type annotation like 'nodeType: typeof MyClass' even if MyClass is imported via 'import type'. Both the type-only import and 'typeof' operate at the type level and are erased at compile time. This pattern is commonly used for constructor types (e.g., 'nodeType: typeof LGraphNode'). Apply this pattern across TypeScript files in the repository (src/**/*.ts) as appropriate, ensuring the imported symbol is a type-only import when possible for clarity and to avoid runtime imports.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 8992
File: src/lib/litegraph/src/widgets/GradientSliderWidget.ts:18-18
Timestamp: 2026-02-20T21:08:19.814Z
Learning: When drawing with CanvasRenderingContext2D in TypeScript/JavaScript, wrap the drawing logic with ctx.save() at the start and ctx.restore() at the end to preserve and restore the canvas state. Do not manually destructure and restore individual properties (e.g., fillStyle, strokeStyle); rely on save/restore to manage state changes in a scoped manner. This should be applied to all TS files that perform canvas drawing.

Learnt from: dante01yoon
Repo: Comfy-Org/ComfyUI_frontend PR: 9075
File: src/scripts/api.featureFlags.test.ts:237-268
Timestamp: 2026-02-22T04:27:33.379Z
Learning: In Vite/Vitest, import.meta.env.DEV is true for any mode that is not 'production' (i.e., DEV is the opposite of PROD, and can be true in 'test', 'development', etc.). Do not assume DEV implies only 'development' mode. When reviewing code and tests, treat DEV as a non-production flag and verify environment-specific logic accordingly. Reference: https://vite.dev/guide/env-and-mode#modes

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 9427
File: src/renderer/extensions/vueNodes/widgets/components/form/dropdown/FormDropdownMenuFilter.vue:33-33
Timestamp: 2026-03-06T00:53:28.835Z
Learning: When reviewing code, note that the enforce-canonical-classes (better-tailwindcss) rule may auto-fix Tailwind v3 !class-name syntax by converting it to v4 class-name! syntax. Do not treat these auto-fixed class-name! instances as newly introduced issues; the perceived change is in syntax placement, not in usage or intent. This guidance applies across all .vue and .ts files in the repository.

Learnt from: sonnybox
Repo: Comfy-Org/ComfyUI_frontend PR: 9446
File: src/renderer/extensions/vueNodes/widgets/components/WidgetTextarea.vue:45-45
Timestamp: 2026-03-06T01:55:00.013Z
Learning: Treat wrap-break-word as a valid Tailwind CSS utility for overflow-wrap: break-word in Tailwind v4+ projects. Do not flag this class as invalid in any Vue (.vue) or TypeScript (.ts/.tsx) files within the repository (e.g., Comfy-Org/ComfyUI_frontend) or other Tailwind v4+ projects. When reviewing, verify that the class is used to enable word breaking in long text content and reference the Tailwind docs: https://tailwindcss.com/docs/overflow-wrap.

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 11420
File: src/composables/useCanvasScheduler.ts:20-20
Timestamp: 2026-04-19T22:12:36.981Z
Learning: In the ComfyUI frontend Vue/TypeScript codebase, when implementing singleton composables inside `src/composables/**`, prefer `createSharedComposable` from VueUse over module-scoped `let` variables. Module-scoped `let` can cause SSR cross-request state leakage, unpredictable HMR behavior, and requires manual lifecycle/cleanup management for watchers/computeds/effects. `createSharedComposable` ties the singleton to Vue lifecycle: it disposes watchers/computeds and effect-scope reactivity automatically when the last consumer unmounts, improving testability. Only use the module-scoped `let` pattern if the singleton must intentionally outlive all Vue component trees or if there is a clearly documented reason why `createSharedComposable` is inferior for that specific composable.

Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 11531
File: src/composables/maskeditor/brushDrawingUtils.ts:14-14
Timestamp: 2026-04-22T04:06:01.353Z
Learning: In the Comfy-Org/ComfyUI_frontend codebase, `knip` is used to detect unused exports. When reviewing TypeScript/TSX code, avoid recommending or introducing exported types/functions/constants that have no concrete external consumers (e.g., they’re only used within the same module). Only recommend exporting when there is an actual external usage outside the module. If something might be needed externally later, keep it non-exported for now and defer exporting until an external consumer is added.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 12197
File: src/renderer/extensions/linearMode/AppInput.vue:23-23
Timestamp: 2026-05-14T21:10:45.382Z
Learning: In the ComfyUI_frontend repo, `WidgetEntityId` is a branded template-literal type (e.g., `${UUID}:${NodeId}:${string}`) and should be treated as structurally non-empty when valid—so an empty string is invalid and must be treated as “absent”. When handling optional `entityId?: WidgetEntityId` values (e.g., for Vue props or TS function parameters), guard missing/invalid IDs with a truthy check (e.g., `if (!entityId) return`) rather than `if (entityId === undefined)`. Rationale: `=== undefined` would allow empty-string values through into stores such as `appModeStore.selectedInputs`, creating rows that can’t resolve back to a widget.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 12197
File: src/core/schemas/parseNodePropertyArray.ts:1-1
Timestamp: 2026-05-18T21:34:41.153Z
Learning: In TypeScript, it is correct to use `import type { z } from 'zod'` when the imported symbol `z` is used exclusively in type-annotation/type-only positions (e.g., `schema: z.ZodType<T[]>`, `z.infer<typeof schema>`, `type X = z.AnyZodObject`, etc.). Because `import type` is fully erased at compile time and requires no runtime value, code reviewers should not flag `import type { z }` as an error (e.g., as an unused value import or incorrect runtime import) in TypeScript/React projects when `z` is only referenced in type positions. If `z` is referenced in a value/runtime position, it should instead be imported with a normal `import { z } from 'zod'`.

throw new Error(
`${EXPERIMENTAL_WARNING}Invalid asset response against zod schema:\n${error}`
)
throw new Error(`Invalid asset response against zod schema:\n${error}`)

@coderabbitai coderabbitai Bot May 19, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid throwing raw schema validation details to callers.

Line 229 and Line 448 include full Zod validation output in thrown errors. Keep detailed parse errors in logs, but throw a generic/localized user-safe message.

💡 Suggested change
-  const error = fromZodError(result.error)
-  throw new Error(`Invalid asset response against zod schema:\n${error}`)
+  const error = fromZodError(result.error)
+  console.error('Invalid asset response:', error)
+  throw new Error(
+    st(
+      'assetBrowser.errorInvalidAssetResponse',
+      'Received invalid asset data from the server. Please try again.'
+    )
+  )
-    const error = result.error
-      ? fromZodError(result.error)
-      : 'Unknown validation error'
-    throw new Error(`Invalid asset response against zod schema:\n${error}`)
+    const error = result.error
+      ? fromZodError(result.error)
+      : 'Unknown validation error'
+    console.error(`Invalid asset response for ${id}:`, error)
+    throw new Error(
+      st(
+        'assetBrowser.errorInvalidAssetResponse',
+        'Received invalid asset data from the server. Please try again.'
+      )
+    )
Based on learnings, "In asset service files under src/platform/assets/services, prefer using schema.safeParse() over schema.parse() for API response validation... while throwing user-friendly errors that do not reveal internal schema details."

Also applies to: 448-448

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/assets/services/assetService.ts` at line 229, Replace direct
schema.parse()/throw of Zod error details with schema.safeParse() in the asset
service locations that currently throw "Invalid asset response against zod
schema" (the occurrences at the existing throw sites around the message at lines
229 and 448); on failure, log the full Zod parse error to your internal logger
(e.g., processLogger or the module logger) for debugging, but throw a generic,
user-safe error message (e.g., "Invalid asset response" or a localized
equivalent) instead. Ensure the code path that previously used schema.parse()
now checks result.success and uses result.error for logging only, and update any
callers of those parse sites to expect the same generic Error type.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid finding, but the fromZodError(...) throw pattern is pre-existing on main — this PR only removed the EXPERIMENTAL_WARNING prefix from the messages, not the parse / log / throw shape. Sanitizing zod detail at the throw site (log full detail, throw a user-safe message) is a worthwhile improvement but out of scope for FE-729. Tracking as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dante01yoon, understood — the diff only strips the EXPERIMENTAL_WARNING prefix and doesn't touch the parse/log/throw shape, which is indeed pre-existing. Happy to track the sanitization improvement separately.

Would you like me to open a follow-up GitHub issue for: "Sanitize Zod validation error details at throw sites in assetService — log full detail, throw user-safe message"? I can link back to this PR and comment automatically.


🧠 Learnings used
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).

Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7746
File: src/platform/assets/services/assetService.ts:484-491
Timestamp: 2026-01-06T19:20:52.000Z
Learning: In asset service files under src/platform/assets/services, prefer using schema.safeParse() over schema.parse() for API response validation. Follow the established pattern: call safeParse(), check result.success, and if failed, convert the error with fromZodError(result.error) for logging while throwing user-friendly errors that do not reveal internal schema details.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7906
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:545-552
Timestamp: 2026-01-12T17:39:27.738Z
Learning: In Vue/TypeScript files (src/**/*.{ts,tsx,vue}), prefer if/else statements over ternary operators when performing side effects or actions (e.g., mutating state, calling methods with side effects). Ternaries should be reserved for computing and returning values.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 8248
File: src/platform/assets/schemas/assetSchema.ts:109-118
Timestamp: 2026-01-22T23:44:59.888Z
Learning: Do not export declarations (e.g., schemas, constants, types) unless they are actually used elsewhere in the codebase. Keep the public API surface minimal by exporting only items with concrete usage. This reduces coupling and keeps imports explicit. In src/platform/assets/schemas/assetSchema.ts, ensure only necessary exports are exposed; remove unused exports or switch to non-exported/internal where appropriate.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 8722
File: src/composables/maskeditor/useBrushDrawing.ts:5-5
Timestamp: 2026-02-08T03:19:12.009Z
Learning: Treat unresolved import warnings caused by pnpm workspace catalog mappings (pnpm-workspace.yaml) and unplugin-typegpu in vite.config.mts as false positives. Do not flag these in PR reviews; they are expected in sandboxes without node_modules and are not indicative of actual missing dependencies in the TS codebase.

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 8966
File: src/extensions/core/load3d.ts:427-430
Timestamp: 2026-02-19T02:06:23.468Z
Learning: In TypeScript, you can use typeof SomeClass in type annotation positions (e.g., param: typeof LGraphNode) even when SomeClass is imported with import type. This is a type query that only exists at compile time and is erased in runtime, so it is safe to combine with type-only imports. Apply this pattern to TS files broadly when you need a type that references the shape of a class or constructor function without importing the value at runtime.

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 8966
File: src/extensions/core/uploadAudio.ts:91-94
Timestamp: 2026-02-19T02:06:38.395Z
Learning: In TypeScript files, you can use a type annotation like 'nodeType: typeof MyClass' even if MyClass is imported via 'import type'. Both the type-only import and 'typeof' operate at the type level and are erased at compile time. This pattern is commonly used for constructor types (e.g., 'nodeType: typeof LGraphNode'). Apply this pattern across TypeScript files in the repository (src/**/*.ts) as appropriate, ensuring the imported symbol is a type-only import when possible for clarity and to avoid runtime imports.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 8992
File: src/lib/litegraph/src/widgets/GradientSliderWidget.ts:18-18
Timestamp: 2026-02-20T21:08:19.814Z
Learning: When drawing with CanvasRenderingContext2D in TypeScript/JavaScript, wrap the drawing logic with ctx.save() at the start and ctx.restore() at the end to preserve and restore the canvas state. Do not manually destructure and restore individual properties (e.g., fillStyle, strokeStyle); rely on save/restore to manage state changes in a scoped manner. This should be applied to all TS files that perform canvas drawing.

Learnt from: dante01yoon
Repo: Comfy-Org/ComfyUI_frontend PR: 9075
File: src/scripts/api.featureFlags.test.ts:237-268
Timestamp: 2026-02-22T04:27:33.379Z
Learning: In Vite/Vitest, import.meta.env.DEV is true for any mode that is not 'production' (i.e., DEV is the opposite of PROD, and can be true in 'test', 'development', etc.). Do not assume DEV implies only 'development' mode. When reviewing code and tests, treat DEV as a non-production flag and verify environment-specific logic accordingly. Reference: https://vite.dev/guide/env-and-mode#modes

Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 9427
File: src/renderer/extensions/vueNodes/widgets/components/form/dropdown/FormDropdownMenuFilter.vue:33-33
Timestamp: 2026-03-06T00:53:28.835Z
Learning: When reviewing code, note that the enforce-canonical-classes (better-tailwindcss) rule may auto-fix Tailwind v3 !class-name syntax by converting it to v4 class-name! syntax. Do not treat these auto-fixed class-name! instances as newly introduced issues; the perceived change is in syntax placement, not in usage or intent. This guidance applies across all .vue and .ts files in the repository.

Learnt from: sonnybox
Repo: Comfy-Org/ComfyUI_frontend PR: 9446
File: src/renderer/extensions/vueNodes/widgets/components/WidgetTextarea.vue:45-45
Timestamp: 2026-03-06T01:55:00.013Z
Learning: Treat wrap-break-word as a valid Tailwind CSS utility for overflow-wrap: break-word in Tailwind v4+ projects. Do not flag this class as invalid in any Vue (.vue) or TypeScript (.ts/.tsx) files within the repository (e.g., Comfy-Org/ComfyUI_frontend) or other Tailwind v4+ projects. When reviewing, verify that the class is used to enable word breaking in long text content and reference the Tailwind docs: https://tailwindcss.com/docs/overflow-wrap.

Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 11531
File: src/composables/maskeditor/brushDrawingUtils.ts:14-14
Timestamp: 2026-04-22T04:06:01.353Z
Learning: In the Comfy-Org/ComfyUI_frontend codebase, `knip` is used to detect unused exports. When reviewing TypeScript/TSX code, avoid recommending or introducing exported types/functions/constants that have no concrete external consumers (e.g., they’re only used within the same module). Only recommend exporting when there is an actual external usage outside the module. If something might be needed externally later, keep it non-exported for now and defer exporting until an external consumer is added.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 12197
File: src/renderer/extensions/linearMode/AppInput.vue:23-23
Timestamp: 2026-05-14T21:10:45.382Z
Learning: In the ComfyUI_frontend repo, `WidgetEntityId` is a branded template-literal type (e.g., `${UUID}:${NodeId}:${string}`) and should be treated as structurally non-empty when valid—so an empty string is invalid and must be treated as “absent”. When handling optional `entityId?: WidgetEntityId` values (e.g., for Vue props or TS function parameters), guard missing/invalid IDs with a truthy check (e.g., `if (!entityId) return`) rather than `if (entityId === undefined)`. Rationale: `=== undefined` would allow empty-string values through into stores such as `appModeStore.selectedInputs`, creating rows that can’t resolve back to a widget.

Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 12197
File: src/core/schemas/parseNodePropertyArray.ts:1-1
Timestamp: 2026-05-18T21:34:41.153Z
Learning: In TypeScript, it is correct to use `import type { z } from 'zod'` when the imported symbol `z` is used exclusively in type-annotation/type-only positions (e.g., `schema: z.ZodType<T[]>`, `z.infer<typeof schema>`, `type X = z.AnyZodObject`, etc.). Because `import type` is fully erased at compile time and requires no runtime value, code reviewers should not flag `import type { z }` as an error (e.g., as an unused value import or incorrect runtime import) in TypeScript/React projects when `z` is only referenced in type positions. If `z` is referenced in a value/runtime position, it should instead be imported with a normal `import { z } from 'zod'`.

@codecov

codecov Bot commented May 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/extensions/core/saveMesh.ts 83.33% 2 Missing ⚠️
src/platform/assets/services/assetService.ts 66.66% 1 Missing ⚠️
@@             Coverage Diff             @@
##             main   #12322       +/-   ##
===========================================
- Coverage   76.19%   64.20%   -11.99%     
===========================================
  Files        1611     1498      -113     
  Lines       91309    76648    -14661     
  Branches    28806    21611     -7195     
===========================================
- Hits        69569    49209    -20360     
- Misses      21074    27093     +6019     
+ Partials      666      346      -320     
Flag Coverage Δ
e2e ?
unit 64.20% <88.46%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/composables/useCoreCommands.ts 27.13% <ø> (-29.17%) ⬇️
src/composables/useLoad3d.ts 87.97% <100.00%> (-2.93%) ⬇️
src/platform/assets/components/Media3DTop.vue 88.09% <100.00%> (ø)
src/platform/assets/utils/assetPreviewUtil.ts 100.00% <ø> (+9.09%) ⬆️
src/platform/settings/constants/coreSettings.ts 9.37% <ø> (-59.86%) ⬇️
...sions/vueNodes/widgets/components/WidgetSelect.vue 93.47% <100.00%> (-4.44%) ⬇️
.../components/form/dropdown/FormDropdownMenuItem.vue 81.66% <ø> (-4.05%) ⬇️
src/schemas/apiSchema.ts 100.00% <ø> (ø)
src/stores/modelStore.ts 92.00% <100.00%> (-3.63%) ⬇️
src/stores/workspace/sidebarTabStore.ts 67.12% <100.00%> (+0.90%) ⬆️
... and 2 more

... and 1144 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dante01yoon
dante01yoon marked this pull request as ready for review May 19, 2026 01:12
@dante01yoon
dante01yoon requested a review from a team May 19, 2026 01:12
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 19, 2026
… callers

Follow-up to the previous FE-729 commit. After deleting
isAssetAPIEnabled, isAssetPreviewSupported() became a wrapper that
always returned true. Remove the function and simplify all callers.

Changes:
- Delete isAssetPreviewSupported() from assetPreviewUtil.ts.
- Media3DTop.vue: drop the isAssetPreviewSupported() arm of the
  loadThumbnail guard (asset.name check is still required).
- saveMesh.ts: unwrap two `if (isAssetPreviewSupported()) { ... }`
  blocks in applySaveGLBOutput and the SaveGLB beforeRegisterNodeDef
  extension callback.
- FormDropdownMenuItem.vue: drop the early return from
  resolveMeshPreview.
- useLoad3d.ts: drop the isAssetPreviewSupported() arm of the
  modelReady guard.
- Tests: remove the dead "asset preview is unsupported" branches
  (useLoad3d, Media3DTop, FormDropdownMenuItem) and clean up the
  associated mocks and hoisted state.

Auto-fixed unrelated tailwind class-order lint errors in five files
(VirtualGrid, RightSidePanel, Textarea, ModelInfoPanel,
WidgetSelectDefault) to keep CI green.
@dante01yoon
dante01yoon requested a review from jtydhr88 as a code owner May 19, 2026 01:27
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels May 19, 2026
@dante01yoon

Copy link
Copy Markdown
Collaborator Author

2026-05-19 — Cloud verification

Verified locally against pnpm dev:cloud-prod (Vite HTTPS dev server with DEV_SERVER_COMFYUI_URL=https://cloud.comfy.org/, attached to authenticated Cloud session via Chrome --remote-debugging-port=9222).

Smoke result on Cloud:

  • ✅ Model Library sidebar tab click → Asset Browser dialog opens (routing layer working as before)
  • ✅ Dialog renders heading "Model Library", All Models / Imported nav, search input, Import button, close button — no regression
  • ✅ Page snapshot confirms dialog modal rooted at the expected accessibility node

Cloud-side shouldUseAssetBrowser caller path manually verified. OSS-side smoke still pending BE-786 merge.

(Screenshot attached separately — see comments.)

@dante01yoon dante01yoon changed the title refactor(assets): delete isAssetAPIEnabled and Comfy.Assets.UseAssetAPI refactor(assets): delete isAssetAPIEnabled and Comfy.Assets.UseAssetAPI (FE-729) May 19, 2026
Temporary unblock for FE-729 e2e while BE-786 is in flight. FE-729
removes the legacy /api/models fallback in modelStore, so the assets
endpoint must be reachable in CI. BE-786 will make assets always-on
in OSS core; once that ships in the CI ComfyUI image, this flag (and
this commit) MUST be reverted before merging FE-729 to main.
After FE-729 the model-library sidebar tab routes to the Asset Browser
dialog and never renders ModelLibrarySidebarTab.vue. The legacy
sidebar-tree tests now validate dead code paths:

- delete browser_tests/tests/sidebar/modelLibrary.spec.ts entirely
  (tab/folders/search/refresh/empty-state — all dead)
- drop the model-library entry from the defaultKeybindings sidebar
  toggle table (KeyM no longer toggles a panel)
- remove the Refresh-clears-resolved-missing-model case from
  errorsTabMissingModels.spec.ts — it waited for the legacy
  /experiment/models endpoint that modelStore no longer hits

Dialog-flow coverage for the new entry point belongs to FE-732.
FE-729 routes model widgets (ckpt_name, lora_name, etc.) through
WidgetSelectDropdown on OSS as well as Cloud. That dropdown's trigger
button has no aria-label — the widget name lives in a sibling label
div ([data-testid="widget-layout-field-label"]). Grid-mode widgets
(WidgetSelectDefault) still carry aria-label on the input directly.

Update the helper to .or() the two strategies so existing aria-label
lookups keep working while asset-mode dropdowns are reached via the
visible label text + sibling trigger button.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@browser_tests/fixtures/helpers/BuilderSelectHelper.ts`:
- Around line 131-133: The fallback label selector uses filter({ hasText:
widgetName }) which does substring matching and can pick the wrong label; change
that call on the locator returned by getByTestId("widget-layout-field-label") to
use an anchored regular expression that matches the entire widgetName (e.g., new
RegExp('^' + escapeRegExp(widgetName) + '$')) so the match is exact; ensure you
add or use an escapeRegExp helper to safely escape any regex metacharacters in
widgetName and keep the final .locator('..') chain unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 42a1c44a-0c3e-4976-a9ef-f8d23e3a9c05

📥 Commits

Reviewing files that changed from the base of the PR and between ffe8d0f and 0797b7a.

📒 Files selected for processing (1)
  • browser_tests/fixtures/helpers/BuilderSelectHelper.ts

Comment on lines +131 to +133
.getByTestId("widget-layout-field-label")
.filter({ hasText: widgetName })
.locator('..')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use exact text matching in the fallback label selector

hasText: widgetName is substring-based and can match the wrong field label when names overlap, causing flaky/misdirected clicks. Please make this match exact.

Suggested fix
+function escapeRegExp(value: string): string {
+  return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+}
+
   const widgetLocator = node
     .getByLabel(widgetName, { exact: true })
     .or(
       node
         .getByTestId("widget-layout-field-label")
-        .filter({ hasText: widgetName })
+        .filter({ hasText: new RegExp(`^${escapeRegExp(widgetName)}$`) })
         .locator('..')
         .locator('button')
         .first()
     )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.getByTestId("widget-layout-field-label")
.filter({ hasText: widgetName })
.locator('..')
function escapeRegExp(value: string): string {
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
}
const widgetLocator = node
.getByLabel(widgetName, { exact: true })
.or(
node
.getByTestId("widget-layout-field-label")
.filter({ hasText: new RegExp(`^${escapeRegExp(widgetName)}$`) })
.locator('..')
.locator('button')
.first()
)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@browser_tests/fixtures/helpers/BuilderSelectHelper.ts` around lines 131 -
133, The fallback label selector uses filter({ hasText: widgetName }) which does
substring matching and can pick the wrong label; change that call on the locator
returned by getByTestId("widget-layout-field-label") to use an anchored regular
expression that matches the entire widgetName (e.g., new RegExp('^' +
escapeRegExp(widgetName) + '$')) so the match is exact; ensure you add or use an
escapeRegExp helper to safely escape any regex metacharacters in widgetName and
keep the final .locator('..') chain unchanged.

…Widget

Previous .or() implementation acted as a union — both branches resolved
for number widgets (e.g. 'seed' has aria-label on wrapper + a Decrement
button under widget-layout-field-label), causing Playwright strict mode
violations on tests that previously passed.

Switch to a count-based check: prefer the aria-label match when it
exists, otherwise fall back to the dropdown-trigger button under the
visible label row. This restores grid/number widget behaviour while
keeping asset-mode dropdown support.
dante01yoon added a commit that referenced this pull request May 26, 2026
Align with the L1 stack pattern (FE-729 #12322 / FE-730 #12335 / FE-731 #12375
/ FE-732 #12417): the Generated tab now resolves to `useFlatOutputAssetsGrouped()`
unconditionally. OSS reaches the same asset-API path as cloud once BE-786 lands
and `_ASSETS_ENABLED` is no longer a gate; no transitional fallback is kept, in
line with FE-730's "no temporary isCloud fallback" stance.

FE-740
dante01yoon added a commit that referenced this pull request Jun 2, 2026
…ed feature-flag test infra

Per review (DrJKL): mockFeatureFlags and the exported FeatureFlags type have no live consumer in the open stack — FE-729~732 (#12322/#12335/#12375/#12417) don't use them, and FE-780/781 (#12485/#12486) still hand-roll inline vi.hoisted mocks. Shipping them here adds a public surface with no caller, so split them out; they'll be reintroduced bundled with the first PR that actually adopts the util.

This PR is now scoped to the getAssetStoredFilename extraction, which is consumed at its two call sites in useMediaAssetActions.

Retained-code review fixes:
- M3: spread importOriginal in the distribution/types mock so isDesktop and isNightly survive the wholesale replacement.
- L2: trim getAssetStoredFilename JSDoc; demote the BE-933/934 collapse to a one-line TODO.

Removed: src/test-utils/mockFeatureFlags.ts, the FeatureFlags type export, and its knip ignore entry. Pre-split state preserved on local branch jaewon/fe-733-presplit-snapshot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@christian-byrne

Copy link
Copy Markdown
Contributor

suggestion: (non-blocking) The locale files (e.g. src/locales/en/commands.json) likely still have Comfy_BrowseModelAssets.label set to "Experimental: Browse Model Assets" and an orphaned Comfy_ToggleAssetAPI key. If the command palette resolves labels via st()/stRaw() using the command id as a locale key, the i18n entry overrides the hardcoded change in useCoreCommands.ts and users in all locales continue to see the old "Experimental:" prefix. Both keys need updating/removing across all shipped locale files.

…istered (FE-729)

If Comfy.BrowseModelAssets is not yet registered (load-ordering race), the
model-library tab click was a silent no-op via optional chaining. Fall back to
toggleSidebarTab so the click is never dead, and add regression coverage.
@vercel

vercel Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comfyui-frontend-node-search-preview Error Error Jun 19, 2026 12:22am

@github-actions

Copy link
Copy Markdown
Contributor

Updating Playwright Expectations

@github-actions github-actions Bot removed the New Browser Test Expectations New browser test screenshot should be set by github action label Jun 19, 2026
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 1 day (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/uy-tieu-s-projects?upgradeToPro=build-rate-limit

@dante01yoon

Copy link
Copy Markdown
Collaborator Author

/update-playwright

Regenerating stale @screenshot goldens. The committed image-crop-with-source golden was captured mid-load ("Loading…" placeholder, no crop overlay); current CI renders the loaded state with the crop overlay + 8 handles deterministically, so the golden needs a refresh.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@browser_tests/tests/vueNodes/rerouteNodeSize.spec.ts`:
- Around line 16-19: Remove the optional chaining operator from window.app in
the evaluate function within the poll statement. Instead of using
window.app?.refreshMissingModels(), use window.app.refreshMissingModels()
directly so that the test will fail explicitly if the app object is unavailable
during initialization, rather than silently returning 0 which masks setup
failures. This ensures that any app initialization issues are caught and prevent
false-green test results.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b75b1558-cd15-4cb1-ad6d-1c92c95ec0f0

📥 Commits

Reviewing files that changed from the base of the PR and between 8e0970e and 6e66bf0.

⛔ Files ignored due to path filters (3)
  • browser_tests/tests/vueNodes/interactions/canvas/pan.spec.ts-snapshots/vue-nodes-paned-with-touch-mobile-chrome-linux.png is excluded by !**/*.png
  • browser_tests/tests/vueNodes/rerouteNodeSize.spec.ts-snapshots/vue-reroute-node-compact-chromium-linux.png is excluded by !**/*.png
  • browser_tests/tests/vueNodes/widgets/imageCrop.spec.ts-snapshots/image-crop-with-source-chromium-linux.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • browser_tests/tests/vueNodes/rerouteNodeSize.spec.ts

Comment on lines +16 to +19
comfyPage.page.evaluate(async () => {
const result = await window.app?.refreshMissingModels()
return result?.confirmedCandidates.length ?? 0
}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Avoid silently passing when window.app is unavailable

On Line 17, optional chaining can make this poll pass as 0 even if app init
failed. That masks setup regressions and can produce false-green screenshots.

Proposed fix
     await expect
       .poll(
         () =>
           comfyPage.page.evaluate(async () => {
-            const result = await window.app?.refreshMissingModels()
-            return result?.confirmedCandidates.length ?? 0
+            const app = window.app
+            if (!app) throw new Error('window.app is not initialized')
+            const result = await app.refreshMissingModels()
+            return result.confirmedCandidates.length
           }),
         { timeout: 15_000 }
       )
       .toBe(0)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
comfyPage.page.evaluate(async () => {
const result = await window.app?.refreshMissingModels()
return result?.confirmedCandidates.length ?? 0
}),
comfyPage.page.evaluate(async () => {
const app = window.app
if (!app) throw new Error('window.app is not initialized')
const result = await app.refreshMissingModels()
return result.confirmedCandidates.length
}),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@browser_tests/tests/vueNodes/rerouteNodeSize.spec.ts` around lines 16 - 19,
Remove the optional chaining operator from window.app in the evaluate function
within the poll statement. Instead of using window.app?.refreshMissingModels(),
use window.app.refreshMissingModels() directly so that the test will fail
explicitly if the app object is unavailable during initialization, rather than
silently returning 0 which masks setup failures. This ensures that any app
initialization issues are caught and prevent false-green test results.

Resolve conflicts:
- errorsTabMissingModels.spec.ts: keep main's rewritten "clear resolved
  missing model on Refresh" test. main dropped its /experiment/models wait,
  which was the reason the branch had deleted it; the OSS refresh pipeline
  resolves the group from object_info, unaffected by FE-729's modelStore
  repoint to assetService.
- modelLibrary.spec.ts: keep FE-729's deletion. main (#12765) added two
  sidebar-treeview ghost-preview tests, but FE-729 reroutes the model-library
  tab to open the Asset Browser dialog, so the treeview never renders and
  those tests would time out.
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Thank you for your contribution, we really appreciate it! 🎉

Like many open source projects, we require contributors to sign our Contributor License Agreement (CLA). A CLA makes the ownership of contributions explicit, so contributors and the project share a clear understanding of how the code can be used. By signing, you:

  • Confirm that you own your contribution.
  • Keep the right to reuse your own code.
  • Grant us a copyright license to include and share it within our projects.

CLAs are standard practice across major open source projects including those under the Apache Software Foundation and the Linux Foundation. Ours is based on the Apache Software Foundation's CLA. Most importantly, it would enable us to relicense the project under a more permissive license in the future, giving the project and its community greater flexibility.

✍ To sign, please post a new comment on this PR with exactly the following text: ✍


I have read and agree to the Contributor License Agreement


1 out of 2 committers have signed the CLA.
✅ (dante01yoon)[https://github.com/dante01yoon]
❌ @github-actions
github-actions seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

set -euo pipefail
cp -r ./tools/devtools/* /ComfyUI/custom_nodes/ComfyUI_devtools/
cd /ComfyUI && python3 main.py --cpu --multi-user --front-end-root "${{ inputs.front_end_root }}" &
# TODO(FE-729): remove --enable-assets once BE-786 lands in the CI ComfyUI image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we land the BE side first?

DrJKL added a commit that referenced this pull request Jul 6, 2026
)

## Summary

L1 prerequisite cleanup, scoped to a single type-preserving refactor:
extract `getAssetStoredFilename(asset)` to collapse the duplicated
`isCloud && asset.asset_hash ? asset.asset_hash : asset.name` branch
from `useMediaAssetActions.ts` into one helper in
`assetMetadataUtils.ts`. No behavior change.

Once BE-933/934 emit `file_path` and the cloud spec sync brings the
field into generated types, only the helper internals change (collapse
to `asset.file_path ?? asset.name`).

## Scope change (per review)

The `mockFeatureFlags` test util and the exported `FeatureFlags` type
that this PR originally also added have been **split out**. They had no
live consumer in the open stack — FE-729~732 (#12322 / #12335 / #12375 /
#12417) don't use them, and FE-780 / FE-781 (#12485 / #12486) still
hand-roll inline `vi.hoisted` mocks — so shipping them here would add a
public surface with no caller. They will be reintroduced bundled with
the first PR that actually adopts the util, where `featureFlag`'s return
type and the "all flags off vs. production defaults" semantics can be
validated against a real consumer.

## Review fixes carried in this PR

- Mock `@/platform/distribution/types` via an `importOriginal` spread so
`isDesktop` / `isNightly` survive the wholesale replacement (only
`isCloud` was re-hoisted before).
- Trimmed the `getAssetStoredFilename` JSDoc; the BE-933/934
future-collapse is now a one-line `TODO` rather than a design-doc
paragraph.

## Review Focus

- The helper is intentionally named `getAssetStoredFilename` to
disambiguate from the existing `getAssetFilename` (which targets
`user_metadata.filename` / `metadata.filename` for serialized-identifier
contexts — missing-model matching, filename schema validation) and
`getAssetDisplayFilename` (UI labels). Folding the `isCloud &&
asset_hash` fallback into either of those would regress
display/identifier sites where the cloud hash is never meant to surface.

- Fixes FE-733
- Parent: FE-601 (L1 umbrella)
- RFC: [Asset Identity
Semantics](https://www.notion.so/comfy-org/RFC-Asset-Identity-Semantics-35a6d73d365080e59d59c98cebae779b)
- Survey: [Asset FE Divergence Survey M1
Scope](https://www.notion.so/comfy-org/Assets-FE-Divergence-Survey-M1-Scope-3616d73d365080d0a9cbf5f2394c12f8)
- Slack thread:
https://comfy-organization.slack.com/archives/C0AUUTS2RQV/p1778815571949519

## Screenshots (if applicable)

N/A — no UI change.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-12287-refactor-assets-extract-getAssetStoredFilename-helper-add-mockFeatureFlags-test-util-3616d73d365081c9a1c6e1982728a38a)
by [Unito](https://www.unito.io)

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Alexander Brown <drjkl@comfy.org>
Co-authored-by: Matt Miller <matt@miller-media.com>
@dante01yoon

Copy link
Copy Markdown
Collaborator Author

@github-actions github-actions Bot locked and limited conversation to collaborators Jul 23, 2026
@christian-byrne

christian-byrne commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Closed — retiring the FE-729→732 chain in favour of a fresh re-cut

Closing this chain (#12322, #12335, #12375, #12417 — Linear FE-729, FE-730, FE-731, FE-732) by agreement between @dante01yoon, @synap5e and @christian-byrne (Slack, 2026-07-23). This is not an abandonment of the work — the L1 isCloud / isAssetAPIEnabled teardown is still wanted. It is a decision to re-cut it fresh from main once the assets-sidebar stack lands, rather than rebase four branches whose premise has shifted underneath them.

Why re-cut rather than rebase. First, the premise was overtaken. The chain exists to delete Comfy.Assets.UseAssetAPI and the isCloud forks, but #13464 adds a sibling flag Comfy.ModelLibrary.UseAssetBrowser in the very block #12322 removes, plus new isCloud branches in modelStore.ts. A rebase would have to delete code that doesn't exist yet and re-open a design decision that just went the other way. Second, assetsStore.ts is a head-on collision: #12335 is +346/−395 in that file while #12948 is +416/−366 — two near-complete rewrites of the same file, with 13 files overlapping across the two stacks. Drift compounds it: #12322 is 246 commits behind main, #12417 is 320.

The blocker underneath all of it: BE-786 never landed. #12322 patches CI to start ComfyUI with --enable-assets because FE-729 routes modelStore through assetService, which 503s without it — and main's .github/actions/start-comfyui-server/action.yaml still does not pass that flag. So the chain was never merge-eligible regardless of conflicts, and the same dependency will block the re-cut. BE-786 (Core serving /api/assets by default, tracked in core as ComfyUI#14699) needs to land, or be explicitly scheduled, before the re-cut is scoped. Related context: the assets-panel rewire (FE-740 / #12464) faces the same gating fork, and the dialog-architecture work has its own track in #13558.

The full diff is preserved on each PR as the specification of intent — please read these branches rather than re-deriving the approach when the re-cut is scoped. @dante01yoon to be looped back in at that point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants