Skip to content

Commit 70f0d2b

Browse files
committed
styling
1 parent 6ea4286 commit 70f0d2b

File tree

1 file changed

+39
-8
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/tool-input

1 file changed

+39
-8
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/tool-input/tool-input.tsx

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -696,12 +696,14 @@ export function ToolInput({
696696
const newTools = [...selectedTools]
697697
const draggedTool = newTools[draggedIndex]
698698

699-
// Remove the dragged tool from its original position
700699
newTools.splice(draggedIndex, 1)
701700

702-
// Insert the dragged tool at the new position
703-
const adjustedDropIndex = draggedIndex < dropIndex ? dropIndex - 1 : dropIndex
704-
newTools.splice(adjustedDropIndex, 0, draggedTool)
701+
if (dropIndex === selectedTools.length) {
702+
newTools.push(draggedTool)
703+
} else {
704+
const adjustedDropIndex = draggedIndex < dropIndex ? dropIndex - 1 : dropIndex
705+
newTools.splice(adjustedDropIndex, 0, draggedTool)
706+
}
705707

706708
setStoreValue(newTools)
707709
setDraggedIndex(null)
@@ -868,18 +870,33 @@ export function ToolInput({
868870
<div
869871
key={`${tool.type}-${toolIndex}`}
870872
className={cn(
871-
'group flex flex-col transition-opacity',
873+
'group relative flex flex-col transition-all duration-200 ease-in-out',
872874
isWide ? 'w-[calc(50%-0.25rem)]' : 'w-full',
873-
draggedIndex === toolIndex ? 'opacity-50' : '',
874-
dragOverIndex === toolIndex && draggedIndex !== toolIndex ? 'scale-105' : ''
875+
draggedIndex === toolIndex ? 'scale-95 opacity-40' : '',
876+
dragOverIndex === toolIndex && draggedIndex !== toolIndex && draggedIndex !== null
877+
? 'translate-y-1 transform'
878+
: '',
879+
selectedTools.length > 1 && !isPreview && !disabled
880+
? 'cursor-grab active:cursor-grabbing'
881+
: ''
875882
)}
876883
draggable={!isPreview && !disabled}
877884
onDragStart={(e) => handleDragStart(e, toolIndex)}
878885
onDragOver={(e) => handleDragOver(e, toolIndex)}
879886
onDragEnd={handleDragEnd}
880887
onDrop={(e) => handleDrop(e, toolIndex)}
881888
>
882-
<div className='flex flex-col overflow-visible rounded-md border bg-card'>
889+
{/* Subtle drop indicator - use border highlight instead of separate line */}
890+
<div
891+
className={cn(
892+
'flex flex-col overflow-visible rounded-md border bg-card',
893+
dragOverIndex === toolIndex &&
894+
draggedIndex !== toolIndex &&
895+
draggedIndex !== null
896+
? 'border-t-2 border-t-muted-foreground/40'
897+
: ''
898+
)}
899+
>
883900
<div
884901
className={cn(
885902
'flex items-center justify-between bg-accent/50 p-2',
@@ -1141,6 +1158,20 @@ export function ToolInput({
11411158
)
11421159
})}
11431160

1161+
{/* Drop zone for the end of the list */}
1162+
{selectedTools.length > 0 && draggedIndex !== null && (
1163+
<div
1164+
className={cn(
1165+
'h-2 w-full rounded transition-all duration-200 ease-in-out',
1166+
dragOverIndex === selectedTools.length
1167+
? 'border-b-2 border-b-muted-foreground/40'
1168+
: ''
1169+
)}
1170+
onDragOver={(e) => handleDragOver(e, selectedTools.length)}
1171+
onDrop={(e) => handleDrop(e, selectedTools.length)}
1172+
/>
1173+
)}
1174+
11441175
<Popover open={open} onOpenChange={setOpen}>
11451176
<PopoverTrigger asChild>
11461177
<Button

0 commit comments

Comments
 (0)