Find a flow's declared inputs and outputs in the global search
/search lists each input and batch output under its qualified message, and picking one opens the flow on the label's id, which the editor now treats like a click on the label: it opens the flow's settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013GAeg4Jo6xjZzjwy9QDWMQ
This commit is contained in:
@@ -6,6 +6,8 @@ import {
|
||||
KeyRound,
|
||||
LayoutDashboard,
|
||||
LayoutGrid,
|
||||
LogIn,
|
||||
LogOut,
|
||||
type LucideIcon,
|
||||
MonitorSmartphone,
|
||||
Package,
|
||||
@@ -45,6 +47,8 @@ const GROUPS: {
|
||||
}[] = [
|
||||
{ category: "flow", label: "Flows", icon: Workflow },
|
||||
{ category: "node", label: "Nodes", icon: Box },
|
||||
{ category: "input", label: "Inputs", icon: LogIn },
|
||||
{ category: "output", label: "Outputs", icon: LogOut },
|
||||
{ category: "dashboard", label: "Dashboards", icon: LayoutDashboard },
|
||||
{ category: "widget", label: "Widgets", icon: LayoutGrid },
|
||||
{ category: "panel", label: "Panels", icon: MonitorSmartphone },
|
||||
@@ -106,7 +110,7 @@ function couldMatch(value: string, query: string): boolean {
|
||||
* narrow as they are typed without a round trip per keystroke.
|
||||
*
|
||||
* cmdk does the matching over what is mounted, so the entries are bucketed by
|
||||
* category once per fetch rather than filtered nine times per keystroke, and
|
||||
* category once per fetch rather than filtered eleven times per keystroke, and
|
||||
* each group is capped — a list nobody can scroll to the end of is not a
|
||||
* better answer than its first twenty.
|
||||
*/
|
||||
@@ -129,7 +133,7 @@ export function GlobalSearch({
|
||||
const entries = data ?? []
|
||||
const typed = query.trim()
|
||||
const typing = typed.length > 0
|
||||
// One pass over the index rather than one per group — nine passes over
|
||||
// One pass over the index rather than one per group — eleven passes over
|
||||
// every entry on each keystroke. Not memoised: the component returns early
|
||||
// while closed, so a hook cannot go here, and one pass is already the win.
|
||||
// The same pass drops what the query cannot reach, so each bucket is already
|
||||
@@ -157,6 +161,14 @@ export function GlobalSearch({
|
||||
params: { flowName: entry.parent ?? "" },
|
||||
search: { node: entry.name },
|
||||
})
|
||||
// Arriving on the label's id does what clicking the label does.
|
||||
case "input":
|
||||
case "output":
|
||||
return navigate({
|
||||
to: "/flows/$flowName",
|
||||
params: { flowName: entry.parent ?? "" },
|
||||
search: { node: `${entry.category}:${entry.name}` },
|
||||
})
|
||||
case "dashboard":
|
||||
return navigate({
|
||||
to: "/dashboards/$name",
|
||||
|
||||
Reference in New Issue
Block a user