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 and others added 6 commits February 27, 2026 11:16
… 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>
@mtopo27 mtopo27 force-pushed the mtopo27/add-axis-range-frontend branch from 8b48517 to 965f0d8 Compare February 27, 2026 16:23
@mtopo27 mtopo27 requested review from a team and removed request for a team February 27, 2026 16:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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