You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@maple-dev/alchemy: typed dashboard props, a managed refresh interval, and adopting a dashboard built in the UI #1891
Written by an AI agent (Claude) on behalf of @jasonkuhrt.
A team managing its Maple dashboards with @maple-dev/alchemy can't type-check a dashboard, can't manage its refresh interval, and can't take over a dashboard someone already built in the UI.
yield*Maple.Dashboard("service-health",{name: "Service health",// Type error: not a prop, though the v2 API has it.refresh_interval_seconds: 60,widgets: [// Type-checks, then the API answers 400 at deploy: "timeseries" is not a// visualization, and a raw_sql source needs its `sql`.{id: "requests",visualization: "timeseries",data_source: {kind: "raw_sql"}},],})
And declaring a dashboard that was first built in the UI creates a second one beside it, because the provider creates whenever it has no Alchemy state.
What we'd like to write instead:
// Panels as values, checked where they're written, shared across dashboards.constrequests=Maple.DashboardWidget.make({id: "requests",visualization: "stat",data_source: {kind: "raw_sql",sql: "SELECT count() AS value FROM traces WHERE $__orgFilter"},display: {title: "Requests"},layout: {x: 0,y: 0,w: 3,h: 4},})yield*Maple.Dashboard("service-health",{
...Maple.DashboardData.make({name: "Service health",refresh_interval_seconds: 60,widgets: [requests]}),// Take over the dashboard built in the UI.dashboardId: "dash_…",})
Heartbeat runs this today through a patch of @maple-dev/alchemy 0.2.4, for two dashboards. #1872 implements it.
Activity