Add a global search, and stop the sidebar logo squeezing
`GET /api/v1/search/` hands the client one flat index of everything worth jumping to — flows and the nodes inside them, dashboards and the widgets on them, panels, secrets, modules, workers and alert channels — and cmdk matches it in the browser, so results narrow while typing without a round trip per keystroke. A node hit is the one thing no list endpoint could answer: it opens its flow with that node in focus. The panel is reached from **Search** above Documentation in the sidebar, or ⌘K anywhere. The flow canvas palette moves to ⌘P, being the narrower of the two. The panels dialog gains an address (`/dashboards?panels`) so a panel hit has somewhere to land, and the sidebar logo gets `shrink-0`: the rail's width animates while the logo is already back, and a flex item short of room is squeezed rather than clipped.
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
import { libraryQueryOptions } from "./queries"
|
||||
|
||||
/**
|
||||
* ⌘K: add a node, jump to another flow, or run the current one, without
|
||||
* ⌘P: add a node, jump to another flow, or run the current one, without
|
||||
* reaching for the dock.
|
||||
*/
|
||||
export function CommandPalette({
|
||||
|
||||
@@ -157,7 +157,7 @@ export function FlowDock({
|
||||
<Plus />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Add a node (⌘K)</TooltipContent>
|
||||
<TooltipContent>Add a node (⌘P)</TooltipContent>
|
||||
</Tooltip>
|
||||
|
||||
<Separator
|
||||
|
||||
@@ -1055,7 +1055,9 @@ function FlowEditorInner({
|
||||
"mod+shift+z": () => step(false),
|
||||
"mod+c": () => void copyNodes(),
|
||||
"mod+v": pasteNodes,
|
||||
"mod+k": () => setPaletteOpen((open) => !open),
|
||||
// ⌘P, not ⌘K: the sidebar's global search owns that everywhere, and this
|
||||
// palette is the canvas's own, narrower thing.
|
||||
"mod+p": () => setPaletteOpen((open) => !open),
|
||||
// Inside the code editor ⌘S applies that code, which the node panel
|
||||
// owns; anywhere else on the canvas it puts the flow live.
|
||||
"mod+s": (event) => {
|
||||
@@ -1064,7 +1066,7 @@ function FlowEditorInner({
|
||||
},
|
||||
// Both stay reachable while typing: one is the editor's own save, the
|
||||
// other is how you reach anything at all.
|
||||
["mod+s", "mod+k"],
|
||||
["mod+s", "mod+p"],
|
||||
)
|
||||
|
||||
return (
|
||||
@@ -1243,7 +1245,7 @@ function FlowEditorInner({
|
||||
</span>
|
||||
<p className="text-lg font-medium">This flow is empty</p>
|
||||
<p className="max-w-xs text-sm text-muted-foreground">
|
||||
Add a node to get started. Press ⌘K, or use the plus in the bar
|
||||
Add a node to get started. Press ⌘P, or use the plus in the bar
|
||||
below.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user