@@ -14,6 +14,7 @@ import {
1414import { cn } from "@/lib/utils" ;
1515import { useTaskNode } from "@/providers/TaskNodeProvider" ;
1616import type { InputSpec , OutputSpec } from "@/utils/componentSpec" ;
17+ import { ENABLE_DEBUG_MODE } from "@/utils/constants" ;
1718
1819type InputHandleProps = {
1920 input : InputSpec ;
@@ -32,7 +33,7 @@ export const InputHandle = ({
3233 onLabelClick,
3334 onHandleSelectionChange,
3435} : InputHandleProps ) => {
35- const { nodeId, state } = useTaskNode ( ) ;
36+ const { nodeId, state, name } = useTaskNode ( ) ;
3637
3738 const fromHandle = useConnection ( ( connection ) => connection . fromHandle ?. id ) ;
3839 const toHandle = useConnection ( ( connection ) => connection . toHandle ?. id ) ;
@@ -129,23 +130,33 @@ export const InputHandle = ({
129130 data-active = { active }
130131 >
131132 < div className = "absolute -translate-x-6 flex items-center h-3 w-3" >
132- < Handle
133- ref = { handleRef }
134- type = "target"
135- id = { handleId }
136- position = { Position . Left }
137- isConnectable = { true }
138- className = { cn (
139- "border-0! h-full! w-full! transform-none!" ,
140- missing ,
141- ( selected || active ) && "bg-blue-500!" ,
142- highlight && "bg-green-500!" ,
143- state . readOnly && "cursor-pointer!" ,
144- ) }
145- onClick = { handleHandleClick }
146- data-invalid = { invalid }
147- data-testid = { `input-handle-${ input . name } ` }
148- />
133+ < Tooltip >
134+ < TooltipTrigger asChild >
135+ < Handle
136+ ref = { handleRef }
137+ type = "target"
138+ id = { handleId }
139+ position = { Position . Left }
140+ isConnectable = { true }
141+ className = { cn (
142+ "border-0! h-full! w-full! transform-none!" ,
143+ missing ,
144+ ( selected || active ) && "bg-blue-500!" ,
145+ highlight && "bg-green-500!" ,
146+ state . readOnly && "cursor-pointer!" ,
147+ ) }
148+ onClick = { handleHandleClick }
149+ data-invalid = { invalid }
150+ data-testid = { `input-handle-${ input . name } ` }
151+ />
152+ </ TooltipTrigger >
153+ < TooltipContent disabled = { ! ENABLE_DEBUG_MODE } >
154+ < div > Task Name: { name } </ div >
155+ < div > Handle Name: { input . name } </ div >
156+ < div > parentNodeId: { nodeId } </ div >
157+ < div > handleNodeId: { handleId } </ div >
158+ </ TooltipContent >
159+ </ Tooltip >
149160 </ div >
150161 < div
151162 className = { cn (
@@ -218,7 +229,7 @@ export const OutputHandle = ({
218229 onLabelClick,
219230 onHandleSelectionChange,
220231} : OutputHandleProps ) => {
221- const { nodeId, state } = useTaskNode ( ) ;
232+ const { nodeId, state, name } = useTaskNode ( ) ;
222233
223234 const fromHandle = useConnection ( ( connection ) => connection . fromHandle ?. id ) ;
224235 const toHandle = useConnection ( ( connection ) => connection . toHandle ?. id ) ;
@@ -336,21 +347,31 @@ export const OutputHandle = ({
336347 </ div >
337348 ) }
338349 </ div >
339- < Handle
340- ref = { handleRef }
341- type = "source"
342- id = { handleId }
343- position = { Position . Right }
344- isConnectable = { true }
345- onClick = { handleHandleClick }
346- className = { cn (
347- "relative! border-0! !w-[12px] !h-[12px] transform-none! translate-x-6 cursor-pointer bg-gray-500!" ,
348- ( selected || active ) && "bg-blue-500!" ,
349- highlight && "bg-green-500!" ,
350- state . readOnly && "cursor-pointer!" ,
351- ) }
352- data-testid = { `output-handle-${ output . name } ` }
353- />
350+ < Tooltip >
351+ < TooltipTrigger asChild >
352+ < Handle
353+ ref = { handleRef }
354+ type = "source"
355+ id = { handleId }
356+ position = { Position . Right }
357+ isConnectable = { true }
358+ onClick = { handleHandleClick }
359+ className = { cn (
360+ "relative! border-0! !w-[12px] !h-[12px] transform-none! translate-x-6 cursor-pointer bg-gray-500!" ,
361+ ( selected || active ) && "bg-blue-500!" ,
362+ highlight && "bg-green-500!" ,
363+ state . readOnly && "cursor-pointer!" ,
364+ ) }
365+ data-testid = { `output-handle-${ output . name } ` }
366+ />
367+ </ TooltipTrigger >
368+ < TooltipContent disabled = { ! ENABLE_DEBUG_MODE } >
369+ < div > Task Name: { name } </ div >
370+ < div > Handle Name: { output . name } </ div >
371+ < div > parentNodeId: { nodeId } </ div >
372+ < div > handleNodeId: { handleId } </ div >
373+ </ TooltipContent >
374+ </ Tooltip >
354375 </ div >
355376 ) ;
356377} ;
0 commit comments