Skip to content

feat: link asset details page from bridge asset list#40356

Merged
micaelae merged 81 commits intomainfrom
swaps3899-asset-page-links
Mar 11, 2026
Merged

feat: link asset details page from bridge asset list#40356
micaelae merged 81 commits intomainfrom
swaps3899-asset-page-links

Conversation

@micaelae
Copy link
Copy Markdown
Member

@micaelae micaelae commented Feb 24, 2026

Description

Implements a new info button that opens the asset details page, and sets the src/dest token on Swap button click

Changes in pages/asset

  • asset.tsx: use token passed through the navigation state if the user does not have a balance for the decoded URL asset
  • components/asset-page.tsx
    • use token passed through the navigation state if the user does not have a balance for a non-evm asset
    • change back button to navigate to the previous URL, instead of the default URL

Changes in bridge directories

ducks/bridge

  • move the asset picker modal open/close state to the bridge store so it can be restored on page load
  • move toToken setter logic to actions.ts
  • implement new rehydrateBridgeStore action that loads a cached bridge state

hooks/bridge

  • useBridgeNavigation: implement navigateToAssetPage, which propagates the latest bridge redux state and token data to the asset-page
  • useBridging, usePrefillFromBridgeState: support setting the destination asset using the location state

bridge-asset-picker

  • show info tooltip that navigates to the asset-page on click

Open in GitHub Codespaces

Changelog

CHANGELOG entry: feat: link asset details page from bridge asset list

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-3899

Manual testing steps

  1. Asset page for token in a disabled network should have data (non-evm, native, non-native)
  2. Asset page for token in an enabled network should have data (non-evm, evm, native, non-native)
  3. Set src token from asset details page
  4. Set dest token from asset detail page
  5. Nav back to open asset list from asset details page
  6. Popup's active quote should repopulate bridge page on reopen if closed by accident

Screenshots/Recordings

Before

Screenshot 2026-03-10 at 1 35 21 PM

After

Screenshot 2026-03-10 at 11 55 48 AM Screenshot 2026-03-10 at 1 34 21 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.

Note

Medium Risk
Medium risk because it changes bridge navigation/state rehydration and token selection behavior across routes, which can impact swap/bridge prefill and back-navigation flows.

Overview
Adds an asset details entrypoint from the bridge asset picker via a new info icon, navigating to ASSET_ROUTE while passing the selected token plus the current bridge redux state so users can return without losing context.

Moves bridge asset-picker open/close state into the bridge slice (with new selectors/actions and rehydrateBridgeStore), updates bridge prefill logic to restore state from location (including setting destination token when appropriate), and shifts setToToken swap/amount-reset logic into a thunk action.

Improves asset page robustness by falling back to token data from navigation state when the user doesn’t own the token (including non‑EVM), and updates the asset page back button to navigate(-1); metrics PageViewed is now emitted on bridge entry navigation rather than on bridge page mount.

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

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Feb 24, 2026
@github-actions
Copy link
Copy Markdown
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.

Copy link
Copy Markdown

@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.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [4935d6b]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28026130115287301
total28026130115287301
Confirm Txconfirm_tx600059936006560026006
total600059936006560026006
Bridge User Actionsbridge_load_page21018822313222223
bridge_load_asset_picker18516020116197201
bridge_search_token7026997042704704
total1102108911141011081114
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup15451269189612116081769
load12901058154811313591486
domContentLoaded12811056152510813541466
domInteractive2916105202586
firstPaint181751375151242362
backgroundConnect22820540126228274
firstReactRender20134762233
initialActions107124
loadScripts1072851128110411451252
setupStore1483661625
numNetworkReqs362795182784
Power User HomeuiStartup61401918172142806680511638
load13381145188913413991538
domContentLoaded13161141180712613671501
domInteractive3619248323464
firstPaint234901258143290406
backgroundConnect232130714708251934855270
firstReactRender27194553036
initialActions105112
loadScripts1088931155611511401253
setupStore1583761729
numNetworkReqs2019341052220297
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2232182325224232
srpButtonToSrpForm93919419494
confirmSrpToPwForm21212202122
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen15151601616
doneButtonToHomeScreen61358465929612659
openAccountMenuToAccountListLoaded2911289629341729342934
total39583849414111040224141
Onboarding New WalletcreateWalletToSocialScreen2222222230223223
srpButtonToPwForm1101101100110110
createPwToRecoveryScreen999099
skipBackupToMetricsScreen36333823738
agreeButtonToOnboardingSuccess17171811718
doneButtonToAssetList59148675199629751
total98888011469610211146
Asset DetailsassetClickToPriceChart12511214413131144
total12511214413131144
Solana Asset DetailsassetClickToPriceChart80728978589
total80728978589
Import Srp HomeloginToHomeScreen24372265263114325222631
openAccountMenuAfterLogin614885157285
homeAfterImportWithNewWallet2223212323027222812302
total48054449524828249815248
Send TransactionsopenSendPageFromHome19182011920
selectTokenToSendFormLoaded19162121921
reviewTransactionToConfirmationPage8508488521850852
total90888594423926944
SwapopenSwapPageFromHome28204182641
fetchAndDisplaySwapQuotes269626882708726982708
total272327152731727282731
🌐 Dapp Page Load Benchmarks

Current Commit: 4935d6b | Date: 3/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±43ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 746ms (±40ms) 🟢 | historical mean value: 736ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±11ms) 🟢 | historical mean value: 84ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 43ms 1.03s 1.37s 1.11s 1.37s
domContentLoaded 746ms 40ms 716ms 1.04s 784ms 1.04s
firstPaint 83ms 11ms 68ms 184ms 92ms 184ms
firstContentfulPaint 83ms 11ms 68ms 184ms 92ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 58 Bytes (0%)
  • ui: -34.84 KiB (-0.41%)
  • common: -112 Bytes (0%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [7abcd1c]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2782692929286292
total2782692929286292
Confirm Txconfirm_tx6024601060371060326037
total6024601060371060326037
Bridge User Actionsbridge_load_page2222162274227227
bridge_load_asset_picker24619927837277278
bridge_search_token74470377332769773
total1214112213107612731310
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14441228170410314861656
load1196102714468912381380
domContentLoaded1188102314118712331359
domInteractive281799182577
firstPaint188711190188212381
backgroundConnect21319426612216238
firstReactRender20143942126
initialActions106124
loadScripts99182512118610291169
setupStore1373651623
numNetworkReqs362793183083
Power User HomeuiStartup56201953164632512649310228
load12901119172411913121545
domContentLoaded12731114168311113021514
domInteractive3319208233162
firstPaint1929143983262327
backgroundConnect213929810695198234854955
firstReactRender27195053036
initialActions1025313
loadScripts1046915141610110641281
setupStore1664671828
numNetworkReqs1347126443145243
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2172162181218218
srpButtonToSrpForm94939619596
confirmSrpToPwForm22212302223
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen17161701717
doneButtonToHomeScreen59658461813593618
openAccountMenuToAccountListLoaded2956292729972629712997
total3909389039281439133928
Onboarding New WalletcreateWalletToSocialScreen2192182211220221
srpButtonToPwForm1071051102108110
createPwToRecoveryScreen889099
skipBackupToMetricsScreen36353713737
agreeButtonToOnboardingSuccess16161701717
doneButtonToAssetList4884815049485504
total8758678909873890
Asset DetailsassetClickToPriceChart1111061195110119
total1111061195110119
Solana Asset DetailsassetClickToPriceChart80758448484
total80758448484
Import Srp HomeloginToHomeScreen2268220023124523032312
openAccountMenuAfterLogin533871115771
homeAfterImportWithNewWallet2478241725213824942521
total4828477448964748484896
Send TransactionsopenSendPageFromHome28213563535
selectTokenToSendFormLoaded29183893738
reviewTransactionToConfirmationPage1047849124317312281243
total1104888131018213011310
SwapopenSwapPageFromHome25242612526
fetchAndDisplaySwapQuotes269326882699426942699
total2732271327551727522755
🌐 Dapp Page Load Benchmarks

Current Commit: 7abcd1c | Date: 3/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±52ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 739ms (±48ms) 🟢 | historical mean value: 736ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±17ms) 🟢 | historical mean value: 84ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 52ms 1.02s 1.48s 1.09s 1.48s
domContentLoaded 739ms 48ms 709ms 1.13s 768ms 1.13s
firstPaint 82ms 17ms 64ms 244ms 88ms 244ms
firstContentfulPaint 82ms 17ms 64ms 244ms 88ms 244ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 58 Bytes (0%)
  • ui: -23.26 KiB (-0.27%)
  • common: -112 Bytes (0%)

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
57.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@micaelae micaelae removed the request for review from a team March 11, 2026 17:24
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 11, 2026

Builds ready [0ccf738]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2692592839270283
total2692592839270283
Confirm Txconfirm_tx602860216035760356035
total602860216035760356035
Bridge User Actionsbridge_load_page25522129227268292
bridge_load_asset_picker18115021626197216
bridge_search_token7237207273726727
total1156112512103111721210
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14441217172810514841671
load1199101514269112331381
domContentLoaded1193100214209112281373
domInteractive291898182681
firstPaint161691394143207279
backgroundConnect21419527013217243
firstReactRender20134652129
initialActions106124
loadScripts99581412188910221169
setupStore1473751723
numNetworkReqs352784173080
Power User HomeuiStartup56991946182383334642614009
load13041114168711613381563
domContentLoaded12841110166410613231516
domInteractive3420173233270
firstPaint1808651591240345
backgroundConnect2388324146763068327411138
firstReactRender27194152935
initialActions106113
loadScripts1060905141510110961273
setupStore1775491935
numNetworkReqs1445131145152239
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192152222220222
srpButtonToSrpForm93939419494
confirmSrpToPwForm21212202122
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen16151811718
doneButtonToHomeScreen61359065124633651
openAccountMenuToAccountListLoaded293029282932229322932
total3894388439131238943913
Onboarding New WalletcreateWalletToSocialScreen2182182190219219
srpButtonToPwForm1041021051105105
createPwToRecoveryScreen889099
skipBackupToMetricsScreen35343713537
agreeButtonToOnboardingSuccess16151711717
doneButtonToAssetList54349166568569665
total9288701048729751048
Asset DetailsassetClickToPriceChart12810214015139140
total12810214015139140
Solana Asset DetailsassetClickToPriceChart93821131291113
total93821131291113
Import Srp HomeloginToHomeScreen2390228724746824132474
openAccountMenuAfterLogin655084147284
homeAfterImportWithNewWallet24472264270716324442707
total4810472649007149004900
Send TransactionsopenSendPageFromHome28253232832
selectTokenToSendFormLoaded291946103346
reviewTransactionToConfirmationPage1181844159230414381592
total1236881167031714981670
SwapopenSwapPageFromHome28194493444
fetchAndDisplaySwapQuotes2691268127091227032709
total2720270027471727302747
🌐 Dapp Page Load Benchmarks

Current Commit: 0ccf738 | Date: 3/11/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±43ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 728ms (±40ms) 🟢 | historical mean value: 741ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 82ms (±12ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 43ms 1.04s 1.35s 1.07s 1.35s
domContentLoaded 728ms 40ms 711ms 1.01s 743ms 1.01s
firstPaint 82ms 12ms 60ms 176ms 92ms 176ms
firstContentfulPaint 82ms 12ms 60ms 176ms 92ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 3.5 KiB (0.04%)
  • common: 20 Bytes (0%)

@micaelae micaelae added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 5f1d765 Mar 11, 2026
183 of 184 checks passed
@micaelae micaelae deleted the swaps3899-asset-page-links branch March 11, 2026 18:07
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2026
@metamaskbot metamaskbot added the release-13.23.0 Issue or pull request that will be included in release 13.23.0 label Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.23.0 Issue or pull request that will be included in release 13.23.0 size-L team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants