Repository navigation
Description
Context
Follow-up from the #1750 re-evaluation (closed as completed).
ADR-0021 D2 drill metadata (#2080) snapshots each row's raw grouped values into a parallel drillRawRows array before resolveDimensionLabels overwrites row[dim] with the display label — so a report drill on a data row filters by the stored value (FK id, select option value).
But the snapshot only covers result.rows. The totals/subtotal rows added in #1753 also carry dimension values (a row subtotal is keyed by its row bucket), and they DO go through label resolution — analytics-service.ts resolves each grouping's subset right after the main rows (see the for (const total of result.totals ?? []) loop) — yet no raw values are captured for them.
Net effect: a subtotal row ends up in exactly the pre-#1750 state — display label only, raw value lost. If a host ever drills from a subtotal row (e.g. clicking the "Q2 · Backlog" subtotal in a matrix report to open its records), a lookup/select dimension can't be exact-match filtered:
- select — would need the fragile label→value reverse-map again;
- lookup / master_detail — the label is a record name, not the FK id, so the dimension gets skipped and the drill lands on a superset.
Current state
- objectui's
ReportView.handleDatasetDrillconsumesdrillRawRowsfor data rows only; subtotal drill is not wired up today, so this is latent, not user-visible. - Blocking nothing; filed so the gap is on record instead of rediscovered.
Proposal
When drill metadata is attached, snapshot raw values for totals rows too — e.g. a parallel drillRawTotals aligned to result.totals[i].rows (same shape as drillRawRows, restricted to each grouping's drillable dims), captured in the same pre-label-resolution pass. Purely additive extra props on the result, same as #2080 (no spec-contract change).
Affected
- framework:
packages/services/service-analytics/src/analytics-service.ts(the ADR-0021 D2 block + the totals label-resolution loop),query-dataset.test.ts - objectui (consumer, only if/when subtotal drill ships):
ReportView.handleDatasetDrill
Refs
- Analytics: preserve raw dimension values so report drill-down can filter lookup/select dims precisely #1750 (raw-value drill sidecar for data rows — shipped in feat(analytics): dimension labels + drill-through metadata for dataset reports #2080, released in
@objectstack/service-analytics@9.12.0) - Matrix reports: server-side totals row/column (subtotals + grand total) #1753 (totals rows)
- Report drill-down: date-granularity dimensions need a range filter, not equality #1752 (date-granularity range drill — unaffected; date dims are excluded from drill metadata either way)
Activity
feat(analytics): raw-value drill sidecar for totals/subtotal rows (#3214
docs(service-analytics): re-anchor the dead tracker citations to the …