Uh oh!
There was an error while loading. Please reload this page.
feat(dashboard): row/column/grand totals for dataset pivot cross-tab - #1827
Merged
Conversation
The cross-tab pivot had no totals. Now a pivot matrix requests the marginal subtotal groupings — `[rowDims, [colDim], []]` — and renders a row-totals column, a column-totals row, and the grand total. Totals are SERVER-computed with each measure's true aggregate (ADR-0021): no client re-aggregation, so an avg/min/max total is correct, not a recombined approximation. An older server that returns no `totals` simply renders the plain cross-tab (no totals UI). The "Total" label is i18n (`dashboard.total`). data-objectstack `queryDataset` forwards the `totals` selection and passes the `totals` result through. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
xuyushun441-sys added a commit
that referenced
this pull request
Jun 20, 2026
…t renderer (#1830) Port the dashboard DatasetWidget fixes (PR #1825/#1827/#1828) to the standalone Reports renderer, which had the same user-visible problems: - Headers showed raw field names: DatasetReportTable rendered `{c}` and DatasetMatrixTable used a Title-Case humanize() — neither the real label. - Measures formatted as plain numbers with no currency awareness. - No i18n: "Total" and friends were hardcoded English. Changes: - useDatasetRows now captures the server-returned `fields` (label/format/ currency) and `object` (queryDataset already returns them). - Headers resolve via field label → i18n fieldLabel → raw name fallback (drops the `{c}`/humanizeDimension fallbacks). - Measure cells + server totals format with the field's currency (Intl symbol) and numeral format, mirroring DatasetWidget.formatMeasure — never a bare number or a misleading "$". - i18n via useObjectTranslation / useSafeFieldLabel with graceful fallback; "Total" uses tt('report.total', 'Total'). Drill-through and server-supplied totals are unchanged. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Following #1825 (which turned dataset
pivotwidgets into a true cross-tab), the matrix had no totals. A pivot without subtotals is half a pivot.What
A pivot matrix now requests the marginal subtotal groupings
[rowDims, [colDim], []]and renders:Totals are server-computed with each measure's true aggregate (ADR-0021) — no client re-aggregation, so an
avg/min/maxtotal is correct rather than a recombined approximation. An older server that returns nototalsjust renders the plain cross-tab (no totals UI). The "Total" label is i18n (dashboard.total→ "总计" in zh).data-objectstack.queryDatasetforwards thetotalsselection and passes thetotalsresult through (the server already computes them — same path plugin-report's matrix uses).Tests
DatasetWidget.test.tsx(29 total): requests the right groupings for a matrix, does NOT request totals for a flat table, renders server row/column/grand totals, and degrades gracefully when totals are absent. Type-check green.Verified live
Chart Gallery "Tasks by Status × Priority": headers
状态 | Low | Medium | High | Urgent | 总计, per-row totals, a总计row with column totals1·4·3·2, grand total10(1+4+3+2 = 2×5 = 10).🤖 Generated with Claude Code