From a608982ca77951b30b092fa487ea449d42b12884 Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Tue, 10 Dec 2024 20:34:02 +0000 Subject: [PATCH 01/12] Version v12.9.1 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d7b03f6751d..c379a2ebe5d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [12.9.1] + ## [12.9.0] ### Added - Added error handling to ensure users are not redirected to an incorrect network when sending or swapping tokens ([#28740](https://github.com/MetaMask/metamask-extension/pull/28740)) @@ -5469,7 +5471,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.9.0...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.9.1...HEAD +[12.9.1]: https://github.com/MetaMask/metamask-extension/compare/v12.9.0...v12.9.1 [12.9.0]: https://github.com/MetaMask/metamask-extension/compare/v12.8.1...v12.9.0 [12.8.1]: https://github.com/MetaMask/metamask-extension/compare/v12.8.0...v12.8.1 [12.8.0]: https://github.com/MetaMask/metamask-extension/compare/v12.7.2...v12.8.0 diff --git a/package.json b/package.json index d471f05554a9..67c048a611cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "12.9.0", + "version": "12.9.1", "private": true, "repository": { "type": "git", From 77179c4fcbbabbd0c9426b21deef802b8908da62 Mon Sep 17 00:00:00 2001 From: Nick Gambino <35090461+gambinish@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:52:31 -0800 Subject: [PATCH 02/12] refactor: Init getTokenNetworkFilter selector (#29068) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** We are falling back to an empty object when tokenNetworkFilter is undefined in several areas around the app. This PR aims to consolidate those within a single selector to make is easier to maintain and fall back on. This only mitigates the issue. Root cause is that the `tokenNetworkFilter` needs to be added via a migration script in order to properly be present, without having to fallback. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29068?quickstart=1) ## **Related issues** Fixes: https://metamask.sentry.io/issues/6125799129/?environment=production&project=273505&query=is%3Aunresolved%20issue.priority%3A%5Bhigh%2C%20medium%5D%20firstRelease%3A12.9.0&referrer=issue-stream&sort=freq&statsPeriod=7d&stream_index=0 ## **Manual testing steps** 1. Hardcode tokenNetworkFilter to undefined, should not break app. ## **Screenshots/Recordings** ### **Before** ### **After** ## **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. --------- Co-authored-by: Brian Bergeron --- .../asset-list-control-bar.tsx | 13 ++++++++----- ui/components/app/assets/asset-list/asset-list.tsx | 6 +++--- .../asset-list/network-filter/network-filter.tsx | 10 +++++----- ui/components/app/assets/token-list/token-list.tsx | 7 ++++--- .../detected-token-selection-popover.js | 6 +++--- ui/components/app/detected-token/detected-token.js | 6 +++--- .../detected-token-banner/detected-token-banner.js | 6 +++--- .../network-list-menu/network-list-menu.tsx | 4 ++-- ui/selectors/selectors.js | 8 ++++++-- 9 files changed, 37 insertions(+), 29 deletions(-) diff --git a/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx b/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx index 00e0692cfc73..768d2bb896eb 100644 --- a/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx +++ b/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx @@ -1,6 +1,9 @@ import React, { useEffect, useRef, useState, useContext, useMemo } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { getCurrentNetwork, getPreferences } from '../../../../../selectors'; +import { + getCurrentNetwork, + getTokenNetworkFilter, +} from '../../../../../selectors'; import { getNetworkConfigurationsByChainId } from '../../../../../../shared/modules/selectors/networks'; import { Box, @@ -55,7 +58,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => { const currentNetwork = useSelector(getCurrentNetwork); const allNetworks = useSelector(getNetworkConfigurationsByChainId); - const { tokenNetworkFilter } = useSelector(getPreferences); + const tokenNetworkFilter = useSelector(getTokenNetworkFilter); const [isTokenSortPopoverOpen, setIsTokenSortPopoverOpen] = useState(false); const [isImportTokensPopoverOpen, setIsImportTokensPopoverOpen] = useState(false); @@ -72,7 +75,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => { }); const allNetworksFilterShown = - Object.keys(tokenNetworkFilter || {}).length !== + Object.keys(tokenNetworkFilter).length !== Object.keys(allOpts || {}).length; useEffect(() => { @@ -88,7 +91,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => { useEffect(() => { if ( process.env.PORTFOLIO_VIEW && - Object.keys(tokenNetworkFilter || {}).length === 0 + Object.keys(tokenNetworkFilter).length === 0 ) { dispatch(setTokenNetworkFilter(allOpts)); } else { @@ -99,7 +102,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => { // When a network gets added/removed we want to make sure that we switch to the filtered list of the current network // We only want to do this if the "Current Network" filter is selected useEffect(() => { - if (Object.keys(tokenNetworkFilter || {}).length === 1) { + if (Object.keys(tokenNetworkFilter).length === 1) { dispatch(setTokenNetworkFilter({ [currentNetwork.chainId]: true })); } }, [Object.keys(allNetworks).length]); diff --git a/ui/components/app/assets/asset-list/asset-list.tsx b/ui/components/app/assets/asset-list/asset-list.tsx index ab2adb308bf4..6a82295cb2f3 100644 --- a/ui/components/app/assets/asset-list/asset-list.tsx +++ b/ui/components/app/assets/asset-list/asset-list.tsx @@ -7,8 +7,8 @@ import { getAllDetectedTokensForSelectedAddress, getDetectedTokensInCurrentNetwork, getIstokenDetectionInactiveOnNonMainnetSupportedNetwork, - getPreferences, getSelectedAccount, + getTokenNetworkFilter, } from '../../../../selectors'; import { getNetworkConfigurationsByChainId } from '../../../../../shared/modules/selectors/networks'; import { @@ -80,14 +80,14 @@ const AssetList = ({ onClickAsset, showTokensLinks }: AssetListProps) => { ); const allNetworks = useSelector(getNetworkConfigurationsByChainId); - const { tokenNetworkFilter } = useSelector(getPreferences); + const tokenNetworkFilter = useSelector(getTokenNetworkFilter); const allOpts: Record = {}; Object.keys(allNetworks || {}).forEach((chainId) => { allOpts[chainId] = true; }); const allNetworksFilterShown = - Object.keys(tokenNetworkFilter || {}).length !== + Object.keys(tokenNetworkFilter).length !== Object.keys(allOpts || {}).length; const [showFundingMethodModal, setShowFundingMethodModal] = useState(false); diff --git a/ui/components/app/assets/asset-list/network-filter/network-filter.tsx b/ui/components/app/assets/asset-list/network-filter/network-filter.tsx index e1fdd8db9535..eece5530eea4 100644 --- a/ui/components/app/assets/asset-list/network-filter/network-filter.tsx +++ b/ui/components/app/assets/asset-list/network-filter/network-filter.tsx @@ -3,10 +3,10 @@ import { useDispatch, useSelector } from 'react-redux'; import { setTokenNetworkFilter } from '../../../../../store/actions'; import { getCurrentNetwork, - getPreferences, getShouldHideZeroBalanceTokens, getSelectedAccount, getAllChainsToPoll, + getTokenNetworkFilter, } from '../../../../../selectors'; import { getCurrentChainId, @@ -48,7 +48,7 @@ const NetworkFilter = ({ handleClose }: SortControlProps) => { const selectedAccount = useSelector(getSelectedAccount); const allNetworks = useSelector(getNetworkConfigurationsByChainId); const [chainsToShow, setChainsToShow] = useState([]); - const { tokenNetworkFilter } = useSelector(getPreferences); + const tokenNetworkFilter = useSelector(getTokenNetworkFilter); const shouldHideZeroBalanceTokens = useSelector( getShouldHideZeroBalanceTokens, ); @@ -102,7 +102,7 @@ const NetworkFilter = ({ handleClose }: SortControlProps) => { <> handleFilter(allOpts)} @@ -163,8 +163,8 @@ const NetworkFilter = ({ handleClose }: SortControlProps) => { handleFilter({ [chainId]: true })} testId="network-filter-current" diff --git a/ui/components/app/assets/token-list/token-list.tsx b/ui/components/app/assets/token-list/token-list.tsx index d3e67f6204cc..8a8b207c6397 100644 --- a/ui/components/app/assets/token-list/token-list.tsx +++ b/ui/components/app/assets/token-list/token-list.tsx @@ -17,6 +17,7 @@ import { getSelectedAccountTokensAcrossChains, getShowFiatInTestnets, getTokenExchangeRates, + getTokenNetworkFilter, } from '../../../../selectors'; import { getConversionRate } from '../../../../ducks/metamask/metamask'; import { filterAssets } from '../util/filter'; @@ -86,8 +87,8 @@ export default function TokenList({ const dispatch = useDispatch(); const currentNetwork = useSelector(getCurrentNetwork); const allNetworks = useSelector(getNetworkConfigurationIdByChainId); - const { tokenSortConfig, tokenNetworkFilter, privacyMode } = - useSelector(getPreferences); + const { tokenSortConfig, privacyMode } = useSelector(getPreferences); + const tokenNetworkFilter = useSelector(getTokenNetworkFilter); const selectedAccount = useSelector(getSelectedAccount); const conversionRate = useSelector(getConversionRate); const contractExchangeRates = useSelector( @@ -116,7 +117,7 @@ export default function TokenList({ const allNetworkFilters = Object.fromEntries( Object.keys(allNetworks).map((chainId) => [chainId, true]), ); - if (Object.keys(tokenNetworkFilter || {}).length > 1) { + if (Object.keys(tokenNetworkFilter).length > 1) { dispatch(setTokenNetworkFilter(allNetworkFilters)); } } diff --git a/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js index 4c674a5c437f..ae5e1048037f 100644 --- a/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js +++ b/ui/components/app/detected-token/detected-token-selection-popover/detected-token-selection-popover.js @@ -17,7 +17,7 @@ import { getAllDetectedTokensForSelectedAddress, getCurrentNetwork, getDetectedTokensInCurrentNetwork, - getPreferences, + getTokenNetworkFilter, } from '../../../../selectors'; import Popover from '../../../ui/popover'; @@ -41,14 +41,14 @@ const DetectedTokenSelectionPopover = ({ const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork); const allNetworks = useSelector(getNetworkConfigurationsByChainId); - const { tokenNetworkFilter } = useSelector(getPreferences); + const tokenNetworkFilter = useSelector(getTokenNetworkFilter); const allOpts = {}; Object.keys(allNetworks || {}).forEach((networkId) => { allOpts[networkId] = true; }); const allNetworksFilterShown = - Object.keys(tokenNetworkFilter || {}).length !== + Object.keys(tokenNetworkFilter).length !== Object.keys(allOpts || {}).length; const currentNetwork = useSelector(getCurrentNetwork); diff --git a/ui/components/app/detected-token/detected-token.js b/ui/components/app/detected-token/detected-token.js index 12957e1aca31..8d9d4735eb96 100644 --- a/ui/components/app/detected-token/detected-token.js +++ b/ui/components/app/detected-token/detected-token.js @@ -16,7 +16,7 @@ import { import { getAllDetectedTokensForSelectedAddress, getDetectedTokensInCurrentNetwork, - getPreferences, + getTokenNetworkFilter, } from '../../../selectors'; import { MetaMetricsContext } from '../../../contexts/metametrics'; @@ -63,14 +63,14 @@ const DetectedToken = ({ setShowDetectedTokens }) => { ); const currentChainId = useSelector(getCurrentChainId); const allNetworks = useSelector(getNetworkConfigurationsByChainId); - const { tokenNetworkFilter } = useSelector(getPreferences); + const tokenNetworkFilter = useSelector(getTokenNetworkFilter); const allOpts = {}; Object.keys(allNetworks || {}).forEach((chainId) => { allOpts[chainId] = true; }); const allNetworksFilterShown = - Object.keys(tokenNetworkFilter || {}).length !== + Object.keys(tokenNetworkFilter).length !== Object.keys(allOpts || {}).length; const totalDetectedTokens = useMemo(() => { diff --git a/ui/components/multichain/detected-token-banner/detected-token-banner.js b/ui/components/multichain/detected-token-banner/detected-token-banner.js index 7cd315d57cab..2b6f7238024f 100644 --- a/ui/components/multichain/detected-token-banner/detected-token-banner.js +++ b/ui/components/multichain/detected-token-banner/detected-token-banner.js @@ -11,7 +11,7 @@ import { import { getDetectedTokensInCurrentNetwork, getAllDetectedTokensForSelectedAddress, - getPreferences, + getTokenNetworkFilter, } from '../../../selectors'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { @@ -28,7 +28,7 @@ export const DetectedTokensBanner = ({ }) => { const t = useI18nContext(); const trackEvent = useContext(MetaMetricsContext); - const { tokenNetworkFilter } = useSelector(getPreferences); + const tokenNetworkFilter = useSelector(getTokenNetworkFilter); const allNetworks = useSelector(getNetworkConfigurationsByChainId); const allOpts = {}; @@ -37,7 +37,7 @@ export const DetectedTokensBanner = ({ }); const allNetworksFilterShown = - Object.keys(tokenNetworkFilter || {}).length !== + Object.keys(tokenNetworkFilter).length !== Object.keys(allOpts || {}).length; const detectedTokens = useSelector(getDetectedTokensInCurrentNetwork); diff --git a/ui/components/multichain/network-list-menu/network-list-menu.tsx b/ui/components/multichain/network-list-menu/network-list-menu.tsx index 28680b24ba45..390996980f11 100644 --- a/ui/components/multichain/network-list-menu/network-list-menu.tsx +++ b/ui/components/multichain/network-list-menu/network-list-menu.tsx @@ -54,7 +54,7 @@ import { getAllDomains, getPermittedChainsForSelectedTab, getPermittedAccountsForSelectedTab, - getPreferences, + getTokenNetworkFilter, } from '../../../selectors'; import ToggleButton from '../../ui/toggle-button'; import { @@ -116,7 +116,7 @@ export const NetworkListMenu = ({ onClose }: { onClose: () => void }) => { const dispatch = useDispatch(); const trackEvent = useContext(MetaMetricsContext); - const { tokenNetworkFilter } = useSelector(getPreferences); + const tokenNetworkFilter = useSelector(getTokenNetworkFilter); const showTestNetworks = useSelector(getShowTestNetworks); const currentChainId = useSelector(getCurrentChainId); const selectedTabOrigin = useSelector(getOriginOfCurrentTab); diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 2baaa1a0c931..8cd56236ec8d 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -1076,8 +1076,7 @@ export function getPetnamesEnabled(state) { export function getIsTokenNetworkFilterEqualCurrentNetwork(state) { const chainId = getCurrentChainId(state); - const { tokenNetworkFilter: tokenNetworkFilterValue } = getPreferences(state); - const tokenNetworkFilter = tokenNetworkFilterValue || {}; + const tokenNetworkFilter = getTokenNetworkFilter(state); if ( Object.keys(tokenNetworkFilter).length === 1 && Object.keys(tokenNetworkFilter)[0] === chainId @@ -1087,6 +1086,11 @@ export function getIsTokenNetworkFilterEqualCurrentNetwork(state) { return false; } +export function getTokenNetworkFilter(state) { + const { tokenNetworkFilter } = getPreferences(state); + return tokenNetworkFilter || {}; +} + export function getUseTransactionSimulations(state) { return Boolean(state.metamask.useTransactionSimulations); } From 4ae9db0fedf3ba0c9e567fe7565d18f5b3e815bc Mon Sep 17 00:00:00 2001 From: Nick Gambino <35090461+gambinish@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:37:44 -0800 Subject: [PATCH 03/12] fix: Token list should respect hidezerobalance setting (#29058) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** If a token is not a native asset for a chain, and the balance is zero, it should not be rendered if the `hideZeroBalance` setting is toggled to true. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29058?quickstart=1) ## **Related issues** Fixes: erc20 and native tokens with zero balance rendering on asset list on 12.9 release. ## **Manual testing steps** 1. Add an erc20 token to any chain with zero balance, should display when imported by default 2. Toggle `hideZeroBalance` setting to true in general settings > Respect the "hide zero balance" setting (when true): - Native tokens should always display with zero balance when on the current network filter. - Native tokens should not display with zero balance when on all networks filter - ERC20 tokens with zero balances should respect the setting on both the current and all networks. Respect the "hide zero balance" setting (when false): - Native tokens should always display with zero balance when on the current network filter. - Native tokens should always display with zero balance when on all networks filter - ERC20 tokens always display with zero balance on both the current and all networks filter. ## **Screenshots/Recordings** https://github.com/user-attachments/assets/aaee7e23-ab5c-4216-89e5-dc11485200bc ## **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. --------- Co-authored-by: sahar-fehri --- .../app/assets/token-list/token-list.tsx | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/ui/components/app/assets/token-list/token-list.tsx b/ui/components/app/assets/token-list/token-list.tsx index 8a8b207c6397..a2ba7674f6a2 100644 --- a/ui/components/app/assets/token-list/token-list.tsx +++ b/ui/components/app/assets/token-list/token-list.tsx @@ -8,6 +8,7 @@ import { getCurrencyRates, getCurrentNetwork, getIsTestnet, + getIsTokenNetworkFilterEqualCurrentNetwork, getMarketData, getNetworkConfigurationIdByChainId, getNewTokensImported, @@ -87,7 +88,8 @@ export default function TokenList({ const dispatch = useDispatch(); const currentNetwork = useSelector(getCurrentNetwork); const allNetworks = useSelector(getNetworkConfigurationIdByChainId); - const { tokenSortConfig, privacyMode } = useSelector(getPreferences); + const { tokenSortConfig, privacyMode, hideZeroBalanceTokens } = + useSelector(getPreferences); const tokenNetworkFilter = useSelector(getTokenNetworkFilter); const selectedAccount = useSelector(getSelectedAccount); const conversionRate = useSelector(getConversionRate); @@ -97,6 +99,9 @@ export default function TokenList({ ); const newTokensImported = useSelector(getNewTokensImported); const selectedAccountTokensChains = useFilteredAccountTokens(currentNetwork); + const isOnCurrentNetwork = useSelector( + getIsTokenNetworkFilterEqualCurrentNetwork, + ); const { tokenBalances } = useTokenBalances(); const selectedAccountTokenBalancesAcrossChains = @@ -110,7 +115,7 @@ export default function TokenList({ const nativeBalances: Record = useSelector( getSelectedAccountNativeTokenCachedBalanceByChainId, ) as Record; - + const isTestnet = useSelector(getIsTestnet); // Ensure newly added networks are included in the tokenNetworkFilter useEffect(() => { if (process.env.PORTFOLIO_VIEW) { @@ -148,14 +153,28 @@ export default function TokenList({ currencyRates, }); - // Append processed token with balance and fiat amount - tokensWithBalance.push({ - ...token, - balance, - tokenFiatAmount, - chainId, - string: String(balance), - }); + // Respect the "hide zero balance" setting (when true): + // - Native tokens should always display with zero balance when on the current network filter. + // - Native tokens should not display with zero balance when on all networks filter + // - ERC20 tokens with zero balances should respect the setting on both the current and all networks. + + // Respect the "hide zero balance" setting (when false): + // - Native tokens should always display with zero balance when on the current network filter. + // - Native tokens should always display with zero balance when on all networks filter + // - ERC20 tokens always display with zero balance on both the current and all networks filter. + if ( + !hideZeroBalanceTokens || + balance !== '0' || + (token.isNative && isOnCurrentNetwork) + ) { + tokensWithBalance.push({ + ...token, + balance, + tokenFiatAmount, + chainId, + string: String(balance), + }); + } }); }, ); @@ -217,8 +236,6 @@ export default function TokenList({ console.log(t('loadingTokens')); } - // Check if testnet - const isTestnet = useSelector(getIsTestnet); const shouldShowFiat = useMultichainSelector( getMultichainShouldShowFiat, selectedAccount, From 3fc8b20dadcdf3ccf3226acae737e90ea8d5853c Mon Sep 17 00:00:00 2001 From: Nick Gambino <35090461+gambinish@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:04:51 -0800 Subject: [PATCH 04/12] fix: [cherry-pick] fix sticky autodetection banner (#29061) (#29078) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cherry-picks https://github.com/MetaMask/metamask-extension/commit/5789e1ceebdb59a2fd02feb3e3dee035988ba2f2 (#29061) ## **Description** fix sticky autodetection banner [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29061?quickstart=1) ## **Related issues** Fixes: #29059 ## **Manual testing steps** 1. Go to autodetected banner 2. click on ignore all 3. you should have allNetworks selected ## **Screenshots/Recordings** ### **Before** ### **After** https://drive.google.com/file/d/11zcmgV1Bdq5wx9MkDlhxr8oDBr9DGB3d/view?usp=sharing ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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. --------- ## **Description** [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29078?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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. Co-authored-by: Salim TOUBAL Co-authored-by: Brian Bergeron --- ...tected-token-ignored-popover.test.tsx.snap | 153 ++++++++++++++++++ .../detected-token-ignored-popover.js | 1 + .../detected-token-ignored-popover.test.tsx | 37 +++++ .../app/detected-token/detected-token.js | 12 +- 4 files changed, 198 insertions(+), 5 deletions(-) create mode 100644 ui/components/app/detected-token/detected-token-ignored-popover/__snapshots__/detected-token-ignored-popover.test.tsx.snap create mode 100644 ui/components/app/detected-token/detected-token-ignored-popover/detected-token-ignored-popover.test.tsx diff --git a/ui/components/app/detected-token/detected-token-ignored-popover/__snapshots__/detected-token-ignored-popover.test.tsx.snap b/ui/components/app/detected-token/detected-token-ignored-popover/__snapshots__/detected-token-ignored-popover.test.tsx.snap new file mode 100644 index 000000000000..3839c8d23201 --- /dev/null +++ b/ui/components/app/detected-token/detected-token-ignored-popover/__snapshots__/detected-token-ignored-popover.test.tsx.snap @@ -0,0 +1,153 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`DetectedTokenIgnoredPopover should match snapshot for ignore mode 1`] = ` + +
+
+
+