Skip to content

Commit 9c765bf

Browse files
committed
docs(spec): name the warning level in the widget options doc comment, add the patch changeset
Claude-Session: https://claude.ai/code/session_01UtnxvdiN376GF3sgXwAw4d Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5e967b0 commit 9c765bf

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
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.
6+
7+
Clause-②: no

‎packages/spec/src/ui/dashboard.zod.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,10 @@ const WIDGET_HISTORY =
245245
* a wrong VALUE for one (`sortOrder: 'sideways'`) is an author-time type error
246246
* and a parse error. A misspelled KEY is neither: the bag is open, so
247247
* `sortDirection` or `granularity` compiles and parses like any other extra
248-
* and changes nothing. What names it is the `unconsumed-widget-option` warning
249-
* that `os validate`, `os build` and `os lint` raise on every key the
250-
* dataset-bound path does not read.
248+
* and changes nothing. What names it is the `unconsumed-widget-option`
249+
* warning `os validate`, `os build` and `os lint` raise for a key the
250+
* dataset-bound path does not read — a warning, so none of the three fails on
251+
* it.
251252
*
252253
* The dashboard/report renderer lowers these into the `DatasetSelection` it
253254
* posts (`dateGranularity`, `order`, `limit`); see the field docs on

0 commit comments

Comments
 (0)