diff --git a/apps/web/src/components/app/agent-type-select.tsx b/apps/web/src/components/app/agent-type-select.tsx index 98522651..dc66fa3b 100644 --- a/apps/web/src/components/app/agent-type-select.tsx +++ b/apps/web/src/components/app/agent-type-select.tsx @@ -20,6 +20,7 @@ type AgentTypeSelectProps = { onChange: (type: AgentType) => void; agentTypes: AgentType[]; onOpenChange?: (open: boolean) => void; + label?: string; }; export function AgentTypeSelect({ @@ -27,6 +28,7 @@ export function AgentTypeSelect({ onChange, agentTypes, onOpenChange, + label = "Type", }: AgentTypeSelectProps): JSX.Element { const sortedTypes = useMemo(() => sortAgentTypes(agentTypes), [agentTypes]); const [open, setOpen] = useState(false); @@ -46,7 +48,7 @@ export function AgentTypeSelect({ return (
- + - {open ? ( -
- { - if (el) requestAnimationFrame(() => el.focus()); - }} - onKeyDown={(e) => { - if (e.key === "Escape") { - e.preventDefault(); - setOpen(false); - requestAnimationFrame(() => triggerRef.current?.focus()); - } - }} - > - - - {sorted.map((t) => ( - { - onChange(t); - setOpen(false); - requestAnimationFrame(() => triggerRef.current?.focus()); - }} - > - - {AGENT_TYPE_LABELS[t]} - - ))} - - - -
- ) : null} -
- ); -} - export function TemplateWorktreeOption({ checked, cwd, @@ -259,14 +160,12 @@ export function TemplateConfigFields({ return (
-
- - -
+
diff --git a/apps/web/src/components/app/automations-launch-dialog.tsx b/apps/web/src/components/app/automations-launch-dialog.tsx index cc25c470..e08d0f2d 100644 --- a/apps/web/src/components/app/automations-launch-dialog.tsx +++ b/apps/web/src/components/app/automations-launch-dialog.tsx @@ -13,7 +13,7 @@ import { toast } from "sonner"; import { ArgInput } from "@/components/app/arg-input"; import { ContextPicker } from "@/components/app/context-picker"; import { startupFileKey } from "@/components/app/create-agent-dialog-clipboard"; -import { AgentTypeCombobox } from "@/components/app/automations-form-fields"; +import { AgentTypeSelect } from "@/components/app/agent-type-select"; import { ActivityBars } from "@/components/ui/activity-bars"; import { Button } from "@/components/ui/button"; import { @@ -247,14 +247,12 @@ function LaunchTemplateDialogContent({ onDrop={showMedia ? handleDrop : undefined} > {!isTerminal ? ( -
- - -
+ ) : null} {args.length > 0 ? (