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
13 changes: 13 additions & 0 deletions .changeset/sdui-parser-stageorder-funnel-only.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@objectstack/sdui-parser': patch
---

`dashboard-widget-options.ts` header: `stageOrder` is a `funnel`-only key, not `funnel` / `pyramid`

The accepted-set census comment at the top of the module (carried into the
published `index.d.ts`) described `stageOrder` as "funnel/pyramid stage order".
There is no `pyramid` widget type: `ChartTypeSchema` refuses it, so an author
who copied the pair got a parse refusal. The line now says what the schema's
own `.describe()` says: `funnel` is the only widget type that reads the key.
Comment-only — the accepted set, the diagnostic code and the emitted JS are
unchanged.
2 changes: 1 addition & 1 deletion content/docs/ui/dashboards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ dataset compiles to:
| `sortBy` | `string` | Orders rows by a dimension or measure **this widget selects**. |
| `sortOrder` | `asc \| desc` | Direction for `sortBy` (default `asc`). |
| `limit` | `number` | Max rows, applied **after** ordering. |
| `stageOrder` | `(string \| number \| boolean)[]` | Explicit stage order for `funnel` / `pyramid`, as the dimension's **stored values**. Omit to use the dimension field's picklist option order. |
| `stageOrder` | `(string \| number \| boolean)[]` | Explicit stage order for a `funnel` widget, as the dimension's **stored values**. `funnel` is the only widget type that reads it — on any other type the key parses and is never consulted; order those with `sortBy` / `sortOrder`. Omit to use the dimension field's picklist option order. |

Because they are declared, a misspelling (`sortDirection`, `granularity`) is an
author-time error rather than an option that reads as if it works.
Expand Down
2 changes: 1 addition & 1 deletion packages/sdui-parser/src/dashboard-widget-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* the five the spec DECLARES:
*
* dateGranularity, sortBy, sortOrder, limit (query-affecting, framework#3588)
* stageOrder (funnel/pyramid stage order)
* stageOrder (funnel stage order — the only type that reads it)
*
* plus ONE undeclared key with a real read site:
*
Expand Down
2 changes: 1 addition & 1 deletion skills/objectstack-ui/rules/dashboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ author-time type error rather than an option that silently does nothing.
| `sortBy` | a name this widget selects | Order by that dimension or measure. It must be one of this widget's own `dimensions` / `values` entries. |
| `sortOrder` | `'asc'` \| `'desc'` | Direction for `sortBy` (default ascending). |
| `limit` | positive integer | Max rows, applied **after** ordering — so "top 10 accounts" is `limit` **plus** `sortBy`. Without `sortBy` the runtime orders by the selected dimensions: deterministic, but not the top of anything. |
| `stageOrder` | array of **stored** values | Explicit category order for `funnel` / `pyramid`. Stored values, not display labels; omit it to inherit the field's own picklist order. |
| `stageOrder` | array of **stored** values | Explicit stage order for `funnel`; no other type reads it. Stored values, not display labels; omit to inherit the field's picklist order. |

```typescript
// Top 10 accounts by revenue, bucketed monthly for this widget only
Expand Down
Loading