-
Notifications
You must be signed in to change notification settings - Fork 461
fix RightSidePanel title not updating when litegraph node title changes #7860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Used `useVueNodeLifecycle` to allow reactive access to the title
📝 WalkthroughWalkthroughA test file is added for the RightSidePanel component to verify title reactivity and multi-selection messaging. The component is enhanced to integrate Vue node lifecycle data, using a new derived value to resolve the selected node's title with fallback logic to the node's own title or type. Changes
Possibly related PRs
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/07/2026, 10:17:28 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results⏰ Completed at: 01/07/2026, 10:22:41 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.25 MB (baseline 3.25 MB) • ⚪ 0 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 1.01 MB (baseline 1.01 MB) • 🔴 +326 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.63 kB (baseline 6.63 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 300 kB (baseline 300 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 198 kB (baseline 198 kB) • ⚪ 0 BReusable component library chunks
Status: 9 added / 9 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 1.41 kB (baseline 1.41 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 9.19 MB (baseline 9.19 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.5 MB (baseline 3.5 MB) • ⚪ 0 BBundles that do not match a named category
Status: 20 added / 20 removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @src/components/rightSidePanel/RightSidePanel.test.ts:
- Around line 60-93: Add unit tests that cover fallback and null-manager edge
cases for RightSidePanel: create tests using setupGraph/createMountConfig that
select a node with empty node.title and ensure the panel displays node.type
(verify fallback from nodeData.title/node.title to node.type), add a test that
sets mockNodeManager.value = null and selects a node to ensure it falls back to
node.title when nodeManager is unavailable, and add a test where vueNodeData
lacks an entry for the selected node to confirm the component still renders a
sensible title; reference RightSidePanel, LGraphNode, node.title, node.type,
nodeData/vueNodeData, nodeManager/mockNodeManager, setupGraph and
createMountConfig when locating where to add these tests.
- Around line 48-76: The test fails because directly setting LGraphNode.title
doesn't emit the 'node:property:changed' event that useGraphNodeManager relies
on; update the test to either (a) change the node title via the code path that
triggers the event (e.g., call the node/graph method that emits
'node:property:changed'), or (b) manually emit
graph.trigger('node:property:changed', { node, property: 'title', value:
'Updated Title' }) after assigning node.title, or (c) mock the event emission in
the test; reference LGraphNode, useGraphNodeManager and the
'node:property:changed' event to locate where to apply the fix so RightSidePanel
observes the title change.
In @src/components/rightSidePanel/RightSidePanel.vue:
- Around line 63-68: Add a brief clarifying comment above the selectedNodeTitle
computed that describes the fallback priority: first use
nodeManager.value?.vueNodeData.get(nodeId)?.title, then
selectedNode.value.title, and finally selectedNode.value.type; reference the
symbols selectedNodeTitle, selectedNode, nodeManager and vueNodeData so future
readers understand the lookup order and rationale.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
src/components/rightSidePanel/RightSidePanel.test.tssrc/components/rightSidePanel/RightSidePanel.vue
🧰 Additional context used
📓 Path-based instructions (15)
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
Files:
src/components/rightSidePanel/RightSidePanel.vue
src/**/*.{vue,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json
Files:
src/components/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.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
Files:
src/components/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.test.ts
src/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/components/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.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
Files:
src/components/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.test.ts
**/*.vue
📄 CodeRabbit inference engine (AGENTS.md)
**/*.vue: Use Vue 3.5+ with TypeScript in.vuefiles, exclusively using Composition API with<script setup lang="ts">syntax
Use Tailwind 4 for styling in Vue components; avoid<style>blocks
Name Vue components using PascalCase (e.g.,MenuHamburger.vue)
Use Vue 3.5 TypeScript-style default prop declaration with reactive props destructuring; do not usewithDefaultsor runtime props declaration
Prefercomputed()overrefwithwatchwhen deriving values
PreferuseModelover separately defining prop and emit for two-way binding
Usevue-i18nin composition API for string literals; place new translation entries insrc/locales/en/main.json
Usecn()utility function from@/utils/tailwindUtilfor merging Tailwind class names; do not use:class="[]"syntax
Do not use thedark:Tailwind variant; use semantic values from thestyle.csstheme instead (e.g.,bg-node-component-surface)
Do not use!importantor the!important prefix for Tailwind classes; find and correct interfering!importantclasses instead
Avoid new usage of PrimeVue components; use VueUse, shadcn/vue, or Reka UI instead
Leverage VueUse functions for performance-enhancing styles in Vue components
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventions
Files:
src/components/rightSidePanel/RightSidePanel.vue
**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not useanytype oras anytype assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code
Files:
src/components/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.test.ts
**/*.{ts,tsx,vue,js,jsx,json,css}
📄 CodeRabbit inference engine (AGENTS.md)
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width
Files:
src/components/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.test.ts
src/**/*.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety
Files:
src/components/rightSidePanel/RightSidePanel.test.ts
**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.test.ts: Use unit/component tests intests-ui/orsrc/**/*.test.tswith Vitest framework
For mocking in tests, leverage Vitest utilities; keep module mocks contained and avoid global mutable state within test files
Do not write change detector tests or tests dependent on non-behavioral features like utility classes or styles
Aim for behavioral coverage of critical and new features in unit tests
Files:
src/components/rightSidePanel/RightSidePanel.test.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Minimize the surface area (exported values) of each module and composable
Files:
src/components/rightSidePanel/RightSidePanel.test.ts
🧠 Learnings (35)
📓 Common learnings
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7137
File: src/components/rightSidePanel/RightSidePanel.vue:174-180
Timestamp: 2025-12-06T02:11:00.385Z
Learning: PrimeVue components have poor TypeScript typing, so type assertions (like `as RightSidePanelTab`) may be necessary when handling emitted events or prop values from PrimeVue components like TabList.
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.vue : Utilize ref and reactive for reactive state
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7303
File: src/components/topbar/CurrentUserPopover.test.ts:199-205
Timestamp: 2025-12-10T03:09:19.636Z
Learning: For test files in the Comfy-Org/ComfyUI_frontend repository: When writing tests, prefer selecting elements by accessible properties (text content, aria-label, role, accessible name) over data-testid attributes. This ensures tests verify actual user-facing behavior and accessibility compliance.
📚 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 TabMenu component with Tabs without panels
Applied to files:
src/components/rightSidePanel/RightSidePanel.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,ts,js} : Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners
Applied to files:
src/components/rightSidePanel/RightSidePanel.vue
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{ts,tsx} : Use provided test helpers `createTestSubgraph` and `createTestSubgraphNode` from `./fixtures/subgraphHelpers` for consistent subgraph test setup
Applied to files:
src/components/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.{vue,ts} : Leverage VueUse functions for performance-enhancing styles
Applied to files:
src/components/rightSidePanel/RightSidePanel.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 : Use lifecycle hooks: onMounted, onUpdated in Vue 3 Composition API
Applied to files:
src/components/rightSidePanel/RightSidePanel.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 : Use setup() function in Vue 3 Composition API
Applied to files:
src/components/rightSidePanel/RightSidePanel.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 : Use ref/reactive for state management in Vue 3 Composition API
Applied to files:
src/components/rightSidePanel/RightSidePanel.vue
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Leverage VueUse functions for performance-enhancing styles in Vue components
Applied to files:
src/components/rightSidePanel/RightSidePanel.vue
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.vue : Utilize Vue 3's Teleport component when needed
Applied to files:
src/components/rightSidePanel/RightSidePanel.vue
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/*.{vue,ts,tsx} : Follow Vue 3 composition API style guide
Applied to files:
src/components/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.vue
📚 Learning: 2025-12-22T21:36:08.369Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: src/platform/cloud/subscription/components/PricingTable.vue:185-201
Timestamp: 2025-12-22T21:36:08.369Z
Learning: In Vue components, avoid creating single-use variants for common UI components (e.g., Button and other shared components). Aim for reusable variants that cover multiple use cases. It’s acceptable to temporarily mix variant props with inline Tailwind classes when a styling need is unique to one place, but plan and consolidate into shared, reusable variants as patterns emerge across the codebase.
Applied to files:
src/components/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.vuesrc/components/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.vue
📚 Learning: 2025-12-21T01:06:02.786Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: src/components/graph/selectionToolbox/ColorPickerButton.vue:15-18
Timestamp: 2025-12-21T01:06:02.786Z
Learning: In Comfy-Org/ComfyUI_frontend, in Vue component files, when a filled icon is required (e.g., 'pi pi-circle-fill'), you may mix PrimeIcons with Lucide icons since Lucide lacks filled variants. This mixed usage is acceptable when one icon library does not provide an equivalent filled icon. Apply consistently across Vue components in the src directory where icons are used, and document the rationale when a mixed approach is chosen.
Applied to files:
src/components/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.vue
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{js,ts,jsx,tsx} : When adding features, always write vitest unit tests using cursor rules in @.cursor
Applied to files:
src/components/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Use unit/component tests in `tests-ui/` or `src/**/*.test.ts` with Vitest framework
Applied to files:
src/components/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Aim for behavioral coverage of critical and new features in unit tests
Applied to files:
src/components/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{test,spec}.{ts,tsx} : When writing tests for subgraph-related code, always import from the barrel export at `@/lib/litegraph/src/litegraph` to avoid circular dependency issues
Applied to files:
src/components/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Do not write change detector tests or tests dependent on non-behavioral features like utility classes or styles
Applied to files:
src/components/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : For mocking in tests, leverage Vitest utilities; keep module mocks contained and avoid global mutable state within test files
Applied to files:
src/components/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Follow naming conventions for browser tests
Applied to files:
src/components/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test user workflows in browser tests
Applied to files:
src/components/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-12-06T02:11:00.385Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7137
File: src/components/rightSidePanel/RightSidePanel.vue:174-180
Timestamp: 2025-12-06T02:11:00.385Z
Learning: PrimeVue components have poor TypeScript typing, so type assertions (like `as RightSidePanelTab`) may be necessary when handling emitted events or prop values from PrimeVue components like TabList.
Applied to files:
src/components/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-12-30T22:22:33.836Z
Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().
Applied to files:
src/components/rightSidePanel/RightSidePanel.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/rightSidePanel/RightSidePanel.test.ts
📚 Learning: 2025-12-30T01:31:04.927Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7797
File: tests-ui/tests/lib/litegraph/src/widgets/ComboWidget.test.ts:648-648
Timestamp: 2025-12-30T01:31:04.927Z
Learning: In Vitest v4, when mocking functions that may be called as constructors (using new), the mock implementation must use function() or class syntax rather than an arrow function. Arrow mocks can cause '<anonymous> is not a constructor' errors. This is a breaking change from Vitest v3 where mocks could use an arrow function. Apply this guideline to test files that mock constructor-like calls (e.g., in tests under tests-ui, such as ComboWidget.test.ts) and ensure mock implementations are defined with function() { ... } or class { ... } to preserve constructor behavior.
Applied to files:
src/components/rightSidePanel/RightSidePanel.test.ts
🧬 Code graph analysis (1)
src/components/rightSidePanel/RightSidePanel.test.ts (1)
src/composables/graph/useGraphNodeManager.ts (2)
GraphNodeManager(84-93)useGraphNodeManager(220-604)
🔇 Additional comments (1)
src/components/rightSidePanel/RightSidePanel.vue (1)
10-10: LGTM! Reactive title integration correctly implemented.The integration with
useVueNodeLifecycleprovides reactive access to node title changes throughnodeManager.vueNodeData. The fallback chain inselectedNodeTitleproperly handles cases where:
nodeDatafrom the lifecycle manager has a title- Falls back to the node's own
titleproperty- Falls back to the node's
typeas a last resortThe computed property will reactively update when the node manager detects title changes in LiteGraph, fixing the issue described in the PR objectives.
Also applies to: 28-28, 63-68, 72-72
| const setupGraph = () => { | ||
| const graph = new LGraph() | ||
| mockNodeManager.value = useGraphNodeManager(graph) | ||
| return { graph, canvasStore: useCanvasStore() } | ||
| } | ||
|
|
||
| describe('RightSidePanel', () => { | ||
| beforeEach(() => { | ||
| setActivePinia(createPinia()) | ||
| mockNodeManager.value = null | ||
| }) | ||
|
|
||
| describe('title reactivity', () => { | ||
| it('updates panel title when node.title changes', async () => { | ||
| const { graph, canvasStore } = setupGraph() | ||
|
|
||
| const node = new LGraphNode('Original Title', 'TestNode') | ||
| graph.add(node) | ||
| canvasStore.selectedItems = [node] | ||
|
|
||
| const wrapper = mount(RightSidePanel, createMountConfig()) | ||
| await nextTick() | ||
| expect(wrapper.text()).toContain('Original Title') | ||
|
|
||
| node.title = 'Updated Title' | ||
|
|
||
| await nextTick() | ||
| expect(wrapper.text()).toContain('Updated Title') | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cd /repo && pnpm test src/components/rightSidePanel/RightSidePanel.test.ts -- --reporter=verboseRepository: Comfy-Org/ComfyUI_frontend
Length of output: 125
🏁 Script executed:
#!/bin/bash
# First, check the repository structure
pwd
ls -la
git ls-files | grep -E "RightSidePanel\.test\.ts|package\.json" | head -5Repository: Comfy-Org/ComfyUI_frontend
Length of output: 4143
🏁 Script executed:
#!/bin/bash
# Find the test file and check test structure
find /home/jailuser/git -name "RightSidePanel.test.ts" -type fRepository: Comfy-Org/ComfyUI_frontend
Length of output: 141
🏁 Script executed:
#!/bin/bash
# Read the test file to understand the complete test
cat -n /home/jailuser/git/src/components/rightSidePanel/RightSidePanel.test.ts | head -100Repository: Comfy-Org/ComfyUI_frontend
Length of output: 3498
🏁 Script executed:
#!/bin/bash
# Find LGraphNode implementation
find /home/jailuser/git -name "*.ts" -path "*/litegraph/*" -type f | grep -i "node" | head -10Repository: Comfy-Org/ComfyUI_frontend
Length of output: 733
🏁 Script executed:
#!/bin/bash
# Find the main LGraphNode class definition
find /home/jailuser/git/src/lib/litegraph -name "LGraphNode.ts" -type fRepository: Comfy-Org/ComfyUI_frontend
Length of output: 124
🏁 Script executed:
#!/bin/bash
# Read the LGraphNode implementation to check for property setters
cat -n /home/jailuser/git/src/lib/litegraph/src/LGraphNode.ts | head -150Repository: Comfy-Org/ComfyUI_frontend
Length of output: 5766
🏁 Script executed:
#!/bin/bash
# Search for the title property definition and setter in LGraphNode
rg -n "title\s*[=:]|set title|\.title\s*=" /home/jailuser/git/src/lib/litegraph/src/LGraphNode.ts | head -20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 396
🏁 Script executed:
#!/bin/bash
# Search for event system in LGraphNode (onPropertyChange, emit, etc.)
rg -n "onPropertyChange|onTitleChange|_onTitleChange|emit|trigger" /home/jailuser/git/src/lib/litegraph/src/LGraphNode.ts | head -30Repository: Comfy-Org/ComfyUI_frontend
Length of output: 1891
🏁 Script executed:
#!/bin/bash
# Find the context around line 519 where the property:changed event is triggered
sed -n '510,530p' /home/jailuser/git/src/lib/litegraph/src/LGraphNode.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 534
🏁 Script executed:
#!/bin/bash
# Search for title property changes and events
rg -B5 -A5 "property.*title|title.*changed" /home/jailuser/git/src/lib/litegraph/src/LGraphNode.ts | head -40Repository: Comfy-Org/ComfyUI_frontend
Length of output: 52
🏁 Script executed:
#!/bin/bash
# Check if there's a getter/setter for title in LGraphNode
rg -n "get title|set title" /home/jailuser/git/src/lib/litegraph/src/LGraphNode.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 149
🏁 Script executed:
#!/bin/bash
# Read useGraphNodeManager to see how it listens for title changes
cat -n /home/jailuser/git/src/composables/graph/useGraphNodeManager.ts | head -100Repository: Comfy-Org/ComfyUI_frontend
Length of output: 3596
🏁 Script executed:
#!/bin/bash
# Continue reading useGraphNodeManager, looking for event listeners
sed -n '100,250p' /home/jailuser/git/src/composables/graph/useGraphNodeManager.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 4947
🏁 Script executed:
#!/bin/bash
# Continue reading to find the event listener setup
sed -n '250,400p' /home/jailuser/git/src/composables/graph/useGraphNodeManager.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 4848
🏁 Script executed:
#!/bin/bash
# Continue reading to find graph event listeners
sed -n '400,550p' /home/jailuser/git/src/composables/graph/useGraphNodeManager.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 4715
Direct property assignment does not trigger LiteGraph property change events for the title field.
The test assumes node.title = 'Updated Title' will emit a 'node:property:changed' event that useGraphNodeManager listens to, but the implementation shows event triggering is only explicitly implemented for specific properties (e.g., shape). The title property is a plain string with no setter interceptor, so direct assignment won't trigger the event handler that updates vueNodeData.title. This test will fail.
The title property must be updated through a method that explicitly calls graph.trigger('node:property:changed', { property: 'title', ... }), or the test needs to mock the event emission, or a property setter needs to be added to LGraphNode.title.
🤖 Prompt for AI Agents
In @src/components/rightSidePanel/RightSidePanel.test.ts around lines 48 - 76,
The test fails because directly setting LGraphNode.title doesn't emit the
'node:property:changed' event that useGraphNodeManager relies on; update the
test to either (a) change the node title via the code path that triggers the
event (e.g., call the node/graph method that emits 'node:property:changed'), or
(b) manually emit graph.trigger('node:property:changed', { node, property:
'title', value: 'Updated Title' }) after assigning node.title, or (c) mock the
event emission in the test; reference LGraphNode, useGraphNodeManager and the
'node:property:changed' event to locate where to apply the fix so RightSidePanel
observes the title change.
| describe('title reactivity', () => { | ||
| it('updates panel title when node.title changes', async () => { | ||
| const { graph, canvasStore } = setupGraph() | ||
|
|
||
| const node = new LGraphNode('Original Title', 'TestNode') | ||
| graph.add(node) | ||
| canvasStore.selectedItems = [node] | ||
|
|
||
| const wrapper = mount(RightSidePanel, createMountConfig()) | ||
| await nextTick() | ||
| expect(wrapper.text()).toContain('Original Title') | ||
|
|
||
| node.title = 'Updated Title' | ||
|
|
||
| await nextTick() | ||
| expect(wrapper.text()).toContain('Updated Title') | ||
| }) | ||
|
|
||
| it('shows selection count message when multiple nodes are selected', async () => { | ||
| const { graph, canvasStore } = setupGraph() | ||
|
|
||
| const node1 = new LGraphNode('Node 1', 'TestNode') | ||
| const node2 = new LGraphNode('Node 2', 'TestNode') | ||
| graph.add(node1) | ||
| graph.add(node2) | ||
| canvasStore.selectedItems = [node1, node2] | ||
|
|
||
| const wrapper = mount(RightSidePanel, createMountConfig()) | ||
| await nextTick() | ||
|
|
||
| expect(wrapper.text()).toContain('2') | ||
| expect(wrapper.text()).not.toContain('Node 1') | ||
| expect(wrapper.text()).not.toContain('Node 2') | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider adding edge case tests for fallback logic.
The current tests cover happy path scenarios (title updates, multi-selection). Consider adding tests for:
- Fallback to
node.typewhennodeData.titleandnode.titleare empty/undefined - Behavior when
nodeManagerisnull - Scenario where
vueNodeDatadoesn't contain an entry for the selected node
📋 Suggested additional test cases
it('falls back to node.type when title is empty', async () => {
const { graph, canvasStore } = setupGraph()
const node = new LGraphNode('', 'CustomNodeType')
graph.add(node)
canvasStore.selectedItems = [node]
const wrapper = mount(RightSidePanel, createMountConfig())
await nextTick()
expect(wrapper.text()).toContain('CustomNodeType')
})
it('handles null nodeManager gracefully', async () => {
mockNodeManager.value = null
const canvasStore = useCanvasStore()
const node = new LGraphNode('Test Node', 'TestType')
canvasStore.selectedItems = [node]
const wrapper = mount(RightSidePanel, createMountConfig())
await nextTick()
// Should fallback to node.title when nodeManager is unavailable
expect(wrapper.text()).toContain('Test Node')
})🤖 Prompt for AI Agents
In @src/components/rightSidePanel/RightSidePanel.test.ts around lines 60 - 93,
Add unit tests that cover fallback and null-manager edge cases for
RightSidePanel: create tests using setupGraph/createMountConfig that select a
node with empty node.title and ensure the panel displays node.type (verify
fallback from nodeData.title/node.title to node.type), add a test that sets
mockNodeManager.value = null and selects a node to ensure it falls back to
node.title when nodeManager is unavailable, and add a test where vueNodeData
lacks an entry for the selected node to confirm the component still renders a
sensible title; reference RightSidePanel, LGraphNode, node.title, node.type,
nodeData/vueNodeData, nodeManager/mockNodeManager, setupGraph and
createMountConfig when locating where to add these tests.
| const selectedNodeTitle = computed(() => { | ||
| if (!selectedNode.value) return null | ||
| const nodeId = String(selectedNode.value.id) | ||
| const nodeData = nodeManager.value?.vueNodeData.get(nodeId) | ||
| return nodeData?.title || selectedNode.value.title || selectedNode.value.type | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Optional: Add clarifying comment for the fallback chain.
The fallback logic is sound, but a brief comment explaining the priority would improve maintainability:
💡 Suggested clarifying comment
const selectedNodeTitle = computed(() => {
if (!selectedNode.value) return null
const nodeId = String(selectedNode.value.id)
const nodeData = nodeManager.value?.vueNodeData.get(nodeId)
+ // Priority: reactive lifecycle data → node title → node type
return nodeData?.title || selectedNode.value.title || selectedNode.value.type
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const selectedNodeTitle = computed(() => { | |
| if (!selectedNode.value) return null | |
| const nodeId = String(selectedNode.value.id) | |
| const nodeData = nodeManager.value?.vueNodeData.get(nodeId) | |
| return nodeData?.title || selectedNode.value.title || selectedNode.value.type | |
| }) | |
| const selectedNodeTitle = computed(() => { | |
| if (!selectedNode.value) return null | |
| const nodeId = String(selectedNode.value.id) | |
| const nodeData = nodeManager.value?.vueNodeData.get(nodeId) | |
| // Priority: reactive lifecycle data → node title → node type | |
| return nodeData?.title || selectedNode.value.title || selectedNode.value.type | |
| }) |
🤖 Prompt for AI Agents
In @src/components/rightSidePanel/RightSidePanel.vue around lines 63 - 68, Add a
brief clarifying comment above the selectedNodeTitle computed that describes the
fallback priority: first use nodeManager.value?.vueNodeData.get(nodeId)?.title,
then selectedNode.value.title, and finally selectedNode.value.type; reference
the symbols selectedNodeTitle, selectedNode, nodeManager and vueNodeData so
future readers understand the lookup order and rationale.
AustinMroz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The description seems a little misleading since the reactivity is only fixed in vue mode (where litegraph isn't used)
- There's some pretty significant work being done on the right side panel over in #7812
I'd want a second opinion here, but actual content of the PR is an improvement and LGTM
Summary
When editing a node title via the LiteGraph node with the right panel open, the title is not reactively updated in the panel UI.
Changes
useVueNodeLifecycleto allow reactive access to the title┆Issue is synchronized with this Notion page by Unito