Skip to content

[#858] Show live current price on chart + simplify header token box#859

Merged
realproject7 merged 2 commits intomainfrom
task/858-chart-live-price
Apr 12, 2026
Merged

[#858] Show live current price on chart + simplify header token box#859
realproject7 merged 2 commits intomainfrom
task/858-chart-live-price

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Chart: Appends live current price as the rightmost point, connected by a dashed line from the last historical trade — preserves chart honesty while clearly showing where the price is now
  • Price label: Below chart now shows "Current price · $X.XX" (live) instead of the last historical trade price
  • Header token price box: Simplified to 2 lines (USD price + "Token Price"), removed PLOT secondary line
  • Footnote: Clarifies "Dashed line = current live price"
  • Patch version bump 0.1.22 → 0.1.23

How live current price is represented

The live price point (from usePlotUsdPrice × on-chain currentPriceRaw) is appended as the last chart point with isLive: true. The segment from the last historical trade to this point renders as a dashed line at 60% opacity, matching the existing approximate-data visual language. The pulse marker animates on the live point. Historical data points remain untouched.

Fixes #858

Test plan

  • Chart shows dashed line extending from last trade to current live price
  • Pulse marker sits on the live current price, not the last historical trade
  • Price label below chart shows current live USD price (or PLOT in PLOT mode)
  • Header token price box: 2 lines only (USD + "Token Price")
  • Chart still works when USD data unavailable (falls back to PLOT)
  • No hydration warnings

🤖 Generated with Claude Code

Chart changes:
- Append live current price as rightmost point via usePlotUsdPrice hook
- Dashed line from last historical trade to live price (visually distinct)
- Price label below chart now reads "Current price · $X.XX" instead of
  showing the last historical trade price
- Footnote clarifies dashed line = live price

Header token price box:
- Simplified to 2 lines: USD price + "Token Price" label
- Removed secondary PLOT-denominated line

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 12, 2026 6:30am

Request Review

Copy link
Copy Markdown
Owner Author

@realproject7 realproject7 left a comment

Choose a reason for hiding this comment

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

re2 APPROVE — Historical data preserved, live price correctly appended as dashed-connector endpoint. Empty-state guard properly checks historicalPoints not chartPoints. Stale isLatest logic cleanly removed. Dual dashed-line semantics (live + approx) addressed in footnote. TokenPriceBox simplified to 2 lines as requested.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Summary

The live-current-price concept is right, but the new point insertion mixes units when the USD hook has not resolved yet.

Findings

  • [high] USD mode can append a PLOT-valued live point while labeling it as USD
    • File: src/components/PriceChart.tsx:156
    • Suggestion: In effectiveMode === "usd", only append the live point when currentUsdPrice !== null. Otherwise keep the chart purely historical in USD mode, or temporarily fall back the whole chart to reserve mode. Right now livePrice falls back to currentPrice (PLOT) even though the surrounding series and footer are still labeled USD, which can show a bogus final point and incorrect "Current price" text until usePlotUsdPrice() resolves.

Decision

Requesting changes because this produces an incorrect price/value in the chart’s primary USD mode, which is the core behavior of #858.

…able

In USD mode, only append the live current price point when plotUsd is
resolved. Prevents plotting a PLOT-denominated value on a USD chart
while the rate hook is still loading.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

The follow-up fixes the USD/PLOT unit-mixing bug in the live chart point. In USD mode, the live point is now only appended when the USD rate is available, and the footer correctly shows loading… instead of a mislabeled PLOT value.

Findings

  • [info] GitHub checks are still pending at review time (e2e, lint-and-typecheck, visual-regression)
    • File: PR #859
    • Suggestion: Let CI finish before merge.

Decision

Approved because the revised chart logic preserves unit correctness in USD mode and matches issue #858 without falsifying the historical series.

@realproject7 realproject7 merged commit e56ec33 into main Apr 12, 2026
5 checks passed
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.

[Follow-up] Price history chart: show live current price and simplify header token box

2 participants