Skip to content

refactor: simplify asset download state and fix deletion UI#7974

Merged
DrJKL merged 11 commits intomainfrom
drjkl/order-out-of
Jan 13, 2026
Merged

refactor: simplify asset download state and fix deletion UI#7974
DrJKL merged 11 commits intomainfrom
drjkl/order-out-of

Conversation

@DrJKL
Copy link
Contributor

@DrJKL DrJKL commented Jan 13, 2026

Summary

Refactors asset download state management and fixes asset deletion UI issues.

Changes

assetDownloadStore simplification

  • Replace pendingModelTypes Map with modelType stored directly on AssetDownload
  • Replace completedDownloads array with single lastCompletedDownload ref
  • trackDownload() now creates a placeholder entry immediately
  • Use VueUse whenever instead of watch for cleaner null handling

Asset refresh on download completion

  • Refresh all relevant caches when a download completes:
    • Node type caches (e.g., "CheckpointLoaderSimple")
    • Tag caches (e.g., "tag:checkpoints")
    • "All Models" cache ("tag:models")

Asset deletion fix

  • Remove local deletedLocal state that caused blank grid cells
  • Emit deleted event from AssetCard → AssetGrid → AssetBrowserModal
  • Trigger store refresh on deletion to properly remove the asset from the grid

Testing

  • Added test for out-of-order websocket message handling
  • All existing tests pass

┆Issue is synchronized with this Notion page by Unito

@DrJKL DrJKL requested review from a team, KarryCharon, Yorha4D and shinshin86 as code owners January 13, 2026 00:47
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 13, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

This PR implements an event-driven asset deletion flow through Vue components and refactors the asset download tracking store to track the latest completed download with metadata. It adds tag-based asset cache refresh alongside existing node-type refresh, and implements per-key model asset fetchers in the assets store.

Changes

Cohort / File(s) Summary
Asset Component Event Propagation
src/platform/assets/components/AssetCard.vue, src/platform/assets/components/AssetGrid.vue, src/platform/assets/components/AssetBrowserModal.vue
AssetCard now emits a "deleted" event on successful asset deletion. AssetGrid listens for @deleted and re-emits as @asset-deleted. AssetBrowserModal wires the event to trigger refreshAssets. Changes remove local state tracking (deletedLocal) in favor of event emission.
Asset Download Store Refactor
src/stores/assetDownloadStore.ts, src/stores/assetDownloadStore.test.ts
Replaces completedDownloads list with single lastCompletedDownload property. AssetDownload interface now includes optional modelType and assetName. trackDownload signature updated to accept assetName parameter. Simplifies completed download state tracking and test assertions updated accordingly.
Asset Upload & Refresh Integration
src/platform/assets/composables/useUploadModelWizard.ts, src/stores/assetsStore.ts
useUploadModelWizard now passes filename to trackDownload. assetsStore switches from watching completedDownloads list to monitoring lastCompletedDownload. Replaced watch with whenever from @vueuse/core. Added tag-based refresh (updateModelsForTag) alongside node-type refresh (updateModelsForNodeType) via new getModelState helper with per-key caching.

Sequence Diagram

sequenceDiagram
    participant User
    participant AssetCard
    participant AssetGrid
    participant AssetBrowserModal
    participant AssetStore

    User->>AssetCard: Delete asset
    AssetCard->>AssetCard: Delete via API
    AssetCard->>AssetGrid: emit deleted event
    AssetGrid->>AssetBrowserModal: emit asset-deleted event
    AssetBrowserModal->>AssetStore: refreshAssets()
    AssetStore->>AssetStore: updateModelsForNodeType()
    AssetStore->>AssetStore: updateModelsForTag()
    AssetStore->>AssetBrowserModal: Assets refreshed
Loading

Possibly related PRs

  • #7746: Introduces async upload and WebSocket download tracking that this PR builds upon by adding asset metadata tracking.
  • #7880: Modifies assetsStore caching and per-key model refresh patterns that are expanded here with tag-based updates.
  • #7926: Changes assetDownloadStore shape and completed download recording, directly related to the download tracking refactor here.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 187f340 and 5b41a79.

📒 Files selected for processing (3)
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
🧰 Additional context used
📓 Path-based instructions (13)
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

src/**/*.ts: Derive component types using vue-component-type-helpers (ComponentProps, ComponentSlots) instead of separate type files
Use es-toolkit for utility functions
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones

Files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

src/**/*.{ts,tsx,vue}: Use separate import type statements instead of inline type in mixed imports
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, 80-character width
Sort and group imports by plugin, run pnpm format before committing
Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue
Write code that is expressive and self-documenting - avoid unnecessary comments
Do not add or retain redundant comments - clean as you go
Avoid mutable state - prefer immutability and assignment at point of declaration
Watch out for Code Smells and refactor to avoid them

Files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
src/**/stores/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/stores/**/*.{ts,tsx}: Maintain clear public interfaces and restrict extension access in stores
Use TypeScript for type safety in state management stores

Files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
src/stores/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name Pinia stores as *Store.ts (e.g., nodeStore.ts)

Files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
+(tests-ui|src)/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

+(tests-ui|src)/**/*.test.ts: Unit and component tests belong in tests-ui/ or src/**/*.test.ts using Vitest
Write tests for all changes, especially bug fixes to catch future regressions
Do not write tests dependent on non-behavioral features like utility classes or styles
Do not write tests that just test the mocks - ensure tests fail when code behaves unexpectedly
Leverage Vitest's utilities for mocking where possible
Keep module mocks contained - do not use global mutable state within test files; use vi.hoisted() if necessary
Use Vue Test Utils for Component testing and follow best practices for making components easy to test
Aim for behavioral coverage of critical and new features in unit tests

Files:

  • src/stores/assetDownloadStore.test.ts
src/**/*.{ts,vue}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,vue}: Use ref for reactive state, computed() for derived values, and watch/watchEffect for side effects in Composition API
Avoid using ref with watch if a computed would suffice - minimize refs and derived state
Use provide/inject for dependency injection only when simpler alternatives (Store or shared composable) won't work
Leverage VueUse functions for performance-enhancing composables
Use VueUse function for useI18n in composition API for string literals

Files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx}: Keep functions short and functional
Minimize nesting (if statements, for loops, etc.)
Use function declarations instead of function expressions when possible

Files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
+(tests-ui|src|browser_tests)/**/*.+(test.ts|spec.ts)

📄 CodeRabbit inference engine (AGENTS.md)

+(tests-ui|src|browser_tests)/**/*.+(test.ts|spec.ts): Do not write change detector tests - avoid tests that only assert default values
Be parsimonious in testing - do not write redundant tests
Don't Mock What You Don't Own

Files:

  • src/stores/assetDownloadStore.test.ts
src/**/{services,composables}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/{services,composables}/**/*.{ts,tsx}: Use api.apiURL() for backend endpoints instead of constructing URLs directly
Use api.fileURL() for static file access instead of constructing URLs directly

Files:

  • src/platform/assets/composables/useUploadModelWizard.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Clean up subscriptions in state management to prevent memory leaks

Files:

  • src/platform/assets/composables/useUploadModelWizard.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Use vue-i18n for ALL user-facing strings by adding them to src/locales/en/main.json

Files:

  • src/platform/assets/composables/useUploadModelWizard.ts
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Implement cleanup for async operations in Vue components
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7897
File: src/stores/assetDownloadStore.ts:117-117
Timestamp: 2026-01-08T21:44:05.435Z
Learning: In src/stores/assetDownloadStore.ts, the api.addEventListener('asset_download', handleAssetDownload) call at module level is intentional and should persist for the application lifetime since it's a singleton Pinia store managing global WebSocket events.
📚 Learning: 2026-01-08T21:44:05.435Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7897
File: src/stores/assetDownloadStore.ts:117-117
Timestamp: 2026-01-08T21:44:05.435Z
Learning: In src/stores/assetDownloadStore.ts, the api.addEventListener('asset_download', handleAssetDownload) call at module level is intentional and should persist for the application lifetime since it's a singleton Pinia store managing global WebSocket events.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
📚 Learning: 2026-01-09T23:59:06.942Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7926
File: src/stores/assetDownloadStore.ts:101-126
Timestamp: 2026-01-09T23:59:06.942Z
Learning: In src/stores/assetDownloadStore.ts, the empty catch block in pollSingleDownload within pollStaleDownloads is intentional. Do not suggest adding error logging or handling for polling failures in this function.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
📚 Learning: 2025-12-09T03:39:54.501Z
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.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
📚 Learning: 2025-12-13T11:03:11.264Z
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.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
📚 Learning: 2025-12-17T00:40:09.635Z
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).

Applied to files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
📚 Learning: 2025-12-30T22:22:33.836Z
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().

Applied to files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
📚 Learning: 2025-12-10T03:09:13.807Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7303
File: src/components/topbar/CurrentUserPopover.test.ts:199-205
Timestamp: 2025-12-10T03:09:13.807Z
Learning: In test files, prefer selecting or asserting on accessible properties (text content, aria-label, role, accessible name) over data-testid attributes. This ensures tests validate actual user-facing behavior and accessibility, reducing reliance on implementation details like test IDs.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
📚 Learning: 2025-12-30T01:31:04.927Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7797
File: tests-ui/tests/lib/litegraph/src/widgets/ComboWidget.test.ts:648-648
Timestamp: 2025-12-30T01:31:04.927Z
Learning: In Vitest v4, when mocking functions that may be called as constructors (using new), the mock implementation must use function() or class syntax rather than an arrow function. Arrow mocks can cause '<anonymous> is not a constructor' errors. This is a breaking change from Vitest v3 where mocks could use an arrow function. Apply this guideline to test files that mock constructor-like calls (e.g., in tests under tests-ui, such as ComboWidget.test.ts) and ensure mock implementations are defined with function() { ... } or class { ... } to preserve constructor behavior.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
📚 Learning: 2026-01-08T02:40:15.482Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7894
File: src/renderer/extensions/vueNodes/widgets/components/WidgetToggleSwitch.test.ts:11-14
Timestamp: 2026-01-08T02:40:15.482Z
Learning: In TypeScript test files (e.g., any test under src), avoid duplicating interface/type definitions. Import real type definitions from the component modules under test and reference them directly, so there is a single source of truth and to prevent type drift. This improves maintainability and consistency across tests.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
📚 Learning: 2026-01-09T02:07:54.558Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7898
File: src/composables/usePaste.test.ts:248-248
Timestamp: 2026-01-09T02:07:54.558Z
Learning: In test files (e.g., any .test.ts or .test.tsx under src/...), when you create mock objects that partially implement an interface (such as LGraphNode), prefer casting with as Partial<InterfaceType> as InterfaceType rather than as any or as unknown as InterfaceType. This makes the incomplete implementation explicit while preserving type safety, improving readability and maintainability of tests.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
📚 Learning: 2025-12-11T12:25:15.470Z
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.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
📚 Learning: 2026-01-12T17:39:27.738Z
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.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/composables/useUploadModelWizard.ts
📚 Learning: 2026-01-09T23:59:04.777Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7926
File: src/stores/assetDownloadStore.ts:101-126
Timestamp: 2026-01-09T23:59:04.777Z
Learning: In src/stores/assetDownloadStore.ts, the empty catch block in pollSingleDownload within pollStaleDownloads is intentional. Do not suggest adding error logging or error handling for polling failures in this function; treat it as a deliberate swallow of errors to avoid affecting poll logic or user-visible behavior. Reviewers should refrain from proposing fixes to this catch block for this function.

Applied to files:

  • src/stores/assetDownloadStore.ts
📚 Learning: 2025-12-05T06:11:09.383Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7177
File: src/platform/assets/components/UploadModelFooter.vue:72-78
Timestamp: 2025-12-05T06:11:09.383Z
Learning: For the ComfyUI_frontend repository, avoid suggesting comments that would be redundant when the code is already self-explanatory through descriptive naming (e.g., filenames, prop names, aria-labels). The project prefers clean code without unnecessary documentation comments.

Applied to files:

  • src/stores/assetDownloadStore.ts
📚 Learning: 2025-12-09T21:40:19.792Z
Learnt from: benceruleanlu
Repo: Comfy-Org/ComfyUI_frontend PR: 7297
File: src/components/actionbar/ComfyActionbar.vue:33-43
Timestamp: 2025-12-09T21:40:19.792Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, inline Tailwind CSS class strings, even when long, are acceptable and preferred over extracting them to computed properties when the classes are static. This is a common Tailwind pattern and doesn't need to be flagged as a readability issue.

Applied to files:

  • src/stores/assetDownloadStore.ts
📚 Learning: 2025-12-22T21:36:16.031Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: src/platform/cloud/subscription/components/PricingTable.vue:185-201
Timestamp: 2025-12-22T21:36:16.031Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, avoid creating single-use variants for the Button component (and other UI components). Variants should be reusable across multiple use cases. It's acceptable to use a mix of variant props and manual Tailwind classes temporarily when a specific styling need exists in only one place, with consolidation deferred to a later phase when patterns emerge.

Applied to files:

  • src/stores/assetDownloadStore.ts
📚 Learning: 2025-12-09T03:50:03.127Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/platform/updates/components/WhatsNewPopup.vue:5-13
Timestamp: 2025-12-09T03:50:03.127Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, when avoiding PrimeVue components, prefer using the repo's common button components from src/components/button/ (IconButton.vue, TextButton.vue, IconTextButton.vue) rather than plain HTML buttons. These components wrap PrimeVue with custom design system styling.

Applied to files:

  • src/stores/assetDownloadStore.ts
📚 Learning: 2025-12-22T21:36:46.909Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: tests-ui/tests/platform/cloud/subscription/components/SubscriptionPanel.test.ts:189-194
Timestamp: 2025-12-22T21:36:46.909Z
Learning: In the Comfy-Org/ComfyUI_frontend repository test files: Do not stub primitive UI components or customized primitive components (e.g., Button). Instead, import and register the real components in test setup. This ensures tests accurately reflect production behavior and component API usage.

Applied to files:

  • src/stores/assetDownloadStore.ts
📚 Learning: 2025-12-10T03:09:19.636Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7303
File: src/components/topbar/CurrentUserPopover.test.ts:199-205
Timestamp: 2025-12-10T03:09:19.636Z
Learning: For test files in the Comfy-Org/ComfyUI_frontend repository: When writing tests, prefer selecting elements by accessible properties (text content, aria-label, role, accessible name) over data-testid attributes. This ensures tests verify actual user-facing behavior and accessibility compliance.

Applied to files:

  • src/stores/assetDownloadStore.ts
📚 Learning: 2026-01-06T19:17:12.355Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7746
File: src/platform/assets/composables/useUploadModelWizard.ts:207-219
Timestamp: 2026-01-06T19:17:12.355Z
Learning: In `src/platform/assets/composables/useUploadModelWizard.ts`, the `uploadModel()` function should have a concurrency guard at the beginning that checks if `isUploading.value` is already true and returns false early to prevent race conditions from multiple rapid invocations.

Applied to files:

  • src/platform/assets/composables/useUploadModelWizard.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test
  • GitHub Check: collect
  • GitHub Check: lint-and-format
  • GitHub Check: setup
🔇 Additional comments (7)
src/stores/assetDownloadStore.ts (4)

30-45: Clean extraction of placeholder creation logic.

The pure function extraction improves testability and clearly documents the initial state of a tracked download. The guard in trackDownload (line 66) correctly prevents clobbering existing entries that may have arrived via WebSocket before trackDownload was called.


65-72: Guard against clobbering is a good addition.

The early return when taskId already exists prevents race conditions where a WebSocket message arrives before trackDownload is called. This ensures that real download data from WebSocket events isn't overwritten with placeholder values.


92-94: Preserving modelType from existing entry is correct.

Since AssetDownloadWsMessage doesn't include modelType, preserving it from the existing entry ensures the completion tracking works correctly when the download was registered via trackDownload.


98-104: Simplified completion tracking.

The single lastCompletedDownload pattern is cleaner than maintaining a bounded array. The conditional check download.modelType ensures only downloads registered via trackDownload trigger cache refresh downstream.

src/platform/assets/composables/useUploadModelWizard.ts (1)

246-250: Correctly updated to match new trackDownload signature.

The filename parameter is already defined in scope (lines 224-227) and provides meaningful context for download tracking. The guard on line 245 ensures selectedModelType.value is defined.

src/stores/assetDownloadStore.test.ts (2)

116-127: Test correctly updated for new API.

The assertion change from completedDownloads[0] to lastCompletedDownload with toMatchObject correctly validates the simplified completion tracking behavior.


129-142: Good behavioral test for out-of-order WebSocket messages.

This test validates an important edge case where a completed message arrives before a stale running message. The assertions confirm that:

  1. The download remains in terminal state
  2. The lastCompletedDownload is correctly populated

This directly exercises the guard at lines 79-81 in the store.


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 and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 13, 2026

🎭 Playwright Tests: ⚠️ Passed with flaky tests

Results: 498 passed, 0 failed, 4 flaky, 8 skipped (Total: 510)

❌ Failed Tests

📊 Browser Reports
  • chromium: View Report (✅ 488 / ❌ 0 / ⚠️ 3 / ⏭️ 8)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 7 / ❌ 0 / ⚠️ 1 / ⏭️ 0)

@github-actions
Copy link

github-actions bot commented Jan 13, 2026

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 01/13/2026, 01:26:53 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@DrJKL DrJKL changed the base branch from main to drjkl/model-modal-model-modal-model-modal January 13, 2026 00:49
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 13, 2026
@github-actions
Copy link

github-actions bot commented Jan 13, 2026

Bundle Size Report

Summary

  • Raw size: 19.4 MB baseline 19.4 MB — 🔴 +370 B
  • Gzip: 3.95 MB baseline 3.95 MB — 🔴 +13 B
  • Brotli: 3.02 MB baseline 3.02 MB — 🔴 +50 B
  • Bundles: 98 current • 98 baseline • 38 added / 38 removed

Category Glance
App Entry Points 🔴 +236 B (3.32 MB) · Graph Workspace 🔴 +110 B (1.04 MB) · UI Components 🔴 +24 B (200 kB) · Vendor & Third-Party ⚪ 0 B (9.19 MB) · Other ⚪ 0 B (5.25 MB) · Panels & Settings ⚪ 0 B (372 kB) · + 3 more

Per-category breakdown
App Entry Points — 3.32 MB (baseline 3.32 MB) • 🔴 +236 B

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-C_pmfadn.js (new) 3.12 MB 🔴 +3.12 MB 🔴 +654 kB 🔴 +496 kB
assets/index-D43uAv6d.js (removed) 3.12 MB 🟢 -3.12 MB 🟢 -654 kB 🟢 -496 kB
assets/index-CILrtIHU.js (removed) 200 kB 🟢 -200 kB 🟢 -44 kB 🟢 -36.4 kB
assets/index-TpI5dvzF.js (new) 200 kB 🔴 +200 kB 🔴 +44 kB 🔴 +36.4 kB
assets/index-4SeCsy6M.js (new) 345 B 🔴 +345 B 🔴 +243 B 🔴 +210 B
assets/index-Bnq-BBfw.js (removed) 345 B 🟢 -345 B 🟢 -246 B 🟢 -231 B

Status: 3 added / 3 removed

Graph Workspace — 1.04 MB (baseline 1.04 MB) • 🔴 +110 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-DoybSy1a.js (new) 1.04 MB 🔴 +1.04 MB 🔴 +200 kB 🔴 +151 kB
assets/GraphView-DhRwGkRL.js (removed) 1.04 MB 🟢 -1.04 MB 🟢 -200 kB 🟢 -151 kB

Status: 1 added / 1 removed

Views & Navigation — 6.63 kB (baseline 6.63 kB) • ⚪ 0 B

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-avuWyX-V.js (removed) 6.63 kB 🟢 -6.63 kB 🟢 -2.15 kB 🟢 -1.9 kB
assets/UserSelectView-CjIoJQr6.js (new) 6.63 kB 🔴 +6.63 kB 🔴 +2.14 kB 🔴 +1.9 kB

Status: 1 added / 1 removed

Panels & Settings — 372 kB (baseline 372 kB) • ⚪ 0 B

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LegacyCreditsPanel-3lBFnv6R.js (new) 25.1 kB 🔴 +25.1 kB 🔴 +5.74 kB 🔴 +5 kB
assets/LegacyCreditsPanel-p6HaM1e_.js (removed) 25.1 kB 🟢 -25.1 kB 🟢 -5.74 kB 🟢 -5 kB
assets/KeybindingPanel-CNLkr_Fq.js (removed) 14.8 kB 🟢 -14.8 kB 🟢 -3.57 kB 🟢 -3.13 kB
assets/KeybindingPanel-DrNf_zME.js (new) 14.8 kB 🔴 +14.8 kB 🔴 +3.57 kB 🔴 +3.13 kB
assets/ExtensionPanel-Buv-MVGG.js (new) 11.1 kB 🔴 +11.1 kB 🔴 +2.62 kB 🔴 +2.3 kB
assets/ExtensionPanel-d5beBiAB.js (removed) 11.1 kB 🟢 -11.1 kB 🟢 -2.62 kB 🟢 -2.3 kB
assets/AboutPanel-dLhmQSjQ.js (new) 9.16 kB 🔴 +9.16 kB 🔴 +2.46 kB 🔴 +2.21 kB
assets/AboutPanel-Uw_UywU9.js (removed) 9.16 kB 🟢 -9.16 kB 🟢 -2.46 kB 🟢 -2.21 kB
assets/ServerConfigPanel-Cgv3T8i4.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -2.04 kB 🟢 -1.8 kB
assets/ServerConfigPanel-Mz_z39Dj.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +2.04 kB 🔴 +1.8 kB
assets/UserPanel-B2IHkXWw.js (new) 6.88 kB 🔴 +6.88 kB 🔴 +1.79 kB 🔴 +1.56 kB
assets/UserPanel-yTylcjG_.js (removed) 6.88 kB 🟢 -6.88 kB 🟢 -1.79 kB 🟢 -1.56 kB
assets/settings-BGQfQzTx.js 25.6 kB 25.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BVE4KHTw.js 22.7 kB 22.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BVtpJmlU.js 30.9 kB 30.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-C2aO00Dz.js 28.6 kB 28.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-Cm3ieBXR.js 27.8 kB 27.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CzQKMdK3.js 26.2 kB 26.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CzYUIUnL.js 27.1 kB 27.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DwKpL7jw.js 26.3 kB 26.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DX8feV4n.js 25.3 kB 25.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-mWzYycGc.js 22 kB 22 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-U4AdZ8Rl.js 34.9 kB 34.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

UI Components — 200 kB (baseline 200 kB) • 🔴 +24 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LazyImage.vue_vue_type_script_setup_true_lang-D792ZMOc.js (new) 65.6 kB 🔴 +65.6 kB 🔴 +13.3 kB 🔴 +11.5 kB
assets/LazyImage.vue_vue_type_script_setup_true_lang-Dc3HGQev.js (removed) 65.6 kB 🟢 -65.6 kB 🟢 -13.2 kB 🟢 -11.5 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-D0sWsAr6.js (removed) 56.4 kB 🟢 -56.4 kB 🟢 -8.77 kB 🟢 -7.53 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-DoOz8Xre.js (new) 56.4 kB 🔴 +56.4 kB 🔴 +8.77 kB 🔴 +7.53 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-B9E5jHAx.js (removed) 49 kB 🟢 -49 kB 🟢 -10.5 kB 🟢 -9.14 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-H2K2vUgy.js (new) 49 kB 🔴 +49 kB 🔴 +10.5 kB 🔴 +9.14 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-BV64SKPJ.js (removed) 10.9 kB 🟢 -10.9 kB 🟢 -2.9 kB 🟢 -2.56 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-C4vD0WYN.js (new) 10.9 kB 🔴 +10.9 kB 🔴 +2.89 kB 🔴 +2.56 kB
assets/ComfyQueueButton-DZysR4b7.js (new) 8.83 kB 🔴 +8.83 kB 🔴 +2.58 kB 🔴 +2.3 kB
assets/ComfyQueueButton-FyYqH0D7.js (removed) 8.83 kB 🟢 -8.83 kB 🟢 -2.58 kB 🟢 -2.3 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-CbaGSR7U.js (removed) 3.72 kB 🟢 -3.72 kB 🟢 -1.45 kB 🟢 -1.32 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-DTmR7chl.js (new) 3.72 kB 🔴 +3.72 kB 🔴 +1.45 kB 🔴 +1.31 kB
assets/WidgetButton-ByqFNFej.js (new) 2.21 kB 🔴 +2.21 kB 🔴 +996 B 🔴 +896 B
assets/WidgetButton-C6MNVEee.js (removed) 2.21 kB 🟢 -2.21 kB 🟢 -997 B 🟢 -899 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-D3Uf51Ue.js (new) 2.14 kB 🔴 +2.14 kB 🔴 +888 B 🔴 +763 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-t_6awC99.js (removed) 2.14 kB 🟢 -2.14 kB 🟢 -890 B 🟢 -770 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-DWEfpRJs.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 8 added / 8 removed

Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 B

Stores, services, APIs, and repositories

File Before After Δ Raw Δ Gzip Δ Brotli
assets/keybindingService-B1IWVmS-.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -1.83 kB 🟢 -1.58 kB
assets/keybindingService-B3SJAWc3.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +1.83 kB 🔴 +1.57 kB
assets/audioService-BOG98veP.js (removed) 2.2 kB 🟢 -2.2 kB 🟢 -964 B 🟢 -824 B
assets/audioService-BraVis5C.js (new) 2.2 kB 🔴 +2.2 kB 🔴 +960 B 🔴 +823 B
assets/serverConfigStore-lZrt20fn.js 2.83 kB 2.83 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 2 added / 2 removed

Utilities & Hooks — 1.41 kB (baseline 1.41 kB) • ⚪ 0 B

Helpers, composables, and utility bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/audioUtils-0hvr6bDr.js (removed) 1.41 kB 🟢 -1.41 kB 🟢 -649 B 🟢 -547 B
assets/audioUtils-B8YIVoVM.js (new) 1.41 kB 🔴 +1.41 kB 🔴 +649 B 🔴 +547 B

Status: 1 added / 1 removed

Vendor & Third-Party — 9.19 MB (baseline 9.19 MB) • ⚪ 0 B

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-C2WamoVK.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-Da7BzmIq.js 3.9 MB 3.9 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-CvitJUGk.js 1.95 MB 1.95 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-Ds3gPtNh.js 2.08 MB 2.08 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-WJL3cqV8.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-E9hBZNUh.js 160 kB 160 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-BF8peZ5_.js 420 kB 420 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 5.25 MB (baseline 5.25 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/SubscriptionRequiredDialogContent-fPlV9Rkw.js (removed) 29.3 kB 🟢 -29.3 kB 🟢 -6.51 kB 🟢 -5.65 kB
assets/SubscriptionRequiredDialogContent-M_A-XXYH.js (new) 29.3 kB 🔴 +29.3 kB 🔴 +6.51 kB 🔴 +5.65 kB
assets/WidgetRecordAudio-CwSw9T8i.js (new) 20.4 kB 🔴 +20.4 kB 🔴 +5.23 kB 🔴 +4.63 kB
assets/WidgetRecordAudio-geeRW4PI.js (removed) 20.4 kB 🟢 -20.4 kB 🟢 -5.23 kB 🟢 -4.63 kB
assets/AudioPreviewPlayer-BfhY4Rdb.js (new) 13.3 kB 🔴 +13.3 kB 🔴 +3.35 kB 🔴 +3 kB
assets/AudioPreviewPlayer-BL29Z_Sl.js (removed) 13.3 kB 🟢 -13.3 kB 🟢 -3.35 kB 🟢 -3.01 kB
assets/ValueControlPopover-9Nux5KQ4.js (removed) 5.49 kB 🟢 -5.49 kB 🟢 -1.71 kB 🟢 -1.52 kB
assets/ValueControlPopover-DgkKN2gJ.js (new) 5.49 kB 🔴 +5.49 kB 🔴 +1.71 kB 🔴 +1.52 kB
assets/WidgetGalleria-C6f673xQ.js (removed) 4.1 kB 🟢 -4.1 kB 🟢 -1.45 kB 🟢 -1.3 kB
assets/WidgetGalleria-tA5xhXQt.js (new) 4.1 kB 🔴 +4.1 kB 🔴 +1.45 kB 🔴 +1.3 kB
assets/WidgetColorPicker-B8T8e_2V.js (new) 3.41 kB 🔴 +3.41 kB 🔴 +1.38 kB 🔴 +1.24 kB
assets/WidgetColorPicker-BfjeWPmF.js (removed) 3.41 kB 🟢 -3.41 kB 🟢 -1.38 kB 🟢 -1.24 kB
assets/WidgetTextarea-jQGFybBJ.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.21 kB 🔴 +1.07 kB
assets/WidgetTextarea-SfyIh-5c.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.21 kB 🟢 -1.08 kB
assets/WidgetMarkdown-CHrzUGG8.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.28 kB 🔴 +1.12 kB
assets/WidgetMarkdown-DAlVdpjd.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.28 kB 🟢 -1.12 kB
assets/WidgetAudioUI-BJnxSGiV.js (new) 2.89 kB 🔴 +2.89 kB 🔴 +1.17 kB 🔴 +1.06 kB
assets/WidgetAudioUI-C7S8H7Lu.js (removed) 2.89 kB 🟢 -2.89 kB 🟢 -1.17 kB 🟢 -1.06 kB
assets/WidgetToggleSwitch-C0HTEfGQ.js (removed) 2.66 kB 🟢 -2.66 kB 🟢 -1.13 kB 🟢 -1.03 kB
assets/WidgetToggleSwitch-CcCsa_34.js (new) 2.66 kB 🔴 +2.66 kB 🔴 +1.13 kB 🔴 +1.02 kB
assets/WidgetInputText-BLiKAQgi.js (removed) 1.99 kB 🟢 -1.99 kB 🟢 -922 B 🟢 -855 B
assets/WidgetInputText-on8Nn6nP.js (new) 1.99 kB 🔴 +1.99 kB 🔴 +919 B 🔴 +857 B
assets/Media3DTop--7xua3zf.js (new) 1.49 kB 🔴 +1.49 kB 🔴 +764 B 🔴 +650 B
assets/Media3DTop-BhkOwWnH.js (removed) 1.49 kB 🟢 -1.49 kB 🟢 -767 B 🟢 -651 B
assets/WidgetSelect-BOopdaVj.js (removed) 733 B 🟢 -733 B 🟢 -361 B 🟢 -323 B
assets/WidgetSelect-ElD4CR_k.js (new) 733 B 🔴 +733 B 🔴 +360 B 🔴 +326 B
assets/WidgetInputNumber-CtY1pi8e.js (removed) 673 B 🟢 -673 B 🟢 -348 B 🟢 -291 B
assets/WidgetInputNumber-Xrhxy1o3.js (new) 673 B 🔴 +673 B 🔴 +347 B 🔴 +287 B
assets/Load3D-CiuSvggM.js (removed) 424 B 🟢 -424 B 🟢 -267 B 🟢 -224 B
assets/Load3D-DCkNd1eN.js (new) 424 B 🔴 +424 B 🔴 +266 B 🔴 +223 B
assets/WidgetLegacy-_xb7howl.js (new) 364 B 🔴 +364 B 🔴 +238 B 🔴 +192 B
assets/WidgetLegacy-C8OtRXII.js (removed) 364 B 🟢 -364 B 🟢 -240 B 🟢 -193 B
assets/commands-7wafkPd1.js 15.6 kB 15.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-B3CjBnJe.js 14.6 kB 14.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-Bbu2TJPy.js 18.1 kB 18.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BeJss6Df.js 16.9 kB 16.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-C4khqsmz.js 15.6 kB 15.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CDQ7KnIn.js 16.4 kB 16.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CtjMsXHh.js 15.4 kB 15.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CW_l758_.js 16.1 kB 16.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DbX4HUlI.js 15.6 kB 15.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DiGLEtFT.js 16.9 kB 16.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-vRVJOWju.js 14.8 kB 14.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-B_h9YBFl.js 129 kB 129 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BO2lyoih.js 94.2 kB 94.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BWknJp3D.js 133 kB 133 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-C49hGWeZ.js 107 kB 107 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CgivmeTy.js 110 kB 110 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-D_QQCDTL.js 149 kB 149 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-dbu9MIPO.js 123 kB 123 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DhgCCEQx.js 113 kB 113 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DpPNoJth.js 106 kB 106 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-kIdEUfEK.js 94.9 kB 94.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-xSVehrCG.js 108 kB 108 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-DIQlZoPQ.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-C3CvQRZ8.js 1.75 kB 1.75 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-euoHxxM5.js 2.65 kB 2.65 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-B-XzzBeS.js 317 kB 317 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BGwoeek4.js 329 kB 329 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-C6xl5-mL.js 358 kB 358 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CRZGOJB7.js 310 kB 310 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-D8-Yzlzh.js 289 kB 289 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Du8VrAwA.js 320 kB 320 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-jjlLVrIs.js 317 kB 317 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-JQwk1kgy.js 292 kB 292 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-JuuXdMpv.js 391 kB 391 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-l2Y20bod.js 314 kB 314 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-VLMdhOwo.js 357 kB 357 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/OBJLoader2WorkerModule-DTMpvldF.js 109 kB 109 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-515bxB6A.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-DOYclIRS.js 3.21 kB 3.21 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-BIbGSUAt.js 1.28 kB 1.28 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 16 added / 16 removed

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/stores/assetsStore.ts (1)

405-411: Improve error message to reflect both update types.

The error message mentions "provider" but the results array includes both nodeTypeUpdates and tagUpdates. A failed tag update would produce a confusing log message.

📝 Suggested improvement
       for (const result of results) {
         if (result.status === 'rejected') {
           console.error(
-            `Failed to refresh model cache for provider: ${result.reason}`
+            `Failed to refresh model cache: ${result.reason}`
           )
         }
       }
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfb78b2 and 187f340.

📒 Files selected for processing (13)
  • src/locales/en/main.json
  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetDownloadStore.ts
  • src/stores/assetsStore.ts
🧰 Additional context used
📓 Path-based instructions (14)
src/**/*.vue

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.vue: Use the Vue 3 Composition API instead of the Options API when writing Vue components (exception: when overriding or extending PrimeVue components for compatibility)
Use setup() function for component logic
Utilize ref and reactive for reactive state
Implement computed properties with computed()
Use watch and watchEffect for side effects
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection
Use vue 3.5 style of default prop declaration
Use Tailwind CSS for styling
Implement proper props and emits definitions
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventions

src/**/*.vue: Use Vue 3 Single File Components (SFCs) with Composition API only
Use <script setup lang="ts"> for component logic in Vue SFCs
Avoid <style> blocks in Vue components - use Tailwind 4 styling instead
Use vue-i18n for all string literals in Vue components - place translation entries in src/locales/en/main.json
Use Tailwind utility classes instead of dark: variant - use semantic values from style.css theme (e.g., bg-node-component-surface)
Use cn() utility from @/utils/tailwindUtil for merging Tailwind class names instead of :class="[]" or hardcoding
Never use !important or ! Tailwind prefix - fix interfering classes instead
Use Tailwind fraction utilities instead of arbitrary percentage values (e.g., w-4/5 instead of w-[80%])
Use TypeScript Vue 3.5 style default prop declaration with reactive props destructuring - avoid withDefaults or runtime props
Prefer defineModel over separately defining a prop and emit for v-model bindings
Define slots via template usage, not via defineSlots
Use same-name shorthand for slot prop bindings (e.g., :isExpanded instead of :is-expanded="isExpanded")
Do not import Vue macros unnecessarily
Avoid new usage of PrimeVue components
Use Tailwind's plurals system via i18n instead of hardcoding ...

Files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/components/AssetCard.vue
  • src/stores/assetDownloadStore.test.ts
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
  • src/stores/assetsStore.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

src/**/*.{ts,tsx,vue}: Use separate import type statements instead of inline type in mixed imports
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, 80-character width
Sort and group imports by plugin, run pnpm format before committing
Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue
Write code that is expressive and self-documenting - avoid unnecessary comments
Do not add or retain redundant comments - clean as you go
Avoid mutable state - prefer immutability and assignment at point of declaration
Watch out for Code Smells and refactor to avoid them

Files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/components/AssetCard.vue
  • src/stores/assetDownloadStore.test.ts
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
  • src/stores/assetsStore.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Clean up subscriptions in state management to prevent memory leaks

Files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/components/AssetCard.vue
  • src/stores/assetDownloadStore.test.ts
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
  • src/stores/assetsStore.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Use vue-i18n for ALL user-facing strings by adding them to src/locales/en/main.json

Files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
src/**/*.{ts,vue}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,vue}: Use ref for reactive state, computed() for derived values, and watch/watchEffect for side effects in Composition API
Avoid using ref with watch if a computed would suffice - minimize refs and derived state
Use provide/inject for dependency injection only when simpler alternatives (Store or shared composable) won't work
Leverage VueUse functions for performance-enhancing composables
Use VueUse function for useI18n in composition API for string literals

Files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/components/AssetCard.vue
  • src/stores/assetDownloadStore.test.ts
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
  • src/stores/assetsStore.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

src/**/*.ts: Derive component types using vue-component-type-helpers (ComponentProps, ComponentSlots) instead of separate type files
Use es-toolkit for utility functions
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones

Files:

  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
src/**/{services,composables}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/{services,composables}/**/*.{ts,tsx}: Use api.apiURL() for backend endpoints instead of constructing URLs directly
Use api.fileURL() for static file access instead of constructing URLs directly

Files:

  • src/platform/assets/composables/useUploadModelWizard.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx}: Keep functions short and functional
Minimize nesting (if statements, for loops, etc.)
Use function declarations instead of function expressions when possible

Files:

  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
src/**/stores/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/stores/**/*.{ts,tsx}: Maintain clear public interfaces and restrict extension access in stores
Use TypeScript for type safety in state management stores

Files:

  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
src/stores/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name Pinia stores as *Store.ts (e.g., nodeStore.ts)

Files:

  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
+(tests-ui|src)/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

+(tests-ui|src)/**/*.test.ts: Unit and component tests belong in tests-ui/ or src/**/*.test.ts using Vitest
Write tests for all changes, especially bug fixes to catch future regressions
Do not write tests dependent on non-behavioral features like utility classes or styles
Do not write tests that just test the mocks - ensure tests fail when code behaves unexpectedly
Leverage Vitest's utilities for mocking where possible
Keep module mocks contained - do not use global mutable state within test files; use vi.hoisted() if necessary
Use Vue Test Utils for Component testing and follow best practices for making components easy to test
Aim for behavioral coverage of critical and new features in unit tests

Files:

  • src/stores/assetDownloadStore.test.ts
+(tests-ui|src|browser_tests)/**/*.+(test.ts|spec.ts)

📄 CodeRabbit inference engine (AGENTS.md)

+(tests-ui|src|browser_tests)/**/*.+(test.ts|spec.ts): Do not write change detector tests - avoid tests that only assert default values
Be parsimonious in testing - do not write redundant tests
Don't Mock What You Don't Own

Files:

  • src/stores/assetDownloadStore.test.ts
🧠 Learnings (45)
📚 Learning: 2025-12-09T03:49:52.828Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/platform/updates/components/WhatsNewPopup.vue:5-13
Timestamp: 2025-12-09T03:49:52.828Z
Learning: In Vue files across the ComfyUI_frontend repo, when a button is needed, prefer the repo's common button components from src/components/button/ (IconButton.vue, TextButton.vue, IconTextButton.vue) over plain HTML <button> elements. These components wrap PrimeVue with the project’s design system styling. Use only the common button components for consistency and theming, and import them from src/components/button/ as needed.

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2025-12-09T21:40:12.361Z
Learnt from: benceruleanlu
Repo: Comfy-Org/ComfyUI_frontend PR: 7297
File: src/components/actionbar/ComfyActionbar.vue:33-43
Timestamp: 2025-12-09T21:40:12.361Z
Learning: In Vue single-file components, allow inline Tailwind CSS class strings for static classes and avoid extracting them into computed properties solely for readability. Prefer keeping static class names inline for simplicity and performance. For dynamic or conditional classes, use Vue bindings (e.g., :class) to compose classes.

Applies to all Vue files in the repository (e.g., src/**/*.vue) where Tailwind utilities are used for static styling.

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2025-12-16T22:26:49.463Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.vue:17-17
Timestamp: 2025-12-16T22:26:49.463Z
Learning: In Vue 3.5+ with <script setup>, when using defineProps<Props>() with partial destructuring (e.g., const { as = 'button', class: customClass = '' } = defineProps<Props>() ), props that are not destructured (e.g., variant, size) stay accessible by name in the template scope. This pattern is valid: you can destructure only a subset of props for convenience while referencing the remaining props directly in template expressions. Apply this guideline to Vue components across the codebase (all .vue files).

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2025-12-22T21:36:08.369Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: src/platform/cloud/subscription/components/PricingTable.vue:185-201
Timestamp: 2025-12-22T21:36:08.369Z
Learning: In Vue components, avoid creating single-use variants for common UI components (e.g., Button and other shared components). Aim for reusable variants that cover multiple use cases. It’s acceptable to temporarily mix variant props with inline Tailwind classes when a styling need is unique to one place, but plan and consolidate into shared, reusable variants as patterns emerge across the codebase.

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2026-01-08T02:26:18.357Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7893
File: src/components/button/IconGroup.vue:5-6
Timestamp: 2026-01-08T02:26:18.357Z
Learning: In components that use the cn utility from '@/utils/tailwindUtil' with tailwind-merge, rely on the behavior that conflicting Tailwind classes are resolved by keeping the last one. For example, cn('base-classes bg-default', propClass) will have any conflicting background class from propClass override bg-default. This additive pattern is intentional and aligns with the shadcn-ui convention; ensure you document or review expectations accordingly in Vue components.

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2025-12-11T12:25:15.470Z
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.

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/components/AssetCard.vue
  • src/stores/assetDownloadStore.test.ts
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
  • src/stores/assetsStore.ts
📚 Learning: 2025-12-18T02:07:38.870Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7598
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:131-131
Timestamp: 2025-12-18T02:07:38.870Z
Learning: Tailwind CSS v4 safe utilities (e.g., items-center-safe, justify-*-safe, place-*-safe) are allowed in Vue components under src/ and in story files. Do not flag these specific safe variants as invalid when reviewing code in src/**/*.vue or related stories.

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2025-12-18T21:15:46.862Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7603
File: src/components/queue/QueueOverlayHeader.vue:49-59
Timestamp: 2025-12-18T21:15:46.862Z
Learning: In the ComfyUI_frontend repository, for Vue components, do not add aria-label to buttons that have visible text content (e.g., buttons containing <span> text). The visible text provides the accessible name. Use aria-label only for elements without visible labels (e.g., icon-only buttons). If a button has no visible label, provide a clear aria-label or associate with an aria-labelledby describing its action.

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2025-12-21T01:06:02.786Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: src/components/graph/selectionToolbox/ColorPickerButton.vue:15-18
Timestamp: 2025-12-21T01:06:02.786Z
Learning: In Comfy-Org/ComfyUI_frontend, in Vue component files, when a filled icon is required (e.g., 'pi pi-circle-fill'), you may mix PrimeIcons with Lucide icons since Lucide lacks filled variants. This mixed usage is acceptable when one icon library does not provide an equivalent filled icon. Apply consistently across Vue components in the src directory where icons are used, and document the rationale when a mixed approach is chosen.

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2026-01-12T17:39:27.738Z
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.

Applied to files:

  • src/platform/assets/components/AssetBrowserModal.vue
  • src/platform/assets/components/UploadModelUrlInputCivitai.vue
  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
  • src/platform/assets/components/AssetGrid.vue
  • src/stores/assetDownloadStore.ts
  • src/platform/assets/components/AssetCard.vue
  • src/stores/assetDownloadStore.test.ts
  • src/platform/assets/components/UploadModelUrlInput.vue
  • src/platform/assets/components/UploadModelConfirmation.vue
  • src/stores/assetsStore.ts
📚 Learning: 2026-01-06T19:17:12.355Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7746
File: src/platform/assets/composables/useUploadModelWizard.ts:207-219
Timestamp: 2026-01-06T19:17:12.355Z
Learning: In `src/platform/assets/composables/useUploadModelWizard.ts`, the `uploadModel()` function should have a concurrency guard at the beginning that checks if `isUploading.value` is already true and returns false early to prevent race conditions from multiple rapid invocations.

Applied to files:

  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/platform/assets/components/UploadModelDialog.vue
  • src/platform/assets/components/UploadModelFooter.vue
📚 Learning: 2025-12-09T03:39:54.501Z
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.

Applied to files:

  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
📚 Learning: 2025-12-13T11:03:11.264Z
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.

Applied to files:

  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
📚 Learning: 2025-12-17T00:40:09.635Z
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).

Applied to files:

  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
📚 Learning: 2025-12-30T22:22:33.836Z
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().

Applied to files:

  • src/platform/assets/composables/useUploadModelWizard.ts
  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
📚 Learning: 2025-12-09T04:35:43.971Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/locales/en/main.json:774-780
Timestamp: 2025-12-09T04:35:43.971Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, locale files other than `src/locales/en/main.json` are generated automatically on every release. Developers only need to add English (en) key/values in `src/locales/en/main.json` when making PRs; manual updates to other locale files (fr, ja, ko, ru, zh, zh-TW, es, ar, tr, etc.) are not required and should not be suggested in reviews.

Applied to files:

  • src/locales/en/main.json
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`

Applied to files:

  • src/locales/en/main.json
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Applied to files:

  • src/locales/en/main.json
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Replace PrimeVue Steps component with Stepper without panels

Applied to files:

  • src/platform/assets/components/UploadModelFooter.vue
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.vue : Implement proper props and emits definitions

Applied to files:

  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Prefer emit/event-name for state changes over other communication patterns

Applied to files:

  • src/platform/assets/components/AssetGrid.vue
  • src/platform/assets/components/AssetCard.vue
📚 Learning: 2026-01-08T21:44:05.435Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7897
File: src/stores/assetDownloadStore.ts:117-117
Timestamp: 2026-01-08T21:44:05.435Z
Learning: In src/stores/assetDownloadStore.ts, the api.addEventListener('asset_download', handleAssetDownload) call at module level is intentional and should persist for the application lifetime since it's a singleton Pinia store managing global WebSocket events.

Applied to files:

  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
📚 Learning: 2026-01-09T23:59:04.777Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7926
File: src/stores/assetDownloadStore.ts:101-126
Timestamp: 2026-01-09T23:59:04.777Z
Learning: In src/stores/assetDownloadStore.ts, the empty catch block in pollSingleDownload within pollStaleDownloads is intentional. Do not suggest adding error logging or error handling for polling failures in this function; treat it as a deliberate swallow of errors to avoid affecting poll logic or user-visible behavior. Reviewers should refrain from proposing fixes to this catch block for this function.

Applied to files:

  • src/stores/assetDownloadStore.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/stores/**/*.{ts,tsx} : Maintain clear public interfaces and restrict extension access in stores

Applied to files:

  • src/stores/assetDownloadStore.ts
  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/stores/**/*.{ts,tsx} : Use TypeScript for type safety in state management stores

Applied to files:

  • src/stores/assetDownloadStore.ts
  • src/stores/assetsStore.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Define proper props and emits definitions in Vue components

Applied to files:

  • src/platform/assets/components/AssetCard.vue
📚 Learning: 2026-01-09T23:59:06.942Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7926
File: src/stores/assetDownloadStore.ts:101-126
Timestamp: 2026-01-09T23:59:06.942Z
Learning: In src/stores/assetDownloadStore.ts, the empty catch block in pollSingleDownload within pollStaleDownloads is intentional. Do not suggest adding error logging or handling for polling failures in this function.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
  • src/stores/assetsStore.ts
📚 Learning: 2025-12-10T03:09:13.807Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7303
File: src/components/topbar/CurrentUserPopover.test.ts:199-205
Timestamp: 2025-12-10T03:09:13.807Z
Learning: In test files, prefer selecting or asserting on accessible properties (text content, aria-label, role, accessible name) over data-testid attributes. This ensures tests validate actual user-facing behavior and accessibility, reducing reliance on implementation details like test IDs.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
📚 Learning: 2025-12-30T01:31:04.927Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7797
File: tests-ui/tests/lib/litegraph/src/widgets/ComboWidget.test.ts:648-648
Timestamp: 2025-12-30T01:31:04.927Z
Learning: In Vitest v4, when mocking functions that may be called as constructors (using new), the mock implementation must use function() or class syntax rather than an arrow function. Arrow mocks can cause '<anonymous> is not a constructor' errors. This is a breaking change from Vitest v3 where mocks could use an arrow function. Apply this guideline to test files that mock constructor-like calls (e.g., in tests under tests-ui, such as ComboWidget.test.ts) and ensure mock implementations are defined with function() { ... } or class { ... } to preserve constructor behavior.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
📚 Learning: 2026-01-08T02:40:15.482Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7894
File: src/renderer/extensions/vueNodes/widgets/components/WidgetToggleSwitch.test.ts:11-14
Timestamp: 2026-01-08T02:40:15.482Z
Learning: In TypeScript test files (e.g., any test under src), avoid duplicating interface/type definitions. Import real type definitions from the component modules under test and reference them directly, so there is a single source of truth and to prevent type drift. This improves maintainability and consistency across tests.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
📚 Learning: 2026-01-09T02:07:54.558Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7898
File: src/composables/usePaste.test.ts:248-248
Timestamp: 2026-01-09T02:07:54.558Z
Learning: In test files (e.g., any .test.ts or .test.tsx under src/...), when you create mock objects that partially implement an interface (such as LGraphNode), prefer casting with as Partial<InterfaceType> as InterfaceType rather than as any or as unknown as InterfaceType. This makes the incomplete implementation explicit while preserving type safety, improving readability and maintainability of tests.

Applied to files:

  • src/stores/assetDownloadStore.test.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to src/**/*.vue : Use Tailwind utility classes instead of `dark:` variant - use semantic values from `style.css` theme (e.g., `bg-node-component-surface`)

Applied to files:

  • src/platform/assets/components/UploadModelUrlInput.vue
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.{vue,css} : Use the correct tokens from style.css in the design system package

Applied to files:

  • src/platform/assets/components/UploadModelUrlInput.vue
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Replace PrimeVue InlineMessage component with Message

Applied to files:

  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Replace PrimeVue OverlayPanel component with Popover

Applied to files:

  • src/platform/assets/components/UploadModelConfirmation.vue
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.vue : Utilize ref and reactive for reactive state

Applied to files:

  • src/stores/assetsStore.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to src/**/*.{ts,vue} : Use `ref` for reactive state, `computed()` for derived values, and `watch`/`watchEffect` for side effects in Composition API

Applied to files:

  • src/stores/assetsStore.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to src/**/*.{ts,vue} : Leverage VueUse functions for performance-enhancing composables

Applied to files:

  • src/stores/assetsStore.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Use ref/reactive for state management in Vue 3 Composition API

Applied to files:

  • src/stores/assetsStore.ts
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Leverage VueUse functions for performance-enhancing styles

Applied to files:

  • src/stores/assetsStore.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Implement computed() for derived state in Vue 3 Composition API

Applied to files:

  • src/stores/assetsStore.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to src/**/*.{ts,vue} : Avoid using `ref` with `watch` if a `computed` would suffice - minimize refs and derived state

Applied to files:

  • src/stores/assetsStore.ts
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.vue : Use Suspense for async components

Applied to files:

  • src/stores/assetsStore.ts
📚 Learning: 2026-01-10T00:24:17.695Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T00:24:17.695Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Avoid mutable state - prefer immutability and assignment at point of declaration

Applied to files:

  • src/stores/assetsStore.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Implement cleanup for async operations in Vue components

Applied to files:

  • src/stores/assetsStore.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: deploy-and-comment
  • GitHub Check: setup
  • GitHub Check: test
  • GitHub Check: collect
  • GitHub Check: lint-and-format
🔇 Additional comments (21)
src/platform/assets/components/UploadModelConfirmation.vue (2)

7-9: LGTM!

The padding adjustment provides appropriate spacing for the model preview container.


24-32: No action required. The icon class icon-[lucide--circle-question-mark] references a valid Lucide icon. Both circle-help and circle-question-mark are legitimate Lucide icons; while the codebase uses both interchangeably, the icon used here is not non-existent.

Likely an incorrect or invalid review comment.

src/platform/assets/components/UploadModelUrlInputCivitai.vue (1)

14-14: LGTM! Styling improvements enhance link visibility and text readability.

The addition of underline to anchor elements improves link discoverability, and the font size increase from text-xs to text-sm improves consistency across the upload UI.

Also applies to: 54-54, 61-61, 70-70

src/platform/assets/components/UploadModelUrlInput.vue (1)

23-23: LGTM! Consistent link styling across upload components.

The styling changes align with the parallel updates in UploadModelUrlInputCivitai.vue, ensuring visual consistency across the upload flow.

Also applies to: 38-38, 61-61

src/platform/assets/composables/useUploadModelWizard.ts (2)

319-320: Appropriate public API extension.

Exposing resetWizard in the return object enables the "Import Another" workflow as intended.


287-299: No action needed — resetWizard is correctly guarded by UI state.

The resetWizard function is safe. The "Import Another" button is only visible when currentStep === 3 and upload has already completed (status is 'success' or 'processing'). By that time, the finally block in uploadModel() has already set isUploading to false, so resetWizard is never called during an active upload. The UI structure prevents the race condition scenario.

src/platform/assets/components/AssetBrowserModal.vue (1)

60-60: LGTM! Proper event wiring for asset deletion refresh.

The @asset-deleted="refreshAssets" binding correctly triggers a cache refresh when an asset is deleted, ensuring the grid updates to reflect the deletion. This aligns with the PR objective to fix the deletion UI behavior.

src/locales/en/main.json (1)

2314-2314: LGTM! Locale key properly added.

The importAnother key is correctly placed within the assetBrowser namespace and follows the existing naming conventions.

src/platform/assets/components/AssetGrid.vue (1)

38-38: LGTM! Clean event propagation for deletion flow.

The deletion event is properly forwarded from AssetCard to parent components via the new assetDeleted emit. This aligns with the PR objective of removing local deletedLocal state in favor of event-based communication. Based on learnings, this follows the preferred pattern of using emit/event-name for state changes.

Also applies to: 58-61

src/stores/assetDownloadStore.test.ts (2)

123-127: LGTM! Assertion updated for new API shape.

The test correctly validates the new lastCompletedDownload structure with taskId and modelType properties using toMatchObject for partial matching.


129-142: LGTM! Valuable test for out-of-order WebSocket messages.

This test covers an important edge case where a completed message arrives before progress updates. It properly validates that:

  1. The download remains finished (not reactivated by late progress messages)
  2. finishedDownloads contains the completed entry
  3. lastCompletedDownload reflects the correct modelType

This ensures robustness against network reordering.

src/platform/assets/components/UploadModelDialog.vue (1)

51-51: LGTM! Clean integration of the "import another" workflow.

The resetWizard function is properly destructured from the composable and wired to handle the import-another event from the footer. This enables users to start a new import flow after completing one.

Also applies to: 89-91

src/platform/assets/components/UploadModelFooter.vue (2)

83-109: LGTM! Well-structured step-3 controls with proper conditional rendering.

The new UI flow correctly provides both "Import Another" and "Finish/Close" actions when a download succeeds or is processing. The ternary for button label (lines 103-106) appropriately computes a value rather than performing side effects.


149-149: LGTM! Emit definition follows existing patterns.

The importAnother emit is properly typed and matches the function signature style used by other emits in this component.

src/platform/assets/components/AssetCard.vue (2)

141-144: LGTM! Properly typed emit definitions for event-based deletion.

The emit constant is correctly bound, and the new deleted event is properly typed with AssetDisplayItem payload. This enables proper event propagation to parent components.


213-213: LGTM! Event emission replaces local state for deletion.

Emitting the deleted event instead of toggling local state correctly addresses the PR objective of fixing the blank grid cells issue. The parent components (AssetGrid → AssetBrowserModal) can now trigger a proper store refresh to remove the deleted asset from the grid.

src/stores/assetDownloadStore.ts (2)

48-59: LGTM! Clean placeholder initialization with modelType preservation.

The immediate placeholder creation with sensible defaults ensures the download entry exists before WebSocket messages arrive. This handles the out-of-order message scenario mentioned in the PR objectives.


79-91: LGTM! Correct modelType preservation and completion handling.

Preserving modelType from the existing entry (line 80) and only updating lastCompletedDownload when modelType is available (line 85) ensures the state remains consistent even when WebSocket messages arrive out of order.

src/stores/assetsStore.ts (3)

1-4: LGTM! Appropriate use of VueUse whenever.

Replacing watch with whenever is the correct choice here since the callback only needs to execute when lastCompletedDownload becomes truthy. This aligns with the coding guidelines to leverage VueUse functions.


269-327: LGTM! Well-designed per-key caching pattern.

The getModelState factory correctly:

  • Uses shallowReactive for Maps to enable reactivity
  • Lazily creates useAsyncState instances per key
  • Uses isEqual from es-toolkit to avoid unnecessary reactive updates
  • Returns stubs for non-cloud builds

The non-null assertion on line 303 is safe because the key is guaranteed to exist from the preceding set call.


379-413: LGTM! Clean completion handler with concurrent cache refresh.

The whenever watcher correctly:

  • Fires only when lastCompletedDownload becomes truthy (non-null)
  • Refreshes node type caches for all providers of the model type
  • Refreshes tag caches for both the specific model type and "models"
  • Uses Promise.allSettled for fault-tolerant concurrent execution

Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

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

LGTM. Do we need to add the backport labels?

Comment on lines 49 to 58
downloads.value.set(taskId, {
taskId,
modelType,
assetName: '',
bytesTotal: 0,
bytesDownloaded: 0,
progress: 0,
status: 'created',
lastUpdate: Date.now()
})
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this code might benefit from some form of documentation like making it a named variable or a comment. Currently, readers might not understand what it is or the purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great point. WDYT?

// Watch for completed downloads and refresh model caches
watch(
() => assetDownloadStore.completedDownloads.at(-1),
whenever(
Copy link
Contributor

Choose a reason for hiding this comment

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

neat!

watch(
() => assetDownloadStore.completedDownloads.at(-1),
whenever(
() => assetDownloadStore.lastCompletedDownload,
Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense

@DrJKL
Copy link
Contributor Author

DrJKL commented Jan 13, 2026

LGTM. Do we need to add the backport labels?

Yes, but in order. 7969 then 7974

@DrJKL DrJKL merged commit a166ec9 into main Jan 13, 2026
27 checks passed
@DrJKL DrJKL deleted the drjkl/order-out-of branch January 13, 2026 01:57
@DrJKL DrJKL added needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch cloud/1.36 Backport PRs for cloud 1.36 labels Jan 13, 2026
@github-actions
Copy link

⚠️ Backport to cloud/1.36 failed

Reason: Merge conflicts detected during cherry-pick of a166ec9

📄 Conflicting files
src/stores/assetDownloadStore.test.ts
src/stores/assetDownloadStore.ts
🤖 Prompt for AI Agents
Backport PR #7974 (https://github.com/Comfy-Org/ComfyUI_frontend/pull/7974) to cloud/1.36.
Cherry-pick merge commit a166ec91a6e95b6dc4d2d139b929b1d24df5f608 onto new branch
backport-7974-to-cloud-1.36 from origin/cloud/1.36.
Resolve conflicts in: src/stores/assetDownloadStore.test.ts src/stores/assetDownloadStore.ts .
For test snapshots (browser_tests/**/*-snapshots/), accept PR version if
changed in original PR, else keep target. For package.json versions, keep
target branch. For pnpm-lock.yaml, regenerate with pnpm install.
Ask user for non-obvious conflicts.
Create PR titled "[backport cloud/1.36] <original title>" with label "backport".
See .github/workflows/pr-backport.yaml for workflow details.

cc @DrJKL

1 similar comment
@github-actions
Copy link

⚠️ Backport to cloud/1.36 failed

Reason: Merge conflicts detected during cherry-pick of a166ec9

📄 Conflicting files
src/stores/assetDownloadStore.test.ts
src/stores/assetDownloadStore.ts
🤖 Prompt for AI Agents
Backport PR #7974 (https://github.com/Comfy-Org/ComfyUI_frontend/pull/7974) to cloud/1.36.
Cherry-pick merge commit a166ec91a6e95b6dc4d2d139b929b1d24df5f608 onto new branch
backport-7974-to-cloud-1.36 from origin/cloud/1.36.
Resolve conflicts in: src/stores/assetDownloadStore.test.ts src/stores/assetDownloadStore.ts .
For test snapshots (browser_tests/**/*-snapshots/), accept PR version if
changed in original PR, else keep target. For package.json versions, keep
target branch. For pnpm-lock.yaml, regenerate with pnpm install.
Ask user for non-obvious conflicts.
Create PR titled "[backport cloud/1.36] <original title>" with label "backport".
See .github/workflows/pr-backport.yaml for workflow details.

cc @DrJKL

@DrJKL DrJKL added cloud/1.36 Backport PRs for cloud 1.36 needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch and removed needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch cloud/1.36 Backport PRs for cloud 1.36 labels Jan 13, 2026
github-actions bot pushed a commit that referenced this pull request Jan 13, 2026
## Summary

Refactors asset download state management and fixes asset deletion UI
issues.

## Changes

### assetDownloadStore simplification
- Replace `pendingModelTypes` Map with `modelType` stored directly on
`AssetDownload`
- Replace `completedDownloads` array with single `lastCompletedDownload`
ref
- `trackDownload()` now creates a placeholder entry immediately
- Use VueUse `whenever` instead of `watch` for cleaner null handling

### Asset refresh on download completion
- Refresh all relevant caches when a download completes:
  - Node type caches (e.g., "CheckpointLoaderSimple")
  - Tag caches (e.g., "tag:checkpoints")
  - "All Models" cache ("tag:models")

### Asset deletion fix
- Remove local `deletedLocal` state that caused blank grid cells
- Emit `deleted` event from AssetCard → AssetGrid → AssetBrowserModal
- Trigger store refresh on deletion to properly remove the asset from
the grid

## Testing

- Added test for out-of-order websocket message handling
- All existing tests pass

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7974-refactor-simplify-asset-download-state-and-fix-deletion-UI-2e76d73d365081c69bcde9150a0d460c)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Amp <amp@ampcode.com>
@comfy-pr-bot
Copy link
Member

@DrJKL Successfully backported to #7991

@github-actions github-actions bot removed the needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch label Jan 13, 2026
DrJKL added a commit that referenced this pull request Jan 13, 2026
… deletion UI (#7991)

Backport of #7974 to `cloud/1.36`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7991-backport-cloud-1-36-refactor-simplify-asset-download-state-and-fix-deletion-UI-2e76d73d365081ac8a99c9d4c849325f)
by [Unito](https://www.unito.io)

Co-authored-by: Alexander Brown <drjkl@comfy.org>
Co-authored-by: Amp <amp@ampcode.com>
@christian-byrne christian-byrne added needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch cloud/1.37 Backport PRs for cloud 1.37 and removed cloud/1.36 Backport PRs for cloud 1.36 labels Jan 13, 2026
@github-actions
Copy link

@DrJKL Commit a166ec91a6e95b6dc4d2d139b929b1d24df5f608 already exists on branch cloud/1.37. No backport needed.

1 similar comment
@github-actions
Copy link

@DrJKL Commit a166ec91a6e95b6dc4d2d139b929b1d24df5f608 already exists on branch cloud/1.37. No backport needed.

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

Labels

cloud/1.37 Backport PRs for cloud 1.37 needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants