Skip to content

feat: add chain filter pills with client-side filtering (All, Base, S…#28710

Merged
zone-live merged 14 commits intomainfrom
TSA-374-leaderboard-chain-filter
Apr 16, 2026
Merged

feat: add chain filter pills with client-side filtering (All, Base, S…#28710
zone-live merged 14 commits intomainfrom
TSA-374-leaderboard-chain-filter

Conversation

@Bigshmow
Copy link
Copy Markdown
Contributor

@Bigshmow Bigshmow commented Apr 13, 2026

Description

  • Replace NetworkFilterButton/bottom sheet with inline chain filter pills (All, Base, Solana, Ethereum)
  • Client-side filtering from a pre-fetched leaderboard (250 max), capped at 50 displayed
  • Re-ranks traders 1-N within the filtered set
  • Uses FlatList with React.memo on TraderRow for rendering performance
  • Preserves pull-to-refresh and feature flag guard from main

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Changes list rendering and ranking/filtering logic in TopTradersView, which could affect ordering, empty states, and performance if pnlPerChain data is missing or inconsistent.

Overview
Adds inline chain filter pills (All/Base/Solana/Ethereum) to TopTradersView, replacing the previous NetworkFilterButton/bottom sheet approach and filtering the list client-side.

Extends TopTrader and useTopTraders to include pnlPerChain, then uses it to filter and re-rank results (cap display to 50) while increasing the fetch limit (250) and switching to FlatList plus React.memo(TraderRow) for rendering performance.

Updates tests, test IDs, and English strings for the new filter UI, and adds SOLANA_DISPLAY_NAME to engine constants.

Reviewed by Cursor Bugbot for commit 602ab34. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Base automatically changed from TSA-114-traders-list-leaderboard to main April 13, 2026 12:53
@Bigshmow Bigshmow force-pushed the TSA-374-leaderboard-chain-filter branch from b94a5f6 to 9d88f82 Compare April 14, 2026 21:58
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.73%. Comparing base (15470f4) to head (9d88f82).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
...ocialLeaderboard/TopTradersView/TopTradersView.tsx 70.58% 3 Missing and 2 partials ⚠️
...omepage/Sections/TopTraders/hooks/useTopTraders.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main   #28710       +/-   ##
===========================================
- Coverage   82.20%   58.73%   -23.48%     
===========================================
  Files        5017     5028       +11     
  Lines      131659   131957      +298     
  Branches    29381    29455       +74     
===========================================
- Hits       108228    77502    -30726     
- Misses      16083    48123    +32040     
+ Partials     7348     6332     -1016     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Bigshmow Bigshmow marked this pull request as ready for review April 15, 2026 01:17
Comment thread app/components/Views/SocialLeaderboard/TopTradersView/TopTradersView.tsx Outdated
@github-actions github-actions Bot added the risk-low Low testing needed · Low bug introduction risk label Apr 15, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 15, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 15, 2026
zone-live
zone-live previously approved these changes Apr 15, 2026
@zone-live zone-live enabled auto-merge April 15, 2026 11:09
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 15, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 15, 2026
<TouchableOpacity onPress={onPress} testID={`chain-filter-${filterKey}`}>
<Box
twClassName={`px-4 py-2 rounded-xl border ${
isSelected ? 'bg-default border-white' : 'border-muted'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't match exactly what's in Figma

Image

Copy link
Copy Markdown
Contributor

@xavier-brochard xavier-brochard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested adding more items to the list, and the component behaved badly

  • no more spacing between items. I think we should enforce constant spacing between them.
  • no horizontal scrolling. The items are locked in place.

It may seem like we don't need to care about this yet, but in fact we do, because even the current list ("All", "Base", "Solana", "Ethereum") could overflow on smaller devices.

Image

@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 16, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 16, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Apr 16, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are entirely contained within the Social Leaderboard / Top Traders feature area, which is part of the Trending discovery tab covered by SmokeWalletPlatform.

Key changes:

  1. Engine/constants.ts: Purely additive - adds SOLANA_DISPLAY_NAME = 'Solana' constant. Only used in TopTradersView, no cascade effects.
  2. TopTraders types/hooks: Added pnlPerChain field for client-side chain filtering - additive data model change.
  3. NetworkFilterButton deleted: Replaced by inline ChainPill component - no other consumers found (grep confirmed zero remaining references).
  4. TopTradersView.tsx: Major UI refactor - replaced bottom sheet network filter with horizontal pill filters (All/Base/Solana/Ethereum), migrated from ScrollView to FlatList for performance, added client-side filtering logic.
  5. TraderRow.tsx: Wrapped with React.memo - performance optimization only.
  6. Test IDs updated: New chain filter test IDs added.
  7. Locales: Added chain_filter.all string.

No E2E test files exist for this feature (confirmed via grep). The changes are self-contained within the Social Leaderboard section. No shared navigation, modals, confirmations, or TabBar components are affected. SmokeWalletPlatform covers the Trending tab where this feature lives.

No other tags are needed: no confirmations, no account management, no network permissions, no swaps/bridges are affected.

Performance Test Selection:
While TraderRow was wrapped with React.memo and ScrollView was migrated to FlatList (both performance improvements), these changes are within the Social Leaderboard/Top Traders feature which is not covered by any existing performance test tags. The available performance tags cover: AccountList, Onboarding, Login, Swaps, Launch, AssetLoading, Predict, and Perps - none of which map to the Top Traders leaderboard view. The performance improvements are low-risk optimizations (React.memo, FlatList) that are unlikely to regress performance.

View GitHub Actions results

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 602ab34. Configure here.

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
11 value mismatches detected (expected — fixture represents an existing user).
View details

@zone-live zone-live added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit 7eec98b Apr 16, 2026
171 of 173 checks passed
@zone-live zone-live deleted the TSA-374-leaderboard-chain-filter branch April 16, 2026 15:43
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 16, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.74.0 Issue or pull request that will be included in release 7.74.0 label Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.74.0 Issue or pull request that will be included in release 7.74.0 risk-low Low testing needed · Low bug introduction risk size-M team-portfolio

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants