You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: multichain support on dapp connected site popover cp-13.5.0 (#36881)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
This PR fixes issue with the DaPP permissions icon showing wrong network
for Solana only DaPP.
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Fixed a bug with the DaPP permissions icon showing
wrong network for Solana only DaPP
## **Related issues**
Fixes: #36825
## **Manual testing steps**
1. Navigate to SOL only dapp (Orca, Jupiter)
2. Connect to DaPP
3. Notice Badge icon
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<img width="398" height="596" alt="Screenshot 2025-10-15 at 16 37 41"
src="https://github.com/user-attachments/assets/350edb96-5c1d-4904-8601-c1f04f1a5c8c"
/>
<!-- [screenshots/recordings] -->
### **After**
<img width="398" height="598" alt="Screenshot 2025-10-15 at 16 35 33"
src="https://github.com/user-attachments/assets/c212b838-246d-4bb3-8e96-99c4ddeadf88"
/>
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Refactors active network detection to be multichain-aware (EVM and
Solana) via a selector, updates the connected site popover to use it,
adds safeguards, and adjusts/extends tests and fixtures.
>
> - **Selectors**:
> - `getDappActiveNetwork`: Derives active network from ordered
connected accounts; supports EVM and non‑EVM (Solana) via scopes;
returns `{ ...network, isEvm }`; uses
`getMultichainNetworkConfigurationsByChainId`.
> - Adds use of `getOrderedConnectedAccountsForActiveTab`; updates tests
for new logic.
> - `getMetaMaskAccountsOrdered`: Safeguards spreading when `address`
missing.
> - **UI**:
> - `ConnectedSitePopover`: Replaces manual domain-based lookup with
`getDappActiveNetwork`; removes `useMemo` and unused selectors.
> - **Tests**:
> - New/updated tests for selector (`ui/selectors/dapp.test.ts`)
covering EVM, Solana, and null paths.
> - Updates to popover/menu/routes tests to include required state
(`domains`, `selectedNetworkClientId`, `keyrings.metadata`,
`internalAccounts`, `permissionHistory`, multichain configs/accounts).
> - **Test data**:
> - Extend fixtures with additional accounts/addresses and keyring
metadata in `mock-send-state.json` and onboarding data.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
98c125e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments