Skip to content

feat(analytics): dimension labels + drill-through metadata for dataset reports#2080

Merged
xuyushun441-sys merged 2 commits into
mainfrom
fix/dashboard-report-ux
Jun 20, 2026
Merged

feat(analytics): dimension labels + drill-through metadata for dataset reports#2080
xuyushun441-sys merged 2 commits into
mainfrom
fix/dashboard-report-ux

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Why

Reviewing the Chart Gallery report page surfaced gaps in the dataset-bound analytics path. Two are server-side:

  1. Headers showed raw field names. queryDataset enriched only measure result fields with a display label; dimension columns came back bare, so renderers fell back to status/priority/account instead of Status/Priority/Account.
  2. No data drill-through. There was no way for a host to drill a grouped bucket back to its records — and crucially, label resolution overwrites row[dim] with the display label, so the raw stored value needed for an exact-match filter was lost.

What

  • Enrich dimension result fields with their dataset display label (match by dimension name or underlying field).
  • Attach drill metadata to the result: base object, a drillable dimensionFields map, and a parallel drillRawRows array holding each row's RAW grouped values (snapshotted before label resolution). Rows themselves are untouched (no shape change for existing consumers). Date dimensions are excluded — a humanized bucket can't be exact-matched.
  • Showcase: budget_sum/spent_sum are currency fields with no declared currency, so the hardcoded $0,0 format misrepresented the amount → changed to plain 0,0.

All carried as extra props on the result (no spec-contract change; res.json(result) serializes verbatim).

Tests

query-dataset.test.ts: drill metadata shape, raw-values array, dimension label enrichment, date-dimension exclusion. Full service-analytics suite green.

Companion

Consumed by objectui PR fix/dashboard-report-ux (renders the labels, currency, i18n, and drill UI).

🤖 Generated with Claude Code

…t reports

The dataset-bound report/table path enriched only MEASURE result fields with
their display label, leaving dimension columns bare (renderers fell back to the
raw field name e.g. "status"). It also offered no way to drill a grouped bucket
back to its records.

- Enrich DIMENSION result fields with their dataset display label (match by
  dimension name or underlying field), so headers read "Status" not "status".
- Attach drill-through metadata to the dataset query result: the base `object`,
  a drillable dimension→field map, and a PARALLEL `drillRawRows` array holding
  each row's RAW grouped values (captured before label resolution overwrites
  `row[dim]`) so a host builds an exact-match filter from the stored value, not
  the display label. Rows themselves are left untouched. Date dimensions are
  excluded (a humanized bucket can't be exact-matched).
- Showcase: `budget_sum`/`spent_sum` are currency fields with no declared
  currency, so drop the misleading hardcoded `$0,0` format for a plain `0,0`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 20, 2026 4:17pm

Request Review

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): packages/services.

5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/guides/packages.mdx (via packages/services)
  • content/docs/guides/runtime-services/audit-service.mdx (via packages/services)
  • content/docs/guides/runtime-services/index.mdx (via packages/services)
  • content/docs/guides/runtime-services/settings-service.mdx (via packages/services)
  • content/docs/protocol/objectos/i18n-standard.mdx (via packages/services)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants