Skip to content

fix(dashboards): preserve display type when switching display types#109208

Merged
DominikB2014 merged 2 commits intomasterfrom
DominikB2014/changing-chart-type-resets-intervals
Feb 24, 2026
Merged

fix(dashboards): preserve display type when switching display types#109208
DominikB2014 merged 2 commits intomasterfrom
DominikB2014/changing-chart-type-resets-intervals

Conversation

@DominikB2014
Copy link
Contributor

@DominikB2014 DominikB2014 commented Feb 24, 2026

Now that we have more display types with thresholds, we should preserve the thresholds section unless the display type doesn't support it.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 24, 2026
@DominikB2014
Copy link
Contributor Author

@cursor review

@DominikB2014 DominikB2014 marked this pull request as ready for review February 24, 2026 18:45
@DominikB2014 DominikB2014 requested a review from a team as a code owner February 24, 2026 18:45
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

setThresholds(undefined, options);
if (!doesDisplayTypeSupportThresholds(action.payload)) {
setThresholds(undefined, options);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thresholds preserved while aggregate resets

Medium Severity

On SET_DISPLAY_TYPE, thresholds now persist for threshold-capable display types, but selectedAggregate still gets cleared unconditionally. This can leave thresholds values out of sync with the widget’s metric/field (and its unit/type), causing the thresholds UI and saved payload to represent an invalid or misleading configuration after a display type switch.

Fix in Cursor Fix in Web

Copy link
Contributor Author

@DominikB2014 DominikB2014 Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fair, i guess it's better to reset the threshold if the aggregates change, but the user will also have a clear idea what's going on in the widget preview.

Copy link
Member

@nikkikapadia nikkikapadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks Dom!

@DominikB2014 DominikB2014 merged commit b45699c into master Feb 24, 2026
63 checks passed
@DominikB2014 DominikB2014 deleted the DominikB2014/changing-chart-type-resets-intervals branch February 24, 2026 18:53
mchen-sentry pushed a commit that referenced this pull request Feb 24, 2026
…109208)

Now that we have more display types with thresholds, we should preserve
the thresholds section unless the display type doesn't support it.
wedamija pushed a commit that referenced this pull request Feb 24, 2026
…109208)

Now that we have more display types with thresholds, we should preserve
the thresholds section unless the display type doesn't support it.
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants