Repository navigation
Commit 7c68b10
feat(spec): a dataset dimension may name its null bucket with
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao65RrUYonFsC9SXEirycswQ)_
Fixes #25391
Clause-②: yes (widening)
Metadata-protocol: added
The spec half of ruling `6358843349` on #25330 (letter A, maintainer
「同意」), verbatim: "new spec key `DatasetDimension.nullLabel` (I18nLabel,
optional; final spelling settled at spec review), the objectui consumer
reads it over `chart.nullCategory`, and `system.datasets.ts` sets
`user_id`'s null label to 「System」." The consumer half and the
`system.datasets.ts` producer follow after this lands; #25330 remains
open for them.
## What changes
- **`DatasetDimensionSchema.nullLabel`**
(`packages/spec/src/ui/dataset.zod.ts`): optional, typed
`I18nLabelSchema` (the `label` slot's own type, so a plain string or an
inline locale map), `.meta({ title: 'Null Label' })`. The describe says
it names the bucket of rows whose value for the dimension is null, that
it is display copy only (grouping is unchanged), and that consumers fall
back to their own default when it is absent. No alias and no guidance
entry: no sibling contract spells this slot, so there is nothing to
anchor one to.
- **Liveness row** `dataset.dimensions.nullLabel`: `planned`,
`evidenceScope: cross-repo`, `authorWarn: true` with an `authorHint`.
Measured: objectstack's dataset compiler copies `name` / `label` /
`field` / `type` / `dateGranularity` into the Cube dimension and nothing
else; objectui at the `.objectui-sha` pin `0d12e953` and at main
`a14737b` has no reader (its only `nullLabel` spelling is the local
parameter of `chart-series.ts` `pivotSeriesBuckets`, fed from
`ChartSeriesOptions.nullCategoryLabel`).
- **Form reconciliation ledger**
(`metadata-form-zod-reconciliation.test.ts`): one `omit` row for
`dataset` / `dimensions` / `nullLabel`, in the planned-not-rendered
group (`page.print`, `page.record`, `field.conditionalFormatting`).
Offering a repeater column now would let an author set a label nothing
shows. It also keeps `packages/platform-objects` out of this diff: a new
repeater row child would owe four locale catalog entries there.
- **Generated:** `content/docs/references/ui/dataset.mdx`,
`packages/spec/authorable-surface/ui.json`
(`ui/DatasetDimension:nullLabel`),
`packages/spec/liveness/state-counts/dataset.md` (planned 0 to 1), via
`check:generated --fix`.
- **Changeset** `.changeset/25391-dataset-dimension-null-label.md`:
`@objectstack/spec` `minor`, with both declaration lines.
## Verification (head `b22602309`)
- New `packages/spec/src/ui/dataset-dimension-null-label.test.ts`, 6
cases: the string form and the locale-map form parse and keep their
value; an absent key parses to the same object with no `nullLabel`
materialized; `nullLabel: 42` is refused as `invalid_union` at
`['nullLabel']`; an undeclared sibling key is still refused
(`unrecognized_keys`); a whole `DatasetSchema` carrying it parses clean.
- `pnpm --filter @objectstack/spec test`: 711/711 files, 21633 passed, 1
todo. The first run (before the ledger row) failed exactly one case,
`dataset.dimensions: accepted by the Zod but unauthorable in the form`,
which the ledger row answers.
- `pnpm --filter @objectstack/spec typecheck`: exit 0. `pnpm --filter
@objectstack/lint test`: 155/155 files, 7178 tests.
- Author warning measured end to end:
`lintLivenessPropertiesFromLedgerDir` over a stack whose dataset
dimension sets `nullLabel: 'System'` returns one
`liveness-planned-property` finding carrying the row's hint; the same
stack without the key returns none.
- `node scripts/pm/dispatch-gates.mjs --commands` derived 112 families
for this diff; all 112 ran and exit 0. `--ran` reconciliation: 112 run,
0 NOT-MEASURED, 0 UNRUN. On the first sweep 11 families answered exit 3
(a stale `packages/spec/dist` after the test edit, and one pinned
control commit missing from the shallow clone) and `check:generated`
answered 1 for the same stale dist; after `pnpm --filter
@objectstack/spec build` and a fetch of that one commit, all 12 re-ran
and exit 0.
## Acceptance notes
- **How the key reaches the renderer is the consumer half's decision.**
A dataset response describes a dimension column as `{ name, type, label
}`, and the compiler does not copy `nullLabel` into the Cube. The
objectui half can read it from the served dataset document, or the
response's dimension descriptor can carry it, which would be a
`service-analytics` change. The ruling does not pick one; noted here,
not filed.
- **Translation.** `translation.datasets.NAME.dimensions.DIM` declares
only `label`, so a translated null label is written today as an inline
locale map on the key itself. A bundle face for it would come with the
consumer, if wanted.
- Final spelling stays open to the spec review, per the ruling.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Fd2ukZvGZZbccf6CSDPzuv
---------
Co-authored-by: Claude <noreply@anthropic.com>nullLabel (#25397)1 parent 431327b commit 7c68b10
8 files changed
Lines changed: 112 additions & 1 deletion
File tree
- .changeset
- content/docs/references/ui
- packages/spec
- authorable-surface
- liveness
- state-counts
- src
- system
- ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| 414 | + | |
414 | 415 | | |
415 | 416 | | |
416 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
71 | 79 | | |
72 | 80 | | |
73 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
368 | 379 | | |
369 | 380 | | |
370 | 381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
188 | 201 | | |
189 | 202 | | |
190 | 203 | | |
| |||
0 commit comments