Skip to content

feat(ui): add portfolio and analytics dashboard - #165

Merged
truthixify merged 1 commit into
wraith-protocol:developfrom
fwseyi:feat/portfolio-analytics-dashboard
Aug 26, 2026
Merged

feat(ui): add portfolio and analytics dashboard#165
truthixify merged 1 commit into
wraith-protocol:developfrom
fwseyi:feat/portfolio-analytics-dashboard

Conversation

@fwseyi

@fwseyi fwseyi commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Adds /portfolio — a one-glance view of inflow/outflow, per-asset totals, and top counterparties, derived entirely client-side from activityStore. No new network calls.

Changes

  • src/lib/portfolio.ts — pure derivation functions: filterByWindow, calcAssetTotals, calcMonthlyFlow, calcTopCounterparties
  • src/pages/Portfolio.tsx — time filter tabs (7d/30d/90d/All), assets table, inline SVG bar chart (no charting dep, dark/light adaptive), top-5 counterparties list, EmptyState fallback, wallet-not-connected state matching Activity page pattern
  • src/App.tsx — /portfolio route
  • src/components/Header.tsx — nav link added after /activity
  • src/i18n/en.json, es.json — nav.portfolio translation keys

Performance

Benchmark included per acceptance criteria — 500 entries × 4 window switches:

  • Total elapsed: 5.345ms (avg 1.336ms/window) — well under the 100ms threshold
  • Single window switch (30d): 0.618ms
  • Fixed calcMonthlyFlow to use a module-level Intl.DateTimeFormat instance instead of per-entry instantiation, cutting per-call cost from ~35ms to sub-millisecond

Tests

29 new unit tests in portfolio.test.ts covering all four derivation functions (empty input, boundary conditions, multi-token/multi-month aggregation, tiebreakers, missing-data fallbacks) plus 2 benchmark tests. 135/135 tests passing overall, no regressions.

Validation

pnpm test:unit → 10 test files, 135 passed
prettier --check → clean

Closes #148

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the truthixify's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@fwseyi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@truthixify
truthixify merged commit 103f61d into wraith-protocol:develop Aug 26, 2026
1 of 2 checks passed
@truthixify

Copy link
Copy Markdown
Contributor

Merged. Portfolio derives entirely from the existing activity store with no added network calls, exactly as you described in your application. Strong first contribution @fwseyi.

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.

Portfolio and analytics dashboard

2 participants