Skip to content

feat: add CompareView and PriceHistoryView render components - #4

Open
ygd58 wants to merge 1 commit into
RitualChain:mainfrom
ygd58:feat/add-compare-and-history-views
Open

feat: add CompareView and PriceHistoryView render components#4
ygd58 wants to merge 1 commit into
RitualChain:mainfrom
ygd58:feat/add-compare-and-history-views

Conversation

@ygd58

@ygd58 ygd58 commented Jul 1, 2026

Copy link
Copy Markdown

Summary

The two new tools added in PR #2 (compareTokensTool, priceHistoryTool) had no UI components — their output would render as raw JSON in the chat. This PR adds proper render components for both.

New Components

CompareView (components/compare-view.tsx)

  • Renders multi-token comparison as a clean table
  • Columns: Token, Price, 24h change (green/red color-coded), Market Cap, Volume 24h
  • Large numbers abbreviated (e.g. $1.2T, $45.3B)
  • Handles missing data gracefully with em dash

PriceHistoryView (components/price-history-view.tsx)

  • SVG sparkline chart (green/red based on trend direction)
  • 4 stat cards: Start Price, End Price, High, Low
  • Color-coded % change badge in the header
  • Downsampled sparkline points for smooth rendering

Integration

  • Both components wired into app/page.tsx switch statement
  • Loading states show inline text while data is being fetched
  • Consistent styling with existing MarketView component

- Add CompareView: renders multi-token comparison as a sortable table
  with price, 24h change (color-coded), market cap, and volume columns
- Add PriceHistoryView: renders historical data with SVG sparkline chart,
  start/end/high/low stat cards, and color-coded % change badge
- Wire both components into page.tsx for tool-compare and tool-priceHistory
  message parts so new tools render rich UI instead of raw JSON
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

@ygd58 is attempting to deploy a commit to the 0xBuns Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant