Flow canvas draws panel I/O ports as panel:<id>:<port> endpoints that open their panel in the Panels dialog
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
@@ -35,7 +35,7 @@ import {
|
||||
import useCustomToast from "@/hooks/useCustomToast"
|
||||
import { handleError } from "@/utils"
|
||||
|
||||
type Search = { panels?: boolean }
|
||||
type Search = { panels?: boolean; panel?: string }
|
||||
|
||||
export const Route = createFileRoute("/_layout/dashboards/")({
|
||||
component: Dashboards,
|
||||
@@ -43,6 +43,8 @@ export const Route = createFileRoute("/_layout/dashboards/")({
|
||||
// else — the global search among them — arrives at it.
|
||||
validateSearch: (search: Record<string, unknown>): Search => ({
|
||||
panels: search.panels === true || search.panels === "true" || undefined,
|
||||
// Which panel to scroll to, for a link that is about one of them.
|
||||
panel: typeof search.panel === "string" ? search.panel : undefined,
|
||||
}),
|
||||
})
|
||||
|
||||
@@ -57,7 +59,7 @@ function Dashboards() {
|
||||
const [deleteOpen, setDeleteOpen] = useState(false)
|
||||
// Which screens exist is a question with an address, so anything can link to
|
||||
// it — the global search lands a panel here.
|
||||
const { panels: panelsOpen } = Route.useSearch()
|
||||
const { panels: panelsOpen, panel: panelFocus } = Route.useSearch()
|
||||
const setPanelsOpen = (open: boolean) =>
|
||||
navigate({ to: "/dashboards", search: open ? { panels: true } : {} })
|
||||
|
||||
@@ -122,7 +124,7 @@ function Dashboards() {
|
||||
{/* Its own root rather than a nested one: which screens exist is a
|
||||
different question from which dashboards do. */}
|
||||
<Dialog open={panelsOpen ?? false} onOpenChange={setPanelsOpen}>
|
||||
<PanelsDialog />
|
||||
<PanelsDialog focus={panelFocus} />
|
||||
</Dialog>
|
||||
|
||||
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
|
||||
|
||||
Reference in New Issue
Block a user