Skip to content

feat(dashboards): Add axisRange frontend types, state, wiring, and builder UI#109390

Merged
mtopo27 merged 7 commits intomasterfrom
mtopo27/add-axis-range-frontend
Feb 27, 2026
Merged

feat(dashboards): Add axisRange frontend types, state, wiring, and builder UI#109390
mtopo27 merged 7 commits intomasterfrom
mtopo27/add-axis-range-frontend

Conversation

@mtopo27
Copy link
Contributor

@mtopo27 mtopo27 commented Feb 25, 2026

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)

@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

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 25, 2026
@mtopo27 mtopo27 changed the base branch from mtopo27/add-axis-range-backend to master February 25, 2026 22:43
@mtopo27 mtopo27 changed the base branch from master to mtopo27/add-axis-range-backend February 25, 2026 22:44
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.

EventsStats | MultiSeriesEventsStats,
TableData
> = {
axisRange: 'dataMin',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

want the default for mobileAppSize to be dataMin

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

This can probably just be an enum

@mtopo27 mtopo27 requested review from a team as code owners February 27, 2026 16:02
@mtopo27 mtopo27 merged commit 733e15a into master Feb 27, 2026
60 checks passed
mtopo27 added a commit that referenced this pull request Feb 27, 2026
…ilder (#109598)

When editing an existing widget that was saved before the axisRange
feature (#109390), the builder showed the dataset default (e.g. "Fit to
data" for mobile app size) as checked, even though the widget was
actually rendering with `auto` (Y-axis starting at 0). This created a
mismatch between the builder UI and the actual chart behavior.

The fix normalizes missing `axisRange` to `'auto'` when loading an
existing widget into the builder. This way `undefined` in builder state
unambiguously means "new widget, apply dataset defaults" — existing
widgets get an explicit value that matches their current rendering.

- Existing widgets: builder shows unchecked, matching actual rendering
- New widgets: dataset default still applies (e.g. `dataMin` for mobile
app size)
- Existing widgets with explicit `axisRange`: no change

Refs EME-890

---------

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 Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants