Skip to content

Commit b96bf38

Browse files
Fixes nits for #5758 (#5763)
## 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 <[email protected]>
1 parent bc45492 commit b96bf38

File tree

3 files changed

+26
-28
lines changed

3 files changed

+26
-28
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ dist-ssr
2222
*.local
2323
# Claude configuration
2424
.claude/*.local.json
25+
.claude/*.local.md
26+
.claude/*.local.txt
2527
CLAUDE.local.md
2628

2729
# Editor directories and files

src/components/graph/GraphCanvas.vue

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -308,16 +308,20 @@ watch(
308308
const nodeErrors = lastNodeErrors?.[node.id]
309309
if (!nodeErrors) continue
310310
311-
let slotErrorsChanged = false
312-
for (const error of nodeErrors.errors) {
313-
if (!error.extra_info?.input_name) continue
314-
315-
const inputIndex = node.findInputSlot(error.extra_info.input_name)
316-
if (inputIndex === -1) continue
317-
318-
node.inputs[inputIndex].hasErrors = true
319-
slotErrorsChanged = true
320-
}
311+
const validErrors = nodeErrors.errors.filter(
312+
(error) => error.extra_info?.input_name !== undefined
313+
)
314+
const slotErrorsChanged =
315+
validErrors.length > 0 &&
316+
validErrors.some((error) => {
317+
const inputName = error.extra_info!.input_name!
318+
const inputIndex = node.findInputSlot(inputName)
319+
if (inputIndex !== -1) {
320+
node.inputs[inputIndex].hasErrors = true
321+
return true
322+
}
323+
return false
324+
})
321325
322326
// Trigger Vue node data update if slot errors changed
323327
if (slotErrorsChanged && comfyApp.graph.onTrigger) {

src/renderer/extensions/vueNodes/components/LGraphNode.vue

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ import { computed, inject, onErrorCaptured, onMounted, provide, ref } from 'vue'
136136
137137
import type { VueNodeData } from '@/composables/graph/useGraphNodeManager'
138138
import { useErrorHandling } from '@/composables/useErrorHandling'
139-
import {
140-
type INodeInputSlot,
141-
type INodeOutputSlot,
142-
LiteGraph
143-
} from '@/lib/litegraph/src/litegraph'
139+
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
144140
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
145141
import { useCanvasInteractions } from '@/renderer/core/canvas/useCanvasInteractions'
146142
import { TransformStateKey } from '@/renderer/core/layout/injectionKeys'
@@ -205,18 +201,14 @@ const hasExecutionError = computed(
205201
206202
// Computed error states for styling
207203
const hasAnyError = computed((): boolean => {
208-
return (
209-
!!hasExecutionError.value ||
210-
!!nodeData.hasErrors ||
211-
!!error ||
204+
return !!(
205+
hasExecutionError.value ||
206+
nodeData.hasErrors ||
207+
error ||
212208
// Type assertions needed because VueNodeData.inputs/outputs are typed as unknown[]
213209
// but at runtime they contain INodeInputSlot/INodeOutputSlot objects
214-
!!nodeData.inputs?.some(
215-
(slot) => (slot as INodeInputSlot)?.hasErrors ?? false
216-
) ||
217-
!!nodeData.outputs?.some(
218-
(slot) => (slot as INodeOutputSlot)?.hasErrors ?? false
219-
)
210+
nodeData.inputs?.some((slot) => slot?.hasErrors) ||
211+
nodeData.outputs?.some((slot) => slot?.hasErrors)
220212
)
221213
})
222214
@@ -279,7 +271,7 @@ const { latestPreviewUrl, shouldShowPreviewImg } = useNodePreviewState(
279271
280272
const borderClass = computed(() => {
281273
if (hasAnyError.value) {
282-
return 'border-red-500 dark-theme:border-red-500'
274+
return 'border-error dark-theme:border-error'
283275
}
284276
if (executing.value) {
285277
return 'border-blue-500'
@@ -292,10 +284,10 @@ const outlineClass = computed(() => {
292284
return undefined
293285
}
294286
if (hasAnyError.value) {
295-
return 'outline-red-500'
287+
return 'outline-error dark-theme:outline-error'
296288
}
297289
if (executing.value) {
298-
return 'outline-blue-500'
290+
return 'outline-blue-500 dark-theme:outline-blue-500'
299291
}
300292
return 'outline-black dark-theme:outline-white'
301293
})

0 commit comments

Comments
 (0)