From cfd2556053192e76865c5e98fd36eeaea4c69b35 Mon Sep 17 00:00:00 2001 From: stroblme Date: Mon, 12 Oct 2026 22:06:31 +0200 Subject: [PATCH] Dashboard message picker: searchable combobox instead of a plain select Co-Authored-By: Claude Opus 5.5 --- frontend/src/components/Dashboard/panels.tsx | 85 +++++++++++++++----- 1 file changed, 63 insertions(+), 22 deletions(-) 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 (
- + + + + + + + + + No message by that name. + + {choices.map((message) => ( + { + onPick(message.name, message.dtype ?? "") + setOpen(false) + }} + > + {message.name} + {message.name === value ? ( + + ) : null} + + ))} + + + + +
) }