This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit cecd6a0
fix(app-shell): the report and dashboard-widget pickers show a dataset member's label and the dataset's description (objectui#11161) (#11171)
Fixes #11161
Clause-②: no
## What an author now sees
The report inspector and the dashboard-widget inspector show the text a
dataset declares, beside the machine names. This is the objectui
sub-issue of objectstack-ai/objectstack#20282, as the triage ruled it
(comment 5903169797).
- **Measure and dimension options show the member's `label`.** The
add-member lists in both inspectors read `Revenue · sum` with `revenue`
in the code chip beside it, and `Stage` beside `stage`. The report's
chart-axis selects read `Stage (stage)` and `Revenue (revenue) · sum`.
The dashboard's filter-binding field picker shows `stage`, then `Stage`.
- **Dataset options show the dataset's `description`.** The report's
dataset select reads `Sales pipeline (sales_pipeline) — Open deals by
stage`. The dashboard's searchable dataset picker shows the description
as the option's muted hint.
- **Nothing declared, nothing changes.** A member with no label reads
`deal_count · count` or `region`, and a dataset with no description
reads `Bare metrics (bare_metrics)`, exactly as before.
- **A map-valued label resolves in the designer's language.** `{ en,
zh-CN }` labels and descriptions read their `en` entry under English and
their `zh-CN` entry under Chinese. A language switch re-reads them
without refetching the catalog.
- **What a pick stores is unchanged.** Every option's value is the
machine name. The label never reaches `report.values`, `rows`,
`columns`, the chart axes, `dataset`, or the widget's `dimensions`,
`values` and `dataset`.
- **No `/analytics/meta` reader, no authored cubes**, per the triage.
## Where it landed
All in `packages/app-shell/src/views/metadata-admin/`, the claimed
surface. `_shared.tsx` is untouched: its select renders each option's
`label` as given, so the report's dataset options carry the description
in their label text.
- `previews/useDatasetCatalog.ts`
- `toCatalogEntry(doc, locale)` keeps each member's `label`, the
dataset's `description` and the dataset `label`. It resolves all four
through the spec's `resolveI18nLabel` in `locale`. A blank or non-text
value reads as undeclared. There is no `String()` of a label.
- The hand-rolled `resolveLabel` is gone. It read a string or a `{
default }` object only. The spec resolver reads the untagged `default`
entry itself, so that spelling still resolves (pinned).
- `useDatasetCatalog` and `useDatasetSemantics` keep the documents as
served. They resolve where they return, in `useMetadataLocale()`.
- The entry's new fields are `description?` on the dataset and `label?`
on each member. All of them are optional strings, so the
`datasetCatalogOverride` contract is unchanged.
- `inspectors/ReportDefaultInspector.tsx`
- `datasetMeasureOptions`, `datasetDimensionOptions` and
`datasetPickerOptions` live next to `DatasetNamesEditor`, which the
widget inspector already imports from here. They are the one form both
inspectors build their options from.
- The chart-axis options use the same `LABEL (name)` text the dataset
picker has always used.
- `inspectors/DashboardWidgetInspector.tsx`: its dataset, dimension,
measure and filter-field options come from those builders.
## The mechanism readings the order asked for
1. **What the old reader did with a map label.** Measured, not read: the
base `useDatasetCatalog.ts` was put under the new pin. For `label: { en:
'Sales pipeline', zh-CN: '销售管道' }` it answered `sales_pipeline`, the
machine name. So a map-valued dataset label never reached the picker.
That case is folded into the spec resolver, and no second resolver
remains.
2. **Where the locale enters: as a required `toCatalogEntry`
parameter.** The hooks supply `useMetadataLocale()`. Four reasons:
- A catalog entry leaves the one seam as display-ready strings. No
consumer can render a raw locale map, which reads `[object Object]` in a
template literal and throws as a React child.
- The `datasetCatalogOverride` type stays string-typed.
- The pure function stays unit-pinnable in both languages.
- A language switch re-reads the text without a refetch. That is the
pattern `useDatasetSemantics` already follows for its not-found sentence
(objectui#10862).
Both hosts pass `useMetadataLocale()` as the inspectors' `locale` prop
(`ResourceEditPage`, `ReportConfigPanel`), so the options and the rest
of the inspector read in one language.
3. **Does `useDatasetSemantics` read the same entry?**
- When the list carried the members, it reads the same catalog entry.
- When the list carried a summary, it hydrates once with `get('dataset',
name)`.
- Both paths now go through `toCatalogEntry` in the designer locale. The
new pins cover both: the report's list answers full documents, and the
dashboard's list answers summaries, so its members come through `get`.
4. **Existing pins.** `git grep` for `useDatasetCatalog`,
`toCatalogEntry` and `DatasetMeasureInfo` over test sources finds:
- three report test files that type their override fixtures as
`DatasetCatalogEntry`;
- `DashboardWidgetInspector.test.tsx`, which mocks the module's two
hooks.
No expected option text moved, because none of those fixtures declares a
member label or a description: `deal_count · count` and `Sales metrics
(sales_metrics)` read as before.
`ReportDefaultInspector.joinedClearsBinding-10746.test.tsx`, which PR
objectui#11086 edits, is untouched.
## Verification (all at `d5dc4a99d`, the head of this branch)
- **New pins** (`useDatasetCatalog.authorText-11161.test.ts`,
`datasetPickers.authorText-11161.test.tsx`): `Test Files 2 passed (2)`,
`Tests 24 passed (24)`.
- **The order's test gate**: `pnpm exec vitest run` over `inspectors/`
and `previews/`, plus `ReportConfigPanel.panelTitle.test.tsx` and
`ResourceEditPage.servedDraftTakenAsIs-10765.test.tsx`, the two other
suites that mount these inspectors. Result: `Test Files 201 passed
(201)`, `Tests 2733 passed | 1 skipped (2734)`.
- **Type-check**: `pnpm --filter @object-ui/app-shell type-check` exits
0. The script echoes `tsc --noEmit && tsc -p tsconfig.test.json`. It ran
after `turbo run build --filter='@object-ui/app-shell^...'
--concurrency=2`, which reported `28 successful, 28 total`. `tsc -p
tsconfig.test.json --listFilesOnly` lists both new test files among its
4782 program files.
- **ESLint** on the five changed source and test files: 0 errors. The
warnings delta against the base, per file:
- `ReportDefaultInspector.tsx`: +3
`react-refresh/only-export-components`, one per exported builder. They
are warn level, and exported helpers beside components are the tree's
existing pattern (`FlowReferenceField.tsx`,
`DatasetDefaultInspector.tsx`).
- `useDatasetCatalog.ts` and `DashboardWidgetInspector.tsx`: unchanged.
- **Other gates, each exit 0**:
- `node scripts/check-changeset-presence.mjs`: 1 released package, 1
changeset.
- `check:control-bytes`.
- `check:new-line-citations`: `0 new citation(s)`.
- `check:vi-mock-specifiers`, `check:vi-mock-inherit`,
`check:vi-mock-override-shape`, `check:test-path-roots`.
- `check:changeset-claims`, `check:pending-changeset-literals`.
- `check:phantom-deps`, `check:self-import`, and `check:esm-specifiers`
(its specifiers-only leg).
**Ablations.** Both ran from the committed head. Each restore was proven
by `blob == HEAD` and an empty `git diff HEAD`.
- **The base catalog file restored in place.** The on-disk blob equalled
the base blob. Result: `Tests 20 failed | 4 passed (24)`. The four green
cases are the ones the base already satisfied: the names and type keys,
the dataset-label fallback, the `{ default }` spelling, and a nameless
document.
- **The measure option's stored `name` set to its label** (through
`ablation-replace.mjs`, anchor hit x1 to x0). Result: `Tests 6 failed |
18 passed (24)`. Both "a pick stores the machine name" pins went red,
with `values` receiving `Revenue` instead of `revenue`, and so did the
four measure-option pins whose name chip read the label.
**Not measured here, left to CI:** the full `pnpm test` and lint farm,
and a browser pass. No live console was driven.
## Acceptance notes
These are observations and are not filed.
- **Picked rows still show the stored name.** `DatasetNamesEditor`'s
rows (the values and rows already bound) show the machine name, not the
label. The triage scoped this card to the options, so the rows are left
as they were.
- **The report's dataset select shows the description in its trigger
too.** A Radix select mirrors the chosen item's text into its trigger,
so the trigger reads `LABEL (name) — description`, clamped to one line
by the trigger's own style. Avoiding that needs a secondary-text slot in
`InspectorSelectField` (`_shared.tsx`), which this card did not need.
- **Long descriptions wrap on the right in the dashboard picker.**
`InspectorComboField`'s `hint` suffix has no truncation, so a long
description wraps there.
- **A measure's `format` is still dropped by `toCatalogEntry`.** The
card named it, and the triage's direction did not ask for it.
- **`plugin-dashboard`'s `WidgetConfigPanel` is untouched.** It keeps
its own catalog type, which already has an optional member `label`, and
no in-repo host passes it a catalog.
---
_Generated by [Claude
Code](https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 33da643 commit cecd6a0
6 files changed
Lines changed: 667 additions & 60 deletions
File tree
- .changeset
- packages/app-shell/src/views/metadata-admin
- inspectors
- previews
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
133 | 142 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 143 | + | |
138 | 144 | | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
142 | 148 | | |
143 | 149 | | |
144 | | - | |
| 150 | + | |
145 | 151 | | |
146 | 152 | | |
147 | 153 | | |
148 | | - | |
| 154 | + | |
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
153 | | - | |
| 159 | + | |
| 160 | + | |
154 | 161 | | |
155 | | - | |
| 162 | + | |
156 | 163 | | |
157 | 164 | | |
158 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
153 | 220 | | |
154 | 221 | | |
155 | 222 | | |
| |||
291 | 358 | | |
292 | 359 | | |
293 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
294 | 364 | | |
295 | 365 | | |
296 | | - | |
297 | | - | |
298 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
299 | 369 | | |
300 | 370 | | |
301 | 371 | | |
302 | 372 | | |
303 | 373 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 374 | + | |
311 | 375 | | |
312 | 376 | | |
313 | 377 | | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 378 | + | |
321 | 379 | | |
322 | 380 | | |
323 | 381 | | |
| |||
341 | 399 | | |
342 | 400 | | |
343 | 401 | | |
| 402 | + | |
| 403 | + | |
344 | 404 | | |
345 | | - | |
346 | | - | |
| 405 | + | |
| 406 | + | |
347 | 407 | | |
348 | 408 | | |
349 | | - | |
350 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
351 | 415 | | |
352 | 416 | | |
353 | 417 | | |
| |||
0 commit comments