Skip to content

feat(solana): update add account from opt in solana #31387

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

Conversation

PatrykLucka
Copy link
Contributor

@PatrykLucka PatrykLucka commented Mar 28, 2025

Description

This PR updates the flow of adding new Solana account from the Whats new modal to be consistent with the flow from accounts picker. It also allows user to pick which SRP to use if there are more than one SRP added.

Related issues

Depends on: #31358

Manual testing steps

  1. Install new MetaMask instance and onboard
  2. Whats new modal should be displayed automatically
  3. Click Create Solana account
  4. New modal should be displayed

Screenshots/Recordings

Before

Screenshot 2025-03-31 at 12 52 00

After

Screenshot 2025-03-31 at 12 49 32

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.

@PatrykLucka PatrykLucka self-assigned this Mar 28, 2025
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-mmi PRs from the MMI team label Mar 28, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Mar 28, 2025

✨ Files requiring CODEOWNER review ✨

🖥️ @MetaMask/wallet-ux

  • ui/components/multichain/create-solana-account-modal/create-solana-account-modal.tsx
  • ui/components/multichain/create-solana-account-modal/index.ts

@PatrykLucka PatrykLucka force-pushed the MMMULTISRP-115-update-add-account-from-opt-in-solana branch 3 times, most recently from 579925b to dd50ee7 Compare March 31, 2025 10:21
@metamaskbot
Copy link
Collaborator

Builds ready [dd50ee7]
UI Startup Metrics (1209 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1209108414306212501313
load10549551309621155987
domContentLoaded10489501299611155983
domInteractive16133741629
firstPaint731821311416247979
backgroundConnect107223910
firstReactRender19164451934
getState11431768
initialActions001001
loadScripts828737106258862928
setupStore8517279
WebpackHomeuiStartup947779121379954975
load80765393757839891
domContentLoaded80063692557833879
domInteractive15124271336
firstPaint48954884333831878
backgroundConnect16106691538
firstReactRender14122941426
getState6414278
initialActions001001
loadScripts79863491557832869
setupStore7412188
FirefoxBrowserifyHomeuiStartup13941189194316514331843
load12521065180815813011681
domContentLoaded12521065180715813001681
domInteractive10138264329097
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23165562434
firstReactRender22193732429
getState7446678
initialActions001001
loadScripts12301043178815712811652
setupStore6413268
WebpackHomeuiStartup9758221644169898973
load8557181412147805964
domContentLoaded8557181412147805964
domInteractive112342212816797
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect201389112236
firstReactRender18162921923
getState104851379
initialActions001001
loadScripts8397041396144794949
setupStore8575879
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -634.11 KiB (-9.77%)
  • ui: -969.88 KiB (-12.51%)
  • common: -806.36 KiB (-7.85%)

@PatrykLucka PatrykLucka changed the title Mmmultisrp 115 update add account from opt in solana feat(solana): update add account from opt in solana Mar 31, 2025
@PatrykLucka PatrykLucka marked this pull request as ready for review March 31, 2025 11:11
@PatrykLucka PatrykLucka requested a review from a team as a code owner March 31, 2025 11:11
handleModalClose();
}}
/>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this in parallel with the normal notifications Modal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well it technically is a part of the flow from the notification modal, but I didn't want to use the notification modal itself, as it's a bit limited in terms of the structure (header, content and footer) and it was easier to add it next to it and just hide notification when user decides to add new account.

Comment on lines 31 to 46
const SNAP_CLIENT_CONFIG_MAP: Record<
string,
{ clientType: WalletClientType | null; chainId: CaipChainId | null }
> = {
[MultichainNetworks.BITCOIN]: {
clientType: WalletClientType.Bitcoin,
chainId: MultichainNetworks.BITCOIN,
},
[MultichainNetworks.BITCOIN_TESTNET]: {
clientType: WalletClientType.Bitcoin,
chainId: MultichainNetworks.BITCOIN_TESTNET,
},
[MultichainNetworks.SOLANA]: {
clientType: WalletClientType.Solana,
chainId: MultichainNetworks.SOLANA,
},
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen this before somewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a similar map, but is using network instead of action (used in account menu) as a key

@@ -0,0 +1,107 @@
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesnt this already exist as create-snap-account?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this one is using create-snap-account, it's just a modal that uses it, it was needed as we don't have modal open, as we had in case of network or account modal flow.

@PatrykLucka PatrykLucka force-pushed the MMMULTISRP-115-update-add-account-from-opt-in-solana branch 2 times, most recently from 41f898d to 0e253f6 Compare April 3, 2025 10:28
@metamaskbot
Copy link
Collaborator

Builds ready [0e253f6]
UI Startup Metrics (1220 ± 51 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1220112013425112591310
load10699751187491126990
domContentLoaded10639711181491125988
domInteractive16134651629
firstPaint7521291185418215991
backgroundConnect106606910
firstReactRender19157061926
getState11432767
initialActions001001
loadScripts81271592147845888
setupStore8421378
WebpackHomeuiStartup20981686260622322352424
load16341328216918817511976
domContentLoaded16291324216418617461969
domInteractive181267121454
firstPaint21966175717426775
backgroundConnect2812281292866
firstReactRender179563621178795
getState8322489
initialActions316134
loadScripts16161321197317217411916
setupStore296291612889
FirefoxBrowserifyHomeuiStartup13861180184414114191763
load12481056167113512781601
domContentLoaded12481056167113512781600
domInteractive10141238308796
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2616155182544
firstReactRender22194432228
getState7335478
initialActions001001
loadScripts12241038164313412531571
setupStore6413267
WebpackHomeuiStartup15041322229817015551843
load13021152207515813441624
domContentLoaded13011151207515813441624
domInteractive9038173218996
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25174972643
firstReactRender34285653645
getState8465778
initialActions002111
loadScripts12791134205115713161595
setupStore7528379
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0%)
  • ui: 6.52 KiB (0.1%)
  • common: 1 Bytes (0%)

zone-live
zone-live previously approved these changes Apr 3, 2025
@PatrykLucka PatrykLucka enabled auto-merge April 3, 2025 14:13
NidhiKJha
NidhiKJha previously approved these changes Apr 4, 2025
Copy link
Member

@NidhiKJha NidhiKJha left a comment

Choose a reason for hiding this comment

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

LGTM!
What's new modal shows up ✅
User able to add Solana account from Modal ✅

@PatrykLucka PatrykLucka added this pull request to the merge queue Apr 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 4, 2025
@PatrykLucka PatrykLucka added this pull request to the merge queue Apr 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 4, 2025
@PatrykLucka PatrykLucka dismissed stale reviews from NidhiKJha and zone-live via b668f1b April 4, 2025 16:08
@PatrykLucka PatrykLucka force-pushed the MMMULTISRP-115-update-add-account-from-opt-in-solana branch from 0e253f6 to b668f1b Compare April 4, 2025 16:08
@metamaskbot
Copy link
Collaborator

Builds ready [b668f1b]
UI Startup Metrics (1220 ± 53 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1220110613335312541310
load10749691174491131989
domContentLoaded10689651170491127990
domInteractive17137391630
firstPaint80472117640718672
backgroundConnect96294910
firstReactRender19153342029
getState10435768
initialActions001001
loadScripts81872292248857893
setupStore8427378
WebpackHomeuiStartup21761776249516322862373
load16891389203013117771876
domContentLoaded16821385191812817731872
domInteractive171365111447
firstPaint165654156727191
backgroundConnect3211175203763
firstReactRender193543621126495
getState1332522479
initialActions315145
loadScripts16721382190512817681856
setupStore406306682847
FirefoxBrowserifyHomeuiStartup13671190203915513921712
load12251052188114612491548
domContentLoaded12251052188114612491547
domInteractive9641181249197
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2416147152350
firstReactRender23183632529
getState6317278
initialActions001001
loadScripts12021033186414112281514
setupStore6423267
WebpackHomeuiStartup15981351207215916761948
load13771150183615014431731
domContentLoaded13771150183615014431731
domInteractive9736178218997
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25195052832
firstReactRender37295564049
getState8441679
initialActions102111
loadScripts13531130181615014191703
setupStore8537489
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -74 Bytes (0%)
  • ui: 2.77 KiB (0.04%)
  • common: 0 Bytes (0%)

@PatrykLucka PatrykLucka enabled auto-merge April 4, 2025 16:55
zone-live
zone-live previously approved these changes Apr 7, 2025
</Modal>
<>
<Modal
onClose={() => null}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this null? Do we not want to allow the user to close this via the x?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do, but it's done with:

<modal.header.component onClose={onClose} image={image} />

I changed it to null, because it was also triggered by some other flow, where we didn't want to close it yet.

@PatrykLucka PatrykLucka requested a review from darkwing April 7, 2025 14:54
@PatrykLucka PatrykLucka force-pushed the MMMULTISRP-115-update-add-account-from-opt-in-solana branch from b668f1b to 7c104c0 Compare April 8, 2025 16:30
@PatrykLucka PatrykLucka force-pushed the MMMULTISRP-115-update-add-account-from-opt-in-solana branch from 7c104c0 to b9a1540 Compare April 8, 2025 17:31
@metamaskbot
Copy link
Collaborator

Builds ready [b9a1540]
UI Startup Metrics (1289 ± 62 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1289114814356213221405
load11259761262651171984
domContentLoaded11179701250651165978
domInteractive18146581732
firstPaint8011451259438230291
backgroundConnect1278912910
firstReactRender2514163212341
getState15540879
initialActions001001
loadScripts85271399065893972
setupStore9531479
WebpackHomeuiStartup26622038306820827942980
load22661558275529225142639
domContentLoaded22571554275129025072635
domInteractive2014105141753
firstPaint187694497227086
backgroundConnect4413459733174
firstReactRender9655476866474
getState1441832668
initialActions218125
loadScripts22421550274729225012624
setupStore1773073589
FirefoxBrowserifyHomeuiStartup13271163186514213501634
load11901046172913612251502
domContentLoaded11901046172913612251502
domInteractive9536204298896
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect24165572640
firstReactRender22185152231
getState7334478
initialActions001001
loadScripts11681024169413512031484
setupStore6424367
WebpackHomeuiStartup15161340183811116001720
load13061159161010413881495
domContentLoaded13061159161010413871494
domInteractive9967167238898
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect25185762836
firstReactRender35286063847
getState8528489
initialActions102111
loadScripts12831139158210413571471
setupStore1052922889

@PatrykLucka PatrykLucka added this pull request to the merge queue Apr 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 9, 2025
@PatrykLucka PatrykLucka added this pull request to the merge queue Apr 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 9, 2025
@PatrykLucka PatrykLucka added this pull request to the merge queue Apr 9, 2025
Merged via the queue into main with commit 0bb08ab Apr 9, 2025
166 checks passed
@PatrykLucka PatrykLucka deleted the MMMULTISRP-115-update-add-account-from-opt-in-solana branch April 9, 2025 12:33
@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2025
@metamaskbot metamaskbot added the release-12.17.0 Issue or pull request that will be included in release 12.17.0 label Apr 9, 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-mmi PRs from the MMI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants