-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(aci): Apply chart zoom on automation history #103392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Previously set query parameters that didn't seem to do anything. Moved away from deprecated render component.
| const chartZoomProps = useChartZoom({saveOnZoom: true}); | ||
| const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The useChartZoom hook fails to pass utc, start, and end props to BarChart, affecting date formatting.
Severity: HIGH | Confidence: 0.95
🔍 Detailed Analysis
The useChartZoom hook, replacing the ChartZoom component, omits utc, start, and end from its renderProps. These properties, previously passed from AutomationStatsChart to BarChart, are crucial for BarChart/BaseChart to correctly format date/time information in tooltips and axis labels when isGroupedByDate is true. The ZoomRenderProps interface for useChartZoom also lacks these fields, leading to incorrect or generic date formatting in the chart.
💡 Suggested Fix
Modify the useChartZoom hook to include utc, start, and end in its renderProps and ensure these are passed down to the BarChart component. Update the ZoomRenderProps interface in useChartZoom.tsx to include these properties.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: static/app/views/automations/components/automationStatsChart.tsx#L31-L32
Potential issue: The `useChartZoom` hook, replacing the `ChartZoom` component, omits
`utc`, `start`, and `end` from its `renderProps`. These properties, previously passed
from `AutomationStatsChart` to `BarChart`, are crucial for `BarChart`/`BaseChart` to
correctly format date/time information in tooltips and axis labels when
`isGroupedByDate` is true. The `ZoomRenderProps` interface for `useChartZoom` also lacks
these fields, leading to incorrect or generic date formatting in the chart.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference_id: 2695024
| utc, | ||
| }: IssueAlertDetailsProps) { | ||
| const organization = useOrganization(); | ||
| const chartZoomProps = useChartZoom({saveOnZoom: true}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Chart Zoom Overwrites Global Filters
The useChartZoom hook is configured with saveOnZoom: true instead of usePageDate: true. This causes chart zoom to update the global page filters via updateDateTime rather than setting page-specific query parameters like the previous ChartZoom component did. The old code used usePageDate to persist zoom state to query params without affecting page filters, but the new implementation will modify global filters instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is what i want
Previously set query parameters that didn't seem to do anything. Moved away from deprecated render component.