Skip to content

Dataset KPI / table / pivot / report captions still print the server's built-in Count: buildDatasetFieldHelpers.headerLabel ignores builtinAggregate (sibling of #7258) #7534

Description

@hotlong

Symptom

The same defect class as #7258, one seam over: a dataset result field the analytics service minted as a BUILT-IN default measure (label: 'Count', hard-coded English, objectstack#14492 background) still prints Count on a zh console on every surface that resolves its title through buildDatasetFieldHelpers().headerLabel instead of through buildChartSeries:

  • packages/plugin-dashboard/src/DatasetWidget.tsx — the metric / KPI widget's measure caption (the isMetric branch reads measureField + headerLabel), and the table / pivot column headers (values.map(... headerLabel(m)), around line 942)
  • packages/plugin-report/src/DatasetReportRenderer.tsx — the summary table header (headerLabel(c), around line 576), the single-value metric caption and the report chart's measureLabel (authoredSeriesLabel(...) ?? headerLabel(yAxis), around line 965), and the third buildDatasetFieldHelpers site around line 1240
  • packages/app-shell/src/views/metadata-admin/previews/DatasetPreview.tsx:135 — the dataset preview's headers

headerLabel is measureField(name)?.label ?? name, then the object-field i18n convention; it never looks at the optional builtinAggregate discriminator objectstack#14492 puts on the wire, so a report chart whose legend now reads 计数 (via buildChartSeries, #7258) still captions the same measure Count in the table beneath it.

Why this is not in #7258's PR

The maintainer ruling on #7258 (2026-09-02, option B) scoped the consumer half to buildChartSeries() / labelOf(), and this sibling family spans a fifth package (app-shell) and five call sites. The resolver it needs already lands with #7258: resolveMeasureLabel(field, builtinAggregateLabels) in @object-ui/core and builtinAggregateLabels(tt) in @object-ui/i18n.

Mechanical fix

  1. buildDatasetFieldHelpers(fields, object, fieldLabel, builtinAggregateLabels?) in packages/core/src/utils/dataset-format.ts: headerLabel takes the field through resolveMeasureLabel first (locale label for a recognised discriminator), then the existing fieldLabel convention, then the name — so the resolution order is one order on every surface.
  2. Pass builtinAggregateLabels(tt) at the five call sites above.
  3. Pin: a zh table header / KPI caption for a builtinAggregate: 'count' field reads 计数; an author-labelled measure stays verbatim (objectui#4106).

Blocked-by: objectstack-ai/objectstack#14492 (the wire field; #7258's consumer PR reads it structurally and compiles against spec 17.2.0, so this one can too).

Found while implementing #7258 (branch fix/chart-builtin-aggregate-label-7258); filed rather than folded in per the claim's file surface.

Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatfindingi18npm:queuepriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions