feat(service-analytics): resolve dimension display labels (select options / lookup names)#1680
Merged
Merged
Conversation
…ions / lookup names) Dashboard/report charts grouped by a `select` dimension showed the stored option `value` (e.g. `backlog`), and by a `lookup`/`master_detail` dimension showed the raw FK `id` (e.g. `8eqtuKI4G9IhUsPS`) — never the human-readable text. `queryDataset` now post-processes result rows (ADR-0021): a `select` dimension renders its option `label`, and a `lookup` dimension renders the related record's display name. The console plots `row[dimension]` verbatim, so this single server-side pass fixes every chart with no frontend change. - new `dimension-labels.ts`: resolution logic (select via field options; lookup via injected id→label fetch) + `pickDisplayField` (name > title > label > first text field). De-dupes lookup ids; leaves unresolved values untouched (no blanks); no-op for date/number/string dimensions. - `AnalyticsServiceConfig.labelResolver` injects the two low-level capabilities; the plugin wires them from the `data` engine — field metadata via `getObject`, id→name pairs via the existing `executeAggregate` bridge (group by id + display field), so no new engine capability is needed. - 16 tests (unit + queryDataset integration). Verified in the browser on the showcase Chart Gallery: status→Backlog/Done/To Do, priority→High/Urgent, account lookup→Fabrikam; zero raw ids remain. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jun 10, 2026
xuyushun441-sys
added a commit
that referenced
this pull request
Jun 13, 2026
Picks up objectui#1684 — interface pages (ADR-0047) now render data columns when the referenced source view is served hollow (columns only in named views), instead of a bare row-number grid. Also rolls up #1680/#1681/#1682 (toolbar viz dropdown, URL filter persistence, lookup quick-filter e2e) that landed after the previous pin (76c38108544d). build-console.sh builds clean at this SHA (33 MB dist, verified locally). Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Fable 5 <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 free
to 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.
Problem
On the showcase Chart Gallery (and any dashboard/report), charts grouped by a dimension showed the raw stored value, never the human-readable text:
8eqtuKI4G9IhUsPS)backlog,high)Fix (server-side, ADR-0021)
AnalyticsService.queryDatasetnow post-processes the result rows to resolve dimension display labels:label(via the field'soptions)The console plots
row[dimension]verbatim, so this single server-side pass fixes every chart with zero frontend change.Implementation
dimension-labels.ts: pure resolution logic +pickDisplayField(name>title>label> first text field). De-dupes lookup ids, leaves unresolved values untouched (no blanks), no-op for date/number/string dims.AnalyticsServiceConfig.labelResolverinjects two low-level capabilities; the plugin wires them from thedataengine — field metadata viagetObject, id→name pairs via the existingexecuteAggregatebridge (group byid+ display field). No new engine capability.queryDatasetintegration), all green (service-analytics 100/100).Browser verification
Ran the showcase Chart Gallery against this build:
status(select)backlog,done,todopriority(select)high,urgentaccount(lookup)8eqtuKI4G9IhUsPSProgrammatic axis scan after the fix: zero id-like strings remain.
Out of scope (follow-up)
Date dimensions (
created_at) still render raw epoch-millis on a couple of trend charts — a separate date-formatting concern, not part of this lookup/select bug.🤖 Generated with Claude Code