Skip to content

Commit 6139ec9

Browse files
committed
docs(spec): regenerate the dashboard reference page, add the changeset
`content/docs/references/ui/dashboard.mdx` is a build product of the spec's docs build — its line 6 says so — so the new `globalFilters[].field` description reaches it by regeneration, never by hand. Two rows carry the sentence because two sections render the same `GlobalFilterSchema`: `### Nested Shape: Dashboard.globalFilters[number]` and the top-level `## GlobalFilter` → `### Properties`. No other reference page moved: the identically-spelled `field` describe on the list-view schema is a different surface and was deliberately left alone. Changeset is `patch` on `@objectstack/spec`: the string is a published datum, not a comment — it is the `description` of the property in the shipped JSON Schema and the runtime `.description` on the Zod schema in `dist`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x
1 parent 6e7b285 commit 6139ec9

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
`Dashboard.globalFilters[].field` now describes WHERE the name resolves, instead of only that it is a field name.
6+
7+
The key's `.describe()` read `Field name to filter on` — true, but silent on the one thing authors get wrong. A dashboard global filter's `field` resolves against the object behind each bound widget's dataset (`dataset.object`), never against that dataset's declared `dimensions`; `widgets[].dimensions[]` selects from that second, separate namespace by name. Readers who assumed the two were the same namespace concluded a filter needs a matching dataset dimension, which is not so.
8+
9+
The rewritten description states the resolution target, scopes the claim to the authoring layer, and names the rule that already enforces it — `dashboard-filter-field-unknown`, `severity: 'error'` in `@objectstack/lint`'s widget-binding validator. It is a statement about a rule that already fires, not a suggestion.
10+
11+
The mirrored TSDoc carries the half a one-line description cannot: the separation holds for the **authorable surface** only. It is NOT a claim that an object field can never serve as a dimension — the analytics query API does accept an object's own field as an ad-hoc dimension without the dataset declaring it, and `widget-dimension-unknown` (also `severity: 'error'`) is what holds that line for authored dashboards.
12+
13+
**What moves for consumers.** The string is a published datum, not a comment: it is the `description` of the `field` property in the shipped JSON Schema (`json-schema/ui/GlobalFilter.json`, `json-schema/ui/Dashboard.json`, `json-schema/objectstack.json`) and the runtime `.description` on the Zod schema in `dist`, so anything that renders schema descriptions — editor hovers, generated reference pages, prompt builders — shows the new sentence. No accept set moves: the key stays `z.string()`, nothing that parses today stops parsing, and no validation behaviour changes.
14+
15+
The same wording already stands on the hand-written page (`content/docs/ui/dashboards.mdx`**Where a Filter's `field` Resolves**); the generated reference page now agrees with it rather than trailing it.

content/docs/references/ui/dashboard.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const result = DashboardSchema.parse(data);
9797
| Property | Type | Required | Description |
9898
| :--- | :--- | :--- | :--- |
9999
| **name** | `string` | optional | Stable filter name (variable key); defaults to field |
100-
| **field** | `string` || Field name to filter on |
100+
| **field** | `string` || Field name to filter on — at the authoring layer it resolves against the object behind each bound widget's dataset (`dataset.object`), not against that dataset's declared `dimensions`; enforced by the lint rule `dashboard-filter-field-unknown` (severity error) |
101101
| **object** | `string` | optional | Object whose `fields.<object>.<field>` translation-bundle entry resolves this filter's field label and option labels |
102102
| **label** | `string \| Record<string, string>` | optional | Display label for the filter |
103103
| **type** | `Enum<'text' \| 'select' \| 'date' \| 'number' \| 'lookup'>` | optional | Filter input type |
@@ -275,7 +275,7 @@ Widget configuration — declared query keys + open renderer extras
275275
| Property | Type | Required | Description |
276276
| :--- | :--- | :--- | :--- |
277277
| **name** | `string` | optional | Stable filter name (variable key); defaults to field |
278-
| **field** | `string` || Field name to filter on |
278+
| **field** | `string` || Field name to filter on — at the authoring layer it resolves against the object behind each bound widget's dataset (`dataset.object`), not against that dataset's declared `dimensions`; enforced by the lint rule `dashboard-filter-field-unknown` (severity error) |
279279
| **object** | `string` | optional | Object whose `fields.<object>.<field>` translation-bundle entry resolves this filter's field label and option labels |
280280
| **label** | `string \| Record<string, string>` | optional | Display label for the filter |
281281
| **type** | `Enum<'text' \| 'select' \| 'date' \| 'number' \| 'lookup'>` | optional | Filter input type |

0 commit comments

Comments
 (0)