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
15 changes: 6 additions & 9 deletions browser_tests/fixtures/ComfyPage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { APIRequestContext, Locator, Page } from '@playwright/test'
import { expect } from '@playwright/test'
import { test as base } from '@playwright/test'
import { test as base, expect } from '@playwright/test'
import dotenv from 'dotenv'
import * as fs from 'fs'

Expand Down Expand Up @@ -130,7 +129,8 @@ export class ComfyPage {

// Buttons
public readonly resetViewButton: Locator
public readonly queueButton: Locator
public readonly queueButton: Locator // Run button in Legacy UI
public readonly runButton: Locator // Run button (renamed "Queue" -> "Run")

// Inputs
public readonly workflowUploadInput: Locator
Expand Down Expand Up @@ -165,6 +165,9 @@ export class ComfyPage {
this.widgetTextBox = page.getByPlaceholder('text').nth(1)
this.resetViewButton = page.getByRole('button', { name: 'Reset View' })
this.queueButton = page.getByRole('button', { name: 'Queue Prompt' })
this.runButton = page
.getByTestId('queue-button')
.getByRole('button', { name: 'Run' })
this.workflowUploadInput = page.locator('#comfy-file-input')
this.visibleToasts = page.locator('.p-toast-message:visible')

Expand Down Expand Up @@ -1086,12 +1089,6 @@ export class ComfyPage {

const targetPosition = await targetSlot.getPosition()

// Debug: Log the positions we're trying to use
console.log('Drag positions:', {
source: sourcePosition,
target: targetPosition
})

await this.dragAndDrop(sourcePosition, targetPosition)
await this.nextFrame()
}
Expand Down
19 changes: 12 additions & 7 deletions browser_tests/tests/vueNodes/nodeStates/error.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
comfyPageFixture as test
} from '../../../fixtures/ComfyPage'

const ERROR_CLASS = /border-error/
const ERROR_CLASS = /border-node-stroke-error/

test.describe('Vue Node Error', () => {
test.beforeEach(async ({ comfyPage }) => {
Expand All @@ -17,16 +17,21 @@ test.describe('Vue Node Error', () => {
await comfyPage.setup()
await comfyPage.loadWorkflow('missing/missing_nodes')

// Close missing nodes warning dialog
await comfyPage.page.getByRole('button', { name: 'Close' }).click()
await comfyPage.page.waitForSelector('.comfy-missing-nodes', {
state: 'hidden'
})

// Expect error state on missing unknown node
const unknownNode = comfyPage.page.locator('[data-node-id]').filter({
hasText: 'UNKNOWN NODE'
})
await expect(unknownNode).toHaveClass(ERROR_CLASS)
})

test('should display error state when node causes execution error', async ({
comfyPage
}) => {
await comfyPage.setup()
await comfyPage.loadWorkflow('nodes/execution_error')
await comfyPage.runButton.click()

const raiseErrorNode = comfyPage.vueNodes.getNodeByTitle('Raise Error')
await expect(raiseErrorNode).toHaveClass(ERROR_CLASS)
})
})
18 changes: 16 additions & 2 deletions packages/design-system/src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@

/* --- */

--accent-primary: var(--color-charcoal-700);
--backdrop: var(--color-white);
--dialog-surface: var(--color-neutral-200);
--node-component-border: var(--color-gray-400);
Expand All @@ -154,13 +155,20 @@
from var(--color-zinc-500) r g b / 10%
);
--node-component-widget-skeleton-surface: var(--color-zinc-300);
--node-stroke: var(--color-stone-100);
--node-stroke: var(--color-gray-400);
--node-stroke-selected: var(--color-accent-primary);
--node-stroke-error: var(--color-error);
--node-stroke-executing: var(--color-blue-100);
}

.dark-theme {
--accent-primary: var(--color-pure-white);
--backdrop: var(--color-neutral-900);
--dialog-surface: var(--color-neutral-700);
--node-component-border: var(--color-stone-200);
--node-component-border-error: var(--color-danger-100);
--node-component-border-executing: var(--color-blue-500);
--node-component-border-selected: var(--color-charcoal-200);
--node-component-header-icon: var(--color-slate-300);
--node-component-header-surface: var(--color-charcoal-800);
--node-component-outline: var(--color-white);
Expand All @@ -176,7 +184,10 @@
--node-component-tooltip-border: var(--color-slate-300);
--node-component-tooltip-surface: var(--color-charcoal-800);
--node-component-widget-skeleton-surface: var(--color-zinc-800);
--node-stroke: var(--color-slate-100);
--node-stroke: var(--color-stone-200);
--node-stroke-selected: var(--color-pure-white);
--node-stroke-error: var(--color-error);
--node-stroke-executing: var(--color-blue-100);
}

@theme inline {
Expand Down Expand Up @@ -214,6 +225,9 @@
--node-component-widget-skeleton-surface
);
--color-node-stroke: var(--node-stroke);
--color-node-stroke-selected: var(--node-stroke-selected);
--color-node-stroke-error: var(--node-stroke-error);
--color-node-stroke-executing: var(--node-stroke-executing);
}

@custom-variant dark-theme {
Expand Down
7 changes: 3 additions & 4 deletions src/renderer/extensions/vueNodes/components/LGraphNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,9 @@ const { latestPreviewUrl, shouldShowPreviewImg } = useNodePreviewState(
)

const borderClass = computed(() => {
return (
(hasAnyError.value && 'border-error') ||
(executing.value && 'border-node-executing')
)
if (hasAnyError.value) return 'border-node-stroke-error'
if (executing.value) return 'border-node-stroke-executing'
return 'border-node-stroke'
})

const outlineClass = computed(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ export const useNodeExecutionState = (
nodeLocatorIdMaybe: MaybeRefOrGetter<string | undefined>
) => {
const locatorId = computed(() => toValue(nodeLocatorIdMaybe) ?? '')
const { nodeLocationProgressStates } = storeToRefs(useExecutionStore())
const { nodeLocationProgressStates, isIdle } =
storeToRefs(useExecutionStore())

const progressState = computed(() => {
const id = locatorId.value
return id ? nodeLocationProgressStates.value[id] : undefined
})

const executing = computed(() => progressState.value?.state === 'running')
const executing = computed(
() => !isIdle.value && progressState.value?.state === 'running'
)

const progress = computed(() => {
const state = progressState.value
Expand Down