Skip to content

fix: Display "🦊 Smart contract" in "interacting with" row for batch transaction confirmations #31507

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

Merged
merged 12 commits into from
Apr 10, 2025

Conversation

vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Apr 2, 2025

Description

This PR aims to hide the interacting with row when the transaction is a batch transaction.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/4504

Manual testing steps

  1. On v12.15, kickoff a 5792 send call for the first time
  2. Notice the Interacting with row with your own account as the value

Screenshots/Recordings

image

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.

@vinistevam vinistevam added the team-confirmations Push issues to confirmations team label Apr 2, 2025
Copy link
Contributor

github-actions bot commented Apr 2, 2025

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
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

✅ @MetaMask/confirmations

  • ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.test.tsx
  • ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.tsx

@vinistevam vinistevam marked this pull request as ready for review April 2, 2025 09:09
@vinistevam vinistevam requested a review from a team as a code owner April 2, 2025 09:09
@metamaskbot
Copy link
Collaborator

Builds ready [6ba7186]
UI Startup Metrics (1243 ± 63 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1243110914206312841351
load10849561240611165994
domContentLoaded10789521236611152987
domInteractive17143441729
firstPaint7701361262418241986
backgroundConnect12715815910
firstReactRender20134252033
getState11430678
initialActions001001
loadScripts857743101261901956
setupStore8526379
WebpackHomeuiStartup21471701275323622732573
load16751326213419018011984
domContentLoaded16681322210118717961967
domInteractive181270131455
firstPaint195724167225075
backgroundConnect3014234263073
firstReactRender181583581138495
getState9329489
initialActions316134
loadScripts16591319207518417931941
setupStore39628973259
FirefoxBrowserifyHomeuiStartup13701212196915014031703
load12311064181414112701541
domContentLoaded12311064181414112701540
domInteractive9540203288795
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23167282434
firstReactRender22193532430
getState8361878
initialActions001001
loadScripts12091048179113912511515
setupStore6422367
WebpackHomeuiStartup15711348209915916311951
load13631180189515214311747
domContentLoaded13621180189515214311747
domInteractive10762179248898
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2617133142645
firstReactRender34285253545
getState8427479
initialActions102111
loadScripts13391160187314914051729
setupStore8548579
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 172 Bytes (0%)
  • common: 0 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [a2ba28d]
UI Startup Metrics (1182 ± 65 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1182106014076512161309
load1034944121261949993
domContentLoaded1028936120361950996
domInteractive16134251629
firstPaint8091331212375251995
backgroundConnect96283910
firstReactRender20155071935
getState11526678
initialActions001000
loadScripts81872898260855944
setupStore7419378
WebpackHomeuiStartup21221680264823822622566
load16481306213718617572015
domContentLoaded16411303213218317541982
domInteractive171270121454
firstPaint187744106124778
backgroundConnect3111276302878
firstReactRender189623431158597
getState8321489
initialActions315134
loadScripts16301300200317417501929
setupStore39628675218
FirefoxBrowserifyHomeuiStartup13661141194915213871760
load12291029179614512561589
domContentLoaded12291028179614512561589
domInteractive10039198308797
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2416111122446
firstReactRender221811092226
getState7439578
initialActions001001
loadScripts12061013177514212401563
setupStore6314267
WebpackHomeuiStartup15791374206415116191981
load13601182182114313881731
domContentLoaded13601182182114313881730
domInteractive9961222239096
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect27175162842
firstReactRender37296064052
getState9337689
initialActions002111
loadScripts13361163180114213651697
setupStore9537489
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 172 Bytes (0%)
  • common: 0 Bytes (0%)

@@ -53,13 +56,16 @@ export const RecipientRow = ({ recipient }: { recipient?: Hex } = {}) => {
const t = useI18nContext();
const { currentConfirmation } = useConfirmContext<TransactionMeta>();
const to = recipient ?? currentConfirmation?.txParams?.to;
const isBatchTransaction =
Copy link
Member

Choose a reason for hiding this comment

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

Rather than relying on the type, as we may add more batch types in future, should we instead rely on checking the length of nestedTransactions in TransactionMeta?

As that's what triggers the nested transaction data component, plus the metrics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perfect, changed to check the length of the nestedTransactions.


if (!to || !isValidAddress(to)) {
if (!to || !isValidAddress(to) || isBatchTransaction) {
Copy link
Member

Choose a reason for hiding this comment

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

Should we be future-proof and also check if to is equal to from?

Just in case we send batch transactions elsewhere in future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I pushed a fix to check if to is equal to from as well.

@metamaskbot
Copy link
Collaborator

Builds ready [80b4e52]
UI Startup Metrics (1240 ± 59 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1240113613985912771347
load10789741224611185991
domContentLoaded10729701219601177987
domInteractive17143751631
firstPaint8081511201410210990
backgroundConnect107657910
firstReactRender19165552029
getState12438769
initialActions001001
loadScripts854750100461881960
setupStore8528479
WebpackHomeuiStartup20341590257324322152480
load15911274207219217241915
domContentLoaded15851271206819017171912
domInteractive171258111351
firstPaint198646098326683
backgroundConnect261480162772
firstReactRender169543401098593
getState8320379
initialActions512622634
loadScripts15771267206518817061893
setupStore286292592489
FirefoxBrowserifyHomeuiStartup14161193204517614711861
load12691079186516513271673
domContentLoaded12681079186516513271672
domInteractive10343228288698
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25178692746
firstReactRender24195652531
getState7436478
initialActions001001
loadScripts12451040184216513041645
setupStore6417267
WebpackHomeuiStartup15481331215318116032003
load13351152189516813741762
domContentLoaded13351152189516813741761
domInteractive9840191278898
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25185062742
firstReactRender35285053645
getState8431589
initialActions002111
loadScripts13121131186416713491733
setupStore7516189
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 141 Bytes (0%)
  • common: 0 Bytes (0%)

@vinistevam vinistevam force-pushed the fix/hide-recipient-row-tx-batch-type branch from 80b4e52 to 16920ca Compare April 2, 2025 13:28
@metamaskbot
Copy link
Collaborator

Builds ready [16920ca]
UI Startup Metrics (1211 ± 63 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1211106614756312441322
load10569441280591151983
domContentLoaded10509401275581181985
domInteractive16133551628
firstPaint7341291280419229965
backgroundConnect97273910
firstReactRender18143031923
getState12436768
initialActions001001
loadScripts832729102556859930
setupStore8534379
WebpackHomeuiStartup21101659264825522772574
load16481308205419917752007
domContentLoaded16401304202219417711975
domInteractive171270131453
firstPaint199676058225092
backgroundConnect3314340412978
firstReactRender172563481149098
getState1242632689
initialActions215134
loadScripts16321301199619017601950
setupStore34626865228
FirefoxBrowserifyHomeuiStartup13481158191814114041698
load12151040175213412531524
domContentLoaded12151040175213412531524
domInteractive9839189259096
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect22164552532
firstReactRender22185252430
getState6418278
initialActions001001
loadScripts11941025172213212281492
setupStore6423357
WebpackHomeuiStartup15641362223517016231994
load13491168200816313771772
domContentLoaded13491168200816313771772
domInteractive9943159229195
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25185462634
firstReactRender35295453744
getState9459779
initialActions002111
loadScripts13271143198916313571748
setupStore8528479
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 351 Bytes (0.01%)
  • ui: 115 Bytes (0%)
  • common: 0 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [8e7b08c]
UI Startup Metrics (1229 ± 68 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1229108615286812681358
load10809631369641140990
domContentLoaded10759481362641148993
domInteractive17136881628
firstPaint763771243429240957
backgroundConnect96313910
firstReactRender20155972038
getState12429769
initialActions001001
loadScripts825712110861862916
setupStore8525379
WebpackHomeuiStartup21241701263219022432398
load16511327204414417551854
domContentLoaded16451320201414317501850
domInteractive171273121448
firstPaint170684286623279
backgroundConnect271188143160
firstReactRender167533531076496
getState1233002979
initialActions315134
loadScripts16371316198814217421843
setupStore456302812837
FirefoxBrowserifyHomeuiStartup14021205202216314271784
load12541080186615812851621
domContentLoaded12531079186515812851620
domInteractive10040195279198
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2617120132545
firstReactRender24205762433
getState7414278
initialActions002001
loadScripts12291062176515212661575
setupStore7438467
WebpackHomeuiStartup15171334226816515821932
load13121156206515213571692
domContentLoaded13121155206515213571691
domInteractive9238185279197
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect24184862542
firstReactRender35287463746
getState7433479
initialActions001011
loadScripts12901137204615113361648
setupStore7529378
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 115 Bytes (0%)
  • common: 0 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [fa8583a]
UI Startup Metrics (1267 ± 73 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1267110314087313201389
load11139501262761179962
domContentLoaded11079361255761183987
domInteractive17135851727
firstPaint855871256419176942
backgroundConnect10630399
firstReactRender21155372234
getState11445768
initialActions001001
loadScripts852687100873904963
setupStore8431378
WebpackHomeuiStartup20771670256219922102346
load16111301198415217201825
domContentLoaded16051297195315117171820
domInteractive171259111453
firstPaint155673705926792
backgroundConnect3311347413063
firstReactRender163533781057992
getState9319389
initialActions315134
loadScripts15971289192814917121808
setupStore406296772908
FirefoxBrowserifyHomeuiStartup14181225200915614701806
load12701094182214813181641
domContentLoaded12701094182214813181640
domInteractive9839178268697
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2616129132536
firstReactRender23205142430
getState7415279
initialActions001001
loadScripts12451072179914612631608
setupStore6414268
WebpackHomeuiStartup15911398215516716572005
load13741202194816314231783
domContentLoaded13741202194716314231782
domInteractive10043185249198
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect24184762639
firstReactRender37295553947
getState8433679
initialActions102111
loadScripts13511184192516314001756
setupStore8527489
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 115 Bytes (0%)
  • common: 0 Bytes (0%)

@vinistevam vinistevam changed the title fix: Hide "interacting with" row for batch transaction fix: Display "🦊 Smart contract" in "interacting with" row for batch transaction confirmations Apr 9, 2025
@vinistevam vinistevam force-pushed the fix/hide-recipient-row-tx-batch-type branch from deec64b to 42d37af Compare April 9, 2025 14:14
@metamaskbot
Copy link
Collaborator

Builds ready [42d37af]
UI Startup Metrics (1669 ± 199 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup16691314215619918032027
load14161114182519515571774
domContentLoaded14061106181719515511758
domInteractive251592142370
firstPaint10161771825575227338
backgroundConnect158497199
firstReactRender3816295363966
getState2165011499
initialActions004101
loadScripts10808191446174864970
setupStore13669989
WebpackHomeuiStartup22781790273518523772592
load18271409225919019222225
domContentLoaded18211399225518819182209
domInteractive181266121557
firstPaint172703326025084
backgroundConnect4612356643761
firstReactRender170543861186390
getState1533013079
initialActions317145
loadScripts18081394225218118962176
setupStore1971842478
FirefoxBrowserifyHomeuiStartup13581165173811514331580
load12191050159211413001453
domContentLoaded12181050159211413001453
domInteractive10339242278698
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2416132132434
firstReactRender22184042229
getState7435478
initialActions001001
loadScripts11961035157211412811438
setupStore7336567
WebpackHomeuiStartup15261347189711415881782
load13171158165410813701535
domContentLoaded13171158165410813701534
domInteractive9434191258897
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25186272641
firstReactRender34285253745
getState8429579
initialActions102111
loadScripts12941142163010713431510
setupStore8531489

@metamaskbot
Copy link
Collaborator

Builds ready [dfc52c0]
UI Startup Metrics (1219 ± 57 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1219110714015712511318
load10619341216601142985
domContentLoaded10569271209591166991
domInteractive17136991632
firstPaint705781180431249976
backgroundConnect6413178
firstReactRender221576102243
getState14545979
initialActions001001
loadScripts81368796558852897
setupStore8423379
WebpackHomeuiStartup21511728259017922712448
load17261313223817217832063
domContentLoaded17201307223017117762058
domInteractive161260101446
firstPaint175644696825277
backgroundConnect299235313363
firstReactRender145533461026092
getState11345769
initialActions315134
loadScripts17151305221216817732029
setupStore2763295279
FirefoxBrowserifyHomeuiStartup13341171180610813891572
load11961044163910712541379
domContentLoaded11961044163810712541379
domInteractive9839196288996
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect19134771930
firstReactRender22185862229
getState7334378
initialActions001001
loadScripts11801029162110712391362
setupStore6336567
WebpackHomeuiStartup15771382203413316561868
load13561188179312214321624
domContentLoaded13561188179212214321623
domInteractive9637199248997
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2516310292338
firstReactRender36285153847
getState10547789
initialActions102111
loadScripts13361170177312214141594
setupStore9563789

@vinistevam vinistevam added this pull request to the merge queue Apr 10, 2025
Merged via the queue into main with commit b9ef23e Apr 10, 2025
166 checks passed
@vinistevam vinistevam deleted the fix/hide-recipient-row-tx-batch-type branch April 10, 2025 14:06
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2025
@metamaskbot metamaskbot added the release-12.17.0 Issue or pull request that will be included in release 12.17.0 label Apr 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.17.0 Issue or pull request that will be included in release 12.17.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants