diff --git a/ui/admin/app/components/agent/ToolForm.tsx b/ui/admin/app/components/agent/ToolForm.tsx index 4df132dae..6b447504b 100644 --- a/ui/admin/app/components/agent/ToolForm.tsx +++ b/ui/admin/app/components/agent/ToolForm.tsx @@ -9,12 +9,13 @@ import { noop } from "~/lib/utils"; import { ToolEntry } from "~/components/agent/ToolEntry"; import { ToolCatalogDialog } from "~/components/tools/ToolCatalog"; import { Form } from "~/components/ui/form"; -import { Switch } from "~/components/ui/switch"; import { - Tooltip, - TooltipContent, - TooltipTrigger, -} from "~/components/ui/tooltip"; + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "~/components/ui/select"; const ToolVariant = { FIXED: "fixed", @@ -99,14 +100,6 @@ export function ToolForm({ }).unsubscribe; }, [watch, onChange]); - const [allTools, fixedFields, userFields] = useMemo(() => { - return [ - toolFields.fields.map(({ tool }) => tool), - toolFields.fields?.filter((field) => field.variant === ToolVariant.FIXED), - toolFields.fields?.filter((field) => field.variant !== ToolVariant.FIXED), - ]; - }, [toolFields]); - const removeTools = (tools: string[]) => { const indexes = tools .map((tool) => toolFields.fields.findIndex((t) => t.tool === tool)) @@ -137,80 +130,62 @@ export function ToolForm({ } }; + const sortedFields = toolFields.fields.toSorted((a, b) => + a.tool.localeCompare(b.tool) + ); + return (