fix(explore): Fix attribute breakdowns tooltip caching stale params and losing values#112590
Merged
nsdeschenes merged 5 commits intomasterfrom Apr 14, 2026
Merged
Conversation
Extract the tooltip value (name) into its own ref so it is captured at hover time and remains stable when the tooltip is frozen. Previously the value was derived from the cached params on each render, which could lose the original value when echarts re-invokes the formatter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace tooltipParamsRef (which stored raw echarts params) with tooltipContentRef (which stores the already-formatted HTML string). This avoids re-calling the formatter with stale params when the tooltip is frozen, preventing content from showing incorrect or mismatched data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b34ed14. Configure here.
Replace tooltipParamsRef (which stored raw echarts params) with tooltipContentRef (which stores the already-formatted HTML string). This avoids re-calling the formatter with stale params when the tooltip is frozen, preventing content from showing incorrect or mismatched data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tooltipValueRef was initialized as useRef<string>(''), so .current was
always a string and the ?? fallback to derive the value from params
could never trigger. Initialize as null to match tooltipContentRef,
allowing proper fallback when the ref hasn't been populated before
the tooltip is frozen.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handleMouseLeave was resetting tooltipValueRef to '' instead of null, which meant the ?? fallback could never trigger since nullish coalescing doesn't fall through on empty strings. Align with handleClickAnywhere which correctly uses null. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
k-fish
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Cache the rendered tooltip HTML and extracted value at hover time instead of storing raw echarts params and re-deriving them when frozen. This fixes the frozen tooltip showing stale or mismatched data when echarts re-invokes the formatter.
Closes EXP-869