Skip to content

feat(earn): add history chart hover details - #573

Merged
petar-omni merged 2 commits into
mainfrom
feat/earn-chart-hover-tooltip
Sep 18, 2026
Merged

petar-omni merged 2 commits into
mainfrom
feat/earn-chart-hover-tooltip

Conversation

@petar-omni

@petar-omni petar-omni commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • show the nearest recorded chart value and localized date on hover
  • highlight the active chart point with a dot and cursor guide
  • use theme-derived contrast for the tooltip container
  • add DOM and Chromium coverage for tooltip behavior

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.

HistoryChart now wires Recharts Tooltip with a new ChartTooltip, uses i18n for date formatting, optional valueFormatter (falls back to axis tickFormatter), a dashed cursor, and an active dot matching the endpoint highlight. HistoryChartSection forwards the optional formatter. Theme-based tooltip styles were added in styles.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.

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.
@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c0b9cc6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-573.df4xyoi0xyeak.amplifyapp.com

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-573.d2ribjy8evqo6h.amplifyapp.com

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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",
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7c05eae. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Open in Web View Automation 

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: medium. Not approved: Cursor Security Agent passed with no security findings, but this user-facing earn-chart hover change is above the low-risk approval threshold. Human review is needed; reviewers were already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@raiseerco raiseerco left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm

@petar-omni
petar-omni merged commit 6fcc882 into main Sep 18, 2026
10 checks passed
@petar-omni
petar-omni deleted the feat/earn-chart-hover-tooltip branch September 18, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants