From 714f5409ed19591b7b193e780ac1a0bec88b8b4c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Oct 2026 05:00:32 +0000 Subject: [PATCH 1/4] fix(examples,spec): drop dashboard widget options no dataset-bound renderer reads The census of every key the examples write through DashboardWidgetOptionsSchema's passthrough found no reader on the path a spec-legal widget renders through: objectui's DatasetWidget reads only the five declared keys plus the description sub-caption. app-crm's metric tiles carried options.format/currency (the dataset measures already declare format + currency), and app-todo's widgets carried color, suffix, showLegend, horizontal and showDataLabels. Each is removed from its producer instead of declared. The options docblock no longer claims the renderer understands presentation extras; it states the measured read set and the declared homes for presentation (measure format/currency, colorVariant, chartConfig). Claude-Session: https://claude.ai/code/session_017VaLJnYwhPsanVCe9dMCJU Co-authored-by: Claude --- .../src/dashboards/pipeline.dashboard.ts | 8 +++-- .../app-todo/src/dashboards/task.dashboard.ts | 13 +++----- packages/spec/src/ui/dashboard.zod.ts | 32 ++++++++++++++----- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/examples/app-crm/src/dashboards/pipeline.dashboard.ts b/examples/app-crm/src/dashboards/pipeline.dashboard.ts index 8dcc8f25084..8f03729b631 100644 --- a/examples/app-crm/src/dashboards/pipeline.dashboard.ts +++ b/examples/app-crm/src/dashboards/pipeline.dashboard.ts @@ -35,6 +35,11 @@ export const PipelineDashboard: Dashboard = { columns: 12, widgets: [ // --- Row 1: KPI tiles ------------------------------------------------- + // No `options` on these tiles: the currency face comes from the dataset + // measure (`total_amount` / `avg_amount` declare `format` + `currency` in + // `opportunity.dataset.ts`). A dataset-bound widget reads only the `options` + // keys the spec declares (plus the `description` sub-caption), so an + // `options.format` / `options.currency` here was inert. { id: 'total_pipeline', type: 'metric', @@ -43,7 +48,6 @@ export const PipelineDashboard: Dashboard = { filter: { stage: { $nin: ['closed_won', 'closed_lost'] } }, dataset: 'opportunity_metrics', values: ['total_amount'], - options: { format: 'currency', currency: 'USD' }, layout: { x: 0, y: 0, w: 4, h: 2 }, }, { @@ -61,7 +65,6 @@ export const PipelineDashboard: Dashboard = { compareTo: { kind: 'previousPeriod' }, dataset: 'opportunity_metrics', values: ['total_amount'], - options: { format: 'currency', currency: 'USD' }, layout: { x: 4, y: 0, w: 4, h: 2 }, }, { @@ -79,7 +82,6 @@ export const PipelineDashboard: Dashboard = { compareTo: { kind: 'previousYear' }, dataset: 'opportunity_metrics', values: ['avg_amount'], - options: { format: 'currency', currency: 'USD' }, layout: { x: 8, y: 0, w: 4, h: 2 }, }, diff --git a/examples/app-todo/src/dashboards/task.dashboard.ts b/examples/app-todo/src/dashboards/task.dashboard.ts index e631e8f2c4a..c14b7fa937f 100644 --- a/examples/app-todo/src/dashboards/task.dashboard.ts +++ b/examples/app-todo/src/dashboards/task.dashboard.ts @@ -17,6 +17,11 @@ export const TaskDashboard: Dashboard = { label: 'Task Overview', description: 'Key task metrics and productivity overview', + // No widget carries `options`: a dataset-bound widget reads only the keys the + // spec declares there (`dateGranularity`, `sortBy`, `sortOrder`, `limit`, + // `stageOrder`) plus the `description` sub-caption, so a presentation key in + // the bag renders nothing. A tile accent is `colorVariant`, a chart's look is + // `chartConfig`, and a number's face is the dataset measure's own `format`. widgets: [ // Row 1: Key Metrics { @@ -26,7 +31,6 @@ export const TaskDashboard: Dashboard = { dataset: 'task_metrics', values: ['task_count'], layout: { x: 0, y: 0, w: 3, h: 2 }, - options: { color: '#3B82F6' } }, { id: 'completed_today', @@ -36,7 +40,6 @@ export const TaskDashboard: Dashboard = { dataset: 'task_metrics', values: ['task_count'], layout: { x: 3, y: 0, w: 3, h: 2 }, - options: { color: '#10B981' } }, { id: 'overdue_tasks', @@ -46,7 +49,6 @@ export const TaskDashboard: Dashboard = { dataset: 'task_metrics', values: ['task_count'], layout: { x: 6, y: 0, w: 3, h: 2 }, - options: { color: '#EF4444' } }, { id: 'completion_rate', @@ -56,7 +58,6 @@ export const TaskDashboard: Dashboard = { dataset: 'task_metrics', values: ['task_count'], layout: { x: 9, y: 0, w: 3, h: 2 }, - options: { suffix: '%', color: '#8B5CF6' } }, // Row 2: Task Distribution @@ -75,7 +76,6 @@ export const TaskDashboard: Dashboard = { dimensions: ['status'], values: ['task_count'], layout: { x: 0, y: 2, w: 6, h: 4 }, - options: { showLegend: true } }, { id: 'tasks_by_priority', @@ -86,7 +86,6 @@ export const TaskDashboard: Dashboard = { dimensions: ['priority'], values: ['task_count'], layout: { x: 6, y: 2, w: 6, h: 4 }, - options: { horizontal: true } }, // Row 3: Trends @@ -99,7 +98,6 @@ export const TaskDashboard: Dashboard = { dimensions: ['completed_date'], values: ['task_count'], layout: { x: 0, y: 6, w: 8, h: 4 }, - options: { showDataLabels: true } }, { id: 'tasks_by_category', @@ -110,7 +108,6 @@ export const TaskDashboard: Dashboard = { dimensions: ['category'], values: ['task_count'], layout: { x: 8, y: 6, w: 4, h: 4 }, - options: { showLegend: true } }, // The former Row 4 count-only `table` widgets (`overdue_tasks_table`, diff --git a/packages/spec/src/ui/dashboard.zod.ts b/packages/spec/src/ui/dashboard.zod.ts index fe3b5b89c10..a0e59493e32 100644 --- a/packages/spec/src/ui/dashboard.zod.ts +++ b/packages/spec/src/ui/dashboard.zod.ts @@ -214,15 +214,31 @@ const WIDGET_HISTORY = + 'shipping inert metadata; a stale or mis-layered key is now a loud parse error.'; /** - * Widget `options` — the renderer-extras escape hatch, with the keys that - * reach the ANALYTICS QUERY declared explicitly (framework#3588). + * Widget `options` — an open bag, with the keys that reach the ANALYTICS QUERY + * declared explicitly (framework#3588). * - * The bag stays open (`passthrough`): presentation-only settings the renderer - * understands — `icon`, `trend`, `columns`, `striped`, `density`, … — are - * carried through untouched and are none of the spec's business. What the - * declared keys below buy is a real contract for the four that are NOT - * presentation-only: they change the SQL the dataset query compiles to, so a - * typo (`sortDirection`, `granularity`) is now an author-time type error + * The bag stays open (`passthrough`), but an undeclared key in it is NOT a + * renderer setting. `dataset` is required, so every widget renders through + * objectui's dataset-bound path (`DatasetWidget`), and that path reads exactly + * the five keys declared below plus `description` — the metric sub-caption + * `translateDashboard` writes (`system/i18n-resolver.ts`). Any other key + * parses and reaches no renderer. The #20960 census measured that at objectui + * `main` `5262f7dd` over every key this repo's examples wrote here (`format`, + * `currency`, `color`, `suffix`, `showLegend`, `horizontal`, + * `showDataLabels`): each had a reader only on the legacy inline arm, which a + * widget carrying a `dataset` never reaches, so each was removed from its + * producer rather than declared. ⛔ A key is declared here only with a read + * site on the dataset-bound path, and it then joins + * `CONSUMED_WIDGET_OPTION_KEYS` in `@objectstack/sdui-parser` + * (`check:widget-option-census`). + * + * Presentation has declared homes instead: a number's face is the dataset + * MEASURE's `format` + `currency`, a tile's accent is the widget's + * `colorVariant`, and a chart's look is the widget's `chartConfig`. + * + * What the declared keys below buy is a real contract for the four that are + * NOT presentation-only: they change the SQL the dataset query compiles to, so + * a typo (`sortDirection`, `granularity`) is now an author-time type error * instead of an option that reads as if it works and silently does nothing. * * The dashboard/report renderer lowers these into the `DatasetSelection` it From ef4a1f5a70b14973cad7ef5590bf45aad0d7cdf7 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Oct 2026 05:05:27 +0000 Subject: [PATCH 2/4] chore(changeset): spec patch for the widget options docblock correction Claude-Session: https://claude.ai/code/session_017VaLJnYwhPsanVCe9dMCJU Co-authored-by: Claude --- .changeset/20960-widget-options-census.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .changeset/20960-widget-options-census.md diff --git a/.changeset/20960-widget-options-census.md b/.changeset/20960-widget-options-census.md new file mode 100644 index 00000000000..99f9a25ec11 --- /dev/null +++ b/.changeset/20960-widget-options-census.md @@ -0,0 +1,14 @@ +--- +'@objectstack/spec': patch +--- + +docs(spec): the `DashboardWidgetOptionsSchema` doc comment states which widget `options` keys a renderer reads, instead of naming presentation extras (`icon`, `trend`, `columns`, `striped`, `density`) it called renderer-understood + +Clause-②: no — no key is declared and no value is typed, so the accept set is unchanged. + +`options` still parses any key. A widget always binds a `dataset`, so it renders through +objectui's dataset-bound path, and that path reads only the five declared keys +(`dateGranularity`, `sortBy`, `sortOrder`, `limit`, `stageOrder`) and the `description` +sub-caption. Any other key parses and renders nothing. To format a number, set `format` and +`currency` on the dataset measure. To accent a tile, set the widget's `colorVariant`. To style +a chart, set the widget's `chartConfig`. From 193b40584b290ad9f659f6999eedc39135792f09 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Oct 2026 06:37:01 +0000 Subject: [PATCH 3/4] docs(spec): the options docblock says no examples key is read on the dataset-bound path, without a per-key claim about the inline arm Claude-Session: https://claude.ai/code/session_017VaLJnYwhPsanVCe9dMCJU Co-authored-by: Claude --- packages/spec/src/ui/dashboard.zod.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/spec/src/ui/dashboard.zod.ts b/packages/spec/src/ui/dashboard.zod.ts index c5afc1ad774..f8a65b4eab3 100644 --- a/packages/spec/src/ui/dashboard.zod.ts +++ b/packages/spec/src/ui/dashboard.zod.ts @@ -225,12 +225,12 @@ const WIDGET_HISTORY = * parses and reaches no renderer. The #20960 census measured that at objectui * `main` `5262f7dd` over every key this repo's examples wrote here (`format`, * `currency`, `color`, `suffix`, `showLegend`, `horizontal`, - * `showDataLabels`): each had a reader only on the legacy inline arm, which a - * widget carrying a `dataset` never reaches, so each was removed from its - * producer rather than declared. ⛔ A key is declared here only with a read - * site on the dataset-bound path, and it then joins - * `CONSUMED_WIDGET_OPTION_KEYS` in `@objectstack/sdui-parser` - * (`check:widget-option-census`). + * `showDataLabels`): none is read on that path — only the legacy inline arm, + * which a widget carrying a `dataset` never reaches, spreads the bag into + * component props — so each was removed from its producer rather than + * declared. ⛔ A key is declared here only with a read site on the + * dataset-bound path, and it then joins `CONSUMED_WIDGET_OPTION_KEYS` in + * `@objectstack/sdui-parser` (`check:widget-option-census`). * * Presentation has declared homes instead: a number's face is the dataset * MEASURE's `format` + `currency`, a tile's accent is the widget's From 9efd8ffa5d2cc9b22270f1c86f9f18c5d9d1c25b Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Oct 2026 06:52:56 +0000 Subject: [PATCH 4/4] docs(spec): the options docblock records description as read but unwritten, left undeclared A seat note added the census row: the dataset-bound metric tile reads options.description as its sub-caption, but no authored source writes it (translateDashboard only overlays it from a subCaption bundle entry), and the inline-dialect ruling retires it, so it stays undeclared and the reader-side drop is objectui's follow-up. The declare rule now names both halves: a writer and a read site. Claude-Session: https://claude.ai/code/session_017VaLJnYwhPsanVCe9dMCJU Co-authored-by: Claude --- packages/spec/src/ui/dashboard.zod.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/spec/src/ui/dashboard.zod.ts b/packages/spec/src/ui/dashboard.zod.ts index f8a65b4eab3..98f1a5af439 100644 --- a/packages/spec/src/ui/dashboard.zod.ts +++ b/packages/spec/src/ui/dashboard.zod.ts @@ -220,17 +220,21 @@ const WIDGET_HISTORY = * The bag stays open (`passthrough`), but an undeclared key in it is NOT a * renderer setting. `dataset` is required, so every widget renders through * objectui's dataset-bound path (`DatasetWidget`), and that path reads exactly - * the five keys declared below plus `description` — the metric sub-caption - * `translateDashboard` writes (`system/i18n-resolver.ts`). Any other key - * parses and reaches no renderer. The #20960 census measured that at objectui - * `main` `5262f7dd` over every key this repo's examples wrote here (`format`, - * `currency`, `color`, `suffix`, `showLegend`, `horizontal`, + * the five keys declared below plus `description`, the metric sub-caption. + * Any other key parses and reaches no renderer. The #20960 census measured + * that at objectui `main` `5262f7dd` over every key this repo's examples wrote + * here (`format`, `currency`, `color`, `suffix`, `showLegend`, `horizontal`, * `showDataLabels`): none is read on that path — only the legacy inline arm, * which a widget carrying a `dataset` never reaches, spreads the bag into * component props — so each was removed from its producer rather than - * declared. ⛔ A key is declared here only with a read site on the - * dataset-bound path, and it then joins `CONSUMED_WIDGET_OPTION_KEYS` in - * `@objectstack/sdui-parser` (`check:widget-option-census`). + * declared. `description` is the opposite case, read but unwritten: no + * authored source writes it (only `translateDashboard` overlays it, from a + * `subCaption` bundle entry — `system/i18n-resolver.ts`), and objectui#11228 + * ruled it out with the inline dialect, so it stays undeclared and dropping + * the read is objectui's follow-up. ⛔ A key is declared here only with both + * a writer and a read site on the dataset-bound path, and it then joins + * `CONSUMED_WIDGET_OPTION_KEYS` in `@objectstack/sdui-parser` + * (`check:widget-option-census`). * * Presentation has declared homes instead: a number's face is the dataset * MEASURE's `format` + `currency`, a tile's accent is the widget's