Skip to content

Commit f546ead

Browse files
authored
Merge branch 'main' into chore/create-build-branch-workflow
2 parents 940f91a + 36ddf90 commit f546ead

182 files changed

Lines changed: 19549 additions & 12472 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ jobs:
214214
NODE_OPTIONS: --max_old_space_size=12288
215215

216216
- name: Check bundle size
217-
run: ./scripts/js-bundle-stats.sh ios/main.jsbundle 54
217+
run: ./scripts/js-bundle-stats.sh ios/main.jsbundle 53
218218

219219
- name: Upload iOS bundle
220220
uses: actions/upload-artifact@v4

.js.env.example

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,7 @@ export SENTRY_DISABLE_AUTO_UPLOAD="true"
2222
# ENV vars for e2e tests
2323
# Only enable it for e2e tests
2424
export IS_TEST="false"
25-
# Performance E2E (Appwright): set on the bundle step in CI so seedless/OAuth Metro mocks are explicitly opted in.
26-
# Optional locally when pairing with METAMASK_ENVIRONMENT=e2e.
27-
# export PERFORMANCE_TEST_JOB="true"
28-
# Force-disable seedless + OAuth Metro redirects while keeping other E2E behavior (Sentry mocks, etc.):
29-
# export E2E_USE_SEEDLESS_OAUTH_METRO_MOCK="false"
30-
# Finer control: disable OAuth handler Metro mock for non-seedless
31-
# onboarding perf builds; keep seedless perf on default (unset) so seedless-*.spec.js use mocks.
32-
# export E2E_USE_OAUTH_LOGIN_HANDLERS_METRO_MOCK="false"
33-
# export E2E_USE_SEEDLESS_CONTROLLER_METRO_MOCK="false"
25+
# Seedless + OAuthLoginHandlers Metro mocks: on when IS_TEST/e2e OR E2E_MOCK_OAUTH=true at bundle time.
3426
# defined as secrets to run on Bitrise CI
3527
# but have to be defined here for local tests
3628
export MM_TEST_ACCOUNT_SRP=""

app/components/Nav/Main/MainNavigator.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ import {
117117
selectMarketInsightsEnabled,
118118
} from '../../UI/MarketInsights';
119119
import { selectMarketInsightsPerpsEnabled } from '../../../selectors/featureFlagController/marketInsights';
120+
import { TopTradersView } from '../../Views/SocialLeaderboard';
121+
import { selectSocialLeaderboardEnabled } from '../../../selectors/featureFlagController/socialLeaderboard';
120122
import PerpsPositionTransactionView from '../../UI/Perps/Views/PerpsTransactionsView/PerpsPositionTransactionView';
121123
import PerpsOrderTransactionView from '../../UI/Perps/Views/PerpsTransactionsView/PerpsOrderTransactionView';
122124
import PerpsFundingTransactionView from '../../UI/Perps/Views/PerpsTransactionsView/PerpsFundingTransactionView';
@@ -942,6 +944,9 @@ const MainNavigator = () => {
942944
const isMarketInsightsPerpsEnabled = useSelector(
943945
selectMarketInsightsPerpsEnabled,
944946
);
947+
const isSocialLeaderboardEnabled = useSelector(
948+
selectSocialLeaderboardEnabled,
949+
);
945950

946951
return (
947952
<Stack.Navigator
@@ -1162,6 +1167,13 @@ const MainNavigator = () => {
11621167
options={{ headerShown: false, ...slideFromRightAnimation }}
11631168
/>
11641169
)}
1170+
{isSocialLeaderboardEnabled && (
1171+
<Stack.Screen
1172+
name={Routes.SOCIAL_LEADERBOARD.VIEW}
1173+
component={TopTradersView}
1174+
options={{ headerShown: false, ...slideFromRightAnimation }}
1175+
/>
1176+
)}
11651177
<>
11661178
<Stack.Screen
11671179
name={Routes.EXPLORE_SEARCH}

app/components/Nav/Main/MainNavigator.test.tsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import initialRootState from '../../../util/test/initial-root-state';
55
import Routes from '../../../constants/navigation/Routes';
66
import { ReactTestInstance } from 'react-test-renderer';
77

8+
jest.mock('react-native-device-info', () => ({
9+
getVersion: jest.fn(() => '7.72.0'),
10+
}));
11+
812
jest.mock('@react-navigation/stack', () => ({
913
createStackNavigator: jest.fn().mockReturnValue({
1014
Navigator: 'Navigator',
@@ -145,4 +149,56 @@ describe('MainNavigator', () => {
145149
'FeatureFlagOverride',
146150
);
147151
});
152+
153+
it('includes TopTradersView screen when Social Leaderboard remote flag is enabled', () => {
154+
const stateWithSocialLeaderboard = {
155+
...initialRootState,
156+
engine: {
157+
...initialRootState.engine,
158+
backgroundState: {
159+
...initialRootState.engine.backgroundState,
160+
RemoteFeatureFlagController: {
161+
...initialRootState.engine.backgroundState
162+
.RemoteFeatureFlagController,
163+
remoteFeatureFlags: {
164+
...initialRootState.engine.backgroundState
165+
.RemoteFeatureFlagController.remoteFeatureFlags,
166+
aiSocialLeaderboardEnabled: {
167+
enabled: true,
168+
minimumVersion: '0.0.1',
169+
},
170+
},
171+
},
172+
},
173+
},
174+
};
175+
176+
const container = renderWithProvider(<MainNavigator />, {
177+
state: stateWithSocialLeaderboard,
178+
});
179+
180+
interface ScreenChild {
181+
name: string;
182+
component: { name: string };
183+
}
184+
const screenProps: ScreenChild[] = container.root.children
185+
.filter(
186+
(child): child is ReactTestInstance =>
187+
typeof child === 'object' &&
188+
'type' in child &&
189+
'props' in child &&
190+
child.type?.toString() === 'Screen',
191+
)
192+
.map((child) => ({
193+
name: child.props.name,
194+
component: child.props.component,
195+
}));
196+
197+
const topTradersScreen = screenProps?.find(
198+
(screen) => screen?.name === Routes.SOCIAL_LEADERBOARD.VIEW,
199+
);
200+
201+
expect(topTradersScreen).toBeDefined();
202+
expect(topTradersScreen?.component.name).toBe('TopTradersView');
203+
});
148204
});

app/components/UI/Bridge/Views/BridgeView/BridgeView.view.test.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,44 @@ describeForPlatforms('BridgeView', () => {
197197
expect(await findByText('dest')).toBeOnTheScreen();
198198
});
199199

200+
describe('Gasless swap', () => {
201+
it('shows error banner when gasless swap quote fetch fails and dismisses it on close', async () => {
202+
const now = Date.now();
203+
204+
const { findByText, queryByText, getByTestId } = defaultBridgeWithTokens({
205+
engine: {
206+
backgroundState: {
207+
BridgeController: {
208+
quotes: [],
209+
recommendedQuote: null,
210+
quotesLastFetched: now,
211+
quotesLoadingStatus: RequestStatus.FETCHED,
212+
quoteFetchError: 'GaslessSwapSubmissionFailed',
213+
},
214+
RemoteFeatureFlagController: {
215+
remoteFeatureFlags: {
216+
gasFeesSponsoredNetwork: { '0x1': true },
217+
},
218+
},
219+
},
220+
},
221+
} as unknown as Record<string, unknown>);
222+
223+
// Error banner appears after the gasless swap quote fetch failure
224+
expect(
225+
await findByText(strings('bridge.error_banner_description')),
226+
).toBeOnTheScreen();
227+
228+
// User dismisses the error banner
229+
fireEvent.press(getByTestId(CommonSelectorsIDs.BANNER_CLOSE_BUTTON_ICON));
230+
231+
// Banner is gone after dismissal
232+
expect(
233+
queryByText(strings('bridge.error_banner_description')),
234+
).not.toBeOnTheScreen();
235+
});
236+
});
237+
200238
describe('Swap team regression (bug matrix team-swaps-and-bridge)', () => {
201239
/** Issues covered: #24744, #24865, #24802, #25256 */
202240
// eslint-disable-next-line @metamask/design-tokens/color-no-hex -- "#24744" style references are GitHub issue IDs (e.g. "#2342"), not color literals

app/components/UI/Bridge/Views/BridgeView/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,9 @@ const BridgeView = () => {
408408
<ScreenView contentContainerStyle={styles.screen}>
409409
<Box
410410
style={styles.content}
411-
onStartShouldSetResponder={() => true}
411+
onStartShouldSetResponder={() =>
412+
!(contentMode === 'zero' && isSwapsTrendingTokensEnabled)
413+
}
412414
onResponderRelease={() => {
413415
inputRef.current?.blur();
414416
keypadRef.current?.close();

0 commit comments

Comments
 (0)