feat(dashboards): Disable non-distribution metrics for heat map widgets#118779
Merged
gggritso merged 4 commits intoJul 6, 2026
Conversation
Heat maps plot the distribution of a measurement's values over time, so they only make sense for distribution metrics — counters (always 1) and gauges have no meaningful value distribution to visualize. Dashboards is visualization-first (you pick the chart type, then the metric), so the constraint points from the visualization to the metric: - When Heat Map is the selected display type, the metric picker disables counter and gauge metrics (greyed out with a tooltip) and won't auto-select one. - Switching the display type to Heat Map drops any already-selected non-distribution metric and falls back to a distribution metric, matching the widget builder's coerce-on-transition behavior for every other display type. - As a safety net, saved or otherwise invalid heat map widgets surface a config error instead of failing to render. Reuses the doesMetricSupportHeatMapVisualization helper from Explore (#118661) via the shared MetricSelector's new optional disabledMetricReason prop; Explore doesn't pass it, so its behavior is unchanged. Refs DAIN-1756 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
|
@cursor review |
When every loaded metric option is disabled (e.g. a heat map in a project with only counter/gauge metrics), the auto-select effect fell back to the first option and selected it anyway — a metric the caller explicitly marked invalid. Leave the slot empty in that case so the widget's config error surfaces instead. Caught by Cursor Bugbot on #118779. Refs DAIN-1756 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-1756-disable-selection-of-non-distribution-metrics-in-dashboards
Rename the shared MetricSelector prop disabledMetricReason to getDisabledOptionReason (and the internal disabledMetricKeys to disabledOptionKeys). The new name reads as "compute the disabled reason", aligning with the boolean-predicate naming used elsewhere (e.g. CompactSelect's isOptionDisabled) while keeping the single-callback shape that ties an option's disabled state to its explanatory tooltip. No behavior change. Refs DAIN-1756 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
|
@cursor review |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0d1142a. Configure here.
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.
Dashboards-side partner of #118661. In Explore, users select the metric then the visualization. So, if they choose a non-distribution metric, we disable the Heat Map visualization. In Dashboards, it's reversed. Users select the visualization and then the metric. So here, if they choose "Heat Map" we disable any non-distributions.
e.g.,
Closes DAIN-1756