-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: cp-13.5.0 Fix account icons in send flow #36877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (11 files, +252 -10)
|
❌ test-e2e-chrome-api-specs failed. View the html report here. |
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [83dcf90]
UI Startup Metrics (1237 ± 59 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [fc4c816]
UI Startup Metrics (1219 ± 70 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
> | ||
<Box alignItems={AlignItems.center} display={Display.Flex}> | ||
<PreferredAvatar | ||
address={resolvedAddress} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
}, [accountGroupsWithAddresses]); | ||
|
||
return { accountAddressSeedIconMap }; | ||
}; |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [596eb60]
UI Startup Metrics (1272 ± 80 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
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"? |
Hey @gauthierpetetin, the feature is not yet released in the previous versions hence I didn't put any changelog on that. |
ok thanks |
Description
This PR aims to centralise seed account icon map in a hook and use it in send flow.
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
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.
useAccountAddressSeedIconMap
to build a map of account addresses -> seed icon address from account groups.useAccountRecipients
anduseContactRecipients
to attachseedIcon
to eachRecipient
.Recipient
: passrecipient.seedIcon ?? address
toPreferredAvatar
.RecipientInput
: compute avatar seed address from the map and use it inPreferredAvatar
when a recipient is resolved.Recipient
with optionalseedIcon
.useAccountAddressSeedIconMap
.recipient-input.test.tsx
,recipient.test.tsx
,useAccountRecipients.test.ts
, anduseContactRecipients.test.ts
to account for the new hook andseedIcon
.Written by Cursor Bugbot for commit 596eb60. This will update automatically on new commits. Configure here.