refactor: simplify asset download state and fix deletion UI#7974
refactor: simplify asset download state and fix deletion UI#7974
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019bb4a1-11b8-71df-b523-be21534ad70f Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019bb4a1-11b8-71df-b523-be21534ad70f Co-authored-by: Amp <amp@ampcode.com>
📝 WalkthroughWalkthroughThis 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
Sequence DiagramsequenceDiagram
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
Possibly related PRs
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (13)src/**/*.{vue,ts}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/**/*.ts📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/**/*.{ts,tsx,vue}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
src/**/stores/**/*.{ts,tsx}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
src/**/*.{vue,ts,tsx}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
src/stores/**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
+(tests-ui|src)/**/*.test.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/*.{ts,vue}📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
+(tests-ui|src|browser_tests)/**/*.+(test.ts|spec.ts)📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/{services,composables}/**/*.{ts,tsx}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
src/**/{composables,components}/**/*.{ts,tsx,vue}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
src/**/{components,composables}/**/*.{ts,tsx,vue}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
🧠 Learnings (21)📓 Common learnings📚 Learning: 2026-01-08T21:44:05.435ZApplied to files:
📚 Learning: 2026-01-09T23:59:06.942ZApplied to files:
📚 Learning: 2025-12-09T03:39:54.501ZApplied to files:
📚 Learning: 2025-12-13T11:03:11.264ZApplied to files:
📚 Learning: 2025-12-17T00:40:09.635ZApplied to files:
📚 Learning: 2025-12-30T22:22:33.836ZApplied to files:
📚 Learning: 2025-12-10T03:09:13.807ZApplied to files:
📚 Learning: 2025-12-30T01:31:04.927ZApplied to files:
📚 Learning: 2026-01-08T02:40:15.482ZApplied to files:
📚 Learning: 2026-01-09T02:07:54.558ZApplied to files:
📚 Learning: 2025-12-11T12:25:15.470ZApplied to files:
📚 Learning: 2026-01-12T17:39:27.738ZApplied to files:
📚 Learning: 2026-01-09T23:59:04.777ZApplied to files:
📚 Learning: 2025-12-05T06:11:09.383ZApplied to files:
📚 Learning: 2025-12-09T21:40:19.792ZApplied to files:
📚 Learning: 2025-12-22T21:36:16.031ZApplied to files:
📚 Learning: 2025-12-09T03:50:03.127ZApplied to files:
📚 Learning: 2025-12-22T21:36:46.909ZApplied to files:
📚 Learning: 2025-12-10T03:09:19.636ZApplied to files:
📚 Learning: 2026-01-06T19:17:12.355ZApplied to files:
⏰ 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)
🔇 Additional comments (7)
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. Comment |
🎭 Playwright Tests:
|
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/13/2026, 01:26:53 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.32 MB (baseline 3.32 MB) • 🔴 +236 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 1.04 MB (baseline 1.04 MB) • 🔴 +110 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.63 kB (baseline 6.63 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 372 kB (baseline 372 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 200 kB (baseline 200 kB) • 🔴 +24 BReusable component library chunks
Status: 8 added / 8 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 1.41 kB (baseline 1.41 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 9.19 MB (baseline 9.19 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 5.25 MB (baseline 5.25 MB) • ⚪ 0 BBundles that do not match a named category
Status: 16 added / 16 removed |
There was a problem hiding this comment.
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
resultsarray includes bothnodeTypeUpdatesandtagUpdates. 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
📒 Files selected for processing (13)
src/locales/en/main.jsonsrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/composables/useUploadModelWizard.tssrc/stores/assetDownloadStore.test.tssrc/stores/assetDownloadStore.tssrc/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 insrc/locales/en/main.json
Use Tailwind utility classes instead ofdark:variant - use semantic values fromstyle.csstheme (e.g.,bg-node-component-surface)
Usecn()utility from@/utils/tailwindUtilfor merging Tailwind class names instead of:class="[]"or hardcoding
Never use!importantor!Tailwind prefix - fix interfering classes instead
Use Tailwind fraction utilities instead of arbitrary percentage values (e.g.,w-4/5instead ofw-[80%])
Use TypeScript Vue 3.5 style default prop declaration with reactive props destructuring - avoidwithDefaultsor runtime props
PreferdefineModelover separately defining a prop and emit for v-model bindings
Define slots via template usage, not viadefineSlots
Use same-name shorthand for slot prop bindings (e.g.,:isExpandedinstead 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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/composables/useUploadModelWizard.tssrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/stores/assetDownloadStore.tssrc/platform/assets/components/AssetCard.vuesrc/stores/assetDownloadStore.test.tssrc/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/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 separateimport typestatements instead of inlinetypein mixed imports
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, 80-character width
Sort and group imports by plugin, runpnpm formatbefore committing
Never useanytype - use proper TypeScript types
Never useas anytype 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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/composables/useUploadModelWizard.tssrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/stores/assetDownloadStore.tssrc/platform/assets/components/AssetCard.vuesrc/stores/assetDownloadStore.test.tssrc/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/composables/useUploadModelWizard.tssrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/composables/useUploadModelWizard.tssrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/stores/assetDownloadStore.tssrc/platform/assets/components/AssetCard.vuesrc/stores/assetDownloadStore.test.tssrc/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/composables/useUploadModelWizard.tssrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/UploadModelConfirmation.vue
src/**/*.{ts,vue}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,vue}: Usereffor reactive state,computed()for derived values, andwatch/watchEffectfor side effects in Composition API
Avoid usingrefwithwatchif acomputedwould suffice - minimize refs and derived state
Useprovide/injectfor 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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/composables/useUploadModelWizard.tssrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/stores/assetDownloadStore.tssrc/platform/assets/components/AssetCard.vuesrc/stores/assetDownloadStore.test.tssrc/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/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 usingvue-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.tssrc/stores/assetDownloadStore.tssrc/stores/assetDownloadStore.test.tssrc/stores/assetsStore.ts
src/**/{services,composables}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/{services,composables}/**/*.{ts,tsx}: Useapi.apiURL()for backend endpoints instead of constructing URLs directly
Useapi.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.tssrc/stores/assetDownloadStore.tssrc/stores/assetDownloadStore.test.tssrc/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.tssrc/stores/assetDownloadStore.test.tssrc/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.tssrc/stores/assetDownloadStore.test.tssrc/stores/assetsStore.ts
+(tests-ui|src)/**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
+(tests-ui|src)/**/*.test.ts: Unit and component tests belong intests-ui/orsrc/**/*.test.tsusing 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; usevi.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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/composables/useUploadModelWizard.tssrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/stores/assetDownloadStore.tssrc/platform/assets/components/AssetCard.vuesrc/stores/assetDownloadStore.test.tssrc/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/platform/assets/components/AssetCard.vuesrc/platform/assets/components/UploadModelUrlInput.vuesrc/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.vuesrc/platform/assets/components/UploadModelUrlInputCivitai.vuesrc/platform/assets/composables/useUploadModelWizard.tssrc/platform/assets/components/UploadModelDialog.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/AssetGrid.vuesrc/stores/assetDownloadStore.tssrc/platform/assets/components/AssetCard.vuesrc/stores/assetDownloadStore.test.tssrc/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/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.tssrc/platform/assets/components/UploadModelDialog.vuesrc/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.tssrc/stores/assetDownloadStore.tssrc/stores/assetDownloadStore.test.tssrc/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.tssrc/stores/assetDownloadStore.tssrc/stores/assetDownloadStore.test.tssrc/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.tssrc/stores/assetDownloadStore.tssrc/stores/assetDownloadStore.test.tssrc/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.tssrc/stores/assetDownloadStore.tssrc/stores/assetDownloadStore.test.tssrc/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.vuesrc/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.vuesrc/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.tssrc/stores/assetDownloadStore.test.tssrc/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.tssrc/stores/assetDownloadStore.test.tssrc/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.tssrc/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.tssrc/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 classicon-[lucide--circle-question-mark]references a valid Lucide icon. Bothcircle-helpandcircle-question-markare 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
underlineto anchor elements improves link discoverability, and the font size increase fromtext-xstotext-smimproves 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
resetWizardin the return object enables the "Import Another" workflow as intended.
287-299: No action needed — resetWizard is correctly guarded by UI state.The
resetWizardfunction is safe. The "Import Another" button is only visible whencurrentStep === 3and upload has already completed (status is 'success' or 'processing'). By that time, thefinallyblock inuploadModel()has already setisUploadingto false, soresetWizardis 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
importAnotherkey is correctly placed within theassetBrowsernamespace 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
AssetCardto parent components via the newassetDeletedemit. This aligns with the PR objective of removing localdeletedLocalstate 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
lastCompletedDownloadstructure withtaskIdandmodelTypeproperties usingtoMatchObjectfor 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:
- The download remains finished (not reactivated by late progress messages)
finishedDownloadscontains the completed entrylastCompletedDownloadreflects the correctmodelTypeThis ensures robustness against network reordering.
src/platform/assets/components/UploadModelDialog.vue (1)
51-51: LGTM! Clean integration of the "import another" workflow.The
resetWizardfunction is properly destructured from the composable and wired to handle theimport-anotherevent 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
importAnotheremit 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
emitconstant is correctly bound, and the newdeletedevent is properly typed withAssetDisplayItempayload. This enables proper event propagation to parent components.
213-213: LGTM! Event emission replaces local state for deletion.Emitting the
deletedevent 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
modelTypefrom the existing entry (line 80) and only updatinglastCompletedDownloadwhenmodelTypeis 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 VueUsewhenever.Replacing
watchwithwheneveris the correct choice here since the callback only needs to execute whenlastCompletedDownloadbecomes truthy. This aligns with the coding guidelines to leverage VueUse functions.
269-327: LGTM! Well-designed per-key caching pattern.The
getModelStatefactory correctly:
- Uses
shallowReactivefor Maps to enable reactivity- Lazily creates
useAsyncStateinstances per key- Uses
isEqualfrom 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
setcall.
379-413: LGTM! Clean completion handler with concurrent cache refresh.The
wheneverwatcher correctly:
- Fires only when
lastCompletedDownloadbecomes 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.allSettledfor fault-tolerant concurrent execution
christian-byrne
left a comment
There was a problem hiding this comment.
LGTM. Do we need to add the backport labels?
src/stores/assetDownloadStore.ts
Outdated
| downloads.value.set(taskId, { | ||
| taskId, | ||
| modelType, | ||
| assetName: '', | ||
| bytesTotal: 0, | ||
| bytesDownloaded: 0, | ||
| progress: 0, | ||
| status: 'created', | ||
| lastUpdate: Date.now() | ||
| }) |
There was a problem hiding this comment.
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.
| // Watch for completed downloads and refresh model caches | ||
| watch( | ||
| () => assetDownloadStore.completedDownloads.at(-1), | ||
| whenever( |
| watch( | ||
| () => assetDownloadStore.completedDownloads.at(-1), | ||
| whenever( | ||
| () => assetDownloadStore.lastCompletedDownload, |
Yes, but in order. 7969 then 7974 |
|
1 similar comment
|
## 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>
… 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>
|
@DrJKL Commit |
1 similar comment
|
@DrJKL Commit |
Summary
Refactors asset download state management and fixes asset deletion UI issues.
Changes
assetDownloadStore simplification
pendingModelTypesMap withmodelTypestored directly onAssetDownloadcompletedDownloadsarray with singlelastCompletedDownloadreftrackDownload()now creates a placeholder entry immediatelywheneverinstead ofwatchfor cleaner null handlingAsset refresh on download completion
Asset deletion fix
deletedLocalstate that caused blank grid cellsdeletedevent from AssetCard → AssetGrid → AssetBrowserModalTesting
┆Issue is synchronized with this Notion page by Unito