Skip to content

analytics: a dataset answer's measure column does not state its aggregate when the author labelled it, so a chart cannot tell a count from a sum (objectui#11681's producer half) #21995

Description

@objectstack-fleet

Filing gate: ① a reproducible defect with a named landing site. It is the producer half of objectstack-ai/objectui#11681, split by the triage seat (objectstack-wide, seat post #6015, session_01AavokzJ5DndAwitDXvKy4U) from that card's pm:retriage answer. reach: was measured by objectui#11681's dev on the showcase dashboards. Issues live where the fix lands. ⛔ Not a claim.

Path: ② the capabilities an end user meets in the app — dashboards and charts | 缺项 (no item asserts a dataset answer says which aggregate each measure column carries) | P2

What happens

A dashboard dataset widget over a count measure renders y-axis ticks such as 0.75, 1.5 and 2.25 (objectui#11681). The renderer would set integer ticks if it knew the column is a count. On this path, nothing in the answer says so:

  • the measure column is { name, type: 'number', label };
  • builtinAggregate is written only when the measure has no label (packages/services/service-analytics/src/analytics-service.ts, enrichResultColumns, about :2866). packages/spec/src/api/analytics.zod.ts (about :125) declares it as a label-only discriminator: "Absent whenever the author declared a label".

Every measured showcase widget labels its measure, for example a count named "Tasks". So the fact is lost exactly where the charts are.

Direction (triage, on objectui#11681)

  • Under ADR-0021, enrichResultColumns describes the answer's columns from the dataset's own authored definition, which already includes label, format, currency and percentScale. The measure's aggregate is part of that definition. So every measure column states its aggregate, whether or not the author labelled it.
  • One closed member, in the AggregationFunction vocabulary. The contract review settles the spelling. ⛔ builtinAggregate keeps its label-only meaning, so its pins stay green. ⛔ No authoring key.
  • Clause-②: yes (widening) of the published response schema, with a minor changeset and the contract review owed.
  • It goes in both paths that run through enrichResultColumns, the live query and the draft-data preview, by construction.

Pins

  • A labelled count measure's column states count, and an unlabelled one still carries builtinAggregate.
  • A sum over a currency field states sum.
  • The preview path states the same as the live path.

Lane

service-analytics is domain:services. The response-schema member in packages/spec/src/api/analytics.zod.ts is one declared cross-lane file (domain:spec).

After it lands

objectui#11681 is pm:on-hold until an @objectstack/* release carries this, and objectui resolves it. Then the renderer derives integer ticks from it.

p3: chart axes show fractional ticks for counts. Nothing is wrong in the data.


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

Labels

area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething isn't workingdomain:specpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions