Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class PropertiesPanelHelper {
}

get errorsTabIcon(): Locator {
return this.root.locator('nav i[class*="lucide--octagon-alert"]')
return this.errorsTab.getByTestId('panel-tab-icon')
}

get viewAllSettingsButton(): Locator {
Expand Down
2 changes: 2 additions & 0 deletions browser_tests/tests/propertiesPanel/errorsTab.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ test.describe('Errors tab - common', { tag: '@ui' }, () => {

const panel = new PropertiesPanelHelper(comfyPage.page)
await expect(panel.errorsTabIcon).toBeVisible()
// Missing resources alone are setup warnings, not blocking errors.
await expect(panel.errorsTabIcon).toHaveAccessibleName('Setup required')
})

test('Should not show Errors tab when setting is disabled', async ({
Expand Down
14 changes: 7 additions & 7 deletions browser_tests/tests/propertiesPanel/errorsTabModeAware.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,13 @@ test.describe('Errors tab - Mode-aware errors', { tag: '@ui' }, () => {
await expect(
strip,
'The strip count is scoped to the selection, diverging from the global reference badge'
).toContainText('1 error')
).toContainText('1 issue')

await comfyPage.canvas.click()
await expect(
strip,
'Deselecting swaps the always-visible strip back to the summary'
).toContainText('2 nodes — 1 error')
).toContainText('2 nodes — 1 item')
await expectReferenceBadge(missingModelGroup, 2)
})
})
Expand Down Expand Up @@ -421,12 +421,12 @@ test.describe('Errors tab - Mode-aware errors', { tag: '@ui' }, () => {
TestIds.propertiesPanel.selectionContextStrip
)
await expect(strip).toBeVisible()
await expect(strip).toContainText('1 error')
await expect(strip).toContainText('1 issue')
await expect(mediaRows).toHaveCount(2)

await comfyPage.canvas.click({ position: { x: 400, y: 600 } })
// Deselecting swaps the always-visible strip back to the summary
await expect(strip).toContainText('2 nodes — 2 errors')
await expect(strip).toContainText('2 nodes — 2 items')
await expect(mediaRows).toHaveCount(2)
})
})
Expand All @@ -451,7 +451,7 @@ test.describe('Errors tab - Mode-aware errors', { tag: '@ui' }, () => {
)
await expect(missingNodeCard).toBeVisible()
await expect(mediaRow).toBeVisible()
await expect(strip).toContainText('2 nodes — 2 errors')
await expect(strip).toContainText('2 nodes — 2 items')

const mediaNode = await comfyPage.nodeOps.getNodeRefById('10')
// The node sits near the canvas top where overlays intercept clicks
Expand All @@ -463,14 +463,14 @@ test.describe('Errors tab - Mode-aware errors', { tag: '@ui' }, () => {
await expect(missingNodeCard).toBeHidden()
await expect(mediaRow).toBeVisible()
await expect(mediaRow).toHaveAttribute('aria-current', 'true')
await expect(strip).toContainText('1 error')
await expect(strip).toContainText('1 issue')

await comfyPage.canvas.click({ position: { x: 400, y: 600 } })
// Emphasis ends: the collapsed group re-expands and the strip
// returns to the workflow summary
await expect(missingNodeCard).toBeVisible()
await expect(mediaRow).not.toHaveAttribute('aria-current', 'true')
await expect(strip).toContainText('2 nodes — 2 errors')
await expect(strip).toContainText('2 nodes — 2 items')
})
})

Expand Down
7 changes: 7 additions & 0 deletions packages/design-system/src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
--color-gold-500: #fdab34;
--color-gold-600: #fd9903;
--color-gold-700: #c77700;
--color-gold-800: #8c6a38;

--color-credit: #ddbd31;

Expand Down Expand Up @@ -235,6 +236,8 @@
--inverted-background-hover: var(--color-charcoal-600);
--warning-background: var(--color-gold-400);
--warning-background-hover: var(--color-gold-500);
--warning-foreground: var(--color-gold-800);
--warning-on-background: var(--color-charcoal-800);
--success-background: var(--color-jade-600);
--border-default: var(--color-smoke-600);
--border-subtle: var(--color-smoke-400);
Expand Down Expand Up @@ -388,6 +391,8 @@
--inverted-background-hover: var(--color-smoke-200);
--warning-background: var(--color-gold-600);
--warning-background-hover: var(--color-gold-500);
--warning-foreground: var(--color-gold-600);
--warning-on-background: var(--color-charcoal-800);
--success-background: var(--color-jade-600);
--border-default: var(--color-charcoal-200);
--border-subtle: var(--color-charcoal-300);
Expand Down Expand Up @@ -563,6 +568,8 @@
--color-inverted-background-hover: var(--inverted-background-hover);
--color-warning-background: var(--warning-background);
--color-warning-background-hover: var(--warning-background-hover);
--color-warning-foreground: var(--warning-foreground);
--color-warning-on-background: var(--warning-on-background);
--color-success-background: var(--success-background);
--color-border-default: var(--border-default);
--color-border-subtle: var(--border-subtle);
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -46,6 +48,7 @@ const i18n = createI18n({
en: {
menu: {
run: 'Run',
runOptions: 'Run options',
disabledTooltip: 'Disabled tooltip',
onChange: 'On Change',
onChangeTooltip: 'On change tooltip',
Expand Down Expand Up @@ -157,9 +160,9 @@ function renderQueueButton(
const result = render(ComfyQueueButton, {
props,
global: {
plugins: [pinia, i18n],
plugins: [PrimeVue, pinia, i18n],
directives: {
tooltip: () => {}
tooltip: Tooltip
},
stubs
}
Expand Down Expand Up @@ -222,6 +225,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()
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
size="unset"
:disabled="Boolean(paymentRecoveryLock)"
:class="queueMenuTriggerClass"
:aria-label="t('menu.run')"
:aria-label="t('menu.runOptions')"
data-testid="queue-mode-menu-trigger"
>
<TinyChevronIcon />
Expand Down
2 changes: 2 additions & 0 deletions src/components/error/ErrorOverlay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ describe('ErrorOverlay', () => {
mockAllErrorGroups.value = [
{
type: 'execution',
severity: 'error',
groupKey: 'execution:KSampler',
displayTitle: 'Execution failed',
count: 1,
Expand Down Expand Up @@ -171,6 +172,7 @@ describe('ErrorOverlay', () => {
mockAllErrorGroups.value = [
{
type: 'execution',
severity: 'error',
groupKey: 'execution:KSampler',
displayTitle: 'Execution failed',
count: 1,
Expand Down
10 changes: 10 additions & 0 deletions src/components/error/useErrorOverlayState.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ describe('useErrorOverlayState', () => {
mockAllErrorGroups.value = [
{
type: 'execution',
severity: 'error',
groupKey: 'execution:KSampler',
displayTitle: 'Execution failed',
count: 1,
Expand Down Expand Up @@ -146,6 +147,7 @@ describe('useErrorOverlayState', () => {
mockAllErrorGroups.value = [
{
type: 'execution',
severity: 'error',
groupKey: 'execution:KSampler',
displayTitle: 'Required input is missing',
count: 1,
Expand Down Expand Up @@ -186,6 +188,7 @@ describe('useErrorOverlayState', () => {
mockAllErrorGroups.value = [
{
type: 'execution',
severity: 'error',
groupKey: 'execution:KSampler',
displayTitle: 'Friendly validation title',
count: 1,
Expand Down Expand Up @@ -225,6 +228,7 @@ describe('useErrorOverlayState', () => {
mockAllErrorGroups.value = [
{
type: 'execution',
severity: 'error',
groupKey: 'execution:KSampler',
displayTitle: 'Generation failed',
count: 1,
Expand Down Expand Up @@ -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.',
Expand Down Expand Up @@ -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.',
Expand All @@ -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.',
Expand Down Expand Up @@ -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.',
Expand Down Expand Up @@ -488,6 +496,7 @@ describe('useErrorOverlayState', () => {
mockAllErrorGroups.value = [
{
type: 'execution',
severity: 'error',
groupKey: 'execution:KSampler',
displayTitle: 'Execution failed',
displayMessage: 'First group message',
Expand All @@ -503,6 +512,7 @@ describe('useErrorOverlayState', () => {
},
{
type: 'execution',
severity: 'error',
groupKey: 'execution:CLIPTextEncode',
displayTitle: 'Invalid CLIP input',
displayMessage: 'Second group message',
Expand Down
33 changes: 29 additions & 4 deletions src/components/rightSidePanel/RightSidePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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(() =>
Expand Down Expand Up @@ -189,6 +193,8 @@ const hasPendingErrorScanSelected = computed(() => {
})
})

const hasBlockingError = useHasBlockingError()

const tabs = computed<RightSidePanelTabList>(() => {
const list: RightSidePanelTabList = []

Expand All @@ -200,7 +206,24 @@ const tabs = computed<RightSidePanelTabList>(() => {
list.push({
label: () => t('rightSidePanel.errors'),
value: 'errors',
icon: 'icon-[lucide--octagon-alert] bg-node-stroke-error ml-1'
// No icon while the tab is only retained by a pending scan: with both
// severities absent there is no state for it to describe.
icon: hasRelevantErrors.value
? {
className: cn(
'ml-1',
hasBlockingError.value
? 'icon-[lucide--octagon-alert] bg-node-stroke-error'
: 'icon-[lucide--triangle-alert] bg-warning-foreground'
),
label: () =>
t(
hasBlockingError.value
? 'rightSidePanel.severityErrorLabel'
: 'rightSidePanel.severitySetupLabel'
)
}
: undefined
})
}

Expand Down Expand Up @@ -382,8 +405,10 @@ function handleTitleCancel() {
{{ tab.label() }}
<i
v-if="tab.icon"
aria-hidden="true"
:class="cn(tab.icon, 'size-4')"
role="img"
:aria-label="tab.icon.label()"
data-testid="panel-tab-icon"
:class="cn(tab.icon.className, 'size-4')"
/>
</Tab>
</TabList>
Expand Down
14 changes: 13 additions & 1 deletion src/components/rightSidePanel/errors/ErrorCardSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@
@click="collapse = !collapse"
>
<span
class="flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-destructive-background-hover px-1 text-2xs/none font-semibold text-white tabular-nums"
data-testid="error-section-count-badge"
:data-severity="severity"
:class="
cn(
'flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 text-2xs/none font-semibold tabular-nums',
severity === 'error'
? 'bg-destructive-background-hover text-white'
: 'bg-warning-background text-warning-on-background'
)
"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
>
{{ count }}
</span>
Expand Down Expand Up @@ -53,14 +62,17 @@ import { useI18n } from 'vue-i18n'
import { cn } from '@comfyorg/tailwind-utils'

import TransitionCollapse from '@/components/rightSidePanel/layout/TransitionCollapse.vue'
import type { ErrorGroupSeverity } from '@/components/rightSidePanel/errors/types'

const {
title,
count,
severity,
class: className
} = defineProps<{
title: string
count: number
severity: ErrorGroupSeverity
class?: string
}>()

Expand Down
Loading
Loading