Skip to content

Commit 73600fb

Browse files
committed
improvement: refactor files, subblock spacing
1 parent 75c6582 commit 73600fb

12 files changed

Lines changed: 30 additions & 436 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { checkEnvVarTrigger, EnvVarDropdown } from '@/components/ui/env-var-drop
1010
import { checkTagTrigger, TagDropdown } from '@/components/ui/tag-dropdown'
1111
import { createLogger } from '@/lib/logs/console-logger'
1212
import { cn } from '@/lib/utils'
13-
import { useCodeGeneration } from '@/hooks/use-code-generation'
13+
import { useCodeGeneration } from '@/app/w/[id]/hooks/use-code-generation'
1414
import { CodePromptBar } from '../../../../code-prompt-bar/code-prompt-bar'
1515
import { useSubBlockValue } from '../hooks/use-sub-block-value'
1616

sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
import { useEffect, useMemo, useRef, useState } from 'react'
22
import { Code, FileJson, Trash2, Wand2, X } from 'lucide-react'
3-
import { Button } from '@/components/ui/button'
4-
import {
5-
Dialog,
6-
DialogContent,
7-
DialogDescription,
8-
DialogFooter,
9-
DialogHeader,
10-
DialogTitle,
11-
} from '@/components/ui/dialog'
123
import {
134
AlertDialog,
145
AlertDialogAction,
@@ -19,13 +10,22 @@ import {
1910
AlertDialogHeader,
2011
AlertDialogTitle,
2112
} from '@/components/ui/alert-dialog'
13+
import { Button } from '@/components/ui/button'
14+
import {
15+
Dialog,
16+
DialogContent,
17+
DialogDescription,
18+
DialogFooter,
19+
DialogHeader,
20+
DialogTitle,
21+
} from '@/components/ui/dialog'
2222
import { checkEnvVarTrigger, EnvVarDropdown } from '@/components/ui/env-var-dropdown'
2323
import { Label } from '@/components/ui/label'
2424
import { checkTagTrigger, TagDropdown } from '@/components/ui/tag-dropdown'
2525
import { createLogger } from '@/lib/logs/console-logger'
2626
import { cn } from '@/lib/utils'
2727
import { useCustomToolsStore } from '@/stores/custom-tools/store'
28-
import { useCodeGeneration } from '@/hooks/use-code-generation'
28+
import { useCodeGeneration } from '@/app/w/[id]/hooks/use-code-generation'
2929
import { CodePromptBar } from '../../../../../../../code-prompt-bar/code-prompt-bar'
3030
import { CodeEditor } from '../code-editor/code-editor'
3131

@@ -436,30 +436,30 @@ export function CustomToolModal({
436436

437437
const handleDelete = async () => {
438438
if (!toolId || !isEditing) return
439-
439+
440440
try {
441441
setShowDeleteConfirm(false)
442-
442+
443443
// Call API to delete the tool
444444
const response = await fetch(`/api/tools/custom?id=${toolId}`, {
445445
method: 'DELETE',
446446
})
447-
447+
448448
if (!response.ok) {
449449
const errorData = await response.json().catch(() => ({}))
450450
const errorMessage = errorData.error || response.statusText || 'Failed to delete tool'
451451
throw new Error(errorMessage)
452452
}
453-
453+
454454
// Remove from local store
455455
removeTool(toolId)
456456
logger.info(`Deleted tool: ${toolId}`)
457-
457+
458458
// Notify parent component if callback provided
459459
if (onDelete) {
460460
onDelete(toolId)
461461
}
462-
462+
463463
// Close the modal
464464
handleClose()
465465
} catch (error) {
@@ -489,7 +489,10 @@ export function CustomToolModal({
489489
return (
490490
<>
491491
<Dialog open={open} onOpenChange={handleClose}>
492-
<DialogContent className="sm:max-w-[700px] h-[80vh] flex flex-col p-0 gap-0" hideCloseButton>
492+
<DialogContent
493+
className="sm:max-w-[700px] h-[80vh] flex flex-col p-0 gap-0"
494+
hideCloseButton
495+
>
493496
<DialogHeader className="px-6 py-4 border-b">
494497
<div className="flex items-center justify-between">
495498
<DialogTitle className="text-lg font-medium">
@@ -786,20 +789,23 @@ export function CustomToolModal({
786789
</DialogFooter>
787790
</DialogContent>
788791
</Dialog>
789-
792+
790793
{/* Delete Confirmation Dialog */}
791794
<AlertDialog open={showDeleteConfirm} onOpenChange={setShowDeleteConfirm}>
792795
<AlertDialogContent>
793796
<AlertDialogHeader>
794797
<AlertDialogTitle>Are you sure you want to delete this tool?</AlertDialogTitle>
795798
<AlertDialogDescription>
796-
This action cannot be undone. This will permanently delete the tool
797-
and remove it from any workflows that are using it.
799+
This action cannot be undone. This will permanently delete the tool and remove it from
800+
any workflows that are using it.
798801
</AlertDialogDescription>
799802
</AlertDialogHeader>
800803
<AlertDialogFooter>
801804
<AlertDialogCancel>Cancel</AlertDialogCancel>
802-
<AlertDialogAction onClick={handleDelete} className="bg-destructive text-destructive-foreground hover:bg-destructive/90">
805+
<AlertDialogAction
806+
onClick={handleDelete}
807+
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
808+
>
803809
Delete
804810
</AlertDialogAction>
805811
</AlertDialogFooter>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Info } from 'lucide-react'
12
import { Label } from '@/components/ui/label'
23
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
34
import { useSubBlockStore } from '@/stores/workflows/subblock/store'
@@ -25,7 +26,6 @@ import { Table } from './components/table'
2526
import { TimeInput } from './components/time-input'
2627
import { ToolInput } from './components/tool-input/tool-input'
2728
import { WebhookConfig } from './components/webhook/webhook-config'
28-
import { Info } from 'lucide-react'
2929

3030
interface SubBlockProps {
3131
blockId: string
@@ -191,7 +191,7 @@ export function SubBlock({ blockId, config, isConnecting }: SubBlockProps) {
191191
const required = isFieldRequired()
192192

193193
return (
194-
<div className="space-y-1" onMouseDown={handleMouseDown}>
194+
<div className="space-y-[6px] pt-[2px]" onMouseDown={handleMouseDown}>
195195
{config.type !== 'switch' && (
196196
<Label className="flex items-center gap-1">
197197
{config.title}
File renamed without changes.

sim/app/w/agents/agents.tsx

Lines changed: 0 additions & 62 deletions
This file was deleted.

sim/app/w/agents/components/sidebar/sidebar.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

sim/app/w/agents/components/toolbar/toolbar.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

sim/app/w/agents/page.tsx

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)