[#352] Add Trading History on reader dashboard with pagination#369
[#352] Add Trading History on reader dashboard with pagination#369realproject7 merged 2 commits intomainfrom
Conversation
- Add user_address column to trade_history (migration 00019) - Update trade indexer (POST + cron) to save user address from Mint/Burn event args - Add Trading History section above Donation History on reader dashboard with Buy/Sell labels, reserve amount, Basescan tx links, and Load more pagination (10 per batch) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The migration and indexer changes look directionally correct, but the reader-dashboard UI does not yet satisfy the display requirements in issue #352. The new Trading History section is missing both the storyline link/name and the token amount traded for each row.
Findings
- [medium] Trading History rows omit required storyline navigation and token amount details.
- File:
src/app/dashboard/reader/page.tsx:233 - Suggestion: extend each row to show the storyline as a clickable link or title, and include the token amount traded alongside the reserve amount. The issue explicitly asks for “Token name/storyline link” and “Amount of tokens traded,” but the current row only renders
Story #{t.storyline_id}, date, buy/sell label, reserve amount, and tx link.
- File:
Decision
Requesting changes because the UI portion of issue #352 is still incomplete. lint-and-typecheck was also still pending at review time, but the missing fields are the main blocker.
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. Migration adds nullable user_address with proper composite index. Both indexer routes save args.user. reserve_amount is already human-readable (formatUnits at insert time), so formatPrice works correctly. Consistent Load more + tx link patterns. Approved.
Address T2a review: Story #{id} is now a clickable link to the story
page. Token amount (tokens traded) computed from reserve_amount /
price_per_token and displayed alongside the reserve amount.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM on re-review. Story link is now clickable via Next Link, token amount computed with price_per_token > 0 guard to avoid division by zero. Good improvements. Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The updated PR now satisfies the missing UI requirements from issue #352 by adding a clickable story link and a token-amount field to each Trading History row. The migration and indexer changes remain coherent, and the reader-dashboard UI is now complete enough for the requested feature.
Findings
- No remaining correctness or design issues found in the updated diff.
Decision
Approved on re-review. lint-and-typecheck was still pending again at the time of approval, so merge should still wait for required GitHub checks.
Summary
user_addresscolumn totrade_historytable (migration 00019)userfieldNote: Migration must be run on Supabase before the Trading History will show data. Existing
trade_historyrows will haveuser_address = nulluntil re-indexed.Fixes #352
Files changed
supabase/migrations/00019_trade_history_user_address.sql— new column + indexlib/supabase.ts— updated types + added TradeHistory aliassrc/app/api/index/trade/route.ts— save user_addresssrc/app/api/cron/trade-history/route.ts— save user_addresssrc/app/dashboard/reader/page.tsx— TradingHistory componentTest plan
next buildpasses🤖 Generated with Claude Code