Uh oh!
There was an error while loading. Please reload this page.
feat(dashboard): dataset chart widgets use select/lookup option colors - #1947
Merged
Conversation
DatasetWidget charts grouped by a select/lookup dimension (e.g. project health) now paint each category in its field option color instead of the generic --chart-1..5 palette — matching the object-chart view (#1932). Resolves the dimension field's option colors from the dataset's base object + dimension→field map and threads them to the renderer as a per-category categoryColors map. Extracts the value/label→color resolution into a shared buildOptionColorMap in @object-ui/core, reused by both DatasetWidget and ObjectChart. 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
|
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.
What
Dashboard
DatasetWidgetcharts grouped by a select/lookup dimension (e.g. projecthealth) now paint each category in its field option color instead of the generic--chart-1..5palette.Why
This is the dashboard counterpart of the
object-chartview fix (#1932). Before, only the chart view resolved semantic option colors; dashboard widgets over the same dataset still showed health "Red" as teal. Now both surfaces match.How
DatasetWidgetresolves the first dimension's option colors using the dataset's baseobject+ dimension→field map the query already returns (state.object/state.dimensionFields), fetches the object schema, and threads a per-categorycategoryColorsmap into the chart schema. The renderer (AdvancedChartImpl, shipped in fix(studio): record-page preview binds a real record + charts use field option colors #1932) already applies that map, with the positional palette as fallback.buildOptionColorMapin@object-ui/core, now used by bothDatasetWidgetandObjectChart(the chart view's inline loop is refactored to call it — behavior-preserving).Keyed by BOTH option
valueandlabel, since the server resolves dataset select dimensions value→label while the legacy path keeps the raw value.Test
@object-ui/corebuildOptionColorMapunit test (5 cases: value+label keying, null/empty/no-color, partial, malformed) — passing.AdvancedChartImpl.colors.test.tsx(fix(studio): record-page preview binds a real record + charts use field option colors #1932) — still passing.🤖 Generated with Claude Code