Skip to content

[#672] Add USD values across dashboards#678

Merged
realproject7 merged 2 commits intomainfrom
task/672-dashboard-usd-values
Mar 31, 2026
Merged

[#672] Add USD values across dashboards#678
realproject7 merged 2 commits intomainfrom
task/672-dashboard-usd-values

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

Added muted (≈ $X.XX) USD equivalents next to PLOT values across all dashboards:

  • WriterTradingStats: token price and TVL
  • ClaimRoyalties: unclaimed royalties
  • ReaderPortfolio: total value and per-holding value
  • TradingHistory: trade amounts

Uses existing usePlotUsdPrice() hook (single fetch per component, cached 2min) and formatUsdValue() utility. No new API calls per row.

Changed files

  • src/components/WriterTradingStats.tsx — USD for price + TVL
  • src/components/ClaimRoyalties.tsx — USD for unclaimed royalties
  • src/components/ReaderPortfolio.tsx — USD for total + per-holding
  • src/app/dashboard/reader/page.tsx — USD for trade amounts

Test plan

  • Writer Dashboard shows USD for token price, TVL, royalties
  • Reader Portfolio shows USD for total and per-holding values
  • Reader Trading History shows USD for trade amounts
  • Mobile layout readable, no overflow
  • npm run build passes

Fixes #672

🤖 Generated with Claude Code

Add muted (≈ $X.XX) USD equivalents next to PLOT values using the
existing usePlotUsdPrice() hook and formatUsdValue() utility.

- WriterTradingStats: token price and TVL
- ClaimRoyalties: unclaimed royalties amount
- ReaderPortfolio: total value and per-holding value
- TradingHistory: trade amounts

Single price fetch per component via usePlotUsdPrice(), no per-row
API calls. USD shown only when price data is available.

Fixes #672

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

vercel Bot commented Mar 31, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Mar 31, 2026 0:26am

Request Review

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.

T2b APPROVE

Clean, consistent USD integration across 4 files (+42 lines):

  1. Reuses existing infrastructureusePlotUsdPrice() hook (single fetch, 2min cache) + formatUsdValue(). No new per-row API calls. Smart.
  2. Consistent stylingtext-muted ml-1 text-[10px] with parenthesized USD values across all locations.
  3. Conditional rendering — USD only shows when plotUsd is available. Graceful degradation.
  4. Correct value conversionsparseFloat(formatUnits(bigint, decimals)) * plotUsd for on-chain values, t.reserve_amount * plotUsd for Supabase floats. Appropriate per data source.

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 USD additions are directionally right, but the current implementation still misses two explicit requirements from #672 / #332: the requested (≈ $X.XX) display format and the single-fetch/pass-through data flow.

Findings

  • [medium] The new USD labels omit the required approximation marker. The issue explicitly asks for muted smaller (≈ $X.XX) values, but the new UI renders ($X.XX) everywhere instead.
    • File: src/components/WriterTradingStats.tsx:56
    • Suggestion: Include the marker consistently across all new USD tags, ideally via one shared helper so the format stays uniform.
  • [medium] The PR still fetches the PLOT/USD value inside each component instead of fetching it once at the dashboard level and passing it through. usePlotUsdPrice() is now mounted separately in WriterTradingStats, ClaimRoyalties, ReaderPortfolio, and TradingHistory, which does not match the explicit "fetch once and pass through" requirement in #672 / #332.
    • File: src/components/WriterTradingStats.tsx:19
    • Suggestion: Fetch plotUsd once in the writer and reader dashboard pages, then pass it into the child components as props.

Decision

Requesting changes because this PR is close, but it does not yet fully satisfy the display-format and data-flow requirements in the linked issue.

- All USD tags now show (≈ $X.XX) format per spec
- Price fetched once via usePlotUsdPrice() at WriterDashboard and
  ReaderDashboard level, passed as plotUsd prop to child components
- Removed per-component usePlotUsdPrice() calls from WriterTradingStats,
  ClaimRoyalties, ReaderPortfolio, TradingHistory

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.

T2b APPROVE (re-review after fixes)

Both T2a concerns resolved:

  1. ≈ prefix — all USD tags now show (≈ $X.XX) format ✅
  2. Price liftedusePlotUsdPrice() called once at WriterDashboard and ReaderDashboard level, passed as plotUsd prop to all child components. No per-component hook calls. ✅

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 latest commit resolves the remaining review concerns. USD tags now use the requested (≈ $X.XX) format, and the PLOT/USD value is fetched once at the writer/reader dashboard level and passed into the child components.

Findings

  • No blocking findings.

Decision

Approving because the current head now matches issue #672 / #332: the USD display format is consistent with spec, the data flow uses a single dashboard-level price fetch, and the additions remain focused to the requested dashboard surfaces.

@realproject7 realproject7 merged commit 17a5c68 into main Mar 31, 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.

Add USD values across all dashboards — Writer, Reader, Portfolio

2 participants