Pin a chart to the last few runs of a flow

This commit is contained in:
2026-08-25 11:52:34 +02:00
parent 5ece544b14
commit 77754936c6
7 changed files with 331 additions and 12 deletions
@@ -118,6 +118,20 @@ export function widgetIssue(widget: WidgetDef): string | null {
if (widget.type === "markdown" || widget.type === "clock") return null
const cfg = config(widget)
if (widget.type === "chart" && cfg.source === "runs") {
const runs = (cfg.runs ?? {}) as {
metric?: string
flow?: string
group?: string
ids?: string[]
}
if (!runs.metric) return "This chart names no run metric yet."
if (!runs.ids?.length && !runs.group && !runs.flow) {
return "Say which runs: a flow, a sweep, or run ids."
}
return null
}
if (widget.type === "chart" && cfg.source === "query") {
if (!text(cfg.request)) return "This chart does not ask for anything yet."
if (!text(cfg.message)) return "This chart has no answer to draw yet."