Skip to content

Conversation

@scttcper
Copy link
Member

Previously set query parameters that didn't seem to do anything. Moved away from deprecated render component.

Previously set query parameters that didn't seem to do anything. Moved away from deprecated render component.
@scttcper scttcper requested a review from a team as a code owner November 14, 2025 19:26
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 14, 2025
Comment on lines +31 to 32
const chartZoomProps = useChartZoom({saveOnZoom: true});
const {
Copy link

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

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.

Fix in Cursor Fix in Web

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants