Commit 00bd71d
authored
fix(activity-redesign): populate Activity transaction-details fields in the redesign (#32191)
## **Description**
In the redesigned Activity screen, the transaction-details sheet left
**From/To** and **Amount / gas fee / total amount** blank.
The row-press handler passed a *stub* to `TransactionDetailsSheet` —
`transactionElement: { actionKey, value }` plus a `transactionDetails`
with empty from/to and no
`summaryAmount`/`summaryFee`/`summaryTotalAmount` — so the sheet had
nothing to render. The legacy list runs the tx through the shared
`decodeTransaction`, which produces all of those fields.
This change decodes the EVM transaction the same way before navigating,
and passes the real `transactionElement`/`transactionDetails`. Because
the unified list is multi-chain (can't `useSelector` per-tx-chain inside
a callback), the per-chain inputs — `ticker`, `conversionRate`,
`currencyRates`, `contractExchangeRates`, `primaryCurrency`,
`swapsTransactions`, `tokens` — are read from the redux store for that
tx's chain at press time. A `try/catch` falls back to the previous
minimal view if decoding ever throws. `normalizeTransaction` already
carries full `txParams` (incl. gas), so API-confirmed txs populate too.
## **Changelog**
CHANGELOG entry: null
<!-- Behind the Activity redesign feature flag; not yet user-facing. -->
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-933
## **Manual testing steps**
```gherkin
Feature: Activity transaction details
Scenario: EVM transaction details are fully populated
Given the Activity redesign is enabled
And I have a confirmed EVM transaction (e.g. Sent ETH)
When I tap the row to open its details
Then I see the From/To addresses and the Amount, gas fee, and total amount
```
## **Screenshots/Recordings**
### **Before**
Details sheet showed blank From/To and "No fee" / empty Amount and Total
amount.
https://github.com/user-attachments/assets/b6f8fde8-ef04-4c61-8d68-d2f7a1ade701
### **After**
From/To addresses and Amount / gas fee / total amount are populated.
https://github.com/user-attachments/assets/dd98a320-49ef-4cd3-a840-bd1eabd34a1e
## **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
- [ ] 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]
> **Low Risk**
> Localized Activity UI/navigation change behind the redesign; tests
cover race and error paths with no auth or payment impact.
>
> **Overview**
> Fixes blank **From/To** and **Amount / gas / total** on the redesigned
Activity transaction-details sheet by running each EVM row through the
shared **`decodeTransaction`** path (same as the legacy list) before
navigation, instead of passing stub `transactionElement` /
`transactionDetails`.
>
> Per-transaction chain data (`ticker`, conversion rates, tokens, swaps,
etc.) is read from the Redux **`store`** at press time so multi-chain
rows do not depend on a single hook chain. A **press token** ref ignores
stale async decode results so rapid taps do not open the wrong tx;
**`try/catch`** still navigates with the previous minimal payload if
decoding fails.
>
> **`ActivityList.test.tsx`** adds coverage for async navigation,
out-of-order decodes, and decode failure fallback.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
68f8d17. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent ffdaba8 commit 00bd71d
2 files changed
Lines changed: 198 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
58 | 63 | | |
59 | 64 | | |
60 | 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 | + | |
61 | 91 | | |
62 | 92 | | |
63 | 93 | | |
| |||
537 | 567 | | |
538 | 568 | | |
539 | 569 | | |
540 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
541 | 605 | | |
542 | 606 | | |
543 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
544 | 630 | | |
545 | | - | |
546 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
547 | 648 | | |
548 | | - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
549 | 653 | | |
550 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
551 | 658 | | |
552 | 659 | | |
553 | 660 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
34 | 48 | | |
35 | 49 | | |
36 | 50 | | |
| |||
579 | 593 | | |
580 | 594 | | |
581 | 595 | | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
582 | 602 | | |
583 | | - | |
| 603 | + | |
584 | 604 | | |
585 | 605 | | |
586 | 606 | | |
| 607 | + | |
| 608 | + | |
587 | 609 | | |
588 | 610 | | |
589 | 611 | | |
| |||
649 | 671 | | |
650 | 672 | | |
651 | 673 | | |
652 | | - | |
653 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
654 | 707 | | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
662 | 716 | | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
670 | 737 | | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
| 738 | + | |
| 739 | + | |
675 | 740 | | |
676 | 741 | | |
677 | 742 | | |
| |||
0 commit comments