77 */
88
99import type { CategoryMetadata , INode , Position } from '@badaitech/chaingraph-types'
10- import { isDeepEqual } from '@badaitech/chaingraph-types'
1110import type { PulseState , XYFlowNodeRenderData , XYFlowNodesDataChangedPayload } from '../types'
1211import type { DragDropRenderState } from '@/store/drag-drop/types'
1312import type { ExecutionState , NodeExecutionState } from '@/store/execution/types'
1413import type { NodePortLists } from '@/store/ports-v2'
1514import { NODE_CATEGORIES } from '@badaitech/chaingraph-nodes'
15+ import { isDeepEqual } from '@badaitech/chaingraph-types'
1616import { sample } from 'effector'
1717import { trace } from '@/lib/perf-trace'
1818import { $categoryMetadata } from '@/store/categories'
@@ -170,11 +170,11 @@ function buildCompleteRenderMap(
170170 executionStatus : ( execNode ?. status as XYFlowNodeRenderData [ 'executionStatus' ] ) || 'idle' ,
171171 executionNode : execNode
172172 ? {
173- status : execNode . status ,
174- executionTime : execNode . executionTime ,
175- error : execNode . error ,
176- node : execNode . node ,
177- }
173+ status : execNode . status ,
174+ executionTime : execNode . executionTime ,
175+ error : execNode . error ,
176+ node : execNode . node ,
177+ }
178178 : null ,
179179 isHighlighted : highlightSet . has ( nodeId ) ,
180180 hasAnyHighlights,
@@ -338,7 +338,8 @@ sample({
338338
339339 for ( const nodeId of nodeIds ) {
340340 const current = renderMap [ nodeId ]
341- if ( ! current ) continue
341+ if ( ! current )
342+ continue
342343
343344 const pos = positions [ nodeId ]
344345 const dims = dimensions [ nodeId ]
@@ -348,8 +349,10 @@ sample({
348349
349350 if ( posChanged || dimsChanged ) {
350351 const nodeChanges : Partial < XYFlowNodeRenderData > = { }
351- if ( posChanged ) nodeChanges . position = pos
352- if ( dimsChanged ) nodeChanges . dimensions = dims
352+ if ( posChanged )
353+ nodeChanges . position = pos
354+ if ( dimsChanged )
355+ nodeChanges . dimensions = dims
353356 changes . push ( { nodeId, changes : nodeChanges } )
354357 }
355358 }
@@ -382,13 +385,20 @@ sample({
382385 // Fields to sync from NodeUIState to XYFlowNodeRenderData
383386 // Using isDeepEqual for type-safety (new fields automatically compared)
384387 const fieldsToSync = [
385- 'version' , 'isSelected' , 'isHidden' , 'isDraggable' ,
386- 'nodeType' , 'isErrorPortCollapsed' , 'title' , 'uiStyle' ,
388+ 'version' ,
389+ 'isSelected' ,
390+ 'isHidden' ,
391+ 'isDraggable' ,
392+ 'nodeType' ,
393+ 'isErrorPortCollapsed' ,
394+ 'title' ,
395+ 'uiStyle' ,
387396 ] as const
388397
389398 for ( const [ nodeId , uiState ] of Object . entries ( uiStates ) ) {
390399 const current = renderMap [ nodeId ]
391- if ( ! current ) continue
400+ if ( ! current )
401+ continue
392402
393403 const updates : Partial < XYFlowNodeRenderData > = { }
394404
@@ -454,20 +464,20 @@ sample({
454464 // Execution node data
455465 const executionNode = execNode
456466 ? {
457- status : execNode . status ,
458- executionTime : execNode . executionTime ,
459- error : execNode . error ,
460- node : execNode . node ,
461- }
467+ status : execNode . status ,
468+ executionTime : execNode . executionTime ,
469+ error : execNode . error ,
470+ node : execNode . node ,
471+ }
462472 : null
463473
464474 // Deep comparison for execution node
465475 const currentExecNode = current . executionNode
466476 const execNodeChanged
467477 = ( currentExecNode === null ) !== ( executionNode === null )
468- || currentExecNode ?. status !== executionNode ?. status
469- || currentExecNode ?. executionTime !== executionNode ?. executionTime
470- || currentExecNode ?. node !== executionNode ?. node
478+ || currentExecNode ?. status !== executionNode ?. status
479+ || currentExecNode ?. executionTime !== executionNode ?. executionTime
480+ || currentExecNode ?. node !== executionNode ?. node
471481
472482 if ( execNodeChanged ) {
473483 updates . executionNode = executionNode
@@ -593,8 +603,8 @@ sample({
593603 // Compare with current
594604 const changed
595605 = ( current . dropFeedback === null ) !== ( dropFeedback === null )
596- || current . dropFeedback ?. canAcceptDrop !== dropFeedback ?. canAcceptDrop
597- || current . dropFeedback ?. dropType !== dropFeedback ?. dropType
606+ || current . dropFeedback ?. canAcceptDrop !== dropFeedback ?. canAcceptDrop
607+ || current . dropFeedback ?. dropType !== dropFeedback ?. dropType
598608
599609 if ( changed ) {
600610 changes . push ( { nodeId, changes : { dropFeedback } } )
0 commit comments