Skip to content

Commit 57d13a2

Browse files
committed
fix(ui/ux): handles
1 parent 7d0f3cf commit 57d13a2

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

sim/app/w/[id]/components/workflow-block/components/sub-block/components/condition-input.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,13 @@ export function ConditionInput({ blockId, subBlockId, isConnecting }: ConditionI
456456
id={`condition-${block.id}`}
457457
key={`${block.id}-${index}`}
458458
className={cn(
459-
'!w-3.5 !h-3.5',
460-
'!bg-white !rounded-full !border !border-gray-200',
461-
'group-hover:!border-blue-500',
462-
'!transition-border !duration-150 !cursor-crosshair',
463-
'!absolute !z-50',
459+
'!w-[7px] !h-5',
460+
'!bg-slate-300 dark:!bg-slate-500 !rounded-[2px] !border-none',
461+
'!z-[30]',
462+
'group-hover:!shadow-[0_0_0_3px_rgba(156,163,175,0.15)]',
463+
'hover:!w-[10px] hover:!right-[-28px] hover:!rounded-r-full hover:!rounded-l-none',
464+
'!cursor-crosshair',
465+
'transition-all duration-150',
464466
'!right-[-25px]'
465467
)}
466468
data-nodeid={`${blockId}-${subBlockId}`}

sim/app/w/[id]/components/workflow-block/workflow-block.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,21 @@ export function WorkflowBlock({ id, data }: NodeProps<WorkflowBlockProps>) {
225225
position={horizontalHandles ? Position.Left : Position.Top}
226226
id="target"
227227
className={cn(
228-
'!w-[7px] !h-5',
228+
horizontalHandles ? '!w-[7px] !h-5' : '!w-5 !h-[7px]',
229229
'!bg-slate-300 dark:!bg-slate-500 !rounded-[2px] !border-none',
230230
'!z-[30]',
231231
'group-hover:!shadow-[0_0_0_3px_rgba(156,163,175,0.15)]',
232232
horizontalHandles
233233
? 'hover:!w-[10px] hover:!left-[-10px] hover:!rounded-l-full hover:!rounded-r-none'
234-
: 'hover:!h-[10px] hover:!translate-y-[-3px] hover:!rounded-t-full hover:!rounded-b-none',
234+
: 'hover:!h-[10px] hover:!top-[-10px] hover:!rounded-t-full hover:!rounded-b-none',
235235
'!cursor-crosshair',
236-
'transition-all duration-150',
236+
'transition-[colors] duration-150',
237237
horizontalHandles ? '!left-[-7px]' : '!top-[-7px]'
238238
)}
239239
style={{
240-
...(horizontalHandles ? { top: '50%', transform: 'translateY(-50%)' } : {}),
240+
...(horizontalHandles
241+
? { top: '50%', transform: 'translateY(-50%)' }
242+
: { left: '50%', transform: 'translateX(-50%)' }),
241243
}}
242244
data-nodeid={id}
243245
data-handleid="target"
@@ -376,19 +378,21 @@ export function WorkflowBlock({ id, data }: NodeProps<WorkflowBlockProps>) {
376378
position={horizontalHandles ? Position.Right : Position.Bottom}
377379
id="source"
378380
className={cn(
379-
'!w-[7px] !h-5',
381+
horizontalHandles ? '!w-[7px] !h-5' : '!w-5 !h-[7px]',
380382
'!bg-slate-300 dark:!bg-slate-500 !rounded-[2px] !border-none',
381383
'!z-[30]',
382384
'group-hover:!shadow-[0_0_0_3px_rgba(156,163,175,0.15)]',
383385
horizontalHandles
384386
? 'hover:!w-[10px] hover:!right-[-10px] hover:!rounded-r-full hover:!rounded-l-none'
385-
: 'hover:!h-[10px] hover:!translate-y-[3px] hover:!rounded-b-full hover:!rounded-t-none',
387+
: 'hover:!h-[10px] hover:!bottom-[-10px] hover:!rounded-b-full hover:!rounded-t-none',
386388
'!cursor-crosshair',
387-
'transition-all duration-150',
389+
'transition-[colors] duration-150',
388390
horizontalHandles ? '!right-[-7px]' : '!bottom-[-7px]'
389391
)}
390392
style={{
391-
...(horizontalHandles ? { top: '50%', transform: 'translateY(-50%)' } : {}),
393+
...(horizontalHandles
394+
? { top: '50%', transform: 'translateY(-50%)' }
395+
: { left: '50%', transform: 'translateX(-50%)' }),
392396
}}
393397
data-nodeid={id}
394398
data-handleid="source"
@@ -404,15 +408,15 @@ export function WorkflowBlock({ id, data }: NodeProps<WorkflowBlockProps>) {
404408
position={horizontalHandles ? Position.Right : Position.Bottom}
405409
id="error"
406410
className={cn(
407-
'!w-[7px] !h-5',
411+
horizontalHandles ? '!w-[7px] !h-5' : '!w-5 !h-[7px]',
408412
'!bg-red-400 dark:!bg-red-500 !rounded-[2px] !border-none',
409413
'!z-[30]',
410414
'group-hover:!shadow-[0_0_0_3px_rgba(248,113,113,0.15)]',
411415
horizontalHandles
412416
? 'hover:!w-[10px] hover:!right-[-10px] hover:!rounded-r-full hover:!rounded-l-none'
413-
: 'hover:!h-[10px] hover:!translate-y-[3px] hover:!rounded-b-full hover:!rounded-t-none',
417+
: 'hover:!h-[10px] hover:!bottom-[-10px] hover:!rounded-b-full hover:!rounded-t-none',
414418
'!cursor-crosshair',
415-
'transition-all duration-150'
419+
'transition-[colors] duration-150'
416420
)}
417421
style={{
418422
position: 'absolute',

0 commit comments

Comments
 (0)