Commit c64b1e4
feat: Hip3 Perps Home Screen (#21862)
## **Description**
Introduces new home screen + Hip-3 support UI. Initially broken out from
#21410 to make it easier
to iterate on, and isolate codeowners.
More complete technical detail in original ticket. This includes the
home page redesign with hip-3 support, along with [after hours
UX](#21901).
Figma designs:
https://www.figma.com/design/kdRiGFFmRrkbCJyKf4c4Re/Equity-perps-and-more?node-id=153-3116&p=f&t=AS2BitV7DlFSsEWX-0
## **Changelog**
CHANGELOG entry: Introduce new Perps Home screen UI
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
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**
https://github.com/user-attachments/assets/db35b6dd-ba76-4b95-bca1-f043bc71e27e
## **Pre-merge author checklist**
- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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]
> Implements a new Perps Home UI with search/sections and bulk actions,
overhauls Market List with tabs/sorting/filtering, adds HIP-3 2× fee
logic and market-hours UX, refactors close flows and hooks, and updates
routes, tests, and i18n.
>
> - **UI/Views**:
> - New `PerpsHomeView` with positions/orders carousels, watchlist,
navigation card, search bar, and bottom sheets for bulk actions.
> - Added `PerpsCloseSummary` shared component for close flows;
integrated into Close Position and Close All modals.
> - Added bulk action modals: `PerpsCloseAllPositionsModal` and
`PerpsCancelAllOrdersModal`.
> - **Market List Overhaul**:
> - New components: `PerpsMarketList`, `PerpsMarketListHeader`,
`PerpsMarketFiltersBar`, `PerpsMarketTypeSection`,
`PerpsStocksCommoditiesDropdown/BottomSheet`.
> - Tabs (All/Crypto/Stocks & Commodities), favorites filter, search,
and sort presets (volume, price change, funding, OI).
> - Filters zero-volume/fallback markets by default; optional inclusion
via flag.
> - **Fees/Providers**:
> - Add HIP-3 fee multiplier (2× base protocol rate) with `coin`
propagated through fee calculations.
> - Updated `HyperLiquidProvider` and controller/types; extended tests.
> - **Market Hours**:
> - `PerpsMarketHoursBanner` and tooltip with `marketHours` utils;
integrated into Market Details.
> - **Hooks**:
> - New hooks: `usePerpsHomeData`, `usePerpsMarketListView`,
`usePerpsSearch`, `usePerpsSorting`, `usePerpsCloseAllCalculations`,
`usePerpsCancelAllOrders`, `usePerpsCloseAllPositions`.
> - `usePerpsOrderForm`: prioritize leverage (route > existing position
> saved config > default) and sync on position load.
> - `usePerpsLiveFills` now returns `{fills,isInitialLoading}`.
> - **Navigation/Routes**:
> - Home view wired as main Perps screen; added modal routes for bulk
actions.
> - **Misc**:
> - Numerous tests for new components/hooks; style and i18n updates
(home labels, market-hours strings).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5e56909. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Arthur Breton <arthur.breton@consensys.net>
Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com>
Co-authored-by: Curtis David <Curtis.David7@gmail.com>
Co-authored-by: tommasini <46944231+tommasini@users.noreply.github.com>
Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
Co-authored-by: Borislav Grigorov <b.s.grigorov@gmail.com>
Co-authored-by: Nicholas Smith <nick.smith@consensys.net>1 parent 91c23b3 commit c64b1e4
File tree
140 files changed
+16531
-2073
lines changed- app/components/UI/Perps
- Views
- PerpsCancelAllOrdersView
- PerpsCloseAllPositionsView
- PerpsClosePositionView
- PerpsHomeView
- PerpsMarketDetailsView
- PerpsMarketListView
- components/PerpsMarketFiltersBar
- PerpsOrderView
- PerpsPositionsView
- PerpsTPSLView
- PerpsTabView
- components
- PerpsBottomSheetTooltip
- content
- PerpsCancelAllOrdersModal
- PerpsCard
- PerpsCloseAllPositionsModal
- PerpsCloseSummary
- PerpsHomeHeader
- PerpsHomeSection
- PerpsLeverage
- PerpsMarketHeader
- PerpsMarketHoursBanner
- PerpsMarketListHeader
- PerpsMarketList
- PerpsMarketRowItem
- PerpsMarketSortDropdowns
- PerpsMarketStatisticsCard
- PerpsMarketTabs
- PerpsMarketTypeSection
- PerpsOrderHeader
- PerpsRecentActivityList
- PerpsStocksCommoditiesBottomSheet
- PerpsStocksCommoditiesDropdown
- PerpsTokenLogo
- PerpsTransactionItem
- PerpsTutorialCard
- PerpsWatchlistMarkets
- constants
- controllers
- providers
- types
- hooks
- stream
- routes
- styles
- types
- utils
- e2e/selectors/Perps
- locales/languages
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
140 files changed
+16531
-2073
lines changedLines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 229 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
0 commit comments