From b96bf3871ceb66bd3724c87c5437702824aa2cae Mon Sep 17 00:00:00 2001 From: Arjan Singh <1598641+arjansingh@users.noreply.github.com> Date: Wed, 24 Sep 2025 18:45:33 -0700 Subject: [PATCH] Fixes nits for #5758 (#5763) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary 1. Fixes nits for #5758 2. Adds some git ignores ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5763-Fixes-nits-for-5758-2796d73d36508192b3e6feecfcacf38b) by [Unito](https://www.unito.io) --------- Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com> --- .gitignore | 2 ++ src/components/graph/GraphCanvas.vue | 24 +++++++++------- .../vueNodes/components/LGraphNode.vue | 28 +++++++------------ 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 32e1b6624..e5bb5f107 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,8 @@ dist-ssr *.local # Claude configuration .claude/*.local.json +.claude/*.local.md +.claude/*.local.txt CLAUDE.local.md # Editor directories and files diff --git a/src/components/graph/GraphCanvas.vue b/src/components/graph/GraphCanvas.vue index 5da16d0f0..e40466a3e 100644 --- a/src/components/graph/GraphCanvas.vue +++ b/src/components/graph/GraphCanvas.vue @@ -308,16 +308,20 @@ watch( const nodeErrors = lastNodeErrors?.[node.id] if (!nodeErrors) continue - let slotErrorsChanged = false - for (const error of nodeErrors.errors) { - if (!error.extra_info?.input_name) continue - - const inputIndex = node.findInputSlot(error.extra_info.input_name) - if (inputIndex === -1) continue - - node.inputs[inputIndex].hasErrors = true - slotErrorsChanged = true - } + const validErrors = nodeErrors.errors.filter( + (error) => error.extra_info?.input_name !== undefined + ) + const slotErrorsChanged = + validErrors.length > 0 && + validErrors.some((error) => { + const inputName = error.extra_info!.input_name! + const inputIndex = node.findInputSlot(inputName) + if (inputIndex !== -1) { + node.inputs[inputIndex].hasErrors = true + return true + } + return false + }) // Trigger Vue node data update if slot errors changed if (slotErrorsChanged && comfyApp.graph.onTrigger) { diff --git a/src/renderer/extensions/vueNodes/components/LGraphNode.vue b/src/renderer/extensions/vueNodes/components/LGraphNode.vue index 2b3ec26ae..7171ec770 100644 --- a/src/renderer/extensions/vueNodes/components/LGraphNode.vue +++ b/src/renderer/extensions/vueNodes/components/LGraphNode.vue @@ -136,11 +136,7 @@ import { computed, inject, onErrorCaptured, onMounted, provide, ref } from 'vue' import type { VueNodeData } from '@/composables/graph/useGraphNodeManager' import { useErrorHandling } from '@/composables/useErrorHandling' -import { - type INodeInputSlot, - type INodeOutputSlot, - LiteGraph -} from '@/lib/litegraph/src/litegraph' +import { LiteGraph } from '@/lib/litegraph/src/litegraph' import { useCanvasStore } from '@/renderer/core/canvas/canvasStore' import { useCanvasInteractions } from '@/renderer/core/canvas/useCanvasInteractions' import { TransformStateKey } from '@/renderer/core/layout/injectionKeys' @@ -205,18 +201,14 @@ const hasExecutionError = computed( // Computed error states for styling const hasAnyError = computed((): boolean => { - return ( - !!hasExecutionError.value || - !!nodeData.hasErrors || - !!error || + return !!( + hasExecutionError.value || + nodeData.hasErrors || + error || // Type assertions needed because VueNodeData.inputs/outputs are typed as unknown[] // but at runtime they contain INodeInputSlot/INodeOutputSlot objects - !!nodeData.inputs?.some( - (slot) => (slot as INodeInputSlot)?.hasErrors ?? false - ) || - !!nodeData.outputs?.some( - (slot) => (slot as INodeOutputSlot)?.hasErrors ?? false - ) + nodeData.inputs?.some((slot) => slot?.hasErrors) || + nodeData.outputs?.some((slot) => slot?.hasErrors) ) }) @@ -279,7 +271,7 @@ const { latestPreviewUrl, shouldShowPreviewImg } = useNodePreviewState( const borderClass = computed(() => { if (hasAnyError.value) { - return 'border-red-500 dark-theme:border-red-500' + return 'border-error dark-theme:border-error' } if (executing.value) { return 'border-blue-500' @@ -292,10 +284,10 @@ const outlineClass = computed(() => { return undefined } if (hasAnyError.value) { - return 'outline-red-500' + return 'outline-error dark-theme:outline-error' } if (executing.value) { - return 'outline-blue-500' + return 'outline-blue-500 dark-theme:outline-blue-500' } return 'outline-black dark-theme:outline-white' })