Skip to content

feat: open to Activity tab on failed transaction#41531

Merged
n3ps merged 1 commit intomainfrom
n3ps/badge-open-options
Apr 8, 2026
Merged

feat: open to Activity tab on failed transaction#41531
n3ps merged 1 commit intomainfrom
n3ps/badge-open-options

Conversation

@n3ps
Copy link
Copy Markdown
Contributor

@n3ps n3ps commented Apr 7, 2026

Description

When a transaction fails while the extension is closed, a red badge now shows on the extension icon.

This PR restores ensures it opens directly to the Activity tab.

Changelog

CHANGELOG entry: feat: open to Activity tab when badge is clicked on failed transaction

Related issues

Fixes:

Manual testing steps

  1. Submit a transaction that will fail
  2. Close the extension and wait for transaction to fail
  3. Click on red badge

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
Moderate risk because it changes how the extension action popup (and MV3 side panel path) are configured at runtime, which could alter what UI opens across browsers if paths/query params are wrong.

Overview
Ensures that when a transaction fails while the UI is closed, clicking the extension icon opens directly to the Activity tab by dynamically setting the action popup URL (and resetting it when the failure badge is cleared).

This refactors action URL handling into setClientOpenOptions, adds shared constants for popup.html/popup-init.html/sidepanel.html, and updates environment-type detection to use those constants (including setting MV3 sidePanel options where supported).

Reviewed by Cursor Bugbot for commit c4c3bbd. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

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-core-extension-ux Core Extension UX team label Apr 7, 2026
@github-actions github-actions bot added the size-S label Apr 7, 2026
ENVIRONMENT_TYPE_SIDEPANEL,
PLATFORM_FIREFOX,
MESSAGE_TYPE,
POPUP_FILE,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Refactoring

function onTransactionFailed() {
failedTxCount += 1;
const popupFile = isFirefox ? 'popup.html' : 'popup-init.html';
function setClientOpenOptions(tab) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. Extracted from call sites: onTransactionFailed and clearFailedTxBadge

}

function onTransactionFailed() {
if (isClientOpenStatus()) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. Don't run this unless the extension is closed

@n3ps n3ps marked this pull request as ready for review April 7, 2026 23:29
try {
if (isManifestV3) {
browser.action.setPopup({ popup: `${popupFile}?tab=activity` });
browser.action.setPopup({ popup });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Set the next popup action

if (isManifestV3) {
browser.action.setPopup({ popup: `${popupFile}?tab=activity` });
browser.action.setPopup({ popup });
browser.sidePanel?.setOptions?.({ path: sidepanelPath });
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Set sidepanel option on next open

@n3ps n3ps changed the title chore: set browser action options feat: open to Activity tab when badge is clicked on failed transaction Apr 7, 2026
@n3ps n3ps changed the title feat: open to Activity tab when badge is clicked on failed transaction feat: open to Activity tab on failed transaction Apr 7, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Apr 7, 2026

Builds ready [c4c3bbd]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)

Baseline (latest main): f34f804 | Date: 9/10/58222 | Pipeline: 24109261561 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-browserify
loadNewAccount
🟡 load_new_account
[Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • bridgeUserActions/bridge_load_asset_picker: -43%
  • bridgeUserActions/bridge_search_token: -17%
  • bridgeUserActions/total: -17%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.5s
  • 🟡 confirmTx/FCP: p75 2.5s
  • 🟡 bridgeUserActions/FCP: p75 2.6s
Startup Benchmarks · Samples: 100
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]
startupPowerUserHome🟡 [Show logs]🟡 [Show logs]
🟡 loadScripts
[Show logs]
🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/load: -12%
  • startupStandardHome/domContentLoaded: -14%
  • startupStandardHome/backgroundConnect: +12%
  • startupStandardHome/initialActions: -38%
  • startupStandardHome/loadScripts: -16%
  • startupStandardHome/numNetworkReqs: -21%
  • startupPowerUserHome/uiStartup: -18%
  • startupPowerUserHome/domInteractive: -13%
  • startupPowerUserHome/backgroundConnect: +93%
  • startupStandardHome/uiStartup: -14%
  • startupStandardHome/load: -13%
  • startupStandardHome/domContentLoaded: -12%
  • startupStandardHome/backgroundConnect: -35%
  • startupStandardHome/firstReactRender: -24%
  • startupStandardHome/loadScripts: -12%
  • startupStandardHome/numNetworkReqs: -29%
  • startupPowerUserHome/domInteractive: -17%
  • startupStandardHome/initialActions: -38%
  • startupStandardHome/setupStore: +14%
  • startupStandardHome/numNetworkReqs: -18%
  • startupPowerUserHome/backgroundConnect: -23%
  • startupPowerUserHome/setupStore: +27%
  • startupStandardHome/uiStartup: -12%
  • startupStandardHome/load: -11%
  • startupStandardHome/domContentLoaded: -11%
  • startupStandardHome/domInteractive: -56%
  • startupStandardHome/backgroundConnect: -13%
  • startupStandardHome/initialActions: -44%
  • startupStandardHome/loadScripts: -10%
  • startupStandardHome/setupStore: -57%
  • startupStandardHome/numNetworkReqs: -18%
  • startupPowerUserHome/domInteractive: -21%
  • startupPowerUserHome/backgroundConnect: -33%
  • startupPowerUserHome/setupStore: +19%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 688ms
  • 🔴 startupPowerUserHome/INP: p75 664ms
  • 🟡 startupPowerUserHome/LCP: p75 3.6s
  • 🟡 startupPowerUserHome/LCP: p75 3.6s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -85%
  • onboardingImportWallet/metricsToWalletReadyScreen: -47%
  • onboardingImportWallet/doneButtonToHomeScreen: -77%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +23%
  • onboardingImportWallet/total: -41%
  • onboardingNewWallet/srpButtonToPwForm: -78%
  • onboardingNewWallet/skipBackupToMetricsScreen: -68%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: -19%
  • onboardingNewWallet/doneButtonToAssetList: -33%
  • onboardingNewWallet/total: -32%
  • assetDetails/assetClickToPriceChart: -72%
  • assetDetails/total: -72%
  • solanaAssetDetails/assetClickToPriceChart: -70%
  • solanaAssetDetails/total: -70%
  • importSrpHome/openAccountMenuAfterLogin: -73%
  • importSrpHome/homeAfterImportWithNewWallet: -70%
  • importSrpHome/total: -60%
  • sendTransactions/selectTokenToSendFormLoaded: -29%
  • sendTransactions/reviewTransactionToConfirmationPage: +36%
  • sendTransactions/total: +32%
  • swap/openSwapPageFromHome: -96%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +11%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/INP: p75 232ms
  • 🟡 assetDetails/FCP: p75 2.4s
  • 🟡 solanaAssetDetails/FCP: p75 2.4s
  • 🟡 importSrpHome/INP: p75 216ms
  • 🟡 importSrpHome/FCP: p75 2.5s
  • 🟡 sendTransactions/INP: p75 208ms
  • 🟡 sendTransactions/FCP: p75 2.4s
  • 🟡 swap/FCP: p75 2.5s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-browserify
dappPageLoad🟢 [Show logs]
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -31 Bytes (0%)
  • ui: 7.76 KiB (0.09%)
  • common: 723 Bytes (0.01%)

@n3ps n3ps added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit 31eaceb Apr 8, 2026
421 of 425 checks passed
@n3ps n3ps deleted the n3ps/badge-open-options branch April 8, 2026 19:23
@github-actions github-actions bot locked and limited conversation to collaborators Apr 8, 2026
@metamaskbot metamaskbot added the release-13.27.0 Issue or pull request that will be included in release 13.27.0 label Apr 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.27.0 Issue or pull request that will be included in release 13.27.0 size-S team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants