Skip to content

Conversation

@huntcsg
Copy link
Contributor

@huntcsg huntcsg commented Dec 20, 2025

Summary

Add support for the new effective_balance_micros field to show users their effective balance accounting for pending charges.

Changes

  • What: Update balance display components to use effective_balance_micros (with fallback to amount_micros for backwards compatibility)
  • Types: Add pending_charges_micros and effective_balance_micros to GetCustomerBalance response type in registry-types

Review Focus

  • The fallback pattern ensures backwards compatibility if the API doesn't return the new field
  • The effective_balance_micros can be negative when pending charges exceed the available balance

┆Issue is synchronized with this Notion page by Unito

@huntcsg huntcsg requested review from a team and pythongosssss as code owners December 20, 2025 02:16
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Dec 20, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

📝 Walkthrough

Walkthrough

Updates balance display logic in UserCredit and CurrentUserPopover components to prefer effective_balance_micros when available, with fallbacks to amount_micros then zero. Adds test coverage verifying this fallback chain across multiple scenarios.

Changes

Cohort / File(s) Summary
UserCredit component
src/components/common/UserCredit.vue, src/components/common/UserCredit.test.ts
Modified balance calculations to use effective_balance_micros as primary source with fallbacks to amount_micros then 0. Added comprehensive unit tests for fallback chain behavior, loading states, and edge cases (zero, negative, missing values).
CurrentUserPopover component
src/components/topbar/CurrentUserPopover.vue, src/components/topbar/CurrentUserPopover.test.ts
Updated balance retrieval to apply the same fallback chain (effective_balance_microsamount_micros → 0). Refactored test suite with hoisted mock state for per-test balance manipulation and added dedicated test cases for effective_balance_micros handling scenarios.

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch new

📜 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 6d8a117 and 454aef5.

📒 Files selected for processing (4)
  • src/components/common/UserCredit.test.ts (1 hunks)
  • src/components/common/UserCredit.vue (2 hunks)
  • src/components/topbar/CurrentUserPopover.test.ts (3 hunks)
  • src/components/topbar/CurrentUserPopover.vue (1 hunks)
🧰 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

src/**/*.{vue,ts}: Avoid using ref and watch together - use computed instead if possible
Do not add ref if a prop would suffice; do not add computed if the ref/prop directly would work; use watch only when computed won't accomplish the goal
Leverage VueUse functions for performance-enhancing styles

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/**/*.ts

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

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

src/**/*.ts: Extract complex type definitions that are inlined in multiple related places - name them for reuse
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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}: ESLint rules: Vue + TS rules, no floating promises, unused imports disallowed, i18n raw text restrictions in templates
Use es-toolkit for utility functions
Avoid mutable state - prefer immutability and assignment at point of declaration
Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/**/{composables,components}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Clean up subscriptions in state management to prevent memory leaks

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/components/**/*.{vue,ts,js}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,ts,js}: Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners
Use useIntersectionObserver for visibility detection instead of custom scroll handlers
Use vue-i18n for ALL UI strings

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/**/*.{js,ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript exclusively - no new JavaScript files

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/**/*.{ts,tsx,vue,js}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx,vue,js}: Indent with 2 spaces, use single quotes, no trailing semicolons, line width 80 - see .prettierrc
Sort and group imports by plugin, run pnpm format before committing

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not use function expressions - use function declarations instead when possible

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
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: Vue 3 SFCs must use Composition API only - no Options API
Use <script setup lang="ts"> for component logic
Use Tailwind 4 utility classes for styling - avoid <style> blocks
Use cn() utility from @/utils/tailwindUtil to merge Tailwind class names - never use :class="[]" syntax
Never use the dark: Tailwind variant - use semantic values from style.css theme instead (e.g., bg-node-component-surface)
Use Vue 3.5+ TypeScript style default prop declaration with reactive destructuring - prefer useModel to prop/emit pairs, do not use withDefaults
Do not import Vue macros unnecessarily
Use vue-i18n in composition API for string literals - place translation entries in src/locales/en/main.json
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Avoid new usage of PrimeVue components

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/components/**/*.vue

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.vue: Use setup() function in Vue 3 Composition API
Destructure props using Vue 3.5 style in Vue components
Use ref/reactive for state management in Vue 3 Composition API
Implement computed() for derived state in Vue 3 Composition API
Use provide/inject for dependency injection in Vue components
Prefer emit/@event-name for state changes over other communication patterns
Use defineExpose only for imperative operations (such as form.validate(), modal.open())
Replace PrimeVue Dropdown component with Select
Replace PrimeVue OverlayPanel component with Popover
Replace PrimeVue Calendar component with DatePicker
Replace PrimeVue InputSwitch component with ToggleSwitch
Replace PrimeVue Sidebar component with Drawer
Replace PrimeVue Chips component with AutoComplete with multiple enabled
Replace PrimeVue TabMenu component with Tabs without panels
Replace PrimeVue Steps component with Stepper without panels
Replace PrimeVue InlineMessage component with Message
Extract complex conditionals to computed properties
Implement cleanup for async operations in Vue components
Use lifecycle hooks: onMounted, onUpdated in Vue 3 Composition API
Use Teleport/Suspense when needed for component rendering
Define proper props and emits definitions in Vue components

Vue components must be named in PascalCase (e.g., MenuHamburger.vue)

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/components/**/*.{vue,css}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,css}: Use Tailwind CSS only for styling (no custom CSS)
Use the correct tokens from style.css in the design system package

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
🧠 Learnings (28)
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : For Component testing, use Vue Test Utils and follow advice about making components easy to test

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Write tests for all changes, especially bug fixes to catch future regressions

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Aim for behavioral coverage of critical and new features

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : For mocking, leverage Vitest's utilities where possible

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Keep module mocks contained - do not use global mutable state within test files, use `vi.hoisted()` if necessary

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Unit/Component test files must use pattern `**/*.test.ts`

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Use existing test utilities rather than writing custom utilities

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Do not write tests that just test the mocks - ensure tests fail when code behaves unexpectedly

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Be parsimonious in testing - do not write redundant tests

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Check tests-ui/README.md for test guidelines

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Mocks should be cleanly written and easy to understand, with reusable mocks where possible

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Do not write change detector tests - do not just assert that defaults are certain values

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Follow existing test patterns in the codebase

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Always prefer vitest mock functions over writing verbose manual mocks

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.vue
📚 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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
📚 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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
📚 Learning: 2025-12-18T16:03:02.066Z
Learnt from: henrikvilhelmberglund
Repo: Comfy-Org/ComfyUI_frontend PR: 7617
File: src/components/actionbar/ComfyActionbar.vue:301-308
Timestamp: 2025-12-18T16:03:02.066Z
Learning: In the ComfyUI frontend queue system, useQueuePendingTaskCountStore().count indicates the number of tasks in the queue, where count = 1 means a single active/running task and count > 1 means there are pending tasks in addition to the active task. Therefore, in src/components/actionbar/ComfyActionbar.vue, enable the 'Clear Pending Tasks' button only when count > 1 to avoid clearing the currently running task. The active task should be canceled using the 'Cancel current run' button instead. This rule should be enforced via a conditional check on the queue count, with appropriate disabled/aria-disabled states for accessibility, and tests should verify behavior for count = 1 and count > 1.

Applied to files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
🧬 Code graph analysis (1)
src/components/topbar/CurrentUserPopover.test.ts (1)
src/base/credits/comfyCredits.ts (1)
  • formatCreditsFromCents (73-82)
⏰ 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: setup
  • GitHub Check: lint-and-format
  • GitHub Check: test
  • GitHub Check: collect
🔇 Additional comments (5)
src/components/topbar/CurrentUserPopover.vue (1)

178-181: LGTM! Fallback chain correctly implements backwards compatibility.

The balance calculation properly prefers effective_balance_micros when available, falls back to amount_micros, and finally to 0. This ensures the component displays the effective balance (accounting for pending charges) while maintaining compatibility with older API responses.

src/components/common/UserCredit.vue (2)

45-48: LGTM! Consistent fallback pattern for balance display.

The balance calculation in formattedBalance correctly implements the fallback chain, matching the pattern in CurrentUserPopover.vue.


57-60: LGTM! Credits-only display uses the same fallback logic.

The formattedCreditsOnly computation mirrors the fallback pattern in formattedBalance, ensuring consistent balance handling across both display modes.

src/components/topbar/CurrentUserPopover.test.ts (2)

72-84: LGTM! Proper use of hoisted state for test isolation.

The hoisted mockAuthStoreState enables clean per-test manipulation of balance data while maintaining proper test isolation.


321-418: Excellent test coverage for effective_balance_micros handling!

The test suite comprehensively validates all scenarios:

  • Positive, zero, and negative effective_balance_micros values
  • Fallback to amount_micros when effective_balance_micros is missing
  • Fallback to 0 when both fields are missing

The tests verify both the exact cents parameter passed to formatCreditsFromCents and the rendered output, ensuring robust validation of the fallback behavior.


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 Dec 20, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 12/20/2025, 05:34:16 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Dec 20, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 12/20/2025, 05:43:19 AM UTC

📈 Summary

  • Total Tests: 505
  • Passed: 492 ✅
  • Failed: 0
  • Flaky: 5 ⚠️
  • Skipped: 8 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 480 / ❌ 0 / ⚠️ 5 / ⏭️ 8
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 9 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@github-actions
Copy link

github-actions bot commented Dec 20, 2025

Bundle Size Report

Summary

  • Raw size: 16.6 MB baseline 16.6 MB — 🔴 +141 B
  • Gzip: 3.37 MB baseline 3.37 MB — 🔴 +33 B
  • Brotli: 2.59 MB baseline 2.59 MB — 🔴 +122 B
  • Bundles: 98 current • 98 baseline • 42 added / 42 removed

Category Glance
App Entry Points 🔴 +94 B (3.21 MB) · Graph Workspace 🔴 +47 B (993 kB) · Vendor & Third-Party ⚪ 0 B (8.46 MB) · Other ⚪ 0 B (3.44 MB) · Panels & Settings ⚪ 0 B (297 kB) · UI Components ⚪ 0 B (185 kB) · + 3 more

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

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-C10nS1Fa.js (new) 2.98 MB 🔴 +2.98 MB 🔴 +628 kB 🔴 +478 kB
assets/index-CkrBk5Nz.js (removed) 2.98 MB 🟢 -2.98 MB 🟢 -628 kB 🟢 -477 kB
assets/index-BbI1CZrw.js (new) 227 kB 🔴 +227 kB 🔴 +48.5 kB 🔴 +39.9 kB
assets/index-wJ4XPLGO.js (removed) 227 kB 🟢 -227 kB 🟢 -48.5 kB 🟢 -39.9 kB
assets/index-CokVhjgM.js (removed) 345 B 🟢 -345 B 🟢 -243 B 🟢 -201 B
assets/index-DEjz18jT.js (new) 345 B 🔴 +345 B 🔴 +245 B 🔴 +230 B

Status: 3 added / 3 removed

Graph Workspace — 993 kB (baseline 993 kB) • 🔴 +47 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-bjWGMvYs.js (new) 993 kB 🔴 +993 kB 🔴 +194 kB 🔴 +148 kB
assets/GraphView-Bt5UyvMn.js (removed) 993 kB 🟢 -993 kB 🟢 -194 kB 🟢 -147 kB

Status: 1 added / 1 removed

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

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-B477QlBQ.js (removed) 6.54 kB 🟢 -6.54 kB 🟢 -2.14 kB 🟢 -1.9 kB
assets/UserSelectView-CUp4_Z5U.js (new) 6.54 kB 🔴 +6.54 kB 🔴 +2.14 kB 🔴 +1.9 kB

Status: 1 added / 1 removed

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

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LegacyCreditsPanel-BEFHZn08.js (new) 21.4 kB 🔴 +21.4 kB 🔴 +5.16 kB 🔴 +4.5 kB
assets/LegacyCreditsPanel-Ctd8DOti.js (removed) 21.4 kB 🟢 -21.4 kB 🟢 -5.16 kB 🟢 -4.51 kB
assets/KeybindingPanel-BouDGMid.js (removed) 13.6 kB 🟢 -13.6 kB 🟢 -3.42 kB 🟢 -3.01 kB
assets/KeybindingPanel-ClmVpT6-.js (new) 13.6 kB 🔴 +13.6 kB 🔴 +3.42 kB 🔴 +3.03 kB
assets/ExtensionPanel-CYQinV-k.js (removed) 10.8 kB 🟢 -10.8 kB 🟢 -2.57 kB 🟢 -2.24 kB
assets/ExtensionPanel-DvJI04Yh.js (new) 10.8 kB 🔴 +10.8 kB 🔴 +2.57 kB 🔴 +2.24 kB
assets/AboutPanel-BKJuA3R_.js (removed) 9.16 kB 🟢 -9.16 kB 🟢 -2.46 kB 🟢 -2.2 kB
assets/AboutPanel-JzUdhmGF.js (new) 9.16 kB 🔴 +9.16 kB 🔴 +2.46 kB 🔴 +2.21 kB
assets/ServerConfigPanel-A-fz4ShW.js (new) 7.07 kB 🔴 +7.07 kB 🔴 +1.98 kB 🔴 +1.76 kB
assets/ServerConfigPanel-DenrXFH9.js (removed) 7.07 kB 🟢 -7.07 kB 🟢 -1.98 kB 🟢 -1.76 kB
assets/UserPanel-B2fIAmqA.js (new) 6.23 kB 🔴 +6.23 kB 🔴 +1.72 kB 🔴 +1.5 kB
assets/UserPanel-DvQdKVSK.js (removed) 6.23 kB 🟢 -6.23 kB 🟢 -1.72 kB 🟢 -1.5 kB
assets/settings-BhbWhsRg.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BvFz-TmQ.js 33.1 kB 33.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BxYnTA2y.js 21.5 kB 21.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-C6bMjAne.js 27.1 kB 27.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-C7Yhp7H7.js 24 kB 24 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CsnOn8G0.js 25.7 kB 25.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-D5BGNZ7M.js 24.8 kB 24.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-D7k3huHm.js 25 kB 25 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DamkILzl.js 26.4 kB 26.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-s1k0gw1Y.js 20.9 kB 20.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

UI Components — 185 kB (baseline 185 kB) • ⚪ 0 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/Load3D.vue_vue_type_script_setup_true_lang-BUbAcHFN.js (new) 53.5 kB 🔴 +53.5 kB 🔴 +8.45 kB 🔴 +7.25 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-CstA2wQE.js (removed) 53.5 kB 🟢 -53.5 kB 🟢 -8.45 kB 🟢 -7.25 kB
assets/LazyImage.vue_vue_type_script_setup_true_lang-BUX5GCl-.js (removed) 50 kB 🟢 -50 kB 🟢 -11 kB 🟢 -9.63 kB
assets/LazyImage.vue_vue_type_script_setup_true_lang-Dh1MGeHr.js (new) 50 kB 🔴 +50 kB 🔴 +11 kB 🔴 +9.63 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-D7FcgoNN.js (removed) 48.8 kB 🟢 -48.8 kB 🟢 -10.5 kB 🟢 -9.13 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-FaLzfWFK.js (new) 48.8 kB 🔴 +48.8 kB 🔴 +10.5 kB 🔴 +9.13 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-B7V8mpgW.js (new) 14.3 kB 🔴 +14.3 kB 🔴 +3.74 kB 🔴 +3.29 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-B9uyaUE8.js (removed) 14.3 kB 🟢 -14.3 kB 🟢 -3.73 kB 🟢 -3.29 kB
assets/ComfyQueueButton-BN22pRW0.js (removed) 8.45 kB 🟢 -8.45 kB 🟢 -2.47 kB 🟢 -2.2 kB
assets/ComfyQueueButton-DANDS7dX.js (new) 8.45 kB 🔴 +8.45 kB 🔴 +2.47 kB 🔴 +2.19 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-CCL_bHu1.js (new) 3.68 kB 🔴 +3.68 kB 🔴 +1.45 kB 🔴 +1.31 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-D6Lf_72S.js (removed) 3.68 kB 🟢 -3.68 kB 🟢 -1.45 kB 🟢 -1.31 kB
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-B9okKY1i.js (new) 2.14 kB 🔴 +2.14 kB 🔴 +889 B 🔴 +763 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-BZFmgyCD.js (removed) 2.14 kB 🟢 -2.14 kB 🟢 -890 B 🟢 -770 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-C9Rmxz-u.js (removed) 897 B 🟢 -897 B 🟢 -501 B 🟢 -439 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-CFe-JMlY.js (new) 897 B 🔴 +897 B 🔴 +501 B 🔴 +429 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-DymEwRe0.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetButton-U5ly29Pt.js 2.04 kB 2.04 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-_ITE3HQP.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -1.83 kB 🟢 -1.58 kB
assets/keybindingService-Bi61yBtd.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +1.83 kB 🔴 +1.57 kB
assets/audioService-BGjYKxJG.js (removed) 2.2 kB 🟢 -2.2 kB 🟢 -964 B 🟢 -821 B
assets/audioService-D4-PIAT6.js (new) 2.2 kB 🔴 +2.2 kB 🔴 +962 B 🔴 +829 B
assets/serverConfigStore-7JI8VFS2.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-CcKLPSeL.js (new) 1.41 kB 🔴 +1.41 kB 🔴 +650 B 🔴 +548 B
assets/audioUtils-DU_P5eEm.js (removed) 1.41 kB 🟢 -1.41 kB 🟢 -652 B 🟢 -549 B

Status: 1 added / 1 removed

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

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-DaR9dw3X.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-Cf7iqkoX.js 3.86 MB 3.86 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-BIgr9yoj.js 1.96 MB 1.96 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-C1LfRdh4.js 1.37 MB 1.37 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-C1NB2Q_L.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-DSfeuQOV.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 — 3.44 MB (baseline 3.44 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/SubscriptionRequiredDialogContent-BDhtDez4.js (removed) 28 kB 🟢 -28 kB 🟢 -6.34 kB 🟢 -5.5 kB
assets/SubscriptionRequiredDialogContent-CZe2v-jd.js (new) 28 kB 🔴 +28 kB 🔴 +6.34 kB 🔴 +5.49 kB
assets/WidgetRecordAudio-0XtT0GjG.js (removed) 20.4 kB 🟢 -20.4 kB 🟢 -5.24 kB 🟢 -4.63 kB
assets/WidgetRecordAudio-yEjZhihn.js (new) 20.4 kB 🔴 +20.4 kB 🔴 +5.23 kB 🔴 +4.63 kB
assets/AudioPreviewPlayer-CQtIzPMe.js (removed) 13.3 kB 🟢 -13.3 kB 🟢 -3.35 kB 🟢 -2.99 kB
assets/AudioPreviewPlayer-DUZFcp3_.js (new) 13.3 kB 🔴 +13.3 kB 🔴 +3.34 kB 🔴 +2.99 kB
assets/ValueControlPopover-Bm9ljVgS.js (removed) 5.49 kB 🟢 -5.49 kB 🟢 -1.7 kB 🟢 -1.51 kB
assets/ValueControlPopover-cANpYD3j.js (new) 5.49 kB 🔴 +5.49 kB 🔴 +1.7 kB 🔴 +1.51 kB
assets/WidgetGalleria-C27D1Wnv.js (removed) 4.1 kB 🟢 -4.1 kB 🟢 -1.45 kB 🟢 -1.3 kB
assets/WidgetGalleria-CTA05IAr.js (new) 4.1 kB 🔴 +4.1 kB 🔴 +1.44 kB 🔴 +1.31 kB
assets/WidgetColorPicker-CbAY-GJt.js (new) 3.41 kB 🔴 +3.41 kB 🔴 +1.38 kB 🔴 +1.23 kB
assets/WidgetColorPicker-CLyBCkzm.js (removed) 3.41 kB 🟢 -3.41 kB 🟢 -1.38 kB 🟢 -1.23 kB
assets/WidgetTextarea-B1p4jFhC.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.21 kB 🟢 -1.08 kB
assets/WidgetTextarea-DFzzHB_G.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.21 kB 🔴 +1.08 kB
assets/WidgetMarkdown-BDC4f7Fh.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.28 kB 🟢 -1.13 kB
assets/WidgetMarkdown-BYgz_45f.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.28 kB 🔴 +1.13 kB
assets/WidgetAudioUI-cAZmNrdD.js (new) 2.89 kB 🔴 +2.89 kB 🔴 +1.17 kB 🔴 +1.06 kB
assets/WidgetAudioUI-CnL7pLB5.js (removed) 2.89 kB 🟢 -2.89 kB 🟢 -1.16 kB 🟢 -1.06 kB
assets/WidgetInputText-Bsn88OFl.js (new) 1.99 kB 🔴 +1.99 kB 🔴 +920 B 🔴 +844 B
assets/WidgetInputText-D1iy-2SB.js (removed) 1.99 kB 🟢 -1.99 kB 🟢 -917 B 🟢 -842 B
assets/WidgetToggleSwitch-CNIdHTKI.js (new) 1.76 kB 🔴 +1.76 kB 🔴 +834 B 🔴 +735 B
assets/WidgetToggleSwitch-n-Lv97Lo.js (removed) 1.76 kB 🟢 -1.76 kB 🟢 -833 B 🟢 -732 B
assets/MediaImageBottom-DlrUz6ZD.js (new) 1.55 kB 🔴 +1.55 kB 🔴 +735 B 🔴 +642 B
assets/MediaImageBottom-yvuJ88_v.js (removed) 1.55 kB 🟢 -1.55 kB 🟢 -731 B 🟢 -642 B
assets/MediaAudioBottom-DkdG32s-.js (removed) 1.51 kB 🟢 -1.51 kB 🟢 -732 B 🟢 -651 B
assets/MediaAudioBottom-DO6LOZEZ.js (new) 1.51 kB 🔴 +1.51 kB 🔴 +732 B 🔴 +649 B
assets/Media3DBottom-CmDFiMsg.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +730 B 🔴 +646 B
assets/Media3DBottom-np8bVwlH.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -731 B 🟢 -644 B
assets/MediaVideoBottom-b3omN2bE.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -730 B 🟢 -650 B
assets/MediaVideoBottom-BzWrcwSC.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +730 B 🔴 +646 B
assets/Media3DTop-CMY5W-py.js (new) 1.49 kB 🔴 +1.49 kB 🔴 +768 B 🔴 +652 B
assets/Media3DTop-HwgPbkc8.js (removed) 1.49 kB 🟢 -1.49 kB 🟢 -768 B 🟢 -651 B
assets/WidgetSelect-COBBOSaQ.js (removed) 733 B 🟢 -733 B 🟢 -360 B 🟢 -324 B
assets/WidgetSelect-CrjsjDA_.js (new) 733 B 🔴 +733 B 🔴 +361 B 🔴 +319 B
assets/WidgetInputNumber-BsIFgjyK.js (new) 673 B 🔴 +673 B 🔴 +348 B 🔴 +287 B
assets/WidgetInputNumber-DG2ggPPk.js (removed) 673 B 🟢 -673 B 🟢 -347 B 🟢 -286 B
assets/Load3D-BD2fhXLe.js (removed) 424 B 🟢 -424 B 🟢 -267 B 🟢 -224 B
assets/Load3D-ClsjOFfT.js (new) 424 B 🔴 +424 B 🔴 +268 B 🔴 +223 B
assets/WidgetLegacy-BJzEeyuk.js (new) 364 B 🔴 +364 B 🔴 +237 B 🔴 +194 B
assets/WidgetLegacy-Vvyz_eQX.js (removed) 364 B 🟢 -364 B 🟢 -236 B 🟢 -196 B
assets/commands-BWp4HdfU.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CcfGaui5.js 14.4 kB 14.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CisfgZf5.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CkU12Foh.js 13 kB 13 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CoH2DJa6.js 14.2 kB 14.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-COSt-Bjx.js 14.9 kB 14.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DalfIW5f.js 15.9 kB 15.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DfTl0eCm.js 13.5 kB 13.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DwSJL865.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-Zxyx15Vd.js 12.8 kB 12.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BDhxs-bB.js 79.9 kB 79.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BtXVDFw6.js 84.7 kB 84.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Buv6RhU4.js 82.4 kB 82.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CgJ6zvJL.js 97.2 kB 97.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CI9qb0E5.js 112 kB 112 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Cu4LqtW0.js 81.6 kB 81.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Cw9RZWRY.js 89 B 89 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Dm19QY4N.js 92.2 kB 92.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Tihe0h_r.js 71.3 kB 71.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-wPWMutMw.js 70.4 kB 70.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-Dr0afgCA.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-BXa-oKEc.js 1.75 kB 1.75 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-BVdg2b8C.js 2.65 kB 2.65 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-1Vh3MCrN.js 240 kB 240 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-aW9En70v.js 260 kB 260 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BIckSVgU.js 273 kB 273 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BiYpVi7D.js 263 kB 263 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Bw_Jitw_.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CCEXtYfM.js 243 kB 243 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CvmVDWYd.js 323 kB 323 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-D_wreoPJ.js 267 kB 267 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Dz-0ZIBN.js 297 kB 297 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-VZsNmhG7.js 264 kB 264 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-BU__hen8.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-0zJeINY-.js 2.21 kB 2.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: 20 added / 20 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: 1

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88df662 and b71cc9f.

📒 Files selected for processing (4)
  • packages/registry-types/src/comfyRegistryTypes.ts (1 hunks)
  • src/components/common/UserCredit.vue (2 hunks)
  • src/components/topbar/CurrentUserPopover.test.ts (1 hunks)
  • src/components/topbar/CurrentUserPopover.vue (1 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
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: Vue 3 SFCs must use Composition API only - no Options API
Use <script setup lang="ts"> for component logic
Use Tailwind 4 utility classes for styling - avoid <style> blocks
Use cn() utility from @/utils/tailwindUtil to merge Tailwind class names - never use :class="[]" syntax
Never use the dark: Tailwind variant - use semantic values from style.css theme instead (e.g., bg-node-component-surface)
Use Vue 3.5+ TypeScript style default prop declaration with reactive destructuring - prefer useModel to prop/emit pairs, do not use withDefaults
Do not import Vue macros unnecessarily
Use vue-i18n in composition API for string literals - place translation entries in src/locales/en/main.json
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Avoid new usage of PrimeVue components

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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

src/**/*.{vue,ts}: Avoid using ref and watch together - use computed instead if possible
Do not add ref if a prop would suffice; do not add computed if the ref/prop directly would work; use watch only when computed won't accomplish the goal
Leverage VueUse functions for performance-enhancing styles

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
  • src/components/topbar/CurrentUserPopover.test.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}: ESLint rules: Vue + TS rules, no floating promises, unused imports disallowed, i18n raw text restrictions in templates
Use es-toolkit for utility functions
Avoid mutable state - prefer immutability and assignment at point of declaration
Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
  • src/components/topbar/CurrentUserPopover.test.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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
  • src/components/topbar/CurrentUserPopover.test.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
  • src/components/topbar/CurrentUserPopover.test.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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
  • src/components/topbar/CurrentUserPopover.test.ts
src/components/**/*.vue

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.vue: Use setup() function in Vue 3 Composition API
Destructure props using Vue 3.5 style in Vue components
Use ref/reactive for state management in Vue 3 Composition API
Implement computed() for derived state in Vue 3 Composition API
Use provide/inject for dependency injection in Vue components
Prefer emit/@event-name for state changes over other communication patterns
Use defineExpose only for imperative operations (such as form.validate(), modal.open())
Replace PrimeVue Dropdown component with Select
Replace PrimeVue OverlayPanel component with Popover
Replace PrimeVue Calendar component with DatePicker
Replace PrimeVue InputSwitch component with ToggleSwitch
Replace PrimeVue Sidebar component with Drawer
Replace PrimeVue Chips component with AutoComplete with multiple enabled
Replace PrimeVue TabMenu component with Tabs without panels
Replace PrimeVue Steps component with Stepper without panels
Replace PrimeVue InlineMessage component with Message
Extract complex conditionals to computed properties
Implement cleanup for async operations in Vue components
Use lifecycle hooks: onMounted, onUpdated in Vue 3 Composition API
Use Teleport/Suspense when needed for component rendering
Define proper props and emits definitions in Vue components

Vue components must be named in PascalCase (e.g., MenuHamburger.vue)

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/components/**/*.{vue,css}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,css}: Use Tailwind CSS only for styling (no custom CSS)
Use the correct tokens from style.css in the design system package

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
src/components/**/*.{vue,ts,js}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,ts,js}: Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners
Use useIntersectionObserver for visibility detection instead of custom scroll handlers
Use vue-i18n for ALL UI strings

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
  • src/components/topbar/CurrentUserPopover.test.ts
src/**/*.{js,ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript exclusively - no new JavaScript files

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
  • src/components/topbar/CurrentUserPopover.test.ts
src/**/*.{ts,tsx,vue,js}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx,vue,js}: Indent with 2 spaces, use single quotes, no trailing semicolons, line width 80 - see .prettierrc
Sort and group imports by plugin, run pnpm format before committing

Files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
  • src/components/topbar/CurrentUserPopover.test.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: Extract complex type definitions that are inlined in multiple related places - name them for reuse
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not use function expressions - use function declarations instead when possible

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
🧠 Learnings (17)
📚 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/components/topbar/CurrentUserPopover.vue
📚 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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.vue
  • packages/registry-types/src/comfyRegistryTypes.ts
  • src/components/common/UserCredit.vue
  • src/components/topbar/CurrentUserPopover.test.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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.vue
📚 Learning: 2025-12-18T16:03:02.066Z
Learnt from: henrikvilhelmberglund
Repo: Comfy-Org/ComfyUI_frontend PR: 7617
File: src/components/actionbar/ComfyActionbar.vue:301-308
Timestamp: 2025-12-18T16:03:02.066Z
Learning: In the ComfyUI frontend queue system, useQueuePendingTaskCountStore().count indicates the number of tasks in the queue, where count = 1 means a single active/running task and count > 1 means there are pending tasks in addition to the active task. Therefore, in src/components/actionbar/ComfyActionbar.vue, enable the 'Clear Pending Tasks' button only when count > 1 to avoid clearing the currently running task. The active task should be canceled using the 'Cancel current run' button instead. This rule should be enforced via a conditional check on the queue count, with appropriate disabled/aria-disabled states for accessibility, and tests should verify behavior for count = 1 and count > 1.

Applied to files:

  • src/components/topbar/CurrentUserPopover.vue
  • src/components/common/UserCredit.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:

  • packages/registry-types/src/comfyRegistryTypes.ts
  • src/components/topbar/CurrentUserPopover.test.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:

  • packages/registry-types/src/comfyRegistryTypes.ts
  • src/components/topbar/CurrentUserPopover.test.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:

  • packages/registry-types/src/comfyRegistryTypes.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Keep module mocks contained - do not use global mutable state within test files, use `vi.hoisted()` if necessary

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : For mocking, leverage Vitest's utilities where possible

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Write tests for all changes, especially bug fixes to catch future regressions

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.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/components/topbar/CurrentUserPopover.test.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: setup
  • GitHub Check: lint-and-format
  • GitHub Check: test
  • GitHub Check: collect
🔇 Additional comments (3)
packages/registry-types/src/comfyRegistryTypes.ts (1)

12149-12158: LGTM!

The new optional fields are well-documented and correctly typed:

  • Optional (?) fields ensure backwards compatibility when the feature flag is disabled, allowing frontend components to fall back to amount_micros.
  • The JSDoc comments clearly document the feature flag dependency and the possibility of negative values for effective_balance_micros.
src/components/common/UserCredit.vue (1)

45-48: LGTM! Fallback pattern correctly implements backwards compatibility.

The fallback chain (effective_balance_micros ?? amount_micros ?? 0) is correctly implemented in both formattedBalance and formattedCreditsOnly computed properties. The use of nullish coalescing (??) ensures that:

  • A value of 0 for effective_balance_micros is treated as valid and won't fall back
  • Negative values (when pending charges exceed balance) are correctly displayed
  • The pattern maintains backwards compatibility when the API doesn't return the new field

Also applies to: 57-60

src/components/topbar/CurrentUserPopover.vue (1)

178-181: LGTM! Implementation is consistent with UserCredit.vue.

The fallback chain matches the pattern used in UserCredit.vue, ensuring consistent balance display behavior across all components. The implementation correctly:

  • Prefers effective_balance_micros when available
  • Falls back to amount_micros for backwards compatibility
  • Handles negative balances (when pending charges exceed available balance)

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Dec 20, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

These types are generated by manually running this workflow (it will create a PR). Are these new fields in the deployed prod https://api.comfy.org/openapi?

Manually editing them is also fine though, as long as it matches the type that this workflow will set next time it runs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just ran the generate command locally and it brought in a bunch of other changes too!
I think it would be best to just run the workflow and merge, and I will then rebase on main once it's merged, just to be sure it's exactly matching.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Synced in #7659
Will rebase onto that once it's merged.

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: 1

♻️ Duplicate comments (1)
src/components/topbar/CurrentUserPopover.test.ts (1)

321-418: Excellent test coverage addressing previous review feedback!

This comprehensive test suite properly validates:

  • Preference for effective_balance_micros when present (positive, zero, negative)
  • Fallback to amount_micros when effective_balance_micros is missing
  • Fallback to 0 when both fields are missing
  • Exact formatCreditsFromCents invocations with correct cents values
  • Rendered output matches expectations

The tests directly address the backwards compatibility and negative balance concerns raised in the previous review and PR objectives.

This resolves the previous review comment requesting these exact test cases.

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b71cc9f and ef58964.

📒 Files selected for processing (2)
  • src/components/common/UserCredit.test.ts (1 hunks)
  • src/components/topbar/CurrentUserPopover.test.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
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

src/**/*.{vue,ts}: Avoid using ref and watch together - use computed instead if possible
Do not add ref if a prop would suffice; do not add computed if the ref/prop directly would work; use watch only when computed won't accomplish the goal
Leverage VueUse functions for performance-enhancing styles

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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: Extract complex type definitions that are inlined in multiple related places - name them for reuse
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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}: ESLint rules: Vue + TS rules, no floating promises, unused imports disallowed, i18n raw text restrictions in templates
Use es-toolkit for utility functions
Avoid mutable state - prefer immutability and assignment at point of declaration
Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
src/components/**/*.{vue,ts,js}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,ts,js}: Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners
Use useIntersectionObserver for visibility detection instead of custom scroll handlers
Use vue-i18n for ALL UI strings

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
src/**/*.{js,ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript exclusively - no new JavaScript files

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
src/**/*.{ts,tsx,vue,js}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx,vue,js}: Indent with 2 spaces, use single quotes, no trailing semicolons, line width 80 - see .prettierrc
Sort and group imports by plugin, run pnpm format before committing

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not use function expressions - use function declarations instead when possible

Files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
🧠 Learnings (19)
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Write tests for all changes, especially bug fixes to catch future regressions

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Aim for behavioral coverage of critical and new features

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : For mocking, leverage Vitest's utilities where possible

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : For Component testing, use Vue Test Utils and follow advice about making components easy to test

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Use existing test utilities rather than writing custom utilities

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Be parsimonious in testing - do not write redundant tests

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Unit/Component test files must use pattern `**/*.test.ts`

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Keep module mocks contained - do not use global mutable state within test files, use `vi.hoisted()` if necessary

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Always prefer vitest mock functions over writing verbose manual mocks

Applied to files:

  • src/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.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/components/common/UserCredit.test.ts
  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Do not write tests that just test the mocks - ensure tests fail when code behaves unexpectedly

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Mocks should be cleanly written and easy to understand, with reusable mocks where possible

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Follow existing test patterns in the codebase

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
🧬 Code graph analysis (1)
src/components/topbar/CurrentUserPopover.test.ts (1)
src/base/credits/comfyCredits.ts (1)
  • formatCreditsFromCents (73-82)
⏰ 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: setup
  • GitHub Check: lint-and-format
  • GitHub Check: test
  • GitHub Check: collect
🔇 Additional comments (3)
src/components/topbar/CurrentUserPopover.test.ts (2)

72-84: LGTM! Proper use of hoisted state for per-test manipulation.

The hoisted mockAuthStoreState correctly enables dynamic per-test balance configuration while keeping mocks contained, following best practices for Vitest.

Based on learnings, this aligns with the guidance to use vi.hoisted() for per-test mutable state.


178-183: LGTM! Proper test isolation with beforeEach reset.

Resetting the mock state in beforeEach ensures each test starts with clean default values, preventing test interdependencies.

src/components/common/UserCredit.test.ts (1)

126-133: LGTM! Loading state test properly verifies Skeleton rendering.

The test correctly verifies that the Skeleton component is displayed when isFetchingBalance is true.

Comment on lines +72 to +124
describe('effective_balance_micros handling', () => {
it('uses effective_balance_micros when present (positive balance)', () => {
mockBalance.value = {
amount_micros: 200_000,
effective_balance_micros: 150_000,
currency: 'usd'
}

const wrapper = mountComponent()
expect(wrapper.text()).toContain('Credits')
})

it('uses effective_balance_micros when zero', () => {
mockBalance.value = {
amount_micros: 100_000,
effective_balance_micros: 0,
currency: 'usd'
}

const wrapper = mountComponent()
expect(wrapper.text()).toContain('0')
})

it('uses effective_balance_micros when negative', () => {
mockBalance.value = {
amount_micros: 0,
effective_balance_micros: -50_000,
currency: 'usd'
}

const wrapper = mountComponent()
expect(wrapper.text()).toContain('-')
})

it('falls back to amount_micros when effective_balance_micros is missing', () => {
mockBalance.value = {
amount_micros: 100_000,
currency: 'usd'
} as typeof mockBalance.value

const wrapper = mountComponent()
expect(wrapper.text()).toContain('Credits')
})

it('falls back to 0 when both effective_balance_micros and amount_micros are missing', () => {
mockBalance.value = {
currency: 'usd'
} as typeof mockBalance.value

const wrapper = mountComponent()
expect(wrapper.text()).toContain('0')
})
})
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Strengthen assertions to verify actual balance values.

The test assertions only check for generic text presence ('Credits', '0', '-') rather than verifying the actual formatted balance values. This makes the tests less effective at catching incorrect balance calculations.

For example, line 73-82 tests effective_balance_micros (150,000) but only asserts expect(wrapper.text()).toContain('Credits'), which would pass regardless of whether 1500, 2000, or any other value is displayed.

💡 Recommended fix: Add precise balance verification

Consider following the pattern from CurrentUserPopover.test.ts by mocking formatCreditsFromCents and verifying the exact cents value passed:

+// Mock formatCreditsFromCents
+vi.mock('@/base/credits/comfyCredits', () => ({
+  formatCreditsFromCents: vi.fn(({ cents }) => (cents / 100).toString())
+}))
+
+import { formatCreditsFromCents } from '@/base/credits/comfyCredits'

Then in each test, verify both the function call and rendered output:

 it('uses effective_balance_micros when present (positive balance)', () => {
   mockBalance.value = {
     amount_micros: 200_000,
     effective_balance_micros: 150_000,
     currency: 'usd'
   }
 
   const wrapper = mountComponent()
+  expect(formatCreditsFromCents).toHaveBeenCalledWith({
+    cents: 150_000,
+    locale: 'en',
+    numberOptions: {
+      minimumFractionDigits: 0,
+      maximumFractionDigits: 2
+    }
+  })
+  expect(wrapper.text()).toContain('1500')
-  expect(wrapper.text()).toContain('Credits')
 })

Apply similar changes to all test cases in this suite (lines 84-93, 95-104, 106-114, 116-123).

Based on learnings, tests should verify actual behavior to ensure they fail when code behaves unexpectedly.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/components/common/UserCredit.test.ts around lines 72-124, the tests only
assert generic text like 'Credits', '0', or '-' instead of verifying the exact
formatted balance; update each test to mock/stub formatCreditsFromCents (or
whatever formatting util is used), assert it was called with the expected cent
value derived from effective_balance_micros or amount_micros (and 0 when
missing), and assert the rendered output contains the mocked formatted string so
the tests validate the precise balance formatting and fallback behavior.

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: 1

♻️ Duplicate comments (1)
src/components/common/UserCredit.test.ts (1)

72-124: Weak assertions do not verify actual balance values.

The assertions only check for generic text ('Credits', '0', '-') rather than verifying the exact formatted balance. For example, effective_balance_micros: 150_000 should render as '1500', but asserting toContain('Credits') would pass regardless of the actual value displayed.

Follow the stronger pattern from CurrentUserPopover.test.ts:

  1. Mock formatCreditsFromCents to return predictable output
  2. Assert the mock was called with the expected cents value
  3. Assert the rendered output contains the expected formatted string
🔎 Suggested approach
+// Add mock at top of file
+vi.mock('@/base/credits/comfyCredits', () => ({
+  formatCreditsFromCents: vi.fn(({ cents }) => (cents / 100).toString())
+}))
+
+import { formatCreditsFromCents } from '@/base/credits/comfyCredits'

// Then in tests:
 it('uses effective_balance_micros when present (positive balance)', () => {
   mockBalance.value = {
     amount_micros: 200_000,
     effective_balance_micros: 150_000,
     currency: 'usd'
   }

   const wrapper = mountComponent()
+  expect(formatCreditsFromCents).toHaveBeenCalledWith(
+    expect.objectContaining({ cents: 150_000 })
+  )
+  expect(wrapper.text()).toContain('1500')
-  expect(wrapper.text()).toContain('Credits')
 })

Based on learnings: "Do not write tests that just test the mocks - ensure tests fail when code behaves unexpectedly."

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef58964 and 6d8a117.

📒 Files selected for processing (3)
  • packages/registry-types/src/comfyRegistryTypes.ts (12 hunks)
  • src/components/common/UserCredit.test.ts (1 hunks)
  • src/components/topbar/CurrentUserPopover.test.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
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

src/**/*.{vue,ts}: Avoid using ref and watch together - use computed instead if possible
Do not add ref if a prop would suffice; do not add computed if the ref/prop directly would work; use watch only when computed won't accomplish the goal
Leverage VueUse functions for performance-enhancing styles

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.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: Extract complex type definitions that are inlined in multiple related places - name them for reuse
Minimize the surface area (exported values) of each module and composable
Favor pure functions, especially testable ones

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.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}: ESLint rules: Vue + TS rules, no floating promises, unused imports disallowed, i18n raw text restrictions in templates
Use es-toolkit for utility functions
Avoid mutable state - prefer immutability and assignment at point of declaration
Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.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/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.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/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
src/components/**/*.{vue,ts,js}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,ts,js}: Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners
Use useIntersectionObserver for visibility detection instead of custom scroll handlers
Use vue-i18n for ALL UI strings

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
src/**/*.{js,ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript exclusively - no new JavaScript files

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
src/**/*.{ts,tsx,vue,js}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx,vue,js}: Indent with 2 spaces, use single quotes, no trailing semicolons, line width 80 - see .prettierrc
Sort and group imports by plugin, run pnpm format before committing

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not use function expressions - use function declarations instead when possible

Files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
🧠 Learnings (23)
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Keep module mocks contained - do not use global mutable state within test files, use `vi.hoisted()` if necessary

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : For mocking, leverage Vitest's utilities where possible

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Write tests for all changes, especially bug fixes to catch future regressions

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Aim for behavioral coverage of critical and new features

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Do not write tests that just test the mocks - ensure tests fail when code behaves unexpectedly

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Be parsimonious in testing - do not write redundant tests

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Mocks should be cleanly written and easy to understand, with reusable mocks where possible

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Always prefer vitest mock functions over writing verbose manual mocks

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : For Component testing, use Vue Test Utils and follow advice about making components easy to test

Applied to files:

  • src/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.test.ts
  • packages/registry-types/src/comfyRegistryTypes.ts
  • src/components/common/UserCredit.test.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/components/topbar/CurrentUserPopover.test.ts
  • packages/registry-types/src/comfyRegistryTypes.ts
  • src/components/common/UserCredit.test.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/components/topbar/CurrentUserPopover.test.ts
  • packages/registry-types/src/comfyRegistryTypes.ts
  • src/components/common/UserCredit.test.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/components/topbar/CurrentUserPopover.test.ts
  • src/components/common/UserCredit.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/components/topbar/CurrentUserPopover.test.ts
  • packages/registry-types/src/comfyRegistryTypes.ts
  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-16T17:41:58.464Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-16T17:41:58.464Z
Learning: Consider updates to docs.comfy.org during development workflow

Applied to files:

  • packages/registry-types/src/comfyRegistryTypes.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:

  • packages/registry-types/src/comfyRegistryTypes.ts
📚 Learning: 2025-12-12T23:02:37.473Z
Learnt from: Myestery
Repo: Comfy-Org/ComfyUI_frontend PR: 7422
File: .github/workflows/pr-update-playwright-expectations.yaml:131-135
Timestamp: 2025-12-12T23:02:37.473Z
Learning: In the `.github/workflows/pr-update-playwright-expectations.yaml` workflow in the Comfy-Org/ComfyUI_frontend repository, the snapshot update process is intentionally scoped to only add and update snapshot images. Deletions of snapshot files are handled explicitly outside this workflow and should not be suggested as part of this automation.

Applied to files:

  • packages/registry-types/src/comfyRegistryTypes.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Use existing test utilities rather than writing custom utilities

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Check tests-ui/README.md for test guidelines

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-12-17T01:01:03.609Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-17T01:01:03.609Z
Learning: Applies to tests-ui/**/*.test.ts : Do not write change detector tests - do not just assert that defaults are certain values

Applied to files:

  • src/components/common/UserCredit.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Follow existing test patterns in the codebase

Applied to files:

  • src/components/common/UserCredit.test.ts
🧬 Code graph analysis (1)
src/components/topbar/CurrentUserPopover.test.ts (1)
src/base/credits/comfyCredits.ts (1)
  • formatCreditsFromCents (73-82)
⏰ 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: lint-and-format
  • GitHub Check: setup
  • GitHub Check: test
  • GitHub Check: collect
🔇 Additional comments (15)
src/components/topbar/CurrentUserPopover.test.ts (2)

72-84: Well-structured hoisted mock state for per-test manipulation.

Good use of vi.hoisted() to enable per-test state changes while keeping mocks contained. The type annotation correctly marks amount_micros and effective_balance_micros as optional to support fallback scenario testing.

Based on learnings: "Keep module mocks contained - do not use global mutable state within test files, use vi.hoisted() if necessary."


321-418: Comprehensive test coverage for the fallback chain.

The test suite thoroughly verifies all critical scenarios for the effective_balance_micros feature:

  • Prefers effective_balance_micros when present (positive, zero, negative)
  • Falls back to amount_micros when effective_balance_micros is missing
  • Falls back to 0 when both fields are missing

Strong assertions verify both the mock call parameters (exact cents value) and the rendered output, ensuring tests will fail if the fallback logic breaks. This aligns with the PR objectives for backwards compatibility verification.

src/components/common/UserCredit.test.ts (2)

25-40: Hoisted mock pattern correctly implemented.

Good use of vi.hoisted() for mutable test state. The mock factory function evaluates mockBalance.value at call time, allowing per-test state changes to take effect.


126-133: Loading state test is appropriate.

Simple and effective test for verifying skeleton display during balance fetch.

packages/registry-types/src/comfyRegistryTypes.ts (11)

2157-2176: LGTM!

The new /proxy/bfl/flux-2-max/generate endpoint path definition follows the established pattern for BFL proxy endpoints and correctly references the bflFlux2MaxGenerate operation.


4780-4786: LGTM!

New Kling model versions (kling-v2-5-turbo, kling-v2-6) added consistently to both enums.


4931-4936: Verify backwards compatibility for the new required sound parameter.

The sound property is not marked as optional (no ?), which means TypeScript will require callers to explicitly provide this value. While the API has @default off, existing code making requests without sound will now fail type-checking.

If this is intentional based on the OpenAPI spec, this is fine. If the intent is to allow omission (relying on the server default), consider making it optional:

-            sound: "on" | "off";
+            sound?: "on" | "off";

5794-5796: LGTM!

Documentation update for the default height value.


5810-5814: Verify if safety_tolerance should be optional.

Similar to the sound parameter concern: safety_tolerance is required in TypeScript but has @default 2. The description notes it's "Flux 2 Max only" - if this field isn't applicable to other Flux Pro variants, making it required could be problematic.

Consider if this should be optional to match API behavior:

-            safety_tolerance: number;
+            safety_tolerance?: number;

7013-7016: LGTM!

The new output_tokens_details object follows the established pattern and is properly marked as optional.


10431-10469: LGTM!

The updated parameter documentation with model-specific resolution and duration details is thorough. The new shot_type and updated duration enum are properly defined as optional with sensible defaults.


11982-11983: LGTM!

Yearly subscription tier options added with clear naming convention.


12226-12235: LGTM! Core PR objective - effective balance fields.

The new pending_charges_micros and effective_balance_micros fields are correctly implemented:

  • Optional (?) for backwards compatibility when the feature flag is disabled
  • Clear documentation about negative balance possibility
  • Format: double appropriately handles negative values

This aligns with the PR objective of supporting effective balance display with fallback to amount_micros.


12302-12311: LGTM!

Consistent addition of balance fields in the second response schema, matching the pattern in the first occurrence.


19517-19599: LGTM!

The bflFlux2MaxGenerate operation is well-structured:

  • Appropriately reuses BFLFlux2ProGenerateRequest and BFLFluxProGenerateResponse schemas
  • Comprehensive error handling including 402 (Payment Required) and 429 (Rate Limit)
  • Consistent with existing BFL proxy operation patterns

Comment on lines 10400 to 10428
model: "wan2.5-t2v-preview" | "wan2.5-i2v-preview" | "wan2.6-t2v" | "wan2.6-i2v";
/** @description Enter basic information, such as prompt words, etc. */
input: {
/** @description Text prompt words. Support Chinese and English, length not exceeding 800 characters */
/**
* @description Text prompt words. Support Chinese and English, length not exceeding 800 characters.
* For wan2.6-r2v with multiple reference videos, use 'character1', 'character2', etc. to refer to subjects
* in the order of reference videos. Example: "Character1 sings on the roadside, Character2 dances beside it"
*/
prompt: string;
/** @description Reverse prompt words are used to describe content that you do not want to see in the video screen */
negative_prompt?: string;
/** @description Audio file download URL. Supported formats: mp3 and wav. */
/** @description Audio file download URL. Supported formats: mp3 and wav. Cannot be used with reference_video_urls. */
audio_url?: string;
/** @description First frame image URL or Base64 encoded data. Required for I2V models. Image formats: JPEG, JPG, PNG, BMP, WEBP. Resolution: 360-2000 pixels. File size: max 10MB. */
img_url?: string;
/** @description Video effect template name. Optional. Currently supported: squish, flying, carousel. When used, prompt parameter is ignored. */
template?: string;
/**
* @description Reference video URLs for wan2.6-r2v model only. Array of 1-3 video URLs.
* Input restrictions:
* - Format: mp4, mov
* - Quantity: 1-3 videos
* - Single video length: 2-30 seconds
* - Single file size: max 30MB
* - Cannot be used with audio_url
* Reference duration: Single video max 5s, two videos max 2.5s each, three videos proportionally less.
* Billing: Based on actual reference duration used.
*/
reference_video_urls?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

rg -n "wan2\.6-r2v" --type ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 545


🏁 Script executed:

# Also check the exact model enum definition to confirm the current state
sed -n '10400,10410p' packages/registry-types/src/comfyRegistryTypes.ts

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 891


Add wan2.6-r2v model to the enum on line 10400.

The model enum is missing the "wan2.6-r2v" option, which is documented in the reference_video_urls field and duration parameter notes. The model should be: "wan2.5-t2v-preview" | "wan2.5-i2v-preview" | "wan2.6-t2v" | "wan2.6-i2v" | "wan2.6-r2v".

🤖 Prompt for AI Agents
In packages/registry-types/src/comfyRegistryTypes.ts around lines 10400 to
10428, the model union is missing the "wan2.6-r2v" option referenced by the
reference_video_urls documentation; update the model type union to include
"wan2.6-r2v" so it reads: add the string literal "wan2.6-r2v" to the existing
union of model values.

- Add pending_charges_micros and effective_balance_micros to GetCustomerBalance response type
- Update UserCredit and CurrentUserPopover components to use effective_balance_micros with fallback
- Update test mock to include new field
- Add UserCredit.test.ts with tests for positive, negative, zero, and missing effective_balance_micros
- Add effective_balance_micros test suite to CurrentUserPopover.test.ts
- Test fallback behavior when effective_balance_micros is missing
@christian-byrne christian-byrne merged commit e5edbf9 into main Dec 20, 2025
27 checks passed
@christian-byrne christian-byrne deleted the new branch December 20, 2025 21:30
Yourz pushed a commit that referenced this pull request Dec 24, 2025
## Summary

Add support for the new `effective_balance_micros` field to show users
their effective balance accounting for pending charges.

## Changes

- **What**: Update balance display components to use
`effective_balance_micros` (with fallback to `amount_micros` for
backwards compatibility)
- **Types**: Add `pending_charges_micros` and `effective_balance_micros`
to `GetCustomerBalance` response type in registry-types

## Review Focus

- The fallback pattern ensures backwards compatibility if the API
doesn't return the new field
- The `effective_balance_micros` can be negative when pending charges
exceed the available balance

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7658-feat-support-effective_balance_micros-for-user-balance-display-2cf6d73d36508193a5a7e999f3185078)
by [Unito](https://www.unito.io)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants