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.handleDatasetDrill consumes drillRawRows for 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
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
drillRawRowsarray beforeresolveDimensionLabelsoverwritesrow[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.tsresolves each grouping's subset right after the main rows (see thefor (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:
Current state
ReportView.handleDatasetDrillconsumesdrillRawRowsfor data rows only; subtotal drill is not wired up today, so this is latent, not user-visible.Proposal
When drill metadata is attached, snapshot raw values for totals rows too — e.g. a parallel
drillRawTotalsaligned toresult.totals[i].rows(same shape asdrillRawRows, 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
packages/services/service-analytics/src/analytics-service.ts(the ADR-0021 D2 block + the totals label-resolution loop),query-dataset.test.tsReportView.handleDatasetDrillRefs
@objectstack/service-analytics@9.12.0)