Skip to content

fix(activity): align EVM activity with account group and network filter cp-7.77.0#29983

Merged
wachunei merged 3 commits into
mainfrom
fix/activity-multichain-network-filter
May 11, 2026
Merged

fix(activity): align EVM activity with account group and network filter cp-7.77.0#29983
wachunei merged 3 commits into
mainfrom
fix/activity-multichain-network-filter

Conversation

@wachunei

@wachunei wachunei commented May 11, 2026

Copy link
Copy Markdown
Member

Description

Activity’s unified transaction list used the globally selected account for the Accounts API infinite query (selectEvmAddress). When a non-EVM account stayed selected (e.g. Bitcoin) but the network filter returned to all popular networks, the query had no EVM address and stayed disabled, so the UI showed only non-EVM rows.

This PR resolves the query to the selected account group’s EVM internal account when present, falling back to the global EVM address otherwise. It also filters confirmed and pending EVM rows to the currently enabled EVM chain IDs so the list matches the Activity network filter (including single-chain vs multi-chain). ConfirmedEvm rows use the same group EVM selectedAddress as pending EVM rows for consistent decode/display with multichain selection.

This builds on the earlier Activity fixes in #29794 (TransactionElement / token map); this branch carries the remaining UnifiedTransactionsView and useTransactionsQuery alignment.

Changelog

CHANGELOG entry: Fixed Activity transaction list not showing EVM history after switching back from a non-EVM network filter to all popular networks, and tightened EVM rows to the enabled network filter.

Related issues

Fixes #29952
Refs: #28035

Manual testing steps

Feature: Activity unified transactions and network filter

  Scenario: EVM history returns when non-EVM account is selected and filter is all popular networks
    Given the user has an account group with both EVM and non-EVM accounts
    And the globally selected account is non-EVM (e.g. Bitcoin)

    When the user opens Activity then sets the network filter to all popular networks

    Then EVM and non-EVM transactions appear in the unified list as expected

  Scenario: Single EVM chain filter only shows that chain
    Given Activity Transactions is open with multiple EVM networks available

    When the user sets the filter to one EVM chain (e.g. Linea) then to another (e.g. Ethereum)

    Then the list updates to transactions for the selected chain only

  Scenario: Pending EVM rows respect enabled chains
    Given the user has a submitted EVM transaction on one chain

    When the user filters Activity to a different single EVM chain

    Then pending rows for other chains do not appear at the top of the list

Screenshots/Recordings

Before

After

fix_activity_filtering.mp4

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Medium Risk
Changes how Activity selects the EVM account/address for history queries and tightens EVM pending/confirmed filtering by enabled chain IDs, which can affect transaction visibility in the main Activity list.

Overview
Fixes unified Activity EVM history loading by resolving the Accounts API query address from the selected account group’s EVM internal account (falling back to the global selectEvmAddress), so EVM activity still loads when a non-EVM account is selected.

Aligns the unified list with the network filter by filtering both confirmed (API) and pending (local) EVM transactions to the currently enabled EVM chain IDs (including guarding against stale paged results), and ensures confirmed EVM rows pass the same group-based selectedAddress into TransactionElement as pending rows.

Adds targeted tests covering EVM chain-filter behavior for pending/confirmed rows and the new address-selection precedence rules in useTransactionsQuery.

Reviewed by Cursor Bugbot for commit 67fb3e1. Bugbot is set up for automated code reviews on this repo. Configure here.

- Load Accounts API history using group EVM account when global selection is non-EVM

- Filter confirmed and pending EVM rows to enabled EVM chain IDs

- Align ConfirmedEvm TransactionElement selectedAddress with group EVM address

Refs: #29952

Refs: #28035
@wachunei wachunei self-assigned this May 11, 2026
@metamaskbotv2 metamaskbotv2 Bot added the team-money-movement issues related to Money Movement features label May 11, 2026
@github-actions github-actions Bot added pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. size-S labels May 11, 2026
@wachunei wachunei removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 11, 2026
@wachunei wachunei marked this pull request as ready for review May 11, 2026 14:31
@wachunei wachunei requested a review from a team as a code owner May 11, 2026 14:31
@wachunei wachunei changed the title fix(activity): align EVM activity with account group and network filter fix(activity): align EVM activity with account group and network filter cp-7.77.0 May 11, 2026
@wachunei wachunei added team-mobile-ux Mobile UX team and removed team-money-movement issues related to Money Movement features labels May 11, 2026
vinnyhoward
vinnyhoward previously approved these changes May 11, 2026
- Assert useTransactionsQuery prefers group EVM address when global is also set
- Cover allConfirmedForEnabledChains and pending filter with network enablement states
vinnyhoward
vinnyhoward previously approved these changes May 11, 2026
- Wire AccountsController so selectLocalTransactions yields pending txs under test
- Cover empty enabled EVM set, missing chainId, and group EVM empty-string edge case
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform, SmokeNetworkExpansion, SmokeNetworkAbstractions
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are focused on the UnifiedTransactionsView component and its useTransactionsQuery hook:

  1. Transaction history filtering by enabled EVM chains: New allConfirmedForEnabledChains memo filters confirmed transactions to only show those on currently enabled EVM chains. Similarly, pending/submitted transactions are now filtered by enabled chains. This directly affects the transaction history display in SmokeWalletPlatform.

  2. Multi-chain account group EVM address resolution: useTransactionsQuery now uses selectSelectedAccountGroupEvmInternalAccount to resolve the EVM address for the account group. This ensures EVM transaction history loads correctly when a non-EVM account (e.g., Bitcoin) is selected — directly relevant to SmokeNetworkExpansion (non-EVM blockchain support).

  3. selectedAddress fix: The selectedAddress prop for transaction elements now prefers selectedAccountGroupEvmAddress over selectedInternalAccount?.address, ensuring correct address display in multi-chain account group scenarios.

Tag justifications:

  • SmokeWalletPlatform: Transaction history display is a core feature tested here (incoming/outgoing ETH transactions, token transfer details). The filtering changes directly affect what transactions appear in the activity view.
  • SmokeNetworkExpansion: The account group EVM address resolution is specifically for non-EVM account scenarios (e.g., Bitcoin selected), which is the multi-chain/non-EVM expansion feature. The enabled chain filtering also affects multi-chain scenarios.
  • SmokeNetworkAbstractions: The enabled EVM chain filtering uses enabledEVMChainIds from the NetworkEnablementController, which is managed by the network abstraction layer. Changes to which networks are enabled directly affect what transactions are shown.

No performance tests are needed as the changes are lightweight memo computations on transaction lists with no significant rendering or data loading impact.

Performance Test Selection:
The changes add lightweight useMemo computations for filtering transaction lists by enabled chains. These are simple Set lookups and array filters that do not introduce meaningful performance overhead. No performance test tags are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@vinnyhoward vinnyhoward left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM

@wachunei wachunei enabled auto-merge May 11, 2026 16:29
@wachunei wachunei added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit 664cf53 May 11, 2026
100 checks passed
@wachunei wachunei deleted the fix/activity-multichain-network-filter branch May 11, 2026 16:56
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-M team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Activity list & network switching Issues

2 participants