Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(suite-native): new welcome flow by default #16526

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 3 additions & 29 deletions suite-native/app/e2e/pageObjects/onboardingActions.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
import { expect as detoxExpect } from 'detox';

import { onAlertSheet } from './alertSheetActions';
import { waitForElementByIdToBeVisible } from '../utils';

const platform = device.getPlatform();

class OnOnboardingActions {
async finishOnboarding() {
const testId = '@onboarding/Welcome/nextBtn';
await waitForElementByIdToBeVisible(testId, 20000);
await waitForElementByIdToBeVisible(testId, 30000);
await element(by.id(testId)).tap();

if (platform === 'android') {
await element(by.id('@onboarding/ConnectTrezor/nextBtn')).tap();
} else {
await element(by.id('@onboarding/TrackBalances/nextBtn')).tap();
}

await element(by.id('@onboarding/AboutReceiveCoinsFeature/nextBtn')).tap();

if (platform === 'android') {
await element(by.id('@onboarding/TrackBalances/nextBtn')).tap();
}

await detoxExpect(element(by.id('@onboarding/UserDataConsent/allow'))).toBeVisible();
await element(by.id('@onboarding/UserDataConsent/allow')).tap();
await element(by.id('@onboarding/AnalyticsConsent/nextBtn')).tap();

try {
await onAlertSheet.tapSecondaryButton();
} catch {
// Android emulator does not support biometrics, so the sheet is not displayed at all.
console.warn(
'Biometrics not supported by device, skipping close of biometrics bottom sheet.',
);
}
await element(by.id('@onboarding/Biometrics/skipBtn')).tap();
}

async skipOnboarding() {
Expand Down
1 change: 0 additions & 1 deletion suite-native/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@suite-native/module-device-settings": "workspace:*",
"@suite-native/module-home": "workspace:*",
"@suite-native/module-onboarding": "workspace:*",
"@suite-native/module-onboarding-legacy": "workspace:*",
"@suite-native/module-send": "workspace:*",
"@suite-native/module-settings": "workspace:*",
"@suite-native/module-staking-management": "workspace:*",
Expand Down
7 changes: 1 addition & 6 deletions suite-native/app/src/navigation/RootStackNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
import { selectIsOnboardingFinished } from '@suite-native/settings';
import { DevUtilsStackNavigator } from '@suite-native/module-dev-utils';
import { TransactionDetailScreen } from '@suite-native/transactions';
import { OnboardingStackNavigator as LegacyOnboardingStackNavigator } from '@suite-native/module-onboarding-legacy';
import { OnboardingStackNavigator } from '@suite-native/module-onboarding';
import { ReceiveStackNavigator } from '@suite-native/receive';
import { AuthorizeDeviceStackNavigator } from '@suite-native/module-authorize-device';
Expand All @@ -42,18 +41,14 @@ export const RootStackNavigator = () => {
return RootStackRoutes.AppTabs;
}

return RootStackRoutes.LegacyOnboarding;
return RootStackRoutes.Onboarding;
};

return (
<RootStack.Navigator
initialRouteName={getInitialRouteName()}
screenOptions={stackNavigationOptionsConfig}
>
<RootStack.Screen
name={RootStackRoutes.LegacyOnboarding}
component={LegacyOnboardingStackNavigator}
/>
<RootStack.Screen
name={RootStackRoutes.Onboarding}
component={OnboardingStackNavigator}
Expand Down
1 change: 0 additions & 1 deletion suite-native/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
{ "path": "../module-device-settings" },
{ "path": "../module-home" },
{ "path": "../module-onboarding" },
{ "path": "../module-onboarding-legacy" },
{ "path": "../module-send" },
{ "path": "../module-settings" },
{
Expand Down
13 changes: 0 additions & 13 deletions suite-native/biometrics/src/biometricsAtoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ const isBiometricsOptionEnabledAtom = atomWithUnecryptedStorage<boolean>(
false,
);

const isBiometricsInitialSetupFinishedAtom = atomWithUnecryptedStorage<boolean>(
'isBiometricsInitialSetupFinished',
false,
);

const isUserAuthenticatedAtom = atom(false);
const isBiometricsOverlayVisibleAtom = atom(true);

Expand All @@ -32,14 +27,6 @@ export const useIsBiometricsEnabled = () => {
};
};

export const useIsBiometricsInitialSetupFinished = () => {
const [isBiometricsInitialSetupFinished, setIsBiometricsInitialSetupFinished] = useAtom(
isBiometricsInitialSetupFinishedAtom,
);

return { isBiometricsInitialSetupFinished, setIsBiometricsInitialSetupFinished };
};

export const useIsBiometricsOverlayVisible = () => {
const isBiometricsOptionEnabled = useAtomValue(isBiometricsOptionEnabledAtom);
const [isBiometricsOverlayVisibleAtomValue, setBiometricsOverlayVisibleAtomValue] = useAtom(
Expand Down
52 changes: 0 additions & 52 deletions suite-native/intl/src/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,6 @@ export const en = {
buttons: {
receive: 'Receive',
},

// TODO: delete this when is the new welcome flow enabled by default
biometricsModal: {
title: 'Enable biometrics protection',
description: 'You can always change this later.',
button: {
later: 'I’ll do that later in Settings',
},
resultMsg: {
error: 'Unable to enable biometrics',
success: 'Biometrics enabled',
},
},
rememberModeModal: {
title: 'Enable view-only to check balances after you disconnect your Trezor',
description:
Expand Down Expand Up @@ -776,40 +763,6 @@ export const en = {
welcomeScreen: {
subtitle: 'Take control.',
button: "Let's get started",

// TODO: this should be removed when is the new onboarding enabled by default
welcome: 'Welcome to',
subtitleLegacy: 'Securely track, manage & receive\ncrypto on the go',
trezorLink: 'Don’t have a Trezor? <trezorLink>Get one here.</trezorLink>',
nextButton: 'Get started',
},
connectTrezorScreen: {
title: 'Connect',
subtitle:
'Manage your portfolio with your Trezor hardware wallet connected directly to your mobile device.',
},
featureReceiveScreen: {
portfolioTracker: {
title: 'Receive coins',
subtitle: 'Generate addresses and QR codes to receive crypto on the go.',
},
device: {
title: 'Receive',
subtitle:
'Generate and verify addresses directly on your Trezor to get paid and receive crypto on the go.',
},
},
trackBalancesScreen: {
portfolioTracker: {
title: 'Track balances',
subtitle:
'Easily sync your coin addresses and keep up with the crypto on your hardware wallet.',
},
device: {
title: 'Track balances',
subtitle:
'Keep up with your favorite coins even without your Trezor connected. Simply sync and track your crypto from anywhere.',
},
},
analyticsConsentScreen: {
title: 'Better—with you.',
Expand All @@ -829,11 +782,6 @@ export const en = {
},
helpSwitchTitle: 'Help us anonymously',
learnMoreButton: 'More about privacy',

// TODO: this should be removed when is the new onboarding enabled by default
titleLegacy: 'Better with you',
subtitleLegacy: 'Improve Trezor Suite Lite with your anonymous data.',
learnMore: '<securityLink>More</securityLink> about privacy',
},
biometricsScreen: {
title: 'Biometrics',
Expand Down
21 changes: 3 additions & 18 deletions suite-native/module-dev-utils/src/screens/DevUtilsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import {
DevUtilsStackParamList,
DevUtilsStackRoutes,
ScreenHeader,
RootStackRoutes,
StackToStackCompositeNavigationProps,
RootStackParamList,
OnboardingStackRoutes,
} from '@suite-native/navigation';
import { clearStorage } from '@suite-native/storage';
import { getCommitHash, getSuiteVersion } from '@trezor/env-utils';
Expand All @@ -33,11 +31,6 @@ type NavigationProps = StackToStackCompositeNavigationProps<
export const DevUtilsScreen = () => {
const navigation = useNavigation<NavigationProps>();

const navigateToNewWelcomeFlow = () =>
navigation.navigate(RootStackRoutes.Onboarding, {
screen: OnboardingStackRoutes.Welcome,
});

return (
<Screen header={<ScreenHeader content="DEV utils" />}>
<VStack spacing="sp16">
Expand All @@ -48,17 +41,9 @@ export const DevUtilsScreen = () => {
subtitle={`${getEnv()}-${getSuiteVersion()}, commit ${getCommitHash() || 'N/A in debug build'}`}
/>
{isDevelopOrDebugEnv() && (
<>
<Button
onPress={() => navigation.navigate(DevUtilsStackRoutes.Demo)}
>
See Component Demo
</Button>
{/* This button will be present for limited time only, until the new welcome flow is finished and enabled by default. */}
<Button onPress={navigateToNewWelcomeFlow}>
Open New Welcome Flow
</Button>
</>
<Button onPress={() => navigation.navigate(DevUtilsStackRoutes.Demo)}>
See Component Demo
</Button>
)}
<FeatureFlags />
{isDevelopOrDebugEnv() && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {
import { DeviceManagerScreenHeader } from '@suite-native/device-manager';
import { Screen } from '@suite-native/navigation';

import { useShowBiometricsAlert } from './useShowBiometricsAlert';
import { EmptyHomeRenderer } from './components/EmptyHomeRenderer';
import { PortfolioContent } from './components/PortfolioContent';
import { useHomeRefreshControl } from './useHomeRefreshControl';
import { PortfolioGraphRef } from './components/PortfolioGraph';
import { useShowViewOnlyAlert } from './useShowViewOnlyAlert';

export const HomeScreen = () => {
const isDiscoveredDeviceAccountless = useSelector(selectIsDiscoveredDeviceAccountless);
const isDeviceAuthorized = useSelector(selectIsDeviceAuthorized);
Expand All @@ -33,7 +33,6 @@ export const HomeScreen = () => {
portfolioContentRef,
});

useShowBiometricsAlert();
useShowViewOnlyAlert();

return (
Expand Down

This file was deleted.

Loading
Loading