Skip to content

Reader holdings: replace inline stats with 4-box grid (Value, Balance, PnL, First Traded) #756

@realproject7

Description

@realproject7

Problem

The Reader tab's Story Token Holdings info area shows inline label-value text next to the Moleskine book. It's unclear and inconsistent with the dashboard box pattern used elsewhere.

Fix: 4-box grid matching Writer tab pattern

Replace the inline stats with a 2×2 grid of stat boxes:

```
┌─────────────────┐ ┌─────────────────┐
│ $1.32 +5.6% │ │ 240K │
│ Value │ │ Balance │
└─────────────────┘ └─────────────────┘
┌─────────────────┐ ┌─────────────────┐
│ $0.01 +0.23% │ │ Mar 31, 2026 │
│ PnL │ │ First Traded │
└─────────────────┘ └─────────────────┘
```

Box 1: Value

  • Show USD value only (not PLOT — confusing to show both)
  • Append 24h price change: `$1.32 +5.6%`
  • Change % colored: green (accent) for positive, red (error) for negative

Box 2: Balance

  • Shortened format: use K, M abbreviations
    • 12,000 → `12K`
    • 1,500,000 → `1.5M`
    • 240,000 → `240K`
    • Under 1,000 → show full number
  • Label: "Balance"

Box 3: PnL (Profit & Loss)

  • Calculate: `(currentPrice - entryPrice) × balance` in USD
  • Show as: `$0.01 +0.23%` (dollar PnL + percentage)
  • If no entry price available, show "—"
  • Colored: green/red based on positive/negative

Box 4: First Traded

  • Show full date with year: `Mar 31, 2026`
  • Label: "First Traded"

What to remove

  • Remove the current inline: value line, "Balance:", "Price:", "Entry:", "Traded:" labels
  • All that info is now captured in the 4 boxes

Mobile (375px)

  • `grid-cols-2` — same as Writer tab stat boxes
  • Each box: number on top (bold), label below (muted), bordered
  • Value and PnL boxes: fit `$1.32 +5.6%` on one line — use smaller font if needed

Shortened number helper

```typescript
function formatCompact(n: number): string {
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
if (n >= 1_000) return `${(n / 1_000).toFixed(0)}K`;
return n.toLocaleString();
}
```

Files to modify

  • `src/app/profile/[address]/page.tsx` — Reader tab token holding card

Branch

`task/756-reader-holdings-boxes`

Self-Verification (T3)

  • 4 stat boxes next to Moleskine book (2×2 grid)
  • Value: USD only with 24h % change (no PLOT value)
  • Balance: shortened format (12K, 1.5M, etc.)
  • PnL: USD profit/loss with % (or "—" if no entry price)
  • First Traded: full date with year
  • No inline Price/Entry/Traded labels remaining
  • Mobile (375px): boxes fit cleanly
  • `npm run build` passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions