Referrals: guide leaderboard global totals + pagination #225
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#225
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On
/referrals, the Guide leaderboard card has two UX gaps:Summary stat mislabeled / wrong scope — the header shows "Codes registered (this page)" and the number is the sum of
codes_registered_countfor the current 20-row page only (computed client-side inReferralLeaderboardSection). It should show "Codes registered (global)" with the network-wide total from the indexer (e.g. total rows inidx_referral_code_registered, or an equivalent authoritative aggregate), not a page-local sum.No pagination — the card loads a single fixed page (
fetchReferralReferrerLeaderboard(20, 0)) and never exposes additional referrers. Users should be able to page through all guides via clickable page numbers at the bottom of the card.Current behavior
frontend/src/pages/referrals/ReferralLeaderboardSection.tsxlimit=20&offset=0.totalCodesRegistered(and similarlytotalBuys,totalCharmWad) are reduced from page items only.GET /v1/referrals/referrer-leaderboardalready supportslimit/offsetand returnsnext_offset(indexer/src/api.rs); nototal/ global aggregate fields today (unlikeGET /v1/timecurve/buyswhich exposestotal).Expected behavior
Global summary totals
ReferralRegistry, independent of the visible page.Pagination
offsetonGET /v1/referrals/referrer-leaderboardand re-renders rows;rankvalues must remain the indexer’s dense competitive rank (notoffset + row_index + 1) — seeINV-INDEXER-170-REFERRAL-LB-TIE/ #177.Work to scope
GET /v1/referrals/referrer-leaderboard(or add a small companion route) to return global aggregates for the summary strip — e.g.total_codes_registered,total_referred_buys,total_referrer_charm_wad, plustotalreferrer count for page math. BumpSCHEMA_VERSIONper repo conventions if response shape changes.limit,offset, derived page index fromnext_offset/total); updateindexerApitypes; fix summary labels and data source; add pagination UI + styles consistent with referrals / TimeCurve surfaces./referralspagination + global summary label (extendfrontend/e2e/referrals-surface.spec.tsas appropriate).docs/product/referrals.mddashboard table and manual QA checklist if copy or invariants change.Related
codes_registered_count: #204/cc @PlasticDigits/yieldomega
mentioned in commit
0632942790Implementation summary (merged to
main@0632942)Guide leaderboard on
/referralsnow uses network-wide indexer aggregates for the summary strip and supports numbered pagination through all guides.Changes
Indexer (
SCHEMA_VERSION→ 1.25.0)GET /v1/referrals/referrer-leaderboardnow returns on every page:total— distinct referrer union count (registry ∪ ReferralApplied)total_codes_registered— full-table count onidx_referral_code_registeredtotal_referred_buys— full-table count onidx_timecurve_referral_appliedtotal_referrer_charm_wad—SUM(referrer_amount)onidx_timecurve_referral_appliedFrontend
reducesums).ReferralLeaderboardPagination) at the bottom of the card; 20 rows/page.rankremains indexer dense competitive rank (#177).referralLeaderboardPagination.ts,ReferralLeaderboardPagination.tsx.Tests
postgres_gitlab225_referrer_leaderboard_global_totals_and_paginationreferralLeaderboardPagination.test.tsreferrals-surface.spec.ts(mocked indexer + global label assertion)Docs / invariants
INV-INDEXER-225-REFERRAL-LB-GLOBAL,INV-FRONTEND-225-REFERRAL-LBdocs/product/referrals.md,docs/indexer/design.md,docs/testing/invariants-and-business-logic.md,docs/testing/manual-qa-checklists.md#manual-qa-issue-225,skills/README.md,.cursor/skills/yieldomega-guardrails/SKILL.mdVerification checklist
x-schema-version: 1.25.0(or later) on referrer-leaderboard responses.GET /v1/referrals/referrer-leaderboard?limit=20&offset=0returnstotal_*fields matching full-table counts (not sums of currentitems)./referralssummary shows “Codes registered (global)”, “Recorded referral buys (global)”, “Total guide CHARM (global)”.offset=20andrankvalues are still dense competitive ranks (not21, 22, …).cargo test postgres_gitlab225·npm test -- referralLeaderboardPaginationinfrontend/./cc @nullvector_ux — please verify on staging/local stack when convenient. Leaving this issue open until sign-off.
Verification checklist @PlasticDigits
x-schema-version: 1.25.0(or later) on referrer-leaderboard responses.GET /v1/referrals/referrer-leaderboard?limit=20&offset=0returnstotal_*fields matching full-table counts (not sums of currentitems)./referralssummary shows “Codes registered (global)”, “Recorded referral buys (global)”, “Total guide CHARM (global)”.offset=20andrankvalues are still dense competitive ranks (not21, 22, …).cargo test postgres_gitlab225·npm test -- referralLeaderboardPaginationinfrontend/.mentioned in issue #231
Ransk due to 0 charm tie, closing
mentioned in issue #234