Skip to content

feat(dashboards): Persist and serve axisRange on dashboard widgets#109389

Merged
mtopo27 merged 3 commits intomasterfrom
mtopo27/add-axis-range-backend
Feb 27, 2026
Merged

feat(dashboards): Persist and serve axisRange on dashboard widgets#109389
mtopo27 merged 3 commits intomasterfrom
mtopo27/add-axis-range-backend

Conversation

@mtopo27
Copy link
Contributor

@mtopo27 mtopo27 commented Feb 25, 2026

Summary

  • Add axis_range ChoiceField ("auto" | "dataMin") to DashboardWidgetSerializer
  • Wire axis_range into create_widget and update_widget detail dict persistence
  • Return axisRange in API responses via DashboardWidgetResponse TypedDict and serialize()
  • Add backend tests for create, update, and invalid value validation

Test plan

  • pytest -svv --reuse-db tests/sentry/dashboards/endpoints/test_organization_dashboard_details.py -k "axis_range" — new tests pass
  • pytest -svv --reuse-db tests/sentry/dashboards/endpoints/test_organization_dashboard_details.py — no regressions
  • Existing widgets without axis_range in detail return axisRange: null (backward compatible)

Closes EME-890 (backend portion)

Accept `axisRange` ("auto" | "dataMin") on widget create/update, store
it in the existing `detail` JSONField alongside `layout`, and return it
in API responses. This enables configurable Y-axis range for timeseries
widgets so small variations in high-baseline data are visible.

EME-890
@mtopo27 mtopo27 requested a review from a team as a code owner February 25, 2026 22:18
@linear
Copy link

linear bot commented Feb 25, 2026

The API docs test was failing because the CreateDashboard example was
missing the newly added axisRange property.
@mtopo27 mtopo27 merged commit 38ff725 into master Feb 27, 2026
55 of 56 checks passed
@mtopo27 mtopo27 deleted the mtopo27/add-axis-range-backend branch February 27, 2026 16:08
mtopo27 added a commit that referenced this pull request Feb 27, 2026
…ilder UI (#109390)

Add configurable Y-axis range behavior for dashboard time-series
widgets.

This introduces `axisRange` in 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
`auto` vs `dataMin` consistently.

It also sets the mobile app size dataset default to `dataMin` and
enables
`PREPROD_APP_SIZE` to use the time-series visualization path so app-size
charts
benefit from the same axis-range controls.

A follow-up fix in this PR normalizes runtime `axisRange` values from
URL/query
state and widget payloads. Without normalization, null/invalid values
could make
preview behavior diverge from the builder control state. We now accept
only
`auto` and `dataMin`, and fall back safely to default behavior
otherwise.

Depends on #109389.

Closes EME-890 (frontend portion)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants