-
Notifications
You must be signed in to change notification settings - Fork 460
Subgraph/workflow breadcrumbs menu updates #7852
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
- Add menu button to WorkflowTab for quick workflow actions - Add menu and back button to SubgraphBreadcrumb - Extract shared menu items to useBreadcrumbMenu composable - Add Comfy.RenameWorkflow command for renaming persisted workflows - Menu always shows root workflow menu, even when in subgraph
📝 WalkthroughWalkthroughThe pull request enhances breadcrumb navigation and workflow management by adding a responsive control panel with menu and back buttons to the subgraph breadcrumb component, introducing a shared breadcrumb menu composable for context operations (rename, duplicate, save, delete), and adding a new rename workflow command to the core command system. 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/06/2026, 09:56:02 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results❌ Some tests failed ⏰ Completed at: 01/06/2026, 10:04:04 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.23 MB (baseline 3.23 MB) • ⚪ 0 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 1.01 MB (baseline 1 MB) • 🔴 +4.7 kBGraph 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 — 193 kB (baseline 193 kB) • ⚪ 0 BReusable component library chunks
Status: 10 added / 10 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
Status: 1 added / 1 removed Other — 3.5 MB (baseline 3.5 MB) • ⚪ 0 BBundles that do not match a named category
Status: 21 added / 21 removed |
|
Updating Playwright Expectations |
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: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/breadcrumb/SubgraphBreadcrumb.vue (1)
119-127: Missing error handling in subgraph navigation command.Lines 123-126 throw a TypeError if
canvas.graphis null, similar to the home command. This should handle errors gracefully instead of throwing.🔎 Proposed fix
command: () => { useTelemetry()?.trackUiButtonClicked({ button_id: 'breadcrumb_subgraph_item_selected' }) const canvas = useCanvasStore().getCanvas() - if (!canvas.graph) throw new TypeError('Canvas has no graph') + if (!canvas.graph) { + console.error('Canvas has no graph') + return + } canvas.setGraph(subgraph) },
🤖 Fix all issues with AI Agents
In @src/components/breadcrumb/SubgraphBreadcrumb.vue:
- Around line 99-113: The breadcrumb's home computed property command currently
throws a TypeError when canvas.graph is missing; wrap the command body in a
try/catch to prevent an unhandled exception, e.g., in the computed property home
-> command: call useCanvasStore().getCanvas(), check for canvas and
canvas.graph, and if missing handle gracefully in the catch by logging the error
(or using the app's notifier/telemetry) and returning early instead of throwing;
keep the existing telemetry.trackUiButtonClicked call and only call
canvas.setGraph(canvas.graph.rootGraph) when canvas.graph is present.
- Around line 150-152: The handler handleBackClick is calling
useCommandStore().execute('Comfy.Graph.ExitSubgraph') and dropping the returned
Promise with void, so failures will be lost; make handleBackClick async, await
useCommandStore().execute(...) and wrap the await in a try/catch (or return the
Promise) to surface/log errors (reference handleBackClick and
useCommandStore().execute).
In @src/components/topbar/WorkflowTab.vue:
- Around line 150-159: Guard against a null/undefined workflow before accessing
its properties: check props.workflowOption.workflow and use a safe fallback when
building rootMenuItem (e.g., use a default label like 'Untitled' and isBlueprint
= false) so that label and the call to
useSubgraphStore().isSubgraphBlueprint(...) never read properties of null; then
pass that safe rootMenuItem into useBreadcrumbMenu and keep the existing command
invocation useCommandStore().execute('Comfy.RenameWorkflow').
In @src/composables/useBreadcrumbMenu.ts:
- Around line 29-30: The code dereferences workflowStore.activeWorkflow with a
non-null assertion when calling workflowService.duplicateWorkflow, risking a
runtime error if no workflow is active; add a guard in the useBreadcrumbMenu
action so you check that workflowStore.activeWorkflow is defined before calling
duplicateWorkflow (e.g., if not defined, return early or show an error/disable
the action), and use the non-asserted value (no "!") when passing it to
workflowService.duplicateWorkflow to ensure safe runtime behavior.
- Line 71: The code dereferences workflowStore.activeWorkflow with a non-null
assertion when calling saveWorkflowAs, which can throw if activeWorkflow is
null; add a null/undefined guard before calling workflowService.saveWorkflowAs
(e.g., check if workflowStore.activeWorkflow is present and handle the missing
case by returning early or showing an error) and only call
workflowService.saveWorkflowAs(workflowStore.activeWorkflow) when the guard
passes; update any caller paths that assume success accordingly.
- Line 85: The code dereferences workflowStore.activeWorkflow with a non-null
assertion when calling workflowService.deleteWorkflow; add a null/undefined
guard before calling deleteWorkflow (e.g., check if workflowStore.activeWorkflow
exists and return or throw a handled error if not) and pass the validated value
to workflowService.deleteWorkflow instead of using the `!` operator so you avoid
potential runtime exceptions.
- Around line 17-90: The computed menuItems currently includes entries with a
visible property so hidden items remain in the array; change the logic inside
the computed menuItems to only return items that meet their visibility
conditions (e.g., include entries conditionally instead of setting visible) and
filter out falsy entries before returning, ensuring you also avoid
leading/trailing or duplicate separators when conditions remove neighboring
items; update the computed block that builds MenuItem[] (menuItems) to construct
items conditionally and then call a final .filter(Boolean) and a small pass to
collapse/remove redundant separators.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (24)
browser_tests/tests/mobileBaseline.spec.ts-snapshots/mobile-default-workflow-mobile-chrome-linux.pngis excluded by!**/*.pngbrowser_tests/tests/mobileBaseline.spec.ts-snapshots/mobile-empty-canvas-mobile-chrome-linux.pngis excluded by!**/*.pngbrowser_tests/tests/mobileBaseline.spec.ts-snapshots/mobile-settings-dialog-mobile-chrome-linux.pngis excluded by!**/*.pngbrowser_tests/tests/viewport.spec.ts-snapshots/viewport-fits-when-saved-offscreen-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/groups/groups.spec.ts-snapshots/vue-groups-create-group-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/groups/groups.spec.ts-snapshots/vue-groups-fit-to-contents-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/canvas/pan.spec.ts-snapshots/vue-nodes-paned-with-touch-mobile-chrome-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/canvas/zoom.spec.ts-snapshots/zoomed-in-ctrl-shift-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts-snapshots/vue-node-dragging-link-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts-snapshots/vue-node-input-drag-ctrl-alt-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts-snapshots/vue-node-input-drag-reuses-origin-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts-snapshots/vue-node-reroute-input-drag-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts-snapshots/vue-node-reroute-output-shift-drag-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts-snapshots/vue-node-shift-output-multi-link-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts-snapshots/vue-node-snap-to-node-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/links/linkInteraction.spec.ts-snapshots/vue-node-snap-to-slot-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/node/move.spec.ts-snapshots/vue-node-moved-node-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/interactions/node/move.spec.ts-snapshots/vue-node-moved-node-touch-mobile-chrome-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/nodeStates/bypass.spec.ts-snapshots/vue-node-bypassed-state-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/nodeStates/colors.spec.ts-snapshots/vue-node-custom-color-blue-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/nodeStates/colors.spec.ts-snapshots/vue-node-custom-colors-dark-all-colors-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/nodeStates/colors.spec.ts-snapshots/vue-node-custom-colors-light-all-colors-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/nodeStates/mute.spec.ts-snapshots/vue-node-muted-state-chromium-linux.pngis excluded by!**/*.pngbrowser_tests/tests/vueNodes/widgets/load/uploadWidgets.spec.ts-snapshots/vue-nodes-upload-widgets-chromium-linux.pngis excluded by!**/*.png
📒 Files selected for processing (5)
src/components/breadcrumb/SubgraphBreadcrumb.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/topbar/WorkflowTab.vuesrc/composables/useBreadcrumbMenu.tssrc/composables/useCoreCommands.ts
🧰 Additional context used
📓 Path-based instructions (16)
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/topbar/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/topbar/WorkflowTab.vuesrc/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.tssrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.vue
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/topbar/WorkflowTab.vuesrc/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.tssrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/topbar/WorkflowTab.vuesrc/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.tssrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.vue
src/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/components/topbar/WorkflowTab.vuesrc/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.tssrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/topbar/WorkflowTab.vuesrc/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.tssrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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
Files:
src/components/topbar/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.vue
**/*.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/topbar/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/topbar/WorkflowTab.vuesrc/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.tssrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.vue
**/*.{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/topbar/WorkflowTab.vuesrc/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.tssrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.vue
src/**/*.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety
Files:
src/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.ts
src/**/{services,composables}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/{services,composables}/**/*.{ts,tsx}: Useapi.apiURL()for backend endpoints instead of constructing URLs directly
Useapi.fileURL()for static file access instead of constructing URLs directly
Files:
src/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.ts
**/**/use[A-Z]*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Name composables using the pattern
useXyz.ts
Files:
src/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Minimize the surface area (exported values) of each module and composable
Files:
src/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.ts
🧠 Learnings (34)
📓 Common learnings
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.
📚 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/topbar/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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 Sidebar component with Drawer
Applied to files:
src/components/topbar/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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 InputSwitch component with ToggleSwitch
Applied to files:
src/components/topbar/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/topbar/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.tssrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/topbar/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.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/WorkflowTab.vuesrc/components/breadcrumb/SubgraphBreadcrumbItem.vuesrc/components/breadcrumb/SubgraphBreadcrumb.vue
📚 Learning: 2025-12-09T03:39:54.501Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.
Applied to files:
src/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.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/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.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/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.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/composables/useCoreCommands.tssrc/composables/useBreadcrumbMenu.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Implement computed() for derived state in Vue 3 Composition API
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumbItem.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/breadcrumb/SubgraphBreadcrumbItem.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,ts} : Leverage VueUse functions for performance-enhancing styles
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumbItem.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/breadcrumb/SubgraphBreadcrumbItem.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/breadcrumb/SubgraphBreadcrumbItem.vue
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.vue : Implement computed properties with computed()
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumbItem.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/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumbItem.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 : Extract complex conditionals to computed properties
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumbItem.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 vue-i18n for ALL UI strings
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumbItem.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 Steps component with Stepper without panels
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumb.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 Dropdown component with Select
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumb.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 : Use Vue 3.5+ with TypeScript in `.vue` files, exclusively using Composition API with `<script setup lang="ts">` syntax
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumb.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 : Avoid new usage of PrimeVue components; use VueUse, shadcn/vue, or Reka UI instead
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumb.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 Chips component with AutoComplete with multiple enabled
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumb.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/breadcrumb/SubgraphBreadcrumb.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/**/stores/**/*.{ts,tsx} : Use TypeScript for type safety in state management stores
Applied to files:
src/components/breadcrumb/SubgraphBreadcrumb.vue
🧬 Code graph analysis (2)
src/composables/useCoreCommands.ts (1)
src/stores/queueStore.ts (1)
workflow(314-316)
src/composables/useBreadcrumbMenu.ts (1)
src/stores/commandStore.ts (1)
useCommandStore(75-147)
🔇 Additional comments (11)
src/composables/useCoreCommands.ts (1)
177-196: LGTM! The rename workflow command is well-implemented.The command correctly:
- Guards against null workflows and non-persisted workflows
- Prompts for a new filename with the current filename as default
- Validates that the new name differs from the current name
- Constructs the new path by combining directory + filename + extension
- Delegates to the workflow service for the actual rename operation
The path construction on line 193 correctly uses the workflow's directory and appends
.json, ensuring the renamed file stays in the same location.src/components/topbar/WorkflowTab.vue (2)
10-18: LGTM! Context menu button is correctly implemented.The button:
- Only renders when
isActiveTabis true- Uses appropriate styling and size
- Stops event propagation with
@click.stopto prevent triggering the parent click handler- Uses PrimeIcons consistently with other menu buttons in the codebase
174-180: No action needed; the implementation is correct.The Menu ref is properly initialized because both the button (line 11,
v-if="isActiveTab") and the Menu component (line 48,v-if="isActiveTab") are conditionally rendered with the same reactive condition. WhenisActiveTabis true, both the triggering button and the Menu are mounted. SincehandleMenuClickcan only be called when the button is visible,menu.valuewill always be defined. The optional chaining (?.toggle()) is appropriate defensive programming and consistent with similar patterns throughout the codebase (e.g.,TopbarBadge.vue,ComfyMenuButton.vue). No race conditions exist because both button and menu visibility are tied to the same reactive value.src/components/breadcrumb/SubgraphBreadcrumbItem.vue (4)
28-28: Menu rendering extended to root item - verify menu items are appropriate.The Menu now renders when
isActive || isRoot, meaning the root item can show a menu even when not active. Ensure the menu items returned byuseBreadcrumbMenuare appropriate for both active and inactive root items.Based on the
useBreadcrumbMenuimplementation, whenisRootis true, the menu includes save/delete actions even if not active. This might be intentional for allowing quick access to workflow actions from the collapsed breadcrumb.Verify this behavior aligns with the UX design intent, especially when the breadcrumb is collapsed and only the root item is visible.
139-158: LGTM! The startRename function handles collapsed breadcrumb correctly.The function:
- Checks if the root element is hidden using
offsetParent === null(correct check for CSSdisplay:none)- Falls back to executing the rename command when collapsed (line 143)
- Otherwise enables in-place editing with proper focus and selection (lines 147-157)
- Dynamically sizes the input to match or exceed the wrapper width (line 154)
This is a well-thought-out solution for handling both expanded and collapsed states.
189-195: LGTM! Exposing toggleMenu enables external control.The
toggleMenumethod is exposed viadefineExpose, allowing parent components (like SubgraphBreadcrumb.vue) to programmatically open the menu. This is a clean API for inter-component communication.
10-10: No layout concern — height is consistently aligned across all breadcrumb components.The
h-8height is already applied consistently throughout the breadcrumb system. The parent container (SubgraphBreadcrumb.vue) usesh-8, as do the menu buttons and all breadcrumb items. All components are uniformly sized, so there is no visual misalignment risk with adjacent elements.src/components/breadcrumb/SubgraphBreadcrumb.vue (3)
16-23: LGTM! Context menu button is well-implemented.The button:
- Uses consistent styling with other breadcrumb controls
- Has appropriate transitions and hover states
- Uses PrimeVue Button component as per project guidelines
- Has proper icon and accessibility attributes
24-33: LGTM! Back button is conditionally rendered and accessible.The button:
- Only shows when in a subgraph (
v-if="isInSubgraph")- Uses a clear "undo" icon to indicate navigation back
- Has consistent styling with the menu button
- Properly wires to
handleBackClick
143-148: LGTM! Menu click handler is correctly implemented.The handler:
- Logs telemetry for UI tracking
- Safely accesses
rootItemRefwith optional chaining- Passes the event to toggle the menu at the correct position
src/composables/useBreadcrumbMenu.ts (1)
23-23: The rename action is properly protected against non-persisted workflows.The disabled state at line 23 correctly prevents UI interaction for non-persisted workflows (
disabled: isRoot && !workflowStore.activeWorkflow?.isPersisted). The edge case concern about direct callback invocation is already mitigated: the underlyingComfy.RenameWorkflowcommand handler validatesif (!workflow || !workflow.isPersisted) return, providing a safeguard against programmatic invocation bypassing the disabled state. No changes needed.
| :ref=" | ||
| (el) => { | ||
| const ref = el as | ||
| | InstanceType<typeof SubgraphBreadcrumbItem> | ||
| | undefined | ||
| if (item.key === 'root') rootItemRef = ref | ||
| if (item.key === activeItemKey) activeItemRef = ref | ||
| } | ||
| " |
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
Verify type safety of ref callback.
The ref callback casts el to InstanceType<typeof SubgraphBreadcrumbItem> | undefined and assigns refs based on item keys. This pattern works but could be fragile if the component type changes.
Consider using a more type-safe approach with a Map or dedicated ref handling:
🔎 Alternative approach
const itemRefs = new Map<string, InstanceType<typeof SubgraphBreadcrumbItem>>()
const setItemRef = (key: string) => (el: unknown) => {
const ref = el as InstanceType<typeof SubgraphBreadcrumbItem> | undefined
if (ref) {
itemRefs.set(key, ref)
if (key === 'root') rootItemRef.value = ref
if (key === activeItemKey.value) activeItemRef.value = ref
}
}
// In template:
// :ref="setItemRef(item.key)"| const home = computed(() => ({ | ||
| label: workflowName.value, | ||
| icon: 'pi pi-home', | ||
| key: 'root', | ||
| isBlueprint: isBlueprint.value, | ||
| command: () => { | ||
| useTelemetry()?.trackUiButtonClicked({ | ||
| button_id: 'breadcrumb_subgraph_root_selected' | ||
| }) | ||
| const canvas = useCanvasStore().getCanvas() | ||
| if (!canvas.graph) throw new TypeError('Canvas has no graph') | ||
| canvas.setGraph(canvas.graph.rootGraph) | ||
| } | ||
| })) |
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.
Missing error handling in home command.
Lines 108-111 throw a TypeError if canvas.graph is null, but there's no try-catch to handle this gracefully. If the error occurs during user interaction, it will propagate unhandled.
🔎 Proposed fix
command: () => {
useTelemetry()?.trackUiButtonClicked({
button_id: 'breadcrumb_subgraph_root_selected'
})
const canvas = useCanvasStore().getCanvas()
- if (!canvas.graph) throw new TypeError('Canvas has no graph')
+ if (!canvas.graph) {
+ console.error('Canvas has no graph')
+ return
+ }
canvas.setGraph(canvas.graph.rootGraph)
}📝 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 home = computed(() => ({ | |
| label: workflowName.value, | |
| icon: 'pi pi-home', | |
| key: 'root', | |
| isBlueprint: isBlueprint.value, | |
| command: () => { | |
| useTelemetry()?.trackUiButtonClicked({ | |
| button_id: 'breadcrumb_subgraph_root_selected' | |
| }) | |
| const canvas = useCanvasStore().getCanvas() | |
| if (!canvas.graph) throw new TypeError('Canvas has no graph') | |
| canvas.setGraph(canvas.graph.rootGraph) | |
| } | |
| })) | |
| const home = computed(() => ({ | |
| label: workflowName.value, | |
| icon: 'pi pi-home', | |
| key: 'root', | |
| isBlueprint: isBlueprint.value, | |
| command: () => { | |
| useTelemetry()?.trackUiButtonClicked({ | |
| button_id: 'breadcrumb_subgraph_root_selected' | |
| }) | |
| const canvas = useCanvasStore().getCanvas() | |
| if (!canvas.graph) { | |
| console.error('Canvas has no graph') | |
| return | |
| } | |
| canvas.setGraph(canvas.graph.rootGraph) | |
| } | |
| })) |
🤖 Prompt for AI Agents
In @src/components/breadcrumb/SubgraphBreadcrumb.vue around lines 99 - 113, The
breadcrumb's home computed property command currently throws a TypeError when
canvas.graph is missing; wrap the command body in a try/catch to prevent an
unhandled exception, e.g., in the computed property home -> command: call
useCanvasStore().getCanvas(), check for canvas and canvas.graph, and if missing
handle gracefully in the catch by logging the error (or using the app's
notifier/telemetry) and returning early instead of throwing; keep the existing
telemetry.trackUiButtonClicked call and only call
canvas.setGraph(canvas.graph.rootGraph) when canvas.graph is present.
| const handleBackClick = () => { | ||
| void useCommandStore().execute('Comfy.Graph.ExitSubgraph') | ||
| } |
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.
Missing await for async command execution.
Line 151 calls useCommandStore().execute() which returns a Promise, but the result is voided without awaiting. If the command fails, the error won't be caught.
🔎 Proposed fix
-const handleBackClick = () => {
+const handleBackClick = async () => {
- void useCommandStore().execute('Comfy.Graph.ExitSubgraph')
+ try {
+ await useCommandStore().execute('Comfy.Graph.ExitSubgraph')
+ } catch (error) {
+ console.error('Failed to exit subgraph:', error)
+ }
}📝 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 handleBackClick = () => { | |
| void useCommandStore().execute('Comfy.Graph.ExitSubgraph') | |
| } | |
| const handleBackClick = async () => { | |
| try { | |
| await useCommandStore().execute('Comfy.Graph.ExitSubgraph') | |
| } catch (error) { | |
| console.error('Failed to exit subgraph:', error) | |
| } | |
| } |
🤖 Prompt for AI Agents
In @src/components/breadcrumb/SubgraphBreadcrumb.vue around lines 150 - 152, The
handler handleBackClick is calling
useCommandStore().execute('Comfy.Graph.ExitSubgraph') and dropping the returned
Promise with void, so failures will be lost; make handleBackClick async, await
useCommandStore().execute(...) and wrap the await in a try/catch (or return the
Promise) to surface/log errors (reference handleBackClick and
useCommandStore().execute).
| const rootMenuItem: MenuItem = { | ||
| label: props.workflowOption.workflow.filename, | ||
| key: 'root', | ||
| isBlueprint: useSubgraphStore().isSubgraphBlueprint( | ||
| props.workflowOption.workflow | ||
| ) | ||
| } | ||
| const { menuItems } = useBreadcrumbMenu(rootMenuItem, () => | ||
| useCommandStore().execute('Comfy.RenameWorkflow') | ||
| ) |
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
Missing null check for workflow before accessing properties.
Lines 151 and 153-155 access props.workflowOption.workflow properties without verifying the workflow exists. While this is likely safe given the component props, defensive coding would add a guard.
🔎 Proposed fix
+const workflow = props.workflowOption.workflow
+if (!workflow) {
+ console.error('WorkflowTab: workflow is missing')
+ // Return empty menuItems or throw
+}
+
const rootMenuItem: MenuItem = {
- label: props.workflowOption.workflow.filename,
+ label: workflow.filename,
key: 'root',
isBlueprint: useSubgraphStore().isSubgraphBlueprint(
- props.workflowOption.workflow
+ workflow
)
}Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In @src/components/topbar/WorkflowTab.vue around lines 150 - 159, Guard against
a null/undefined workflow before accessing its properties: check
props.workflowOption.workflow and use a safe fallback when building rootMenuItem
(e.g., use a default label like 'Untitled' and isBlueprint = false) so that
label and the call to useSubgraphStore().isSubgraphBlueprint(...) never read
properties of null; then pass that safe rootMenuItem into useBreadcrumbMenu and
keep the existing command invocation
useCommandStore().execute('Comfy.RenameWorkflow').
| const menuItems = computed<MenuItem[]>(() => { | ||
| return [ | ||
| { | ||
| label: t('g.rename'), | ||
| icon: 'pi pi-pencil', | ||
| command: startRename, | ||
| disabled: isRoot && !workflowStore.activeWorkflow?.isPersisted | ||
| }, | ||
| { | ||
| label: t('breadcrumbsMenu.duplicate'), | ||
| icon: 'pi pi-copy', | ||
| command: async () => { | ||
| await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!) | ||
| }, | ||
| visible: isRoot && !isBlueprint | ||
| }, | ||
| { | ||
| separator: true, | ||
| visible: isRoot | ||
| }, | ||
| { | ||
| label: t('menuLabels.Save'), | ||
| icon: 'pi pi-save', | ||
| command: async () => { | ||
| await useCommandStore().execute('Comfy.SaveWorkflow') | ||
| }, | ||
| visible: isRoot | ||
| }, | ||
| { | ||
| label: t('menuLabels.Save As'), | ||
| icon: 'pi pi-save', | ||
| command: async () => { | ||
| await useCommandStore().execute('Comfy.SaveWorkflowAs') | ||
| }, | ||
| visible: isRoot | ||
| }, | ||
| { | ||
| separator: true | ||
| }, | ||
| { | ||
| label: t('breadcrumbsMenu.clearWorkflow'), | ||
| icon: 'pi pi-trash', | ||
| command: async () => { | ||
| await useCommandStore().execute('Comfy.ClearWorkflow') | ||
| } | ||
| }, | ||
| { | ||
| separator: true, | ||
| visible: isRoot && isBlueprint | ||
| }, | ||
| { | ||
| label: t('subgraphStore.publish'), | ||
| icon: 'pi pi-copy', | ||
| command: async () => { | ||
| await workflowService.saveWorkflowAs(workflowStore.activeWorkflow!) | ||
| }, | ||
| visible: isRoot && isBlueprint | ||
| }, | ||
| { | ||
| separator: true, | ||
| visible: isRoot | ||
| }, | ||
| { | ||
| label: isBlueprint | ||
| ? t('breadcrumbsMenu.deleteBlueprint') | ||
| : t('breadcrumbsMenu.deleteWorkflow'), | ||
| icon: 'pi pi-times', | ||
| command: async () => { | ||
| await workflowService.deleteWorkflow(workflowStore.activeWorkflow!) | ||
| }, | ||
| visible: isRoot | ||
| } | ||
| ] | ||
| }) |
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 filtering menu items instead of using visible property.
The menu items use a visible property to conditionally show/hide items, which means invisible items are still part of the array. PrimeVue Menu will handle this correctly, but filtering the array would be more efficient and cleaner.
🔎 Proposed refactor
const menuItems = computed<MenuItem[]>(() => {
- return [
+ const allItems = [
{
label: t('g.rename'),
icon: 'pi pi-pencil',
command: startRename,
disabled: isRoot && !workflowStore.activeWorkflow?.isPersisted
},
// ... rest of items
]
+ return allItems.filter(item => item.visible !== false)
})📝 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 menuItems = computed<MenuItem[]>(() => { | |
| return [ | |
| { | |
| label: t('g.rename'), | |
| icon: 'pi pi-pencil', | |
| command: startRename, | |
| disabled: isRoot && !workflowStore.activeWorkflow?.isPersisted | |
| }, | |
| { | |
| label: t('breadcrumbsMenu.duplicate'), | |
| icon: 'pi pi-copy', | |
| command: async () => { | |
| await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!) | |
| }, | |
| visible: isRoot && !isBlueprint | |
| }, | |
| { | |
| separator: true, | |
| visible: isRoot | |
| }, | |
| { | |
| label: t('menuLabels.Save'), | |
| icon: 'pi pi-save', | |
| command: async () => { | |
| await useCommandStore().execute('Comfy.SaveWorkflow') | |
| }, | |
| visible: isRoot | |
| }, | |
| { | |
| label: t('menuLabels.Save As'), | |
| icon: 'pi pi-save', | |
| command: async () => { | |
| await useCommandStore().execute('Comfy.SaveWorkflowAs') | |
| }, | |
| visible: isRoot | |
| }, | |
| { | |
| separator: true | |
| }, | |
| { | |
| label: t('breadcrumbsMenu.clearWorkflow'), | |
| icon: 'pi pi-trash', | |
| command: async () => { | |
| await useCommandStore().execute('Comfy.ClearWorkflow') | |
| } | |
| }, | |
| { | |
| separator: true, | |
| visible: isRoot && isBlueprint | |
| }, | |
| { | |
| label: t('subgraphStore.publish'), | |
| icon: 'pi pi-copy', | |
| command: async () => { | |
| await workflowService.saveWorkflowAs(workflowStore.activeWorkflow!) | |
| }, | |
| visible: isRoot && isBlueprint | |
| }, | |
| { | |
| separator: true, | |
| visible: isRoot | |
| }, | |
| { | |
| label: isBlueprint | |
| ? t('breadcrumbsMenu.deleteBlueprint') | |
| : t('breadcrumbsMenu.deleteWorkflow'), | |
| icon: 'pi pi-times', | |
| command: async () => { | |
| await workflowService.deleteWorkflow(workflowStore.activeWorkflow!) | |
| }, | |
| visible: isRoot | |
| } | |
| ] | |
| }) | |
| const menuItems = computed<MenuItem[]>(() => { | |
| const allItems = [ | |
| { | |
| label: t('g.rename'), | |
| icon: 'pi pi-pencil', | |
| command: startRename, | |
| disabled: isRoot && !workflowStore.activeWorkflow?.isPersisted | |
| }, | |
| { | |
| label: t('breadcrumbsMenu.duplicate'), | |
| icon: 'pi pi-copy', | |
| command: async () => { | |
| await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!) | |
| }, | |
| visible: isRoot && !isBlueprint | |
| }, | |
| { | |
| separator: true, | |
| visible: isRoot | |
| }, | |
| { | |
| label: t('menuLabels.Save'), | |
| icon: 'pi pi-save', | |
| command: async () => { | |
| await useCommandStore().execute('Comfy.SaveWorkflow') | |
| }, | |
| visible: isRoot | |
| }, | |
| { | |
| label: t('menuLabels.Save As'), | |
| icon: 'pi pi-save', | |
| command: async () => { | |
| await useCommandStore().execute('Comfy.SaveWorkflowAs') | |
| }, | |
| visible: isRoot | |
| }, | |
| { | |
| separator: true | |
| }, | |
| { | |
| label: t('breadcrumbsMenu.clearWorkflow'), | |
| icon: 'pi pi-trash', | |
| command: async () => { | |
| await useCommandStore().execute('Comfy.ClearWorkflow') | |
| } | |
| }, | |
| { | |
| separator: true, | |
| visible: isRoot && isBlueprint | |
| }, | |
| { | |
| label: t('subgraphStore.publish'), | |
| icon: 'pi pi-copy', | |
| command: async () => { | |
| await workflowService.saveWorkflowAs(workflowStore.activeWorkflow!) | |
| }, | |
| visible: isRoot && isBlueprint | |
| }, | |
| { | |
| separator: true, | |
| visible: isRoot | |
| }, | |
| { | |
| label: isBlueprint | |
| ? t('breadcrumbsMenu.deleteBlueprint') | |
| : t('breadcrumbsMenu.deleteWorkflow'), | |
| icon: 'pi pi-times', | |
| command: async () => { | |
| await workflowService.deleteWorkflow(workflowStore.activeWorkflow!) | |
| }, | |
| visible: isRoot | |
| } | |
| ] | |
| return allItems.filter(item => item.visible !== false) | |
| }) |
🤖 Prompt for AI Agents
In @src/composables/useBreadcrumbMenu.ts around lines 17 - 90, The computed
menuItems currently includes entries with a visible property so hidden items
remain in the array; change the logic inside the computed menuItems to only
return items that meet their visibility conditions (e.g., include entries
conditionally instead of setting visible) and filter out falsy entries before
returning, ensuring you also avoid leading/trailing or duplicate separators when
conditions remove neighboring items; update the computed block that builds
MenuItem[] (menuItems) to construct items conditionally and then call a final
.filter(Boolean) and a small pass to collapse/remove redundant separators.
| await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!) | ||
| }, |
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.
Missing null check before dereferencing activeWorkflow.
Line 29 uses workflowStore.activeWorkflow! with a non-null assertion, but there's no guard ensuring activeWorkflow exists. If duplicateWorkflow is invoked when no workflow is active, this will throw a runtime error.
🔎 Proposed fix
command: async () => {
+ if (!workflowStore.activeWorkflow) return
await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!)
},📝 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.
| await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!) | |
| }, | |
| command: async () => { | |
| if (!workflowStore.activeWorkflow) return | |
| await workflowService.duplicateWorkflow(workflowStore.activeWorkflow!) | |
| }, |
🤖 Prompt for AI Agents
In @src/composables/useBreadcrumbMenu.ts around lines 29 - 30, The code
dereferences workflowStore.activeWorkflow with a non-null assertion when calling
workflowService.duplicateWorkflow, risking a runtime error if no workflow is
active; add a guard in the useBreadcrumbMenu action so you check that
workflowStore.activeWorkflow is defined before calling duplicateWorkflow (e.g.,
if not defined, return early or show an error/disable the action), and use the
non-asserted value (no "!") when passing it to workflowService.duplicateWorkflow
to ensure safe runtime behavior.
| label: t('subgraphStore.publish'), | ||
| icon: 'pi pi-copy', | ||
| command: async () => { | ||
| await workflowService.saveWorkflowAs(workflowStore.activeWorkflow!) |
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.
Missing null check before dereferencing activeWorkflow.
Line 71 uses workflowStore.activeWorkflow! with a non-null assertion, but there's no guard ensuring activeWorkflow exists when publishing a blueprint.
🔎 Proposed fix
command: async () => {
+ if (!workflowStore.activeWorkflow) return
await workflowService.saveWorkflowAs(workflowStore.activeWorkflow!)
},📝 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.
| await workflowService.saveWorkflowAs(workflowStore.activeWorkflow!) | |
| command: async () => { | |
| if (!workflowStore.activeWorkflow) return | |
| await workflowService.saveWorkflowAs(workflowStore.activeWorkflow!) | |
| }, |
🤖 Prompt for AI Agents
In @src/composables/useBreadcrumbMenu.ts at line 71, The code dereferences
workflowStore.activeWorkflow with a non-null assertion when calling
saveWorkflowAs, which can throw if activeWorkflow is null; add a null/undefined
guard before calling workflowService.saveWorkflowAs (e.g., check if
workflowStore.activeWorkflow is present and handle the missing case by returning
early or showing an error) and only call
workflowService.saveWorkflowAs(workflowStore.activeWorkflow) when the guard
passes; update any caller paths that assume success accordingly.
| : t('breadcrumbsMenu.deleteWorkflow'), | ||
| icon: 'pi pi-times', | ||
| command: async () => { | ||
| await workflowService.deleteWorkflow(workflowStore.activeWorkflow!) |
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.
Missing null check before dereferencing activeWorkflow.
Line 85 uses workflowStore.activeWorkflow! with a non-null assertion, but there's no guard ensuring activeWorkflow exists when deleting.
🔎 Proposed fix
command: async () => {
+ if (!workflowStore.activeWorkflow) return
await workflowService.deleteWorkflow(workflowStore.activeWorkflow!)
},Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In @src/composables/useBreadcrumbMenu.ts at line 85, The code dereferences
workflowStore.activeWorkflow with a non-null assertion when calling
workflowService.deleteWorkflow; add a null/undefined guard before calling
deleteWorkflow (e.g., check if workflowStore.activeWorkflow exists and return or
throw a handled error if not) and pass the validated value to
workflowService.deleteWorkflow instead of using the `!` operator so you avoid
potential runtime exceptions.
Summary
For users who don't use subgraphs, the workflow name in the top left can be unnecessarily obstructive so this updated collapses it to a simple icon until a subgraph is entered.
Changes
Screenshots (if applicable)
┆Issue is synchronized with this Notion page by Unito