feat(earn): add history chart hover details - #573
Conversation
Show the nearest recorded value and localized date when hovering either earn history chart. Highlight the active point and use theme-derived contrast for the tooltip container.
|
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7c05eae. Configure here.
| month: "short", | ||
| day: "numeric", | ||
| year: "numeric", | ||
| }); |
There was a problem hiding this comment.
Hover date shifts by timezone
Medium Severity
DateTime.formatLocal converts each history timestamp into the viewer's local timezone. Chart points are UTC midnight daily snapshots, so users west of UTC see the previous calendar day on hover instead of the recorded date. Locale still applies if the UTC calendar day is formatted instead.
Reviewed by Cursor Bugbot for commit 7c05eae. Configure here.
There was a problem hiding this comment.
Fixed in c0b9cc6. Snapshot dates now use DateTime.formatUtc, with a regression test forced to America/Los_Angeles that previously rendered the prior calendar day.
There was a problem hiding this comment.
Stale comment
Risk: medium. Not approved: Cursor Bugbot finished as skipped after reporting an unresolved hover-date finding, and this user-facing earn-chart change is above the low-risk approval threshold. Human reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router and Approver
Format snapshot dates in UTC so viewers west of UTC do not see the previous calendar day.




Summary
Note
Low Risk
UI-only chart tooltip and styling with guarded tooltip rendering; no auth, data, or API changes.
Overview
Adds hover details to earn history charts so users see the nearest point’s formatted value and a localized date while moving over the series.
HistoryChartnow wires RechartsTooltipwith a newChartTooltip, uses i18n for date formatting, optionalvalueFormatter(falls back to axistickFormatter), a dashed cursor, and an active dot matching the endpoint highlight.HistoryChartSectionforwards the optional formatter. Theme-based tooltip styles were added instyles.css.ts.Tests cover empty/chart render, tooltip edge cases (inactive payload, locale, invalid values), and browser hover showing tooltip + active dot.
Reviewed by Cursor Bugbot for commit 7c05eae. Configure here.