feat(dashboards): Add axisRange frontend types, state, wiring, and builder UI#109390
Merged
feat(dashboards): Add axisRange frontend types, state, wiring, and builder UI#109390
Conversation
static/app/views/dashboards/widgetBuilder/utils/convertBuilderStateToWidget.ts
Show resolved
Hide resolved
static/app/views/dashboards/widgetBuilder/components/axisRangeSection.tsx
Outdated
Show resolved
Hide resolved
f548cf2 to
952efdc
Compare
Contributor
There was a problem hiding this comment.
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.
static/app/views/dashboards/widgetBuilder/utils/convertBuilderStateToWidget.ts
Outdated
Show resolved
Hide resolved
mtopo27
commented
Feb 26, 2026
| EventsStats | MultiSeriesEventsStats, | ||
| TableData | ||
| > = { | ||
| axisRange: 'dataMin', |
Contributor
Author
There was a problem hiding this comment.
want the default for mobileAppSize to be dataMin
static/app/views/dashboards/widgets/timeSeriesWidget/timeSeriesWidgetVisualization.tsx
Show resolved
Hide resolved
Comment on lines
+1
to
+4
| export const AXIS_RANGE_AUTO = 'auto'; | ||
| export const AXIS_RANGE_DATA_MIN = 'dataMin'; | ||
|
|
||
| export type AxisRange = typeof AXIS_RANGE_AUTO | typeof AXIS_RANGE_DATA_MIN; |
Contributor
There was a problem hiding this comment.
This can probably just be an enum
… Type section Move AxisRangeSection from its own section into the Type section below the display type selector. Replace the RadioGroup with a single "Fit Y-Axis to data" checkbox (unchecked = auto, checked = dataMin).
… undefined When a dataset config defines a default axisRange (e.g. 'dataMin' for Mobile App Size), the widget builder UI correctly shows this default but convertBuilderStateToWidget did not apply the same fallback, causing saved widgets to get undefined instead of the dataset default.
Validate axisRange values from URL and widget payload state so null or invalid\nvalues do not render as dataMin while the UI appears unchecked.\n\nUse shared axisRange normalization in builder state hydration, widget\nconversion, and timeseries visualization rendering to keep behavior\nconsistent with defaults. Refs EME-890\nCo-Authored-By: Claude <noreply@anthropic.com>
Keep axis range normalization focused on runtime guard logic while\nusing a shared AxisRange type for state and visualization contracts.\nDrop extra helper constants to keep conventions and readability. Refs EME-890 Co-Authored-By: Claude <noreply@anthropic.com>
8b48517 to
965f0d8
Compare
DominikB2014
approved these changes
Feb 27, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Add configurable Y-axis range behavior for dashboard time-series widgets.
This introduces
axisRangein the frontend widget model and widget-builder state,adds a "Fit Y-Axis to data" control in the builder for time-series display types,
and wires the setting through widget conversion and rendering so charts respect
autovsdataMinconsistently.It also sets the mobile app size dataset default to
dataMinand enablesPREPROD_APP_SIZEto use the time-series visualization path so app-size chartsbenefit from the same axis-range controls.
A follow-up fix in this PR normalizes runtime
axisRangevalues from URL/querystate and widget payloads. Without normalization, null/invalid values could make
preview behavior diverge from the builder control state. We now accept only
autoanddataMin, and fall back safely to default behavior otherwise.Depends on #109389.
Closes EME-890 (frontend portion)