Commit 11db647
authored
chore: Aligned Transactions/Activity tab with the rest of trade lane (MetaMask#21236)
## **Description**
This PR updates the Activity/Transactions page UI to align with the
latest design system standards and improve consistency across the app.
**What is the reason for the change?**
The Activity page's filter buttons (used in Transfers and Perps tabs)
were using outdated styling and inconsistent component patterns. The
buttons didn't follow the current design system guidelines and used a
mix of StyleSheet-based styling and old component-library components.
**What is the improvement/solution?**
- Migrated Activity page to use MetaMask Design System React Native
(MMDS) components (`Box`, `Text`) instead of component-library
equivalents
- Updated all filter buttons (All/Purchased/Sold in Transfers tab, and
Trades/Orders/Funding in Perps tab) to use consistent styling:
- Height: 40px (previously 32px)
- Horizontal padding: 16px
- Border radius: 12px (previously 20px)
- Gap between buttons: 12px (previously 8px)
- Text: Body MD variant with Medium font weight
- Selected state: `bg-icon-default` background with `text-icon-inverse`
text
- Unselected state: `bg-background-muted` background with `text-default`
text
- Replaced `TouchableOpacity` with `Pressable` for better interaction
handling
- Converted styling to use Tailwind CSS via `useTailwind()` hook instead
of StyleSheet
- Improved accessibility with proper pressed states
## **Changelog**
CHANGELOG entry: Updated Activity page filter buttons to use design
system components with consistent styling
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: Updated Activity page filter buttons
Scenario: user views and interacts with Transfers filter buttons
Given user is on the Activity tab
When user taps on the "Transfers" tab
Then user should see "All", "Purchased", and "Sold" filter buttons
And filter buttons should have 40px height with rounded corners
And the "All" button should be selected by default with dark background
When user taps on "Purchased" button
Then "Purchased" button should become selected with dark background
And "All" button should become unselected with light background
Scenario: user views and interacts with Perps filter buttons
Given user is on the Activity tab
And Perps feature is enabled
When user taps on the "Perps" tab
Then user should see "Trades", "Orders", and "Funding" filter buttons
And filter buttons should have 40px height with rounded corners
And the "Trades" button should be selected by default
When user taps on "Orders" button
Then "Orders" button should become selected with dark background
And transactions list should update to show orders
Scenario: user views button pressed state
Given user is on any Activity tab with filter buttons
When user presses and holds a filter button
Then button should show a pressed state with reduced opacity
When user releases the button
Then button should return to its normal state
```
## **Screenshots/Recordings**
### **Before**
https://github.com/user-attachments/assets/ad772865-a079-40dd-a3bf-d9f5776c443e
### **After**
https://github.com/user-attachments/assets/87fb66ab-9611-4142-b568-a6d551e897a3
https://github.com/user-attachments/assets/0b110dae-1adc-47cf-92f3-865a7e8d1f37
## **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]
> Replaces Activity/Transactions UI with design-system Header/Tabs,
standardizes filter/tab styling and behavior, adds dynamic tab
management, and updates related styles, tests, and e2e selectors.
>
> - **ActivityView (major)**:
> - Replace legacy header/tab system with `HeaderBase` and `TabsList`;
use `Box` and Tailwind utilities.
> - Add dynamic tab ordering/visibility (Transactions, Orders, Perps,
Predict) with feature flags; expose `goToTabIndex`.
> - Move network filter button into Transactions tab and align styles.
> - **Tabs**:
> - Update `TabsList` to use `React.Children.toArray` + filter valid
elements; improve key/label extraction; add swipe navigation; expose
testIDs.
> - **Perps Transactions**:
> - Switch to design-system `Text` variants; Tailwind spacing for filter
bar; tweak paddings and section header; minor empty-state padding.
> - **Transactions/Multichain/Unified views**:
> - Normalize empty/loading containers (full-width, `paddingVertical:
40`, bg); simplify styles creation in Multichain view.
> - `TransactionElement`: restructure `ListItem` layout; wrap
import-time row in `View`; small style cleanups.
> - **Tests**:
> - Overhaul ActivityView tests to mock new `TabsList`, validate tab
presence/order and navigation; snapshot updates.
> - Update e2e selectors/page objects (add `activity-view-tabs` IDs;
swipe tabs bar; select tab by label).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5246c91. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 4eff695 commit 11db647
15 files changed
Lines changed: 748 additions & 1234 deletions
File tree
- app
- component-library/components-temp/Tabs/TabsList
- __snapshots__
- components
- UI
- Perps/Views/PerpsTransactionsView
- TransactionElement
- Transactions
- Views
- ActivityView
- __snapshots__
- Asset/__snapshots__
- MultichainTransactionsView
- UnifiedTransactionsView
- e2e
- pages/Transactions
- selectors/Transactions
Lines changed: 7 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 55 | + | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
| |||
Lines changed: 0 additions & 103 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 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 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | 149 | | |
253 | 150 | | |
254 | 151 | | |
| |||
Lines changed: 6 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 11 | | |
| 12 | + | |
15 | 13 | | |
16 | | - | |
17 | 14 | | |
18 | 15 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 16 | | |
33 | 17 | | |
34 | 18 | | |
35 | 19 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 20 | | |
47 | 21 | | |
48 | 22 | | |
49 | 23 | | |
50 | 24 | | |
51 | | - | |
| 25 | + | |
52 | 26 | | |
53 | 27 | | |
54 | 28 | | |
| |||
104 | 78 | | |
105 | 79 | | |
106 | 80 | | |
107 | | - | |
| 81 | + | |
108 | 82 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
113 | 86 | | |
114 | 87 | | |
115 | 88 | | |
Lines changed: 17 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
266 | 270 | | |
267 | 271 | | |
268 | 272 | | |
269 | | - | |
| 273 | + | |
270 | 274 | | |
271 | 275 | | |
272 | 276 | | |
| |||
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
288 | | - | |
| 292 | + | |
289 | 293 | | |
290 | 294 | | |
291 | 295 | | |
| |||
294 | 298 | | |
295 | 299 | | |
296 | 300 | | |
297 | | - | |
| 301 | + | |
298 | 302 | | |
299 | 303 | | |
300 | 304 | | |
| |||
314 | 318 | | |
315 | 319 | | |
316 | 320 | | |
317 | | - | |
| 321 | + | |
318 | 322 | | |
319 | 323 | | |
320 | 324 | | |
| |||
382 | 386 | | |
383 | 387 | | |
384 | 388 | | |
385 | | - | |
| 389 | + | |
386 | 390 | | |
387 | 391 | | |
388 | 392 | | |
| |||
392 | 396 | | |
393 | 397 | | |
394 | 398 | | |
395 | | - | |
| 399 | + | |
396 | 400 | | |
397 | 401 | | |
398 | 402 | | |
| |||
406 | 410 | | |
407 | 411 | | |
408 | 412 | | |
409 | | - | |
| 413 | + | |
410 | 414 | | |
411 | 415 | | |
412 | 416 | | |
| |||
417 | 421 | | |
418 | 422 | | |
419 | 423 | | |
420 | | - | |
| 424 | + | |
421 | 425 | | |
422 | 426 | | |
423 | 427 | | |
| |||
0 commit comments