Skip to content

Conversation

@ccharly
Copy link
Contributor

@ccharly ccharly commented Nov 27, 2025

Description

The icon being used for each recipient addresses was not re-using their account group icons (we use the EVM address of a multichain account group as the seed of account's icons).

This PR fixes this while keeping the original recipient.address as a fallback (which should never happen anyway).

Changelog

CHANGELOG entry: Fix account's icons for send flows

Related issues

Fixes:

Manual testing steps

Feature: Send non-EVM token

  Scenario: user starts a send flow for Solana
    Given the user has funds

    When user selects the recipient address
    Then he should see the same icons than the one used for the account list

Screenshots/Recordings

Before

Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-11-27.at.13.25.36.mov
Screenshot 2025-11-27 at 13 28 36 Screenshot 2025-11-27 at 13 28 22

After

Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-11-27.at.13.14.06.mov
Screenshot 2025-11-27 at 13 29 52 Screenshot 2025-11-27 at 13 29 36

Pre-merge author checklist

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

Recipient avatars now derive from the account group’s icon seed (with address fallback), and useAccounts returns accountGroupId; tests updated accordingly.

  • UI (recipient):
    • Avatar accountAddress now sourced from account group icon seed via selectIconSeedAddressByAccountGroupId, with fallback to recipient.address.
    • RecipientType extended with accountGroupId; Redux selector added to compute avatar seed.
  • Hooks:
    • useAccounts now includes accountGroupId in returned recipient objects.
  • Tests:
    • Updated useAccounts.test.ts expectations to include accountGroupId across EVM, Solana, Bitcoin, and Tron cases.

Written by Cursor Bugbot for commit bcc1017. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-accounts-framework Accounts Framework team label Nov 27, 2025
@ccharly ccharly marked this pull request as ready for review November 27, 2025 12:32
@ccharly ccharly requested a review from a team as a code owner November 27, 2025 12:32
@OGPoyraz OGPoyraz self-requested a review November 27, 2025 14:12
@ccharly ccharly changed the title fix: fix recipient account icons fix: fix recipient account icons cp-7.60.0 Nov 27, 2025
@ccharly ccharly added skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. and removed skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. labels Nov 27, 2025
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmationsRedesigned, SmokeAccounts, SmokeWalletPlatform
  • Risk Level: medium
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

Analysis Summary

The PR adds accountGroupId field to recipient handling in the confirmations flow and uses it to determine the correct avatar seed address for multi-account scenarios.

Changed Files:

  1. useAccounts.ts: Modified hook to include accountGroupId in the returned RecipientType object
  2. recipient.tsx: Added logic to use selectIconSeedAddressByAccountGroupId selector to determine the proper avatar seed address based on account group, falling back to recipient address if needed
  3. useAccounts.test.ts: Updated test expectations to include the new accountGroupId field

Impact Analysis:

Direct Impact:

  • Confirmations Flow: The changes directly affect how recipients are displayed in the confirmations UI, specifically how avatars are rendered for different account types (EOA, Solana, Bitcoin, Tron accounts)
  • Account Management: The changes integrate with the account grouping system and multichain account handling via selectIconSeedAddressByAccountGroupId
  • Send Flow: The useAccounts hook is used in send recipient selection, affecting how accounts appear when selecting recipients

Technical Details:

  • The new selector selectIconSeedAddressByAccountGroupId prefers EVM account addresses for avatar display, falling back to the first account in a group
  • This is part of the multichain account improvements where account groups can contain multiple chain-specific accounts
  • The changes are defensive with try-catch and fallback to recipient address

Risk Assessment:

Medium Risk because:

  1. Changes affect critical user flow (confirmations/send transactions)
  2. Involves account display logic which could affect user experience
  3. Touches recipient selection UI component
  4. Integrates with multichain account system
  5. The hook is imported by 20+ files including various account and permission views

However, mitigating factors:

  • Changes are relatively contained and defensive (try-catch, fallbacks)
  • Only modifying display logic (avatar seed address), not transaction logic
  • Test updates show expected behavior is maintained
  • No changes to core transaction processing

Test Tag Selection Rationale:

  1. SmokeConfirmationsRedesigned (Primary): Direct changes to confirmation UI components and recipient display logic
  2. SmokeAccounts (Secondary): Changes affect account display and account grouping features, particularly multi-account scenarios
  3. SmokeWalletPlatform (Tertiary): The useAccounts hook is used across wallet platform features including account selector, account permissions, and account connections

View GitHub Actions results

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
37.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@ccharly ccharly added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit 0f7ac87 Nov 27, 2025
88 of 89 checks passed
@ccharly ccharly deleted the fix/recipient-account-icons branch November 27, 2025 17:01
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2025
@metamaskbot metamaskbot added the release-7.61.0 Issue or pull request that will be included in release 7.61.0 label Nov 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.61.0 Issue or pull request that will be included in release 7.61.0 size-S skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-accounts-framework Accounts Framework team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants