Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/21210-widget-options-docblock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@objectstack/spec': patch
---

The `DashboardWidgetOptionsSchema` doc comment no longer says that a misspelled widget `options` key is an author-time type error. The bag ends in `.passthrough()`, so a misspelled key such as `sortDirection` or `granularity` compiles and parses like any other extra key, and it changes nothing at render time. A wrong value for a declared key, such as `sortOrder: 'sideways'`, is the type error and the parse error. `os validate`, `os build` and `os lint` name the misspelled key with the `unconsumed-widget-option` warning, which does not fail any of the three commands. Only the comment changed. The schema's shape is the same.

Clause-②: no
9 changes: 7 additions & 2 deletions packages/spec/src/ui/dashboard.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,13 @@ const WIDGET_HISTORY =
*
* 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.
* a wrong VALUE for one (`sortOrder: 'sideways'`) is an author-time type error
* and a parse error. A misspelled KEY is neither: the bag is open, so
* `sortDirection` or `granularity` compiles and parses like any other extra
* and changes nothing. What names it is the `unconsumed-widget-option`
* warning `os validate`, `os build` and `os lint` raise for a key the
* dataset-bound path does not read — a warning, so none of the three fails on
* it.
*
* The dashboard/report renderer lowers these into the `DatasetSelection` it
* posts (`dateGranularity`, `order`, `limit`); see the field docs on
Expand Down
Loading