Let a dashboard be read against runs instead of the live engine

This commit is contained in:
2026-08-25 11:48:15 +02:00
parent deffd1623e
commit c9880cf543
13 changed files with 438 additions and 32 deletions
@@ -7,6 +7,7 @@ import { handleError } from "@/utils"
// The transmit ring's rule lives with the dashboard's own geometry, and CSS is
// chunked per entry — so the sheet is pulled in wherever the pulse is drawn.
import "./ui/core/core.css"
import { useDataContext } from "./dataContext"
import { usePublishMessage } from "./queries"
import { useLocked } from "./settings"
@@ -54,7 +55,10 @@ function confirms(live: unknown, sent: unknown): boolean {
export function usePublish(widget: WidgetDef, dashboard: string) {
const cfg = (widget.config ?? {}) as Record<string, unknown>
const target = cfg.target == null ? "" : String(cfg.target)
const locked = useLocked()
// A dashboard opened against a run or a replay is a picture of something
// that already happened; there is nothing for a control to publish to.
const context = useDataContext()
const locked = useLocked() || Boolean(context?.readOnly)
const publish = usePublishMessage()
const live = useLiveValue(target || undefined)
const { showErrorToast } = useCustomToast()