Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b5e5c6a
chore: stiky trade button in Market Insights (#27047)
zone-live Mar 5, 2026
80f2a27
test: migrates the first set of page objects to the unified approach …
christopherferreira9 Mar 5, 2026
86cb8a3
feat: MUSD-379 fixed off center buy/get mUSD button in Primary conver…
Matt561 Mar 5, 2026
3028d19
chore: Refine Send Review page to polish UI (#26984)
amandaye0h Mar 5, 2026
32d22d9
fix: remove redundant renewSeedlessControllerRefreshTokens call (#27039)
ieow Mar 5, 2026
68f19ab
chore: Refine spacing and styling on the unlock page (#26899)
amandaye0h Mar 5, 2026
708b528
fix(perps): suppress spurious offline/reconnecting toasts on mount an…
abretonc7s Mar 5, 2026
d900457
refactor: remove BIP-44 flag from wallet selector (#26931)
gantunesr Mar 5, 2026
f21fe38
fix: use ref for `targetWalletType` in `useHardwareWallet` system (#2…
mathieuartu Mar 5, 2026
05fac22
refactor: remove BIP-44 wrappers for dapp connection (#26248)
gantunesr Mar 5, 2026
a4a6692
refactor(analytics): PR A0 add identify() as backward-compat alias fo…
NicolasMassart Mar 5, 2026
7ea8fc7
chore: update envs with the correct api url (#27014)
zone-live Mar 5, 2026
1c8aa1e
refactor(networks): replace NetworkSettings with NetworkDetailsView a…
PatrykLucka Mar 5, 2026
6c35bb5
feat(networks): enhance form editability checks in NetworkDetailsView…
PatrykLucka Mar 5, 2026
f7a98b2
test: Swap action smoke test (#27048)
cmd-ob Mar 5, 2026
6b069d2
chore: remove error messages from bug report template (#27037)
gauthierpetetin Mar 5, 2026
6f8f892
fix(TMCU-499): fire Ramps Button Clicked event on token empty state B…
wachunei Mar 5, 2026
03a886f
chore: update package version (#27054)
zone-live Mar 5, 2026
3f9eb24
test: simplify the input in order to avoid flakiness (#27060)
christopherferreira9 Mar 5, 2026
43e62f8
docs: add documentation on how to use ramps staging environments (#27…
cortisiko Mar 5, 2026
d9d8e01
test: color-no-hex snaps (#26958)
georgewrmarshall Mar 5, 2026
34fcbd5
fix: increase homepage section gap from 24px to 48px (#27066)
wachunei Mar 5, 2026
a0da5f1
feat(perps): agentic toolkit — CDP bridge, recipes, yarn shortcuts (#…
abretonc7s Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ module.exports = {
'@metamask/design-tokens/color-no-hex': 'error',
},
},
{
files: ['app/components/Snaps/**/*.{js,jsx,ts,tsx}'],
rules: {
'@metamask/design-tokens/color-no-hex': 'error',
},
},
{
files: [
'app/components/UI/Name/**/*.{js,ts,tsx}',
Expand Down
1 change: 0 additions & 1 deletion .github/scripts/shared/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const bugReportIssueTemplateTitles = [
'### Expected behavior',
'### Screenshots', // TODO: replace '### Screenshots' by '### Screenshots/Recordings' in January 2024 (as most issues will meet this criteria by then)
'### Steps to reproduce',
'### Error messages or log output',
'### Version',
'### Build type',
'### Device',
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ To learn how to contribute to the MetaMask codebase, visit our [Contributor Docs
- [Build Troubleshooting](./docs/readme/troubleshooting.md)
- [Component View Testing](./docs/readme/component-view-testing.md)
- [E2E Testing](./docs/readme/e2e-testing.md)
- [On-Ramp Provider Manual Testing](./tests/docs/ONRAMP-PROVIDER-TESTING.md)
- [Debugging](./docs/readme/debugging.md)
- [Performance](./docs/readme/performance.md)
- [Release Build Profiling](./docs/readme/release-build-profiler.md)
Expand Down
26 changes: 17 additions & 9 deletions app/components/Nav/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import ConnectQRHardware from '../../Views/ConnectQRHardware';
import SelectHardwareWallet from '../../Views/ConnectHardware/SelectHardware';
import { UpdateNeeded } from '../../../components/UI/UpdateNeeded';
import { OTAUpdatesModal } from '../../UI/OTAUpdatesModal';
import NetworkSettings from '../../Views/Settings/NetworksSettings/NetworkSettings';
import NetworkDetailsView from '../../Views/NetworksManagement/NetworkDetailsView';
import ModalMandatory from '../../../component-library/components/Modals/ModalMandatory';
import { RestoreWallet } from '../../Views/RestoreWallet';
import WalletRestored from '../../Views/RestoreWallet/WalletRestored';
Expand Down Expand Up @@ -148,10 +148,10 @@ import useInterval from '../../hooks/useInterval';
import { Duration } from '@metamask/utils';
import { selectSeedlessOnboardingLoginFlow } from '../../../selectors/seedlessOnboardingController';
import { PayWithModal } from '../../Views/confirmations/components/modals/pay-with-modal/pay-with-modal';
import { State2AccountConnectWrapper } from '../../Views/MultichainAccounts/MultichainAccountConnect/State2AccountConnectWrapper';
import MultichainAccountConnect from '../../Views/MultichainAccounts/MultichainAccountConnect/MultichainAccountConnect';
import { SmartAccountModal } from '../../Views/MultichainAccounts/AccountDetails/components/SmartAccountModal/SmartAccountModal';
import TradeWalletActions from '../../Views/TradeWalletActions';
import { BIP44AccountPermissionWrapper } from '../../Views/MultichainAccounts/MultichainPermissionsSummary/BIP44AccountPermissionWrapper';
import { MultichainAccountPermissions } from '../../Views/MultichainAccounts/MultichainAccountPermissions/MultichainAccountPermissions';
import SocialLoginIosUser from '../../Views/SocialLoginIosUser';
import { useOTAUpdates } from '../../hooks/useOTAUpdates';
import MultichainTransactionDetailsSheet from '../../UI/MultichainTransactionDetailsModal/MultichainTransactionDetailsSheet';
Expand Down Expand Up @@ -333,10 +333,10 @@ const AddNetworkFlow = () => {
const route = useRoute();

return (
<Stack.Navigator>
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen
name="AddNetwork"
component={NetworkSettings}
component={NetworkDetailsView}
initialParams={route?.params}
/>
</Stack.Navigator>
Expand Down Expand Up @@ -460,11 +460,11 @@ const RootModalFlow = (props: RootModalFlowProps) => (
/>
<Stack.Screen
name={Routes.SHEET.ACCOUNT_CONNECT}
component={State2AccountConnectWrapper}
component={MultichainAccountConnect}
/>
<Stack.Screen
name={Routes.SHEET.ACCOUNT_PERMISSIONS}
component={BIP44AccountPermissionWrapper}
component={MultichainAccountPermissions}
initialParams={{ initialScreen: AccountPermissionsScreens.Connected }}
/>
<Stack.Screen
Expand Down Expand Up @@ -1059,13 +1059,21 @@ const AppFlow = () => (
<Stack.Screen
name={Routes.ADD_NETWORK}
component={AddNetworkFlow}
options={{ animationEnabled: true }}
options={{
animationEnabled: true,
cardStyle: { flex: 1, backgroundColor: importedColors.transparent },
gestureEnabled: true,
}}
/>
{isNetworkUiRedesignEnabled() ? (
<Stack.Screen
name={Routes.EDIT_NETWORK}
component={AddNetworkFlow}
options={{ animationEnabled: true }}
options={{
animationEnabled: true,
cardStyle: { flex: 1, backgroundColor: importedColors.transparent },
gestureEnabled: true,
}}
/>
) : null}
<Stack.Screen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { fireEvent, waitFor } from '@testing-library/react-native';
import ClipboardManager from '../../../../core/ClipboardManager';
import { Copyable } from '@metamask/snaps-sdk/jsx';
import { mockTheme } from '../../../../util/theme';
import { renderInterface } from '../testUtils';
import { copyable } from './copyable';

Expand Down Expand Up @@ -42,14 +43,6 @@ jest.mock('../../../../core/Engine/Engine', () => ({
describe('SnapUICopyable', () => {
// Tests for the factory function
describe('copyable factory function', () => {
// Create a mock theme object
const mockTheme = {
colors: {
text: { default: '#000000' },
background: { default: '#FFFFFF' },
},
};

// Create base params that match UIComponentParams interface
const baseParams = {
map: {},
Expand Down
8 changes: 4 additions & 4 deletions app/components/Snaps/SnapUIRenderer/components/link.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('link component', () => {
children: 'link',
key: expect.any(String),
props: {
color: '#4459ff',
color: mockTheme.colors.info.default,
style: {
fontWeight: undefined,
textAlign: undefined,
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('link component', () => {
children: 'Visit ',
key: expect.any(String),
props: {
color: '#4459ff',
color: mockTheme.colors.info.default,
style: {
fontWeight: undefined,
textAlign: undefined,
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('link component', () => {
children: 'Visit ',
key: expect.any(String),
props: {
color: '#4459ff',
color: mockTheme.colors.info.default,
style: {
fontWeight: undefined,
textAlign: undefined,
Expand All @@ -133,7 +133,7 @@ describe('link component', () => {
children: 'MetaMask',
key: expect.any(String),
props: {
color: '#4459ff',
color: mockTheme.colors.info.default,
style: {
fontWeight: undefined,
textAlign: undefined,
Expand Down
4 changes: 2 additions & 2 deletions app/components/Snaps/SnapUISpinner/SnapUISpinner.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React from 'react';
import { ActivityIndicator } from 'react-native';
import { render } from '@testing-library/react-native';
import { SnapUISpinner } from './SnapUISpinner';
import { lightTheme } from '@metamask/design-tokens';

const mockUseTheme = jest.fn();
jest.mock('../../../util/theme', () => ({
useTheme: () => mockUseTheme(),
}));

const mockColor = lightTheme.colors.primary.default;
const { mockTheme } = jest.requireActual('../../../util/theme');
const mockColor = mockTheme.colors.primary.default;

describe('SnapUISpinner', () => {
beforeEach(() => {
Expand Down
24 changes: 8 additions & 16 deletions app/components/UI/Card/hooks/useCardDelegation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Engine from '../../../../core/Engine';
import Logger from '../../../../util/Logger';
import { MetaMetricsEvents } from '../../../../core/Analytics';
import { useAnalytics } from '../../../hooks/useAnalytics/useAnalytics';
import { createMockUseAnalyticsHook } from '../../../../util/test/analyticsMock';
import { toTokenMinimalUnit } from '../../../../util/number';
import { safeToChecksumAddress } from '../../../../util/address';
import { ARBITRARY_ALLOWANCE } from '../constants';
Expand Down Expand Up @@ -68,9 +69,7 @@ jest.mock('../../../../core/Engine', () => ({

const mockUseSelector = useSelector as jest.MockedFunction<typeof useSelector>;
const mockUseCardSDK = useCardSDK as jest.MockedFunction<typeof useCardSDK>;
const mockUseAnalytics = useAnalytics as jest.MockedFunction<
typeof useAnalytics
>;
const mockUseAnalytics = jest.mocked(useAnalytics);
const mockUseNeedsGasFaucet = useNeedsGasFaucet as jest.MockedFunction<
typeof useNeedsGasFaucet
>;
Expand Down Expand Up @@ -155,19 +154,12 @@ describe('useCardDelegation', () => {
});
mockTrackEvent = jest.fn();

mockUseAnalytics.mockReturnValue({
trackEvent: mockTrackEvent,
createEventBuilder: mockCreateEventBuilder,
isEnabled: jest.fn().mockReturnValue(true),
enable: jest.fn(),
addTraitsToUser: jest.fn(),
createDataDeletionTask: jest.fn(),
checkDataDeleteStatus: jest.fn(),
getAnalyticsId: jest.fn(),
isDataRecorded: jest.fn().mockReturnValue(true),
getDeleteRegulationId: jest.fn(),
getDeleteRegulationCreationDate: jest.fn(),
} as ReturnType<typeof useAnalytics>);
mockUseAnalytics.mockReturnValue(
createMockUseAnalyticsHook({
trackEvent: mockTrackEvent,
createEventBuilder: mockCreateEventBuilder,
}),
);

// Setup selector mock - returns a function that returns account
mockUseSelector.mockReturnValue(
Expand Down
37 changes: 8 additions & 29 deletions app/components/UI/DeFiPositions/DeFiPositionsList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DeFiPositionsList from './DeFiPositionsList';
import { RootState } from '../../../reducers';
import { WalletViewSelectorsIDs } from '../../Views/Wallet/WalletView.testIds';
import { useAnalytics } from '../../hooks/useAnalytics/useAnalytics';
import type { AnalyticsTrackingEvent } from '../../../util/analytics/AnalyticsEventBuilder';
import { createMockUseAnalyticsHook } from '../../../util/test/analyticsMock';

jest.mock('../../../util/networks', () => ({
...jest.requireActual('../../../util/networks'),
Expand Down Expand Up @@ -564,40 +564,19 @@ describe('DeFiPositionsList', () => {
beforeEach(() => {
mockTrackEvent = jest.fn();
mockAddProperties = jest.fn().mockReturnThis();
jest.mocked(useAnalytics).mockReturnValue({
trackEvent: mockTrackEvent,
createEventBuilder: jest.fn(() => {
const mockEvent: AnalyticsTrackingEvent = {
name: '',
properties: {},
sensitiveProperties: {},
saveDataRecording: false,
get isAnonymous(): boolean {
return false;
},
get hasProperties(): boolean {
return false;
},
};
return {
jest.mocked(useAnalytics).mockReturnValue(
createMockUseAnalyticsHook({
trackEvent: mockTrackEvent,
createEventBuilder: jest.fn().mockReturnValue({
addProperties: mockAddProperties,
addSensitiveProperties: jest.fn().mockReturnThis(),
removeProperties: jest.fn().mockReturnThis(),
removeSensitiveProperties: jest.fn().mockReturnThis(),
setSaveDataRecording: jest.fn().mockReturnThis(),
build: jest.fn(() => mockEvent),
};
build: jest.fn(),
}),
}),
isEnabled: jest.fn(),
enable: jest.fn(),
addTraitsToUser: jest.fn(),
createDataDeletionTask: jest.fn(),
checkDataDeleteStatus: jest.fn(),
getDeleteRegulationCreationDate: jest.fn(),
getDeleteRegulationId: jest.fn(),
isDataRecorded: jest.fn(),
getAnalyticsId: jest.fn(),
});
);
});

it('tracks Position Screen Viewed when isFullView is true and positions are loaded', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ exports[`EarnLendingDepositConfirmationView matches snapshot 1`] = `
style={
{
"backgroundColor": "#ffffff",
"borderRadius": 8,
"marginBottom": 8,
"borderRadius": 12,
"marginBottom": 12,
"paddingBottom": 8,
"paddingHorizontal": 8,
"paddingTop": 12,
Expand Down Expand Up @@ -965,8 +965,8 @@ exports[`EarnLendingDepositConfirmationView matches snapshot 1`] = `
style={
{
"backgroundColor": "#ffffff",
"borderRadius": 8,
"marginBottom": 8,
"borderRadius": 12,
"marginBottom": 12,
"paddingBottom": 8,
"paddingHorizontal": 8,
"paddingTop": 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ exports[`DepositInfoSection renders correctly 1`] = `
style={
{
"backgroundColor": "#ffffff",
"borderRadius": 8,
"marginBottom": 8,
"borderRadius": 12,
"marginBottom": 12,
"paddingBottom": 8,
"paddingHorizontal": 8,
"paddingTop": 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ exports[`DepositReceiveSection renders correctly 1`] = `
style={
{
"backgroundColor": "#ffffff",
"borderRadius": 8,
"marginBottom": 8,
"borderRadius": 12,
"marginBottom": 12,
"paddingBottom": 8,
"paddingHorizontal": 8,
"paddingTop": 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ exports[`EarnLendingWithdrawalConfirmationView matches snapshot 1`] = `
style={
{
"backgroundColor": "#ffffff",
"borderRadius": 8,
"marginBottom": 8,
"borderRadius": 12,
"marginBottom": 12,
"paddingBottom": 8,
"paddingHorizontal": 8,
"paddingTop": 12,
Expand Down Expand Up @@ -341,8 +341,8 @@ exports[`EarnLendingWithdrawalConfirmationView matches snapshot 1`] = `
style={
{
"backgroundColor": "#ffffff",
"borderRadius": 8,
"marginBottom": 8,
"borderRadius": 12,
"marginBottom": 12,
"paddingBottom": 8,
"paddingHorizontal": 8,
"paddingTop": 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const MusdConversionAssetListCta = () => {

<Button
variant={ButtonVariant.Secondary}
style={styles.button}
onPress={() => handlePress(CTA_CLICK_TARGET.CTA_BUTTON)}
size={ButtonSize.Sm}
>
Expand Down
Loading
Loading