From a7b21fe99563fd8c8d2beaf57ef5e32306a0b4b0 Mon Sep 17 00:00:00 2001 From: jaeone94 <89377375+jaeone94@users.noreply.github.com> Date: Fri, 31 Jul 2026 09:20:11 +0900 Subject: [PATCH 01/14] feat(errors): classify error groups by presentation severity --- src/components/error/ErrorOverlay.test.ts | 2 ++ .../error/useErrorOverlayState.test.ts | 10 ++++++ src/components/rightSidePanel/errors/types.ts | 3 ++ .../errors/useErrorGroups.test.ts | 35 +++++++++++++++++++ .../rightSidePanel/errors/useErrorGroups.ts | 15 +++++--- 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/src/components/error/ErrorOverlay.test.ts b/src/components/error/ErrorOverlay.test.ts index be7237a9d32..67a35e7ea6d 100644 --- a/src/components/error/ErrorOverlay.test.ts +++ b/src/components/error/ErrorOverlay.test.ts @@ -134,6 +134,7 @@ describe('ErrorOverlay', () => { mockAllErrorGroups.value = [ { type: 'execution', + severity: 'error', groupKey: 'execution:KSampler', displayTitle: 'Execution failed', count: 1, @@ -171,6 +172,7 @@ describe('ErrorOverlay', () => { mockAllErrorGroups.value = [ { type: 'execution', + severity: 'error', groupKey: 'execution:KSampler', displayTitle: 'Execution failed', count: 1, diff --git a/src/components/error/useErrorOverlayState.test.ts b/src/components/error/useErrorOverlayState.test.ts index deae2a183aa..8dfaa2b63d0 100644 --- a/src/components/error/useErrorOverlayState.test.ts +++ b/src/components/error/useErrorOverlayState.test.ts @@ -115,6 +115,7 @@ describe('useErrorOverlayState', () => { mockAllErrorGroups.value = [ { type: 'execution', + severity: 'error', groupKey: 'execution:KSampler', displayTitle: 'Execution failed', count: 1, @@ -146,6 +147,7 @@ describe('useErrorOverlayState', () => { mockAllErrorGroups.value = [ { type: 'execution', + severity: 'error', groupKey: 'execution:KSampler', displayTitle: 'Required input is missing', count: 1, @@ -186,6 +188,7 @@ describe('useErrorOverlayState', () => { mockAllErrorGroups.value = [ { type: 'execution', + severity: 'error', groupKey: 'execution:KSampler', displayTitle: 'Friendly validation title', count: 1, @@ -225,6 +228,7 @@ describe('useErrorOverlayState', () => { mockAllErrorGroups.value = [ { type: 'execution', + severity: 'error', groupKey: 'execution:KSampler', displayTitle: 'Generation failed', count: 1, @@ -297,6 +301,7 @@ describe('useErrorOverlayState', () => { mockAllErrorGroups.value = [ { type: 'missing_media', + severity: 'missing', groupKey: 'missing_media', displayTitle: 'Media input missing', displayMessage: 'A required media input has no file selected.', @@ -357,6 +362,7 @@ describe('useErrorOverlayState', () => { mockAllErrorGroups.value = [ { type: 'missing_model', + severity: 'missing', groupKey: 'missing_model', displayTitle: 'Missing Models', displayMessage: 'Import a model, or open the node to replace it.', @@ -382,6 +388,7 @@ describe('useErrorOverlayState', () => { mockAllErrorGroups.value = [ { type: 'execution', + severity: 'error', groupKey: 'execution:required_input_missing', displayTitle: 'Missing connection', displayMessage: 'Required input slots have no connection feeding them.', @@ -449,6 +456,7 @@ describe('useErrorOverlayState', () => { mockAllErrorGroups.value = [ { type: 'missing_model', + severity: 'missing', groupKey: 'missing_model', displayTitle: 'Missing Models', displayMessage: 'Import a model, or open the node to replace it.', @@ -488,6 +496,7 @@ describe('useErrorOverlayState', () => { mockAllErrorGroups.value = [ { type: 'execution', + severity: 'error', groupKey: 'execution:KSampler', displayTitle: 'Execution failed', displayMessage: 'First group message', @@ -503,6 +512,7 @@ describe('useErrorOverlayState', () => { }, { type: 'execution', + severity: 'error', groupKey: 'execution:CLIPTextEncode', displayTitle: 'Invalid CLIP input', displayMessage: 'Second group message', diff --git a/src/components/rightSidePanel/errors/types.ts b/src/components/rightSidePanel/errors/types.ts index f5a3810f070..544b8eac903 100644 --- a/src/components/rightSidePanel/errors/types.ts +++ b/src/components/rightSidePanel/errors/types.ts @@ -19,6 +19,8 @@ export interface ErrorCardData { errors: ErrorItem[] } +export type ErrorGroupSeverity = 'error' | 'missing' + interface ErrorGroupBase extends Omit { /** Stable structural key used for rendering, collapse state, and cache identity. */ groupKey: string @@ -26,6 +28,7 @@ interface ErrorGroupBase extends Omit { displayTitle: string count: number priority: number + severity: ErrorGroupSeverity } export type ErrorGroup = diff --git a/src/components/rightSidePanel/errors/useErrorGroups.test.ts b/src/components/rightSidePanel/errors/useErrorGroups.test.ts index 9f2de184a17..55143025598 100644 --- a/src/components/rightSidePanel/errors/useErrorGroups.test.ts +++ b/src/components/rightSidePanel/errors/useErrorGroups.test.ts @@ -423,6 +423,41 @@ describe('useErrorGroups', () => { expect(swapIdx).toBeLessThan(missingIdx) }) + it('places every error-severity group before missing-severity groups', async () => { + const { store, groups } = createErrorGroups() + const missingNodesStore = useMissingNodesErrorStore() + store.recordPromptError({ + type: 'prompt_no_outputs', + message: 'No outputs', + details: '' + }) + store.recordNodeErrors({ + '1': nodeError([validationError('required_input_missing', 'model')]) + }) + store.surfaceMissingModels([ + makeModel('model.safetensors', { nodeId: '2' }) + ]) + store.surfaceMissingMedia([makeMedia('portrait.png', { nodeId: '3' })]) + missingNodesStore.setMissingNodeTypes([ + makeMissingNodeType('MissingNode', { + nodeId: '4', + cnrId: 'missing-pack' + }) + ]) + await nextTick() + + const errorIndices = groups.allErrorGroups.value.flatMap( + (group, index) => (group.severity === 'error' ? [index] : []) + ) + const missingIndices = groups.allErrorGroups.value.flatMap( + (group, index) => (group.severity === 'missing' ? [index] : []) + ) + + expect(Math.max(...errorIndices)).toBeLessThan( + Math.min(...missingIndices) + ) + }) + it('uses fallback catalog grouping for unknown node validation errors', async () => { const { store, groups } = createErrorGroups() store.recordNodeErrors({ diff --git a/src/components/rightSidePanel/errors/useErrorGroups.ts b/src/components/rightSidePanel/errors/useErrorGroups.ts index 66549b0b8a8..34cdccdbdd0 100644 --- a/src/components/rightSidePanel/errors/useErrorGroups.ts +++ b/src/components/rightSidePanel/errors/useErrorGroups.ts @@ -151,6 +151,7 @@ function toSortedGroups(groupsMap: Map): ErrorGroup[] { const cards = Array.from(groupData.cards.values()).sort(compareNodeId) return { type: 'execution' as const, + severity: 'error' as const, groupKey: `execution:${rawGroupKey}`, displayTitle: groupData.displayTitle, displayMessage: groupData.displayMessage, @@ -614,6 +615,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter) { if (swapCount > 0) { groups.push({ type: 'swap_nodes' as const, + severity: 'missing' as const, groupKey: 'swap_nodes', count: swapCount, priority: 0, @@ -629,6 +631,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter) { if (packCount > 0) { groups.push({ type: 'missing_node' as const, + severity: 'missing' as const, groupKey: 'missing_node', count: packCount, priority: 1, @@ -657,6 +660,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter) { return [ { type: 'missing_model' as const, + severity: 'missing' as const, groupKey: 'missing_model', count, priority: 2, @@ -682,6 +686,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter) { return [ { type: 'missing_media' as const, + severity: 'missing' as const, groupKey: 'missing_media', count: totalRows, priority: 3, @@ -752,6 +757,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter) { return [ { type: 'missing_model' as const, + severity: 'missing' as const, groupKey: 'missing_model', count, priority: 2, @@ -773,6 +779,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter) { return [ { type: 'missing_media' as const, + severity: 'missing' as const, groupKey: 'missing_media', count: totalRows, priority: 3, @@ -794,10 +801,10 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter) { processExecutionError(groupsMap) return [ + ...toSortedGroups(groupsMap), ...buildMissingNodeGroups(), ...buildMissingModelGroups(), - ...buildMissingMediaGroups(), - ...toSortedGroups(groupsMap) + ...buildMissingMediaGroups() ] }) @@ -816,12 +823,12 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter) { processExecutionError(groupsMap, true) return [ + ...toSortedGroups(groupsMap), ...buildMissingNodeGroups((nodeTypes) => someNodeTypeInSelection(nodeTypes, selectionMatchedAssetNodeIds.value) ), ...buildMissingModelGroupsForSelection(), - ...buildMissingMediaGroupsForSelection(), - ...toSortedGroups(groupsMap) + ...buildMissingMediaGroupsForSelection() ] }) From 114cf1306d23bdba8549fd1857c5fa665e1be9bc Mon Sep 17 00:00:00 2001 From: jaeone94 <89377375+jaeone94@users.noreply.github.com> Date: Fri, 31 Jul 2026 09:20:30 +0900 Subject: [PATCH 02/14] feat(errors): distinguish setup warnings in the errors panel --- .../ComfyRunButton/ComfyQueueButton.test.ts | 21 ++- .../errors/ErrorCardSection.vue | 13 +- .../rightSidePanel/errors/ErrorGroupList.vue | 141 ++++++++++++++---- src/locales/en/main.json | 8 + 4 files changed, 153 insertions(+), 30 deletions(-) diff --git a/src/components/actionbar/ComfyRunButton/ComfyQueueButton.test.ts b/src/components/actionbar/ComfyRunButton/ComfyQueueButton.test.ts index 0aa8155658e..4e8745a77f7 100644 --- a/src/components/actionbar/ComfyRunButton/ComfyQueueButton.test.ts +++ b/src/components/actionbar/ComfyRunButton/ComfyQueueButton.test.ts @@ -1,4 +1,6 @@ import { createTestingPinia } from '@pinia/testing' +import PrimeVue from 'primevue/config' +import Tooltip from 'primevue/tooltip' import { describe, expect, it, vi } from 'vitest' import { nextTick } from 'vue' import { createI18n } from 'vue-i18n' @@ -157,9 +159,9 @@ function renderQueueButton( const result = render(ComfyQueueButton, { props, global: { - plugins: [pinia, i18n], + plugins: [PrimeVue, pinia, i18n], directives: { - tooltip: () => {} + tooltip: Tooltip }, stubs } @@ -222,6 +224,21 @@ describe('ComfyQueueButton', () => { } ) + it('keeps Run enabled with the missing-resource warning and tooltip', async () => { + const { user } = renderQueueButton() + useMissingModelStore().missingModelCandidates = [missingModelCandidate] + await nextTick() + + const queueButton = screen.getByTestId('queue-button') + expect(queueButton).toBeEnabled() + + await user.hover(queueButton) + + expect(await screen.findByRole('tooltip')).toHaveTextContent( + 'Workflow contains missing resources' + ) + }) + it('keeps the play icon for non-missing errors', async () => { renderQueueButton() useExecutionErrorStore().recordPromptError({ diff --git a/src/components/rightSidePanel/errors/ErrorCardSection.vue b/src/components/rightSidePanel/errors/ErrorCardSection.vue index e27dd5abff2..922b92eaf2c 100644 --- a/src/components/rightSidePanel/errors/ErrorCardSection.vue +++ b/src/components/rightSidePanel/errors/ErrorCardSection.vue @@ -9,7 +9,15 @@ @click="collapse = !collapse" > {{ count }} @@ -52,15 +60,18 @@ import { useId } from 'vue' import { useI18n } from 'vue-i18n' import { cn } from '@comfyorg/tailwind-utils' +import type { ErrorGroupSeverity } from '@/components/rightSidePanel/errors/types' import TransitionCollapse from '@/components/rightSidePanel/layout/TransitionCollapse.vue' const { title, count, + severity, class: className } = defineProps<{ title: string count: number + severity: ErrorGroupSeverity class?: string }>() diff --git a/src/components/rightSidePanel/errors/ErrorGroupList.vue b/src/components/rightSidePanel/errors/ErrorGroupList.vue index 91129b21671..205461023d5 100644 --- a/src/components/rightSidePanel/errors/ErrorGroupList.vue +++ b/src/components/rightSidePanel/errors/ErrorGroupList.vue @@ -29,26 +29,57 @@ class="overflow-hidden rounded-lg border border-secondary-background" > -
- +
- {{ totalErrorCount }} - -
@@ -85,6 +116,7 @@ :data-testid="'error-group-' + group.type.replaceAll('_', '-')" :title="group.displayTitle" :count="group.count" + :severity="group.severity" :collapse="isSectionCollapsed(group.groupKey) && !isSearching" class="border-t border-secondary-background first:border-t-0" @update:collapse="setSectionCollapsed(group.groupKey, $event)" @@ -362,6 +394,26 @@ interface ExecutionItemListEntry { displayDetails?: string } +interface ContextStrip { + keypath: string + count: number + nodes: number +} + +/** Count-only `none` keys keep node-less errors from reading as "0 nodes". */ +const SUMMARY_KEYPATHS = { + error: { + none: 'rightSidePanel.errorsSummary', + single: 'rightSidePanel.errorNodeSummary', + multiple: 'rightSidePanel.errorNodesSummary' + }, + setup: { + none: 'rightSidePanel.setupSummary', + single: 'rightSidePanel.setupNodeSummary', + multiple: 'rightSidePanel.setupNodesSummary' + } +} as const + const { t } = useI18n() const { copyToClipboard } = useCopyToClipboard() const { focusNode } = useFocusNode() @@ -452,8 +504,15 @@ const { errorNodeCount } = useErrorGroups(searchQuery) -const totalErrorCount = computed(() => - filteredGroups.value.reduce((sum, group) => sum + group.count, 0) +const errorCount = computed(() => + filteredGroups.value + .filter((group) => group.severity === 'error') + .reduce((sum, group) => sum + group.count, 0) +) +const missingCount = computed(() => + filteredGroups.value + .filter((group) => group.severity === 'missing') + .reduce((sum, group) => sum + group.count, 0) ) const hasSelectionEmphasis = computed( @@ -468,8 +527,19 @@ const selectionStripNodeLabel = computed( const workflowErrorCount = computed(() => allErrorGroups.value.reduce((sum, group) => sum + group.count, 0) ) +const workflowBlockingErrorCount = computed(() => + allErrorGroups.value + .filter((group) => group.severity === 'error') + .reduce((sum, group) => sum + group.count, 0) +) +const hasErrorSeverity = computed(() => + allErrorGroups.value.some((group) => group.severity === 'error') +) +const hasMissingSeverity = computed(() => + allErrorGroups.value.some((group) => group.severity === 'missing') +) -const strip = computed(() => { +const strip = computed(() => { if (hasSelectionEmphasis.value) { return { keypath: @@ -480,14 +550,31 @@ const strip = computed(() => { count: selectionErrorCount.value } } + if (hasErrorSeverity.value && hasMissingSeverity.value) { + return { + keypath: + errorNodeCount.value === 0 + ? 'rightSidePanel.errorsSummary' + : 'rightSidePanel.nodesAffected', + nodes: errorNodeCount.value, + count: + errorNodeCount.value === 0 + ? workflowBlockingErrorCount.value + : errorNodeCount.value + } + } + const keypaths = hasErrorSeverity.value + ? SUMMARY_KEYPATHS.error + : SUMMARY_KEYPATHS.setup + const nodeCountKey = + errorNodeCount.value === 0 + ? 'none' + : errorNodeCount.value === 1 + ? 'single' + : 'multiple' + return { - keypath: - errorNodeCount.value === 0 - ? // Node-less errors (e.g. prompt-level) would read as "0 nodes" - 'rightSidePanel.errorsSummary' - : errorNodeCount.value === 1 - ? 'rightSidePanel.errorNodeSummary' - : 'rightSidePanel.errorNodesSummary', + keypath: keypaths[nodeCountKey], nodes: errorNodeCount.value, count: workflowErrorCount.value } diff --git a/src/locales/en/main.json b/src/locales/en/main.json index b417a114d87..8a033d26c73 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -4223,6 +4223,14 @@ "errorNodesSummary": "{nodes} nodes — {count} error | {nodes} nodes — {count} errors", "errorsSummary": "{count} error | {count} errors", "resolveBeforeRun": "Resolve before running the workflow", + "setupPending": "Setup pending", + "setupPendingDesc": "This workflow needs resources before it can run", + "setupSummary": "{count} item | {count} items", + "setupNodeSummary": "{nodes} node — {count} item | {nodes} node — {count} items", + "setupNodesSummary": "{nodes} nodes — {count} item | {nodes} nodes — {count} items", + "nodesAffected": "{count} node affected | {count} nodes affected", + "severityErrorLabel": "Blocking errors", + "severitySetupLabel": "Setup pending", "expand": "Expand", "collapse": "Collapse", "executionErrorOccurred": "An error occurred during execution. Check the Errors tab for details.", From 8ec90667c9da985992ed04d13895a7fd6bc241ee Mon Sep 17 00:00:00 2001 From: jaeone94 <89377375+jaeone94@users.noreply.github.com> Date: Fri, 31 Jul 2026 09:20:54 +0900 Subject: [PATCH 03/14] feat(errors): reflect blocking severity in the errors tab --- .../rightSidePanel/RightSidePanel.vue | 29 ++- .../rightSidePanel/errors/TabErrors.test.ts | 166 ++++++++++++++++-- .../errors/useHasBlockingError.ts | 25 +++ 3 files changed, 204 insertions(+), 16 deletions(-) create mode 100644 src/components/rightSidePanel/errors/useHasBlockingError.ts diff --git a/src/components/rightSidePanel/RightSidePanel.vue b/src/components/rightSidePanel/RightSidePanel.vue index 342aee2c73d..67e124e0f9b 100644 --- a/src/components/rightSidePanel/RightSidePanel.vue +++ b/src/components/rightSidePanel/RightSidePanel.vue @@ -41,6 +41,7 @@ import { } from './shared' import SubgraphEditor from './subgraph/SubgraphEditor.vue' import TabErrors from './errors/TabErrors.vue' +import { useHasBlockingError } from './errors/useHasBlockingError' const canvasStore = useCanvasStore() const executionErrorStore = useExecutionErrorStore() @@ -124,7 +125,10 @@ function handleTabChange(newTab: RightSidePanelTab) { type RightSidePanelTabList = Array<{ label: () => string value: RightSidePanelTab - icon?: string + icon?: { + className: string + label: () => string + } }> const hasDirectNodeError = computed(() => @@ -189,6 +193,8 @@ const hasPendingErrorScanSelected = computed(() => { }) }) +const hasBlockingError = useHasBlockingError() + const tabs = computed(() => { const list: RightSidePanelTabList = [] @@ -200,7 +206,20 @@ const tabs = computed(() => { list.push({ label: () => t('rightSidePanel.errors'), value: 'errors', - icon: 'icon-[lucide--octagon-alert] bg-node-stroke-error ml-1' + icon: { + className: cn( + 'ml-1', + hasBlockingError.value + ? 'icon-[lucide--octagon-alert] bg-node-stroke-error' + : 'icon-[lucide--triangle-alert] bg-warning-background' + ), + label: () => + t( + hasBlockingError.value + ? 'rightSidePanel.severityErrorLabel' + : 'rightSidePanel.severitySetupLabel' + ) + } }) } @@ -382,8 +401,10 @@ function handleTitleCancel() { {{ tab.label() }}