Remove price change percentage display from chart tooltips - #2130
Merged
Conversation
The savings rate chart (savings page) and token price chart (coins/[id] page) tooltips showed a period-over-period percentage change next to the date. Remove that change indicator from both the web (recharts ChartTooltip) and native (AreaChart) tooltips so they only display the value and the date. The selectedPriceChange store update is kept so the coin detail header's price-change indicator continues to work. https://claude.ai/code/session_01KE3gjUzyjkEN8ntFCkDTNC
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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.
Summary
This PR removes the price change percentage feature from chart tooltips across all chart components. The percentage change calculation and conditional rendering logic has been stripped out, simplifying the tooltip UI to display only the price and date information.
Key Changes
ChartTooltip.tsx:
isPriceChangeprop from component interfacecnutility import (no longer needed)selectedPriceChangefrom store subscriptionAreaChart.tsx:
priceChangefield from tooltip data statecalculatePercentageChangecall)AreaChart.web.tsx:
isPriceChangeprop when passing toChartTooltipcomponentImplementation Details
The changes maintain the core tooltip functionality while reducing visual complexity. The percentage change calculation logic remains exported from
ChartTooltip.tsxbut is no longer used by any components. The tooltip now consistently displays only the formatted price and formatted date across both web and native implementations.https://claude.ai/code/session_01KE3gjUzyjkEN8ntFCkDTNC