Skip to content

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Oct 15, 2025

Description

This PR aims to centralise seed account icon map in a hook and use it in send flow.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes: #36657

Manual testing steps

Account icon should be consistent as other parts of the wallet.

Screenshots/Recordings

Before

After

AccountIcons.mov

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

Introduces a hook to map account addresses to seed-icon addresses and integrates it across send flow to render consistent avatars, updating recipient types and tests.

  • Hooks:
    • Add useAccountAddressSeedIconMap to build a map of account addresses -> seed icon address from account groups.
    • Use in useAccountRecipients and useContactRecipients to attach seedIcon to each Recipient.
  • Components:
    • Recipient: pass recipient.seedIcon ?? address to PreferredAvatar.
    • RecipientInput: compute avatar seed address from the map and use it in PreferredAvatar when a recipient is resolved.
  • Types:
    • Extend Recipient with optional seedIcon.
  • Tests:
    • Add tests for useAccountAddressSeedIconMap.
    • Update/mocks in recipient-input.test.tsx, recipient.test.tsx, useAccountRecipients.test.ts, and useContactRecipients.test.ts to account for the new hook and seedIcon.

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

@OGPoyraz OGPoyraz requested a review from a team as a code owner October 15, 2025 05:27
@OGPoyraz OGPoyraz added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Oct 15, 2025
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Oct 15, 2025
cursor[bot]

This comment was marked as outdated.

@metamaskbot
Copy link
Collaborator

metamaskbot commented Oct 15, 2025

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (11 files, +252 -10)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 UI/
            • 📁 recipient/
              • 📄 recipient.test.tsx +6 -0
              • 📄 recipient.tsx +2 -2
          • 📁 send/
            • 📁 recipient-input/
              • 📄 recipient-input.test.tsx +5 -0
              • 📄 recipient-input.tsx +5 -1
        • 📁 hooks/
          • 📁 send/
            • 📄 useAccountAddressSeedIconMap.test.ts +173 -0
            • 📄 useAccountAddressSeedIconMap.ts +31 -0
            • 📄 useAccountRecipients.test.ts +5 -0
            • 📄 useAccountRecipients.ts +6 -0
            • 📄 useContactRecipients.test.ts +5 -0
            • 📄 useContactRecipients.ts +13 -7
            • 📄 useRecipients.ts +1 -0

cursor[bot]

This comment was marked as outdated.

@metamaskbot
Copy link
Collaborator

❌ test-e2e-chrome-api-specs failed. View the html report here.

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 83dcf90 | Date: 10/15/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±70ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 727ms (±68ms) 🟢 | historical mean value: 739ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±13ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 70ms 1.00s 1.32s 1.25s 1.32s
domContentLoaded 727ms 68ms 694ms 1.01s 934ms 1.01s
firstPaint 75ms 13ms 56ms 180ms 88ms 180ms
firstContentfulPaint 75ms 13ms 56ms 180ms 88ms 180ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [83dcf90]
UI Startup Metrics (1237 ± 59 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1237112315275912711329
load105995812184910961140
domContentLoaded105394812074910911131
domInteractive18145481840
firstPaint61875124342810781133
backgroundConnect2552412859260268
firstReactRender271876102850
getState13593101628
initialActions40305513
loadScripts80469895148841884
setupStore1063851018
WebpackHomeuiStartup802687112270816971
load62156898373625815
domContentLoaded61356397472618809
domInteractive15116381335
firstPaint20554909198192594
backgroundConnect20114662330
firstReactRender26164273133
getState842031014
initialActions207235
loadScripts61056196370615798
setupStore84232911
FirefoxBrowserifyHomeuiStartup14031213198513414631626
load1202105415439212671353
domContentLoaded1201105415439212671353
domInteractive1003327652104238
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2919113123244
firstReactRender29255043036
getState52405516
initialActions41417216
loadScripts1179103614418712441311
setupStore9410714629
WebpackHomeuiStartup15381330200212615751806
load1335118616348713741497
domContentLoaded1334118516348713731497
domInteractive95304135791242
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect311894123646
firstReactRender352682113671
getState9314822526
initialActions30386216
loadScripts1311117016008313461473
setupStore10424025735
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 1.6 KiB (0.02%)
  • common: 91 Bytes (0%)

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: fc4c816 | Date: 10/15/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±108ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 735ms (±128ms) 🟢 | historical mean value: 739ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 84ms (±98ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 108ms 1.00s 1.87s 1.30s 1.87s
domContentLoaded 735ms 128ms 695ms 1.83s 987ms 1.83s
firstPaint 84ms 98ms 60ms 1.05s 88ms 1.05s
firstContentfulPaint 84ms 98ms 60ms 1.05s 88ms 1.05s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [fc4c816]
UI Startup Metrics (1219 ± 70 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1219110014407012451372
load105295812376310771204
domContentLoaded104594712326310701198
domInteractive17135371638
firstPaint720135124942110751156
backgroundConnect2502372808253267
firstReactRender24194542432
getState1053451218
initialActions40425411
loadScripts80270699562829940
setupStore86152912
WebpackHomeuiStartup8327201106668461001
load63458594465642844
domContentLoaded62758093664634837
domInteractive15125481437
firstPaint18354871185180602
backgroundConnect21103862635
firstReactRender2817144143236
getState942541016
initialActions2016235
loadScripts62457892562632826
setupStore943131012
FirefoxBrowserifyHomeuiStartup1328116017008913641475
load1142101014096811851265
domContentLoaded1142101014096811841265
domInteractive953423837102197
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2719105123041
firstReactRender28238172939
getState5327358
initialActions2025324
loadScripts112199313156411611248
setupStore9419120628
WebpackHomeuiStartup15571379208814016051908
load1355120217279614141572
domContentLoaded1355120217279614141572
domInteractive962935351103185
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3118100153657
firstReactRender33267983542
getState9211416636
initialActions4013014212
loadScripts1331118716409213961546
setupStore12415322738
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 1.38 KiB (0.02%)
  • common: 10 Bytes (0%)

>
<Box alignItems={AlignItems.center} display={Display.Flex}>
<PreferredAvatar
address={resolvedAddress}
Copy link
Contributor

Choose a reason for hiding this comment

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

It is bit big piece of code inline.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

}, [accountGroupsWithAddresses]);

return { accountAddressSeedIconMap };
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we are creating this map for all accounts, can we optimise this for only the concerned account ?

Copy link
Member Author

Choose a reason for hiding this comment

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

The current map-based approach is already optimized for the actual usage patterns where we need seed icons for many/all addresses simultaneously. The only case where per-address lookup would be better is if we only had the single lookup in recipient-input.tsx, but since the other hooks process bulk addresses, the current design is more performant.

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 596eb60 | Date: 10/16/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±72ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 735ms (±71ms) 🟢 | historical mean value: 734ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±13ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 72ms 1.01s 1.35s 1.28s 1.35s
domContentLoaded 735ms 71ms 700ms 1.03s 961ms 1.03s
firstPaint 78ms 13ms 60ms 196ms 88ms 196ms
firstContentfulPaint 78ms 13ms 60ms 196ms 88ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [596eb60]
UI Startup Metrics (1272 ± 80 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1272114615248013371400
load109096212587811601237
domContentLoaded108293912537911541224
domInteractive18145881740
firstPaint68586125343610881200
backgroundConnect25623934014259281
firstReactRender2917192183045
getState1568591729
initialActions50284610
loadScripts834699100577906979
setupStore1063141219
WebpackHomeuiStartup837715125375850968
load637574109482640812
domContentLoaded629570108882630805
domInteractive15115181337
firstPaint17155857162162583
backgroundConnect21104472733
firstReactRender25165173134
getState941631114
initialActions3013246
loadScripts627568107780628803
setupStore951931213
FirefoxBrowserifyHomeuiStartup14431249194412814851715
load1208105914498112561342
domContentLoaded1207105914488112561342
domInteractive1053435558110271
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3322180183360
firstReactRender29254743140
getState1059811924
initialActions6122022413
loadScripts1187104214057812371320
setupStore12762111050
WebpackHomeuiStartup15531379206211115931793
load1328118716498413871500
domContentLoaded1328118616488413861499
domInteractive94323855698204
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect351994154068
firstReactRender32267463440
getState9413012814
initialActions41285313
loadScripts1306117216248113631458
setupStore166233261159
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.72 KiB (0.04%)
  • ui: 11.1 KiB (0.17%)
  • common: 12.63 KiB (0.15%)

@OGPoyraz OGPoyraz enabled auto-merge October 16, 2025 08:29
@OGPoyraz OGPoyraz requested a review from vinistevam October 16, 2025 08:29
@OGPoyraz OGPoyraz added this pull request to the merge queue Oct 16, 2025
Merged via the queue into main with commit 743b315 Oct 16, 2025
170 checks passed
@OGPoyraz OGPoyraz deleted the ogp/36657 branch October 16, 2025 09:39
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2025
@metamaskbot metamaskbot added the release-13.6.0 Issue or pull request that will be included in release 13.6.0 label Oct 16, 2025
@gauthierpetetin
Copy link
Contributor

Hi @OGPoyraz, is this PR user-facing? If yes, what would be the user-facing CHANGELOG entry? If not, can you please set CHANGELOG entry to "null"?

@OGPoyraz
Copy link
Member Author

Hey @gauthierpetetin, the feature is not yet released in the previous versions hence I didn't put any changelog on that.

@gauthierpetetin
Copy link
Contributor

ok thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-13.6.0 Issue or pull request that will be included in release 13.6.0 size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Maskicon is different for the same account in the send flow

6 participants