-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor: Perps market list from swipeable tab view to flatlist filter #24456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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. |
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Implements searchable, filterable market list view for Perps with global search access from the home tab. New Page: /perps/market-list - Search across all markets (crypto + HIP-3 assets) with real-time filtering - Filter by market type: All, Crypto, Stocks & Commodities (with sub-filters) - Sort by: Volume, Price Change, Open Interest, Funding Rate - Search bypasses filters to match mobile behavior Architecture - Extracted business logic into composable hooks (usePerpsMarkets, usePerpsSearch, usePerpsSorting, usePerpsMarketListView) - Reusable Dropdown component with mobile-aligned styling (borderRadius: 8, muted background, opacity press state) - Volume parsing utility handles magnitude suffixes ($1.2B, $850M, $500K) Navigation - Added search icon to PerpsTabView header for global market search access - New route: PERPS_MARKET_LIST_ROUTE Technical Notes - Uses mock data; ready for PerpsController integration - Feature-flagged under perpsEnabledVersion - Mobile parity with metamask-mobile PR [#24456](MetaMask/metamask-mobile#24456) [](https://codespaces.new/MetaMask/metamask-extension/pull/39307?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Added searchable market list view for Perps with filtering and sorting capabilities ## **Related issues** Fixes: ## **Manual testing steps** Testing 1. Navigate to Perps tab → tap search icon 2. Verify search filters across all market types 3. Verify filter/sort dropdowns function correctly 4. Verify market row navigation to detail page ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a dedicated, feature-flagged markets list experience for Perps with search, filter, and sort, and integrates navigation from the Perps tab. > > - New `PERPS_MARKET_LIST_ROUTE` with lazy-loaded `MarketListView` and back navigation; updates `routes` and `ROUTES` > - Header search button in `PerpsTabView` navigates to market list > - Market list: search across all markets, filter (All/Crypto/Stocks with sub-filter), and sort (Volume/Price Change/Open Interest/Funding Rate) > - New reusable UI components: `Dropdown`, `FilterSelect`, `StockSubFilterSelect`, `SortDropdown`, `SearchInput`, `MarketRow`, `MarketRowSkeleton` > - Utilities/constants: `filterMarketsByQuery`, `sortMarkets` (with `parseVolume`), `PERPS_CONSTANTS`, `MARKET_SORTING_CONFIG` > - i18n additions for labels (filters, sorts, markets, empty/search text) > - Comprehensive tests for components, utils, and view; console baseline updated > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e4edf37. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Implements searchable, filterable market list view for Perps with global search access from the home tab. New Page: /perps/market-list - Search across all markets (crypto + HIP-3 assets) with real-time filtering - Filter by market type: All, Crypto, Stocks & Commodities (with sub-filters) - Sort by: Volume, Price Change, Open Interest, Funding Rate - Search bypasses filters to match mobile behavior Architecture - Extracted business logic into composable hooks (usePerpsMarkets, usePerpsSearch, usePerpsSorting, usePerpsMarketListView) - Reusable Dropdown component with mobile-aligned styling (borderRadius: 8, muted background, opacity press state) - Volume parsing utility handles magnitude suffixes ($1.2B, $850M, $500K) Navigation - Added search icon to PerpsTabView header for global market search access - New route: PERPS_MARKET_LIST_ROUTE Technical Notes - Uses mock data; ready for PerpsController integration - Feature-flagged under perpsEnabledVersion - Mobile parity with metamask-mobile PR [#24456](MetaMask/metamask-mobile#24456) [](https://codespaces.new/MetaMask/metamask-extension/pull/39307?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Added searchable market list view for Perps with filtering and sorting capabilities ## **Related issues** Fixes: ## **Manual testing steps** Testing 1. Navigate to Perps tab → tap search icon 2. Verify search filters across all market types 3. Verify filter/sort dropdowns function correctly 4. Verify market row navigation to detail page ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a dedicated, feature-flagged markets list experience for Perps with search, filter, and sort, and integrates navigation from the Perps tab. > > - New `PERPS_MARKET_LIST_ROUTE` with lazy-loaded `MarketListView` and back navigation; updates `routes` and `ROUTES` > - Header search button in `PerpsTabView` navigates to market list > - Market list: search across all markets, filter (All/Crypto/Stocks with sub-filter), and sort (Volume/Price Change/Open Interest/Funding Rate) > - New reusable UI components: `Dropdown`, `FilterSelect`, `StockSubFilterSelect`, `SortDropdown`, `SearchInput`, `MarketRow`, `MarketRowSkeleton` > - Utilities/constants: `filterMarketsByQuery`, `sortMarkets` (with `parseVolume`), `PERPS_CONSTANTS`, `MARKET_SORTING_CONFIG` > - i18n additions for labels (filters, sorts, markets, empty/search text) > - Comprehensive tests for components, utils, and view; console baseline updated > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e4edf37. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Implements searchable, filterable market list view for Perps with global search access from the home tab. New Page: /perps/market-list - Search across all markets (crypto + HIP-3 assets) with real-time filtering - Filter by market type: All, Crypto, Stocks & Commodities (with sub-filters) - Sort by: Volume, Price Change, Open Interest, Funding Rate - Search bypasses filters to match mobile behavior Architecture - Extracted business logic into composable hooks (usePerpsMarkets, usePerpsSearch, usePerpsSorting, usePerpsMarketListView) - Reusable Dropdown component with mobile-aligned styling (borderRadius: 8, muted background, opacity press state) - Volume parsing utility handles magnitude suffixes ($1.2B, $850M, $500K) Navigation - Added search icon to PerpsTabView header for global market search access - New route: PERPS_MARKET_LIST_ROUTE Technical Notes - Uses mock data; ready for PerpsController integration - Feature-flagged under perpsEnabledVersion - Mobile parity with metamask-mobile PR [#24456](MetaMask/metamask-mobile#24456) [](https://codespaces.new/MetaMask/metamask-extension/pull/39307?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Added searchable market list view for Perps with filtering and sorting capabilities ## **Related issues** Fixes: ## **Manual testing steps** Testing 1. Navigate to Perps tab → tap search icon 2. Verify search filters across all market types 3. Verify filter/sort dropdowns function correctly 4. Verify market row navigation to detail page ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a dedicated, feature-flagged markets list experience for Perps with search, filter, and sort, and integrates navigation from the Perps tab. > > - New `PERPS_MARKET_LIST_ROUTE` with lazy-loaded `MarketListView` and back navigation; updates `routes` and `ROUTES` > - Header search button in `PerpsTabView` navigates to market list > - Market list: search across all markets, filter (All/Crypto/Stocks with sub-filter), and sort (Volume/Price Change/Open Interest/Funding Rate) > - New reusable UI components: `Dropdown`, `FilterSelect`, `StockSubFilterSelect`, `SortDropdown`, `SearchInput`, `MarketRow`, `MarketRowSkeleton` > - Utilities/constants: `filterMarketsByQuery`, `sortMarkets` (with `parseVolume`), `PERPS_CONSTANTS`, `MARKET_SORTING_CONFIG` > - i18n additions for labels (filters, sorts, markets, empty/search text) > - Comprehensive tests for components, utils, and view; console baseline updated > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e4edf37. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThis PR makes significant UI changes to the Perps (Perpetuals) trading feature:
The changes are isolated to the Perps feature and don't affect other wallet functionality. The SmokePerps tag covers E2E tests for Perps functionality including the Add Funds flow, balance verification, and Perps interface interactions. Running these tests will verify that the Perps feature still works correctly after the UI refactoring. No other tags are needed because:
|
|
|
Missing release label release-7.64.0 on PR. Adding release label release-7.64.0 on PR and removing other release labels(release-7.65.0), as PR was added to branch 7.64.0 when release was cut. |


Description
Refactors the Perps Market List view to replace the swipeable TabsBar component with a simpler dropdown-based market type filter. This improves UX by consolidating filtering into the existing filter bar rather than using separate horizontal tabs.
Changes
New Components:
Refactored:
Removed:
Behavior
Changelog
CHANGELOG entry: Refactor swipeable perps market list for filterable list
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2216
Manual testing steps
Screenshots/Recordings
Screen.Recording.2026-01-22.at.8.08.14.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Simplifies the Perps market list UX by removing swipeable tabs and consolidating filtering into the existing filter bar.
TabsBar/swipeableScrollViewand tab state; render a singlePerpsMarketListwith JS filteringPerpsMarketTypeDropdownandPerpsMarketTypeBottomSheet(All/Crypto/Stocks & Commodities) and integrated intoPerpsMarketFiltersBarstocks_and_commoditiesusePerpsMarketListViewto computemarketCounts, reset sub-filter on type change, and usesortMarketsdirectly for sortingperps.market_type.filter_by); extended HIP-3 commodity mappingsWritten by Cursor Bugbot for commit e47660a. This will update automatically on new commits. Configure here.