Skip to content

Commit d770b3e

Browse files
os-warrenclaude
andauthored
fix(service-analytics): a draft-preview dataset response describes its columns like the live one (#16097) (#16192)
`queryDataset`'s ADR-0037 P3 preview branch returned ~250 lines before the ADR-0021 result-column enrichment, so a response over drafted seed rows carried no `label`, `format`, `currency`, `percentScale`, `builtinAggregate` and no `type` correction — on measure and dimension columns alike. The same dataset in the same widget described its columns differently depending only on whether a pending seed draft existed. Every key that block writes is read off the authored dataset and `sourceFieldMeta`, never off `result.rows`, so it is extracted into one `enrichResultColumns` seam that both paths call — one rule, not a per-path copy free to drift, the same argument #15768/#16101's `type` correction already makes for living there. Dimension VALUE label resolution stays skipped on the preview path on purpose; the standing comment is narrowed to say that it is a statement about row values and never covered the column descriptors. Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y Co-authored-by: Claude <noreply@anthropic.com>
1 parent fd014b1 commit d770b3e

3 files changed

Lines changed: 487 additions & 28 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/service-analytics': patch
3+
---
4+
5+
Analytics: a draft-preview dataset response now describes its columns like the live one
6+
7+
`AnalyticsService.queryDataset`'s ADR-0037 P3 draft-preview branch returned before the
8+
ADR-0021 result-column enrichment ever ran, so a dataset queried while the base object had a
9+
pending seed draft came back with none of its column metadata: `fields[].label`, `format`,
10+
`currency`, `percentScale`, `builtinAggregate`, and the temporal `type` correction were all
11+
absent, on measure and dimension columns alike. A renderer then fell back to humanizing the
12+
raw measure name and guessing a percent scale from magnitude — so the same dataset in the
13+
same widget described its columns differently depending only on whether a pending seed draft
14+
existed, which is the surface an author is looking at while authoring the dataset.
15+
16+
Every one of those keys is read off the authored dataset and the source object's field
17+
metadata, never off the rows, so the enrichment is now one method both paths call. Dimension
18+
VALUE label resolution (resolving a lookup id to a display name) stays skipped on the preview
19+
path deliberately: drafted seed rows reference lookups by name, so there is no id to resolve.

0 commit comments

Comments
 (0)