Commit 5da5788
fix: Recent activity fields display orders and funding payments (#41446)
## **Description**
The perps home tab Recent Activity section was displaying order and
funding
payment entries alongside trade executions and deposits. Only trades,
deposits, and withdrawals should appear there — open orders are already
shown
in the Positions/Orders section above, and funding payments belong on
the full
activity page.
Root cause: `perps-view.tsx` passed the unfiltered result of
`usePerpsTransactionHistory()` directly to `<PerpsRecentActivity>`. The
hook
returns all transaction types (`trade`, `order`, `funding`, `deposit`,
`withdrawal`). Added a `useMemo` filter to keep only `trade`, `deposit`,
and
`withdrawal` before rendering.
## **Changelog**
CHANGELOG entry: Fixed a bug causing order and funding transactions to
appear in the perps Recent Activity section
## **Related issues**
Fixes: TAT-2793
## **Manual testing steps**
1. Enable perps (`PERPS_ENABLED=true` in `.metamaskrc` +
`perpsEnabledVersion` remote flag)
2. Open the extension and navigate to the Perps tab
3. Scroll down to the Recent Activity section
4. Confirm only trade executions, deposits, and withdrawals appear (no
"Order" or "Funding" entries)
5. Navigate to the full activity page and confirm funding/order entries
still appear there
## **Screenshots/Recordings**
### **Before**
Recording: `before.mp4` (recipe run against unfixed code — wallet has no
live data so empty-state path taken)
### **After**
Recording: `after.mp4` — recipe validates no `transaction-card-order-*`
or `transaction-card-funding-*` elements appear in
`[data-testid="perps-recent-activity"]`. All 7 recipe nodes PASS.
## **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]
> **Low Risk**
> Low risk UI logic change that only filters which transaction types are
shown in the Perps home Recent Activity list; minimal surface area and
covered by a new unit test.
>
> **Overview**
> Fixes the Perps home **Recent Activity** list to exclude `order` and
`funding` entries by filtering the `usePerpsTransactionHistory()`
results to only `trade`, `deposit`, and `withdrawal` before rendering.
>
> Adds a regression test in `perps-view.test.tsx` asserting that
trade/deposit cards render while funding/order cards do not appear.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3277fc7. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Nick Gambino <nicholas.gambino@consensys.net>
Co-authored-by: Howard Braham <howrad@gmail.com>1 parent dd15b92 commit 5da5788
2 files changed
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 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 | + | |
206 | 231 | | |
207 | 232 | | |
208 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
76 | 90 | | |
77 | 91 | | |
78 | 92 | | |
| |||
0 commit comments