diff --git a/frontend/src/components/Dashboard/panels.tsx b/frontend/src/components/Dashboard/panels.tsx index 3afe437..88cf9a3 100644 --- a/frontend/src/components/Dashboard/panels.tsx +++ b/frontend/src/components/Dashboard/panels.tsx @@ -1,5 +1,5 @@ import { useQuery } from "@tanstack/react-query" -import { Ban, ChevronDown, Plus, RotateCw, X } from "lucide-react" +import { Ban, Check, ChevronDown, Plus, RotateCw, X } from "lucide-react" import { useState } from "react" import type { MessageInfo, SettingDef, WidgetDef } from "@/client" @@ -14,6 +14,14 @@ import { } from "@/components/Flow/SidePanel" import { runOverviewQueryOptions } from "@/components/Runs/queries" import { Button } from "@/components/ui/button" +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, + CommandList, +} from "@/components/ui/command" import { Dialog, DialogContent, @@ -97,7 +105,12 @@ function choicesFor(kind: WidgetKind, catalog: MessageInfo[]): MessageInfo[] { ) } -/** The picker, which records the payload type it bound along with the name. */ +/** + * The picker, which records the payload type it bound along with the name. + * + * Searchable, as the flow editor's message fields are: the catalog is every + * message every flow declares. + */ function MessagePicker({ kind, value, @@ -119,6 +132,7 @@ function MessagePicker({ filter?: (message: MessageInfo) => boolean onPick: (message: string, dtype: string) => void }) { + const [open, setOpen] = useState(false) const { data } = useQuery(messageCatalogQueryOptions()) const catalog = data?.data ?? [] const choices = filter @@ -130,26 +144,53 @@ function MessagePicker({ return (