Skip to content

Comments

chore: update NFT transaction labels#40350

Open
n3ps wants to merge 5 commits intomainfrom
n3ps/send-1155-label
Open

chore: update NFT transaction labels#40350
n3ps wants to merge 5 commits intomainfrom
n3ps/send-1155-label

Conversation

@n3ps
Copy link
Contributor

@n3ps n3ps commented Feb 23, 2026

Description

Update handling of mint/buy and send/receive NFT titles

Open in GitHub Codespaces

Changelog

CHANGELOG entry: chore: update NFT transaction labels

Related issues

Fixes: #40319 and #40321

Manual testing steps

  1. Go to the Activity tab of an account with NFT transactions

Screenshots/Recordings

Before

After

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

Medium Risk
Changes user-visible activity labeling logic based on valueTransfers, which could misclassify NFT transactions if transfer metadata is incomplete or varies across providers.

Overview
Adds new i18n strings nftBought and nftMinted, and updates useGetTitle to classify NFT-related TRANSFER and CONTRACT_CALL transactions as minted, bought, received, or sent by inspecting valueTransfers (including detecting mints via the zero address and purchases via a paired native payment).

Refactors and expands useGetTitle tests to cover these new NFT title cases (including missing valueTransfers, OpenSea-like purchases, gifts, and sender/receiver viewpoints), while keeping existing swap/bridge/approve title behavior covered.

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

@n3ps n3ps requested a review from a team as a code owner February 23, 2026 23:09
@n3ps n3ps added the team-core-extension-ux Core Extension UX team label Feb 23, 2026
@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.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 23, 2026

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/core-extension-ux (2 files, +363 -184)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 activity-v2/
          • 📄 hooks.test.tsx +292 -184
          • 📄 hooks.ts +71 -0

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 23, 2026

Builds ready [60aa3ac]
⚡ Performance Benchmarks (1453 ± 113 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28619305310
total28619305310
Confirm Txconfirm_tx6033860336045
total6033860336045
Bridge User Actionsbridge_load_page23738260291
bridge_load_asset_picker18145213240
bridge_search_token70818721737
total11255511881194
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup14531214186111314961677
load1219101614939512541405
domContentLoaded1211100514899412501386
domInteractive3118161242688
firstPaint202711436214222409
backgroundConnect21419531718216246
firstReactRender18124342025
initialActions104112
loadScripts101481412989410541186
setupStore1464561623
numNetworkReqs312297202385
Chrome Browserify Startup Power User HomeuiStartup17541328671866717092044
load1112983167813711091463
domContentLoaded1097978166913010951430
domInteractive3018138182952
firstPaint191681683216237319
backgroundConnect3422503934421290334
firstReactRender25156392744
initialActions104112
loadScripts89878614291288921235
setupStore1766892030
numNetworkReqs57221592459108
Chrome Webpack Startup Standard HomeuiStartup86668911481069291060
load7366091054100815897
domContentLoaded730606104799807891
domInteractive2915126242497
firstPaint1256092398138244
backgroundConnect28196093245
firstReactRender19134662130
initialActions104112
loadScripts727604104598805882
setupStore1263051321
numNetworkReqs312293192584
Chrome Webpack Startup Power User HomeuiStartup1218993171014612951507
load7156221092101708985
domContentLoaded7066131083102698980
domInteractive3218163243294
firstPaint1306734969150283
backgroundConnect17712832545199274
firstReactRender22173332328
initialActions103111
loadScripts7036121073100696972
setupStore1344571434
numNetworkReqs1063725650137197
Firefox Browserify Startup Standard HomeuiStartup15821370254320716032006
load13321154224217113671566
domContentLoaded13301149224217113661565
domInteractive71331923993138
firstPaint------
backgroundConnect61292533656111
firstReactRender13112521415
initialActions102012
loadScripts13061129221316813401540
setupStore207208301568
numNetworkReqs311999192584
Firefox Browserify Startup Power User HomeuiStartup26591934375533027843360
load15201232242422515492030
domContentLoaded15191231242422515492030
domInteractive1133445990109362
firstPaint------
backgroundConnect3201131276272324908
firstReactRender18146261822
initialActions113122
loadScripts14771208238221414781992
setupStore1409787191139627
numNetworkReqs62291833684141
Firefox Webpack Startup Standard HomeuiStartup17981455328931617902287
load15071244303125115231832
domContentLoaded15061244303125115211832
domInteractive113321619160131173
firstPaint------
backgroundConnect72273766074212
firstReactRender16122831724
initialActions102022
loadScripts14781222300024614911773
setupStore258163322089
numNetworkReqs3119105192884
Firefox Webpack Startup Power User HomeuiStartup27071913394442628323664
load15681265268027517242126
domContentLoaded15681265268027517242126
domInteractive12431695127125458
firstPaint------
backgroundConnect307721345272293899
firstReactRender21166362328
initialActions207122
loadScripts15251251262225516821912
setupStore1678742216291675
numNetworkReqs60271703680139
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2171217217
srpButtonToSrpForm8919090
confirmSrpToPwForm2102121
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1501515
doneButtonToHomeScreen58916599609
openAccountMenuToAccountListLoaded689721270067209
total794212580168129
Onboarding New WalletcreateWalletToSocialScreen2181218219
srpButtonToPwForm1071108108
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3613637
agreeButtonToOnboardingSuccess1711718
doneButtonToAssetList89629711321349
total128730215181755
Asset DetailsassetClickToPriceChart3733940
total3733940
Solana Asset DetailsassetClickToPriceChart4624750
total4624750
Import Srp HomeloginToHomeScreen20872621132113
openAccountMenuAfterLogin4424546
homeAfterImportWithNewWallet247713926192635
total459219247744869
Send TransactionsopenSendPageFromHome30103841
selectTokenToSendFormLoaded2202323
reviewTransactionToConfirmationPage8613862866
total9204925925
SwapopenSwapPageFromHome1341134136
fetchAndDisplaySwapQuotes45912045994618
total47131347174732
🌐 Dapp Page Load Benchmarks

Current Commit: 60aa3ac | Date: 2/23/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±38ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 734ms (±36ms) 🟢 | historical mean value: 737ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±9ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 38ms 1.02s 1.34s 1.08s 1.34s
domContentLoaded 734ms 36ms 709ms 1.01s 755ms 1.01s
firstPaint 79ms 9ms 64ms 156ms 88ms 156ms
firstContentfulPaint 79ms 9ms 64ms 156ms 88ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -45.05 KiB (-1.03%)
  • ui: 2.32 KiB (0.03%)
  • common: -46.22 KiB (-0.41%)

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

default:
break;
}
}
Copy link

Choose a reason for hiding this comment

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

Identical NFT classification switch blocks duplicated in two places

Low Severity

The classifyNft call and its associated switch statement (mapping classification to translated title) are copy-pasted verbatim in both the TRANSFER and CONTRACT_CALL branches. If a new NFT classification is added or a label changes, both sites need updating in lockstep — omitting one silently produces wrong titles. Extracting a small helper that maps the classifyNft result to a translated string would eliminate the risk.

Additional Locations (1)

Fix in Cursor Fix in Web

Triggered by project rule: BUGBOT Rules

@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 24, 2026

Builds ready [379bea7]
⚡ Performance Benchmarks (1379 ± 100 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29225289333
total29225289333
Confirm Txconfirm_tx6073760826082
total6073760826082
Bridge User Actionsbridge_load_page25221260283
bridge_load_asset_picker17328180212
bridge_search_token72723736767
total11492311391188
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup13791164165610014231550
load116897514109012131345
domContentLoaded116197214018912081325
domInteractive2717109182574
firstPaint1516544177209255
backgroundConnect20418824310208226
firstReactRender19123042125
initialActions106113
loadScripts97278912078810211144
setupStore1262751321
numNetworkReqs312293192583
Chrome Browserify Startup Power User HomeuiStartup16971349221615917552028
load11151006166614610991551
domContentLoaded11031000160014210881523
domInteractive3318164243596
firstPaint181731592161224298
backgroundConnect28624643031292340
firstReactRender26166493044
initialActions109112
loadScripts90079913921388801319
setupStore1775382031
numNetworkReqs58341562756139
Chrome Webpack Startup Standard HomeuiStartup84768712601048851024
load72361393892771893
domContentLoaded71760893391766887
domInteractive2715101202375
firstPaint12557854112152234
backgroundConnect27186792942
firstReactRender19113762233
initialActions104112
loadScripts71560592590764882
setupStore1154151218
numNetworkReqs312297202587
Chrome Webpack Startup Power User HomeuiStartup1226915182616712671619
load72363811691167091039
domContentLoaded71363111551166981011
domInteractive38191773233127
firstPaint141671171126147280
backgroundConnect18213332748204291
firstReactRender23173642530
initialActions102112
loadScripts71162811451146961003
setupStore1354971519
numNetworkReqs1054026449134201
Firefox Browserify Startup Standard HomeuiStartup16351422241318716502089
load13791193213114914121724
domContentLoaded13771188213114914091724
domInteractive79342724396147
firstPaint------
backgroundConnect62342263160121
firstReactRender13112121417
initialActions102012
loadScripts13491169209113913851577
setupStore198148231637
numNetworkReqs3119100212590
Firefox Browserify Startup Power User HomeuiStartup27152106452740827613477
load15821328235623416402120
domContentLoaded15821328235623416402119
domInteractive12439783116116386
firstPaint------
backgroundConnect226110866165216585
firstReactRender19146491928
initialActions203122
loadScripts15341302232921715672028
setupStore1499722203118637
numNetworkReqs59251513773141
Firefox Webpack Startup Standard HomeuiStartup17021390309427517282042
load14331235282622214561674
domContentLoaded14321235282622214551674
domInteractive99291436147128226
firstPaint------
backgroundConnect60262523365118
firstReactRender15122521518
initialActions102012
loadScripts14071218280821914351606
setupStore34614081401772
numNetworkReqs311994182781
Firefox Webpack Startup Power User HomeuiStartup26921970393846028053759
load16051324266031416542267
domContentLoaded16041323265931416532266
domInteractive13533779153111504
firstPaint------
backgroundConnect267121915185243813
firstReactRender21163042329
initialActions213123
loadScripts15611299262130315312208
setupStore1678743212196667
numNetworkReqs57241914845179
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2190219219
srpButtonToSrpForm9019192
confirmSrpToPwForm2102222
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1501616
doneButtonToHomeScreen99131712441309
openAccountMenuToAccountListLoaded710111572647264
total842838786978870
Onboarding New WalletcreateWalletToSocialScreen2211222222
srpButtonToPwForm1146119121
createPwToRecoveryScreen9099
skipBackupToMetricsScreen3713738
agreeButtonToOnboardingSuccess1711719
doneButtonToAssetList677138779837
total107414411771245
Asset DetailsassetClickToPriceChart57197286
total57197286
Solana Asset DetailsassetClickToPriceChart39114849
total39114849
Import Srp HomeloginToHomeScreen204713921482262
openAccountMenuAfterLogin3843943
homeAfterImportWithNewWallet241322826212746
total450322646624827
Send TransactionsopenSendPageFromHome34144153
selectTokenToSendFormLoaded2012022
reviewTransactionToConfirmationPage85712851878
total91522912951
SwapopenSwapPageFromHome1219132132
fetchAndDisplaySwapQuotes525580962386253
total537680163546360
🌐 Dapp Page Load Benchmarks

Current Commit: 379bea7 | Date: 2/24/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±43ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 743ms (±40ms) 🟢 | historical mean value: 731ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±9ms) 🟢 | historical mean value: 82ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 43ms 1.03s 1.35s 1.10s 1.35s
domContentLoaded 743ms 40ms 709ms 1.02s 769ms 1.02s
firstPaint 81ms 9ms 64ms 148ms 88ms 148ms
firstContentfulPaint 81ms 9ms 64ms 148ms 88ms 148ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -44.86 KiB (-1.02%)
  • ui: 1.27 KiB (0.02%)
  • common: -45.62 KiB (-0.41%)

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

Labels

size-L team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Activity - Send NFT ERC 1155 displayed as Contract interaction instead of Sent

1 participant