Skip to content

Conversation

@gambinish
Copy link
Contributor

@gambinish gambinish commented Jan 12, 2026

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:

  • PerpsMarketTypeDropdown - Dropdown button that shows current market type selection
  • PerpsMarketTypeBottomSheet - Bottom sheet for selecting market type (All, Crypto, Stocks & Commodities)

Refactored:

  • PerpsMarketListView - Removed TabsBar, ScrollView, and tab-related state/logic. Replaced with conditional market type dropdown
  • PerpsMarketFiltersBar - Updated to accept and render the new market type dropdown
  • usePerpsMarketListView hook - Added logic to show dropdown only when multiple market types exist

Removed:

  • Swipeable tab navigation between market types
  • Tab scrolling logic and programmatic scroll refs
  • Container width state management for tabs

Behavior

  • Market type dropdown only appears when both crypto AND stocks/commodities markets exist
  • When only crypto markets are available, the dropdown is hidden
  • Maintains backwards compatibility with existing filter functionality

Changelog

CHANGELOG entry: Refactor swipeable perps market list for filterable list

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2216

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

Screen.Recording.2026-01-22.at.8.08.14.AM.mov

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

Simplifies the Perps market list UX by removing swipeable tabs and consolidating filtering into the existing filter bar.

  • Removed TabsBar/swipeable ScrollView and tab state; render a single PerpsMarketList with JS filtering
  • Added PerpsMarketTypeDropdown and PerpsMarketTypeBottomSheet (All/Crypto/Stocks & Commodities) and integrated into PerpsMarketFiltersBar
  • Show market-type dropdown only when multiple market types exist; show stocks/commodities sub-filter only under stocks_and_commodities
  • Updated usePerpsMarketListView to compute marketCounts, reset sub-filter on type change, and use sortMarkets directly for sorting
  • Adjusted styles and i18n (added perps.market_type.filter_by); extended HIP-3 commodity mappings
  • Comprehensive tests added/updated for list view, filters bar, dropdowns, bottom sheet, and hook behavior

Written by Cursor Bugbot for commit e47660a. This will update automatically on new commits. Configure here.

@github-actions
Copy link
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.

@github-actions github-actions bot added size-XL and removed size-L labels Jan 22, 2026
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Jan 22, 2026
<!--
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)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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 -->
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Jan 22, 2026
<!--
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)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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 -->
@github-project-automation github-project-automation bot moved this to Needs dev review in PR review queue Jan 22, 2026
@gambinish gambinish marked this pull request as ready for review January 22, 2026 17:31
@gambinish gambinish requested a review from a team as a code owner January 22, 2026 17:31
@github-project-automation github-project-automation bot moved this to Needs dev review in PR review queue Jan 22, 2026
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Jan 22, 2026
<!--
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)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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 -->
@gambinish gambinish added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jan 22, 2026
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

This PR makes significant UI changes to the Perps (Perpetuals) trading feature:

  1. Major UI Refactoring: Replaces the horizontal swipeable TabsBar (All, Crypto, Stocks & Commodities tabs) with a dropdown-based filter system using a new PerpsMarketTypeBottomSheet and PerpsMarketTypeDropdown components.

  2. New Components:

    • PerpsMarketTypeBottomSheet - Bottom sheet for market type filter selection
    • PerpsMarketTypeDropdown - Dropdown button to trigger the bottom sheet
  3. Modified Components:

    • PerpsMarketListView - Major refactoring removing TabsBar, ScrollView-based tab content, and swipe handling
    • PerpsMarketFiltersBar - Updated to include the new market type dropdown
    • usePerpsMarketListView hook - Updated sorting logic with useMemo for better performance
  4. Configuration Updates: Added new commodity market types (SILVER, CL, COPPER) to hyperLiquidConfig.ts

  5. Localization: Added new string "Filter by" for the market type bottom sheet header

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:

  • Changes don't affect core wallet functionality (SmokeWalletPlatform)
  • Changes don't affect trading/swap flows (SmokeTrade)
  • Changes don't affect confirmations (SmokeConfirmationsRedesigned)
  • Changes don't affect network management (SmokeNetworkAbstractions)
  • Changes are purely within the Perps UI components

View GitHub Actions results

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
18.3% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube Cloud

@github-project-automation github-project-automation bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Jan 23, 2026
@aganglada aganglada added this pull request to the merge queue Jan 23, 2026
@aganglada aganglada removed this pull request from the merge queue due to a manual request Jan 23, 2026
@gambinish gambinish added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit dfb0881 Jan 23, 2026
81 of 83 checks passed
@gambinish gambinish deleted the perps/remove-swipeable-tab-view branch January 23, 2026 20:27
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
@metamaskbot metamaskbot added the release-7.65.0 Issue or pull request that will be included in release 7.65.0 label Jan 23, 2026
@metamaskbot metamaskbot added release-7.64.0 Issue or pull request that will be included in release 7.64.0 and removed release-7.65.0 Issue or pull request that will be included in release 7.65.0 labels Feb 3, 2026
@metamaskbot
Copy link
Collaborator

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.64.0 Issue or pull request that will be included in release 7.64.0 size-XL skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-perps Perps team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants