Frontend addresses flows and dashboards by id: routes /flows/$flowId, /dashboards/$id and /view/$id, query keys, saves, lists, device pickers, search, brain and endpoint links and generated results dashboards go by id, while live values, issues, pauses and message names keep the key; tabs take the title from the document; creating uses POST and opens the issued id; the flow and dashboard panels show key and id with a copy button and a served HTTP or WebSocket node shows its hook URL under the flow id; specs create by POST and ids.spec.ts exercises issued ids

This commit is contained in:
2026-11-02 19:57:43 +01:00
parent fd637e0f1e
commit fa15522cb0
65 changed files with 1380 additions and 784 deletions
+9 -9
View File
@@ -20,7 +20,7 @@ import { cn } from "@/lib/utils"
* What a paired device shows: the dashboards it was assigned. The address
* stays `/panel/{id}`, which is what screens already hanging were pointed at.
*
* The same full-bleed surface as `/view/{name}`, with a rail down the left
* The same full-bleed surface as `/view/{id}`, with a rail down the left
* (along the bottom on a phone) when there is more than one to switch between — so a hallway tablet and a
* workshop tablet can carry different sets without either dashboard knowing
* anything about the other.
@@ -51,7 +51,7 @@ function PanelRoute() {
const { data: panel } = useQuery(deviceQueryOptions(id))
const dashboards = panel?.dashboards ?? []
// A name in the URL that this panel no longer carries falls back to the
// A dashboard in the URL that this panel no longer carries falls back to the
// first, which is what a dashboard removed from under a running panel does.
const current = d && dashboards.includes(d) ? d : dashboards[0]
@@ -86,12 +86,12 @@ function PanelRoute() {
// Which way along the rail the dashboard shown was reached, so its tiles
// come in from that side: further down it (1) from below, as a round
// panel's next dashboard rises, and further up (-1) from above.
const shown = dashboard?.name
const [turned, setTurned] = useState({ name: shown, by: 1 })
if (shown !== turned.name) {
const shown = dashboard?.id
const [turned, setTurned] = useState({ id: shown, by: 1 })
if (shown !== turned.id) {
const by =
dashboards.indexOf(shown ?? "") - dashboards.indexOf(turned.name ?? "")
setTurned({ name: shown, by: by < 0 ? -1 : 1 })
dashboards.indexOf(shown ?? "") - dashboards.indexOf(turned.id ?? "")
setTurned({ id: shown, by: by < 0 ? -1 : 1 })
}
// Said by the panel rather than by the dashboard: this is the screen, and
// whether it is touched or pointed at is a fact about the screen. A document
@@ -151,10 +151,10 @@ function PanelRoute() {
dashboards={dashboards}
current={current}
horizontal={stacked}
linkFor={(name) => ({
linkFor={(dashboardId) => ({
to: "/panel/$id",
params: { id },
search: { d: name },
search: { d: dashboardId },
})}
/>
) : null