fix: reset price on timeRange change cp-7.74.0#28982
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6a6551e. Configure here.
| return; | ||
| } | ||
| // Clear crosshair data when changing timeframes to reset price/percentage display | ||
| setCrosshairData(null); |
There was a problem hiding this comment.
Early return prevents crosshair reset on same timeframe
Medium Severity
The setCrosshairData(null) call is placed after the early return that fires when range === timeRange. The PR description explicitly mentions the scenario where a user "clicks the same timeframe again" as one of the cases to fix, but the early return on line 159 prevents setCrosshairData(null) from ever executing in that case. The crosshair data remains stale when re-selecting the current timeframe.
Reviewed by Cursor Bugbot for commit 6a6551e. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: This is a minimal, isolated UI fix:
No performance tests are needed as this is a simple state reset (null assignment) with negligible performance impact. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |





Description
Fixes an issue where the price and percentage display would remain stuck at crosshair hover values after changing timeframes in the advanced chart.
Issue
When a user:
Hovers over the chart (which sets crosshair data)
Changes to a different timeframe (or clicks the same timeframe again)
The price and percentage display would incorrectly show the old crosshair values instead of resetting to show the current values for the new timeframe.
The crosshairData state was not being cleared when changing timeframes.
Solution
Added setCrosshairData(null) in the handleTimeRangeSelect callback to clear crosshair data whenever the timeframe changes.
Changelog
CHANGELOG entry: reset crosshair on timeRange change
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Low risk UI-state fix that only clears
crosshairDatawhen switching chart time ranges, affecting display state but not data fetching or persistence.Overview
Fixes the advanced token chart header getting stuck showing crosshair hover price/percentage after changing timeframes by clearing
crosshairDatainhandleTimeRangeSelectbefore updating the selected range and tracking the event.Reviewed by Cursor Bugbot for commit 6a6551e. Bugbot is set up for automated code reviews on this repo. Configure here.