@@ -15,6 +15,7 @@ import { useNodeManager } from "@/hooks/useNodeManager";
1515import { cn } from "@/lib/utils" ;
1616import { useTaskNode } from "@/providers/TaskNodeProvider" ;
1717import type { InputSpec , OutputSpec } from "@/utils/componentSpec" ;
18+ import { ENABLE_DEBUG_MODE } from "@/utils/constants" ;
1819
1920type InputHandleProps = {
2021 input : InputSpec ;
@@ -34,7 +35,7 @@ export const InputHandle = ({
3435 onHandleSelectionChange,
3536} : InputHandleProps ) => {
3637 const { getInputHandleNodeId } = useNodeManager ( ) ;
37- const { taskId, nodeId, state } = useTaskNode ( ) ;
38+ const { taskId, nodeId, state, name } = useTaskNode ( ) ;
3839
3940 const fromHandle = useConnection ( ( connection ) => connection . fromHandle ?. id ) ;
4041 const toHandle = useConnection ( ( connection ) => connection . toHandle ?. id ) ;
@@ -131,23 +132,33 @@ export const InputHandle = ({
131132 data-active = { active }
132133 >
133134 < div className = "absolute -translate-x-6 flex items-center h-3 w-3" >
134- < Handle
135- ref = { handleRef }
136- type = "target"
137- id = { handleId }
138- position = { Position . Left }
139- isConnectable = { true }
140- className = { cn (
141- "border-0! h-full! w-full! transform-none!" ,
142- missing ,
143- ( selected || active ) && "bg-blue-500!" ,
144- highlight && "bg-green-500!" ,
145- state . readOnly && "cursor-pointer!" ,
146- ) }
147- onClick = { handleHandleClick }
148- data-invalid = { invalid }
149- data-testid = { `input-handle-${ input . name } ` }
150- />
135+ < Tooltip >
136+ < TooltipTrigger asChild >
137+ < Handle
138+ ref = { handleRef }
139+ type = "target"
140+ id = { handleId }
141+ position = { Position . Left }
142+ isConnectable = { true }
143+ className = { cn (
144+ "border-0! h-full! w-full! transform-none!" ,
145+ missing ,
146+ ( selected || active ) && "bg-blue-500!" ,
147+ highlight && "bg-green-500!" ,
148+ state . readOnly && "cursor-pointer!" ,
149+ ) }
150+ onClick = { handleHandleClick }
151+ data-invalid = { invalid }
152+ data-testid = { `input-handle-${ input . name } ` }
153+ />
154+ </ TooltipTrigger >
155+ < TooltipContent disabled = { ! ENABLE_DEBUG_MODE } >
156+ < div > Task Name: { name } </ div >
157+ < div > Handle Name: { input . name } </ div >
158+ < div > parentNodeId: { nodeId } </ div >
159+ < div > handleNodeId: { handleId } </ div >
160+ </ TooltipContent >
161+ </ Tooltip >
151162 </ div >
152163 < div
153164 className = { cn (
@@ -221,7 +232,7 @@ export const OutputHandle = ({
221232 onHandleSelectionChange,
222233} : OutputHandleProps ) => {
223234 const { getOutputHandleNodeId } = useNodeManager ( ) ;
224- const { taskId, nodeId, state } = useTaskNode ( ) ;
235+ const { taskId, nodeId, state, name } = useTaskNode ( ) ;
225236
226237 const fromHandle = useConnection ( ( connection ) => connection . fromHandle ?. id ) ;
227238 const toHandle = useConnection ( ( connection ) => connection . toHandle ?. id ) ;
@@ -339,21 +350,31 @@ export const OutputHandle = ({
339350 </ div >
340351 ) }
341352 </ div >
342- < Handle
343- ref = { handleRef }
344- type = "source"
345- id = { handleId }
346- position = { Position . Right }
347- isConnectable = { true }
348- onClick = { handleHandleClick }
349- className = { cn (
350- "relative! border-0! !w-[12px] !h-[12px] transform-none! translate-x-6 cursor-pointer bg-gray-500!" ,
351- ( selected || active ) && "bg-blue-500!" ,
352- highlight && "bg-green-500!" ,
353- state . readOnly && "cursor-pointer!" ,
354- ) }
355- data-testid = { `output-handle-${ output . name } ` }
356- />
353+ < Tooltip >
354+ < TooltipTrigger asChild >
355+ < Handle
356+ ref = { handleRef }
357+ type = "source"
358+ id = { handleId }
359+ position = { Position . Right }
360+ isConnectable = { true }
361+ onClick = { handleHandleClick }
362+ className = { cn (
363+ "relative! border-0! !w-[12px] !h-[12px] transform-none! translate-x-6 cursor-pointer bg-gray-500!" ,
364+ ( selected || active ) && "bg-blue-500!" ,
365+ highlight && "bg-green-500!" ,
366+ state . readOnly && "cursor-pointer!" ,
367+ ) }
368+ data-testid = { `output-handle-${ output . name } ` }
369+ />
370+ </ TooltipTrigger >
371+ < TooltipContent disabled = { ! ENABLE_DEBUG_MODE } >
372+ < div > Task Name: { name } </ div >
373+ < div > Handle Name: { output . name } </ div >
374+ < div > parentNodeId: { nodeId } </ div >
375+ < div > handleNodeId: { handleId } </ div >
376+ </ TooltipContent >
377+ </ Tooltip >
357378 </ div >
358379 ) ;
359380} ;
0 commit comments