Skip to content

Conversation

@bcoe
Copy link
Member

@bcoe bcoe commented Dec 2, 2025

useChartInterval() will now default to the highest granularity available using ChartIntervalUnspecifiedStrategy.USE_SMALLEST.

@bcoe bcoe requested a review from a team as a code owner December 2, 2025 22:15
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 2, 2025
bcoe added 2 commits December 2, 2025 17:27
useChartInterval() will now default to the highest granularity available using
ChartIntervalUnspecifiedStrategy.USE_SMALLEST.
@bcoe bcoe force-pushed the default-explore-interval branch from 4bd87c6 to 79b4c91 Compare December 2, 2025 22:31
end: '2024-01-01T01:00:00.000Z',
range: '1h',
environment: ['production'],
interval: '5m',
Copy link
Member Author

Choose a reason for hiding this comment

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

Given that logs were already setting ChartIntervalUnspecifiedStrategy.USE_SMALLEST I'm confused as to why I needed to update this test.

Would like to look a little closer before landing.

Copy link
Member Author

Choose a reason for hiding this comment

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

useSaveAsItems, when invoking useSaveQuery uses the interval returned by userChartInterval() rather than the interval passed in as options: https://github.com/getsentry/sentry/blob/master/static/app/views/explore/hooks/useSaveQuery.tsx#L59

I believe this to be intentional so that when you save you're saving whatever is currently set in the chart on the page.

Testing locally saving queries seemed to work as expected.

@bcoe bcoe added the Do Not Merge Don't merge label Dec 2, 2025
@bcoe bcoe removed the Do Not Merge Don't merge label Dec 3, 2025
@bcoe bcoe marked this pull request as ready for review December 3, 2025 14:38
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

Very nice, thanks!

@bcoe bcoe merged commit 0fb3dc7 into master Dec 4, 2025
49 checks passed
@bcoe bcoe deleted the default-explore-interval branch December 4, 2025 13:38
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2025
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.

3 participants