Skip to content

feat: implement disconnect all button to dapp connections main screen#39791

Merged
ffmcgee725 merged 6 commits intomainfrom
jc/WAPI-898
Feb 5, 2026
Merged

feat: implement disconnect all button to dapp connections main screen#39791
ffmcgee725 merged 6 commits intomainfrom
jc/WAPI-898

Conversation

@ffmcgee725
Copy link
Copy Markdown
Member

@ffmcgee725 ffmcgee725 commented Feb 4, 2026

Description

This PR adds a “Disconnect All” button to the Dapp Connections screen. This will allow users to quickly revoke access for all connected dapps from one place, without needing to open each one individually.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: add disconnect all button to dapp connections main screen

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/WAPI-898

Manual testing steps

  1. Make sure to have permissions to multiple dapps
  2. Navigate to Dapp Connections screens (Extension View -> Hamburger Icon -> Dapp Connections -> Sites)
  3. There should be a button labeled "Disconnect All"
  4. Pressing this button should open a confirmation modal, to which proceeding should revoke permissions from all connected dapps

Screenshots/Recordings

Before

After

Screen.Recording.2026-02-04.at.15.34.29.mov

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
Adds bulk permission revocation from the connections screen by dispatching removePermissionsFor across all connected origins, which can impact user connectivity if the selection/mapping is wrong. Error handling is mostly synchronous and may not reflect async revocation failures accurately.

Overview
Adds a “Disconnect All” button to the Dapp Connections/Sites (PermissionsPage) screen (only when connections exist), backed by a new confirmation modal (DisconnectAllSitesModal).

On confirm, the page iterates all non-snap connected origins and dispatches removePermissionsFor with each origin’s permission parentCapability list, then shows a success/error toast. Includes new i18n strings and Jest tests/snapshots for the modal and the new page behavior.

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

@ffmcgee725 ffmcgee725 requested a review from a team as a code owner February 4, 2026 14:40
@metamaskbot metamaskbot added the team-wallet-integrations Wallet Integrations team label Feb 4, 2026
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 4, 2026

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/core-extension-ux (7 files, +384 -4)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 disconnect-all-modal/
          • 📁 __snapshots__/
            • 📄 disconnect-all-sites-modal.test.tsx.snap +3 -0
            • 📄 disconnect-all-sites-modal.test.tsx +65 -0
            • 📄 disconnect-all-sites-modal.tsx +56 -0
            • 📄 index.ts +2 -0
        • 📁 pages/
          • 📁 permissions-page/
            • 📁 __snapshots__/
              • 📄 permissions-page.test.js.snap +18 -0
              • 📄 permissions-page.js +105 -4
              • 📄 permissions-page.test.js +135 -0

@github-actions github-actions bot added the size-M label Feb 4, 2026
} else {
setShowSuccessToast(true);
}
}, [dispatch, mergedConnectionsList, subjects]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Async errors not caught, success toast always shown

Medium Severity

The try/catch block in handleDisconnectAll only catches synchronous exceptions, but removePermissionsFor uses an async callback pattern (callBackgroundMethod). Actual permission removal errors are handled via displayWarning in the background callback, not captured in the errors array. This means errors.length will always be 0 (barring synchronous property access failures), so the success toast displays regardless of whether disconnections actually succeeded.

Fix in Cursor Fix in Web

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.

{t('disconnectAllSites')}
</Button>
</Box>
</Footer>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Success toast unmounts before user can see it

Medium Severity

The success/error toasts are rendered inside the Footer component, which is conditionally rendered only when totalConnections > 0. After successfully disconnecting all sites, mergedConnectionsList updates via Redux, causing totalConnections to become 0 and the Footer (including the toast) to unmount. Users will never see the success toast confirming their action completed.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is correct I do not see a success toast when testing

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 4, 2026

Builds ready [1b726e1]
UI Startup Metrics (1442 ± 117 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14421187175111715391605
load--12361001153111513171422
domContentLoaded--1229994152611413111416
domInteractive--2716101192484
firstPaint--202681472231212341
backgroundConnect--24122128614244273
firstReactRender--18103452027
initialActions--107113
loadScripts--1005779128611210891194
setupStore--1463461728
numNetworkReqs--231592201581
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--19051356603383718114586
load--11471013190916511571581
domContentLoaded--11291004189016011271558
domInteractive--34171722631100
firstPaint--182731578162220331
backgroundConnect--45928045046093601075
firstReactRender--22145072439
initialActions--104112
loadScripts--89076415571448851271
setupStore--1453461828
numNetworkReqs--1134726345135207
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--85267812031089041065
load--717605112293771882
domContentLoaded--712599111793766876
domInteractive--251582172376
firstPaint--1046228146126197
backgroundConnect--41181683047115
firstReactRender--15104051728
initialActions--104112
loadScripts--709597111592764872
setupStore--1173041122
numNetworkReqs--231596211587
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1225905211120112951650
load--69760111701276791063
domContentLoaded--68859611621276701058
domInteractive--37172513933122
firstPaint--141601102130153363
backgroundConnect--16713033155171302
firstReactRender--21164032226
initialActions--102011
loadScripts--68659411531256681049
setupStore--1252131317
numNetworkReqs--1184627552146264
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16051336235019417361965
load--13531160195515414541611
domContentLoaded--13521160195515414531611
domInteractive--723317239104140
firstPaint--------
backgroundConnect--70272024173170
firstReactRender--12101821315
initialActions--102122
loadScripts--13161137193014713931568
setupStore--136126161258
numNetworkReqs--251299221894
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--27512039663361428983861
load--15971223539046116812286
domContentLoaded--15961223539046116812286
domInteractive--13635575108138390
firstPaint--------
backgroundConnect--34111813572973531029
firstReactRender--18146471822
initialActions--203122
loadScripts--15371200527144216222222
setupStore--1218717173120609
numNetworkReqs--72391432897121
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--17321427227417118342062
load--14851267176812115901716
domContentLoaded--14841267176812115891716
domInteractive--893129249129152
firstPaint--------
backgroundConnect--73302464676178
firstReactRender--16116991623
initialActions--103122
loadScripts--14441250168910315191626
setupStore--184228291450
numNetworkReqs--231282171872
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--26891948409441528143690
load--15391180244425917012070
domContentLoaded--15391180244425917012069
domInteractive--1213168898115322
firstPaint--------
backgroundConnect--34211715923233331151
firstReactRender--21154852327
initialActions--215123
loadScripts--14901163223221416701874
setupStore--16951206223179667
numNetworkReqs--73361483199133
19--------
📊 Page Load Benchmark Results

Current Commit: 1b726e1 | Date: 2/4/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±39ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 706ms (±62ms) 🟢 | historical mean value: 725ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 87ms (±128ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 39ms 1.01s 1.35s 1.04s 1.35s
domContentLoaded 706ms 62ms 682ms 1.29s 714ms 1.29s
firstPaint 87ms 128ms 60ms 1.36s 84ms 1.36s
firstContentfulPaint 87ms 128ms 60ms 1.36s 84ms 1.36s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 4.34 KiB (0.05%)
  • common: 383 Bytes (0%)

Copy link
Copy Markdown
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

All looks good to me, I might nit the language "If you disconnect from all sites, you’ll need to reconnect your accounts and networks to use them again." but I'll take that up with @adamceresko

@ffmcgee725 ffmcgee725 added this pull request to the merge queue Feb 5, 2026
Merged via the queue into main with commit 10e83d1 Feb 5, 2026
179 checks passed
@ffmcgee725 ffmcgee725 deleted the jc/WAPI-898 branch February 5, 2026 10:20
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2026
@metamaskbot metamaskbot added the release-13.18.0 Issue or pull request that will be included in release 13.18.0 label Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.18.0 Issue or pull request that will be included in release 13.18.0 size-M team-wallet-integrations Wallet Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants