Skip to content

[plugin-dashboard] DashboardGridLayout has no dataset path at all — an ADR-0021 dataset-bound widget renders a silent blank chart on the editable grid #4614

Description

@yinlianghui

Found while implementing #4612 (the retired-shape half of the same asymmetry). Filed unassigned, not fixed there — #4612's scope is the RETIRED inline-analytics shape; this is the current shape failing on the same surface. Duplicate-searched (keyword + DashboardGridLayout path): no open issue covers it.

The defect

DashboardRenderer routes a dataset-bound widget to DatasetWidget:

const datasetBound = !!(widget as any).dataset;          // DashboardRenderer.tsx:528
…
{datasetBound
  ? <DatasetWidget widget={effectiveWidget} dataSource={dataSource} />
  : <SchemaRenderer schema={componentSchema} … />}       // DashboardRenderer.tsx:841-843

DashboardGridLayout has no equivalent. It never reads widget.dataset, never imports DatasetWidget, and takes no dataSource prop at all — measured on origin/main:

$ grep -n "DatasetWidget\|dataset" packages/plugin-dashboard/src/DashboardGridLayout.tsx
191:    // 8 chart families by hand while DatasetWidget covered all 19, so radar /

One hit, inside a comment about a different fix. So a widget authored in the current ADR-0021 shape — { id, type: 'bar', dataset: 'invoices', values: ['count'] } — reaches the series branch, finds widget.data and options.data both undefined, fails isObjectProvider(undefined), and falls to the static-data branch with data: [] (DashboardGridLayout.tsx:213-225). A blank chart, with no diagnostic.

This is the same shape of bug as #4612 one level up, and the outcome is arguably worse: on DashboardRenderer a dataset-bound widget with an incapable data source at least reaches DatasetWidget, which renders a named error ("This data source does not support dataset queries", DatasetWidget.tsx:767-769). On the grid there is nothing to render an error — the dataset binding is simply never read.

Blast radius

The dashboard-grid SDUI component type, registered as "Dashboard Grid (Editable)" (packages/plugin-dashboard/src/index.tsx:271-289), and the DashboardGridLayout named export from the package entry. Every widget authored the way ADR-0021 says to author them is blank on that surface.

Evidence already in the tree

#4612's new suite contains this as a negative control — DashboardGridLayout.legacyRetired.test.tsx, "does NOT show the placeholder for a dataset-bound widget". It asserts only that the retired-format placeholder is absent, which is correct and deliberately says nothing about whether a chart appeared. It did not.

Not to be conflated

The nested options.data = { provider: 'object', … } config is a different, live surface and renders fine on the grid (isObjectProvider branches). This issue is only about the top-level dataset binding.

Fix shape (not prescriptive)

Either route dataset-bound widgets to DatasetWidget on this surface too — which means DashboardGridLayout gaining a dataSource prop it does not currently have, so it is a public-props change and wants a ruling — or, if the editable grid is deliberately not a dataset surface, render a named placeholder saying so rather than a blank, reusing legacyRetiredWidget.ts's pattern of one shared diagnostic. Worth deciding which, rather than defaulting.


Generated by Claude Code

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions