feat: implement disconnect all button to dapp connections main screen#39791
feat: implement disconnect all button to dapp connections main screen#39791ffmcgee725 merged 6 commits intomainfrom
Conversation
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/core-extension-ux (7 files, +384 -4)
|
| } else { | ||
| setShowSuccessToast(true); | ||
| } | ||
| }, [dispatch, mergedConnectionsList, subjects]); |
There was a problem hiding this comment.
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.
ui/components/multichain/pages/permissions-page/permissions-page.js
Outdated
Show resolved
Hide resolved
| {t('disconnectAllSites')} | ||
| </Button> | ||
| </Box> | ||
| </Footer> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I think this is correct I do not see a success toast when testing
Builds ready [1b726e1]
UI Startup Metrics (1442 ± 117 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
adonesky1
left a comment
There was a problem hiding this comment.
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


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.
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
Screenshots/Recordings
Before
After
Screen.Recording.2026-02-04.at.15.34.29.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Adds bulk permission revocation from the connections screen by dispatching
removePermissionsForacross 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
removePermissionsForwith each origin’s permissionparentCapabilitylist, 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.