Skip to content

fix(charts): Preserve ECharts zoom state#119237

Merged
JoshuaKGoldberg merged 3 commits into
masterfrom
scttcper/chart-zoom-state
Jul 9, 2026
Merged

fix(charts): Preserve ECharts zoom state#119237
JoshuaKGoldberg merged 3 commits into
masterfrom
scttcper/chart-zoom-state

Conversation

@scttcper

@scttcper scttcper commented Jul 8, 2026

Copy link
Copy Markdown
Member

Dragging to zoom on issue details could rebuild the hidden ECharts dataZoom toolbox and replay stale zoom events, similar to the dashboards fix in #119013.

This moves the ECharts merge settings into shared chart zoom config and uses it from both ChartZoom implementations. It also keeps the inside dataZoom model for synced release-bubble charts while disabling the hidden toolbox when zoom navigation is off.

Adds a small hook test for rerenders and disabled zoom behavior.

Dragging to zoom can re-init the hidden ECharts toolbox and replay stale dataZoom events, which makes issue detail charts push the wrong time range after rerenders.

Centralize the merge props from the dashboards fix and reuse them from both ChartZoom implementations. Keep the inside dataZoom model around for synced charts while disabling the hidden toolbox when navigation is off.

Adds a small hook test for rerenders and disabled zoom behavior.

Co-Authored-By: Codex <noreply@openai.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-ioeqq33e4.sentry.dev

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.92% 93.92% ±0%
Typed 134,453 134,474 🟢 +21
Untyped 8,700 8,700 ±0
🔍 3 new type safety issues introduced

any-typed symbols (2 new)

File Line Detail
static/app/components/charts/utils.tsx 474 dataZoomFeatures (var)
static/app/components/charts/utils.tsx 480 feature (param)

Type assertions (as) (1 new)

File Line Detail
static/app/components/charts/useChartZoom.tsx 64 as DataZoomPayloadevt as DataZoomPayload

This is informational only and does not block the PR.

renderHook inferred the initial props too narrowly, so typecheck failed when the test rerendered with disabled zoom. Pin the hook props type in the spec so it matches the actual hook API.

Co-Authored-By: Codex <noreply@openai.com>
@scttcper scttcper marked this pull request as ready for review July 8, 2026 17:32
@scttcper scttcper requested review from a team as code owners July 8, 2026 17:32
@scttcper scttcper requested review from a team and gggritso July 8, 2026 17:32

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems very good and reasonable to me (thanks for picking it up!) but I should definitely defer to @gggritso as echarts enthusiast & historian extraordinaire.

@gggritso gggritso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍🏻

…9263)

`LogsAutoRefreshContext` was missing the _"only `navigate()` if the
query changed"_ logic from other places like `chartZoom`. I added it
there, then added a shared `navigateIfQueryChanged` helper to
deduplicate the half-dozen places it was used.

Closes LOGS-383.

Co-authored-by: Claude <noreply@anthropic.com>
@JoshuaKGoldberg JoshuaKGoldberg requested review from a team as code owners July 9, 2026 15:38
@JoshuaKGoldberg JoshuaKGoldberg merged commit 346965d into master Jul 9, 2026
77 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the scttcper/chart-zoom-state branch July 9, 2026 15:58
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.

3 participants