Skip to content

[finding] os explain dashboard's widgets still teach the pre-ADR-0021 inline analytics shape (object + groupBy + aggregate), removed from the spec #15174

Description

@os-litant

Found by the catalog sweep landed for #14811, which parses every SCHEMAS entry's example in packages/cli/src/commands/explain.ts against its real schema. Rewriting catalog entries was ruled out of scope on that card (triage comment 5520209463, step 3), so this is filed unassigned for triage. Suggested domain: domain:cli.

Measured

DashboardSchema (@objectstack/spec/ui) rejects the dashboard entry's example with nine issues — the worst of the eleven entries:

[widgets.0.id]      invalid_type  :: expected string, received undefined
[widgets.0.type]    invalid_value :: Invalid option: expected one of "bar"|"horizontal-bar"|
    "column"|"line"|"area"|"pie"|"donut"|"funnel"|"scatter"|"treemap"|"sankey"|"combo"|
    "gauge"|"solid-gauge"|"metric"|"kpi"|"bullet"|"radar"|"table"|"pivot"
[widgets.0.dataset] invalid_type  :: expected string, received undefined
[widgets.0.values]  invalid_type  :: expected array, received undefined
[widgets.0]         unrecognized_keys :: Unrecognized key(s) on this dashboard widget:
    `object`, `groupBy`.
    - The pre-ADR-0021 inline analytics shape (`object` + `categoryField` + `valueField`
      + `aggregate`, pivot `rowField`/`columnField`) was removed — bind a `dataset` and
      select `dimensions` + `values` by name. Renderer-only settings belong under
      `options`. Undeclared top-level keys were dropped silently before strict
      validation, shipping inert metadata; a stale or mis-layered key is now a loud
      parse error.
[widgets.1.id]      invalid_type  :: expected string, received undefined
[widgets.1.dataset] invalid_type  :: expected string, received undefined
[widgets.1.values]  invalid_type  :: expected array, received undefined
[widgets.1]         unrecognized_keys :: Unrecognized key(s) on this dashboard widget:
    `object`, `aggregate`. [same guidance]

The sample writes { type: 'chart', object: 'project_task', groupBy: 'status' } and { type: 'metric', object: 'project_task', aggregate: 'count' }.

Note for whoever takes it

'chart' is not a widget type at all — the enum names the concrete mark (bar, line, pie, …). Rewriting this example means binding a real dataset and choosing dimensions / values, i.e. it needs an ADR-0021-shaped dashboard to point at, not a key rename. That makes it the entry least suited to a mechanical fix and the one most likely to need an author's judgement about what a good sample dashboard is.

The entry's optional table (widgets, layout, refreshInterval) is only type-name deep, so the wrong shape lives entirely in the example.

Reproduce

pnpm --filter @objectstack/cli exec vitest run test/commands.test.ts

The sweep names this entry as a known-broken xfail; the day the entry is corrected, that xfail turns red and is meant to be promoted to a plain assertion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions