Skip to content

Conversation

@jpuri
Copy link
Contributor

@jpuri jpuri commented Apr 11, 2025

Description

Add option to switch from standard account <-> smart account on accounts details modal.

Related issues

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

Manual testing steps

  1. Open metamask
  2. Open account details modal
  3. Switch to smart / standard account

Screenshots/Recordings

Screenshot 2025-04-16 at 8 40 16 PM

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.

@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-confirmations Push issues to confirmations team label Apr 11, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Apr 11, 2025

✨ Files requiring CODEOWNER review ✨

🖥️ @MetaMask/wallet-ux

  • ui/components/multichain/account-details/account-details-display.js
  • ui/components/multichain/account-details/account-details-display.test.tsx
  • ui/components/multichain/account-details/account-details-section.tsx
  • ui/components/multichain/account-details/account-details.test.js
  • ui/components/multichain/account-details/account-details.tsx

@metamaskbot
Copy link
Collaborator

❌ API Spec Test Failed. View the report here.

@jpuri jpuri changed the title feat: account details modal changes for account switching feat: add option to switch from standard account <-> smart account on accounts details modal Apr 14, 2025
export const DEFAULT_FIXTURE_ACCOUNT =
'0x5CfE73b6021E818B776b421B1c4Db2474086a7e1';

export const DEFAULT_FIXTURE_ACCOUNT_SHOTENED =
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be DEFAULT_FIXTURE_ACCOUNT_SHORTENED (added R)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated

</Box>
<Tabs
onTabClick={() => undefined}
style={{ width: '100%', marginTop: 8 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be 8px?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated

<Preloader size={18} />
</Box>
)}
{network7702List?.map((networkConfiguration) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

If network7702List doesn't exist or is an empty array, should we just not show this tab? Again, with your PR, I'm not seeing any items:

SCR-20250416-iowy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @darkwing : I am not sure why it is like this for you, but it's good point. @bschorchit : what should we display when there are no networks in the list.

Choose a reason for hiding this comment

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

I agree with @darkwing 's suggestion! We can hide this tab if there are no networks in the list. Would that require a loading period though while we fetch for the networks?

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, it would need a loading period

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made this change to conditionally show the tab and show spinner till we load networks supporting 7720

Screenshot 2025-04-17 at 10 32 55 AM Screenshot 2025-04-17 at 10 25 24 AM

expect(mockDispatch).toHaveBeenCalledTimes(1);
});

it('does not renders for confirmation not coming from DAPP', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

does not render (removed s)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated

const { chainId, txParams, origin } = currentConfirmation ?? {};
const { from } = txParams;

if (!currentConfirmation || acknowledged || origin === 'metamask') {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we have a constant for metamask (ORIGIN_METAMASK)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated

),
)) as unknown as TransactionMeta;

setTransactionId(transactionMeta?.id);
Copy link
Contributor

Choose a reason for hiding this comment

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

Outside my scope of knowledge but would we want to call setTransactionId if that id is undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fn call await dispatch(addTransactionAndRouteToConfirmationPage( generates id.

@metamaskbot
Copy link
Collaborator

Builds ready [7be4724]
UI Startup Metrics (1262 ± 64 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1262114314696413011387
load108297512625811231183
domContentLoaded107696812575711171176
domInteractive18135671730
firstPaint75795124842010871168
backgroundConnect74263811
firstReactRender24165992644
getState1454182031
initialActions001001
loadScripts834713100655869936
setupStore95334917
WebpackHomeuiStartup22281842269118723322556
load17331420224516118362052
domContentLoaded17251416224015818272006
domInteractive171278111444
firstPaint1927139868217328
backgroundConnect2810101172959
firstReactRender22456497126345376
getState174260321534
initialActions316135
loadScripts17201414221615518231980
setupStore256289392248
FirefoxBrowserifyHomeuiStartup13661181177411014361583
load12171047164411712851441
domContentLoaded12171046164411712851441
domInteractive1053726935118172
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect20135772240
firstReactRender23194742229
getState7425389
initialActions001001
loadScripts11991030162911712631421
setupStore6429368
WebpackHomeuiStartup15081333204414015921795
load12841154171411713421531
domContentLoaded12841154171411713421531
domInteractive80411401987129
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23154872443
firstReactRender36285663848
getState94336929
initialActions102111
loadScripts12631133169711613241514
setupStore11527126821
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 98 Bytes (0%)
  • ui: 6.02 KiB (0.09%)
  • common: 119 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [5c4418a]
UI Startup Metrics (1221 ± 70 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1221107714737012641339
load105794112676611031172
domContentLoaded105193512626610921166
domInteractive17136971626
firstPaint760103126941110741169
backgroundConnect74222810
firstReactRender20155152029
getState1353682028
initialActions001001
loadScripts814703100663860925
setupStore84192813
WebpackHomeuiStartup21031686237216022132329
load16201321184512517331822
domContentLoaded16131317184112417241814
domInteractive161164101344
firstPaint1766735158205299
backgroundConnect24968132555
firstReactRender20454385119328367
getState124216211222
initialActions317135
loadScripts16081316184012517211810
setupStore206295321932
FirefoxBrowserifyHomeuiStartup13481185168910114111562
load12031018156710712701408
domContentLoaded12021018156710712701408
domInteractive1023624730115161
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2213105122246
firstReactRender22194742331
getState74384710
initialActions002001
loadScripts11831005155110812511394
setupStore6439468
WebpackHomeuiStartup15271362195612615791806
load13061162167711113631571
domContentLoaded13051162167711113631571
domInteractive83452562889138
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21147882330
firstReactRender36307363749
getState84324917
initialActions102111
loadScripts12871145166111113381546
setupStore85515813

@metamaskbot
Copy link
Collaborator

Builds ready [46a96df]
UI Startup Metrics (1230 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1230110414356212691352
load106494512755910961190
domContentLoaded105893412715910911179
domInteractive18136981630
firstPaint761167119240310811161
backgroundConnect74263711
firstReactRender22168992244
getState1353571828
initialActions001001
loadScripts817693100956846935
setupStore85162812
WebpackHomeuiStartup22051779264017923212486
load17011379218014818031982
domContentLoaded16931375217414517941957
domInteractive16125791444
firstPaint1746238156196276
backgroundConnect309160213772
firstReactRender22656392117333371
getState1334971627
initialActions612682646
loadScripts16881374217214317911933
setupStore237299342433
FirefoxBrowserifyHomeuiStartup13691194169810014391561
load1216103615269912751398
domContentLoaded1216103615269912751397
domInteractive1033626432112163
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect20125772032
firstReactRender23195752328
getState84385812
initialActions001001
loadScripts1198102315129912571383
setupStore8416718623
WebpackHomeuiStartup15351344192711315921708
load13151159166310113671507
domContentLoaded13151159166310113661507
domInteractive81511852292126
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21164962237
firstReactRender35304743743
getState94336929
initialActions002111
loadScripts12961144164610113451475
setupStore10526025814

OGPoyraz
OGPoyraz previously approved these changes Apr 17, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [7ba6792]
UI Startup Metrics (1213 ± 64 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1213109614446412611314
load105194912846310961154
domContentLoaded104694612796310901149
domInteractive17136071628
firstPaint70191120442310631141
backgroundConnect74192810
firstReactRender20154742027
getState1253871725
initialActions001001
loadScripts808720103360848906
setupStore85172813
WebpackHomeuiStartup21171741257716822112362
load16341364203912717241814
domContentLoaded16271360201212517201807
domInteractive161176111341
firstPaint1856447573224330
backgroundConnect24975132558
firstReactRender22054395121341356
getState144210271325
initialActions316134
loadScripts16221359199012417171805
setupStore216293381929
FirefoxBrowserifyHomeuiStartup13151142182512413731570
load11741001167812112521408
domContentLoaded11741001167712112521407
domInteractive993717828110159
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect19116481936
firstReactRender21185342127
getState9419519711
initialActions001001
loadScripts1157990166411912351390
setupStore5422257
WebpackHomeuiStartup14951339204812615591732
load12831143169111313361492
domContentLoaded12821142169111313361492
domInteractive82362813193123
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21156172240
firstReactRender34285253646
getState85345919
initialActions002111
loadScripts12631128167511213191472
setupStore85515811

@jpuri jpuri added this pull request to the merge queue Apr 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 17, 2025
@jpuri jpuri added this pull request to the merge queue Apr 17, 2025
Merged via the queue into main with commit db9369e Apr 17, 2025
169 checks passed
@jpuri jpuri deleted the acc_details_change branch April 17, 2025 13:10
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2025
@metamaskbot metamaskbot added the release-12.18.0 Issue or pull request that will be included in release 12.18.0 label Apr 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-12.18.0 Issue or pull request that will be included in release 12.18.0 team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants