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): onboarding unitialized device landing screen #16616

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

PeKne
Copy link
Contributor

@PeKne PeKne commented Jan 27, 2025

Description

  • when is an uninitialized device connected, app redirects to a device onboarding landing screen
  • the UI differs depending if the firmware is already installed on the device

Related Issue

Resolve #16278

Screenshots:

Firmware-less device

Screenshot 2025-01-27 at 11:27:19 AM Screenshot 2025-01-27 at 11:26:57 AM

Device with firmware installed

Screenshot 2025-01-27 at 11:27:29 AM Screenshot 2025-01-27 at 11:26:12 AM

@PeKne PeKne added the mobile Suite Lite issues and PRs label Jan 27, 2025
@PeKne PeKne requested a review from a team as a code owner January 27, 2025 12:19
Copy link

github-actions bot commented Jan 27, 2025

🚀 Expo preview is ready!

  • Project → trezor-suite-preview
  • Platforms → android, ios
  • Scheme → trezorsuitelite
  • Runtime Version → 23
  • More info

Learn more about 𝝠 Expo Github Action

@matejkriz
Copy link
Member

Beware, the "seedless" term can be confusing. Check https://trezor.io/learn/a/seedless-setup and try to search for "seedless" in our codebase... I believe it would be better to rename it to "uninitialized".

@PeKne
Copy link
Contributor Author

PeKne commented Jan 28, 2025

@matejkriz Good point 👀, I will rename it

@PeKne PeKne changed the title feat(suite-native): onboarding seedless device landing screen feat(suite-native): onboarding unitialized device landing screen Jan 28, 2025
@PeKne
Copy link
Contributor Author

PeKne commented Jan 28, 2025

Seedlessnaming substitued with Unitialized in 76c6f6b.

!isDeviceInitialized &&
isDeviceConnected &&
isOnboardingFinished &&
!isNoPhysicalDeviceConnected &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldnt !isPortfolioTrackerDevice be better here? Or what is the reason for checking this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this version originally and I had some problem with it. But now I retested that and it works as expected. Using this version in 94fe6b8. Good point.

case DeviceModelInternal.UNKNOWN:
return false;
default: {
const exhaustiveCheck: never = model;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi you can also use UnreachableCaseError from #16396

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const trezorModelImageMap = {
[DeviceModelInternal.T2B1]: require('../assets/trezorSafe3.png'),
[DeviceModelInternal.T3B1]: require('../assets/trezorSafe3.png'),
[DeviceModelInternal.T3T1]: require('../assets/trezorSafe5.png'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, name those images with model. E.g. T2B1

Also those images are pretty huge (2MB), is there a way to optimise the size?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is just a single image for two models (T2B1 and T3B1) so naming it like that does not make sense to me. I at least compressed the images in 94fe6b8

const trezorImageStyle = prepareNativeStyle<{ hasDeviceFirmwareInstalled: boolean }>(
(_, { hasDeviceFirmwareInstalled }) => ({
width: '100%',
height: hasDeviceFirmwareInstalled ? 280 : 360,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work with system font size changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? The height will be the same on every device, but it has maximumHeight specified right below. Also the screen is scrollable, so if the content overflows on some super small device with an enlarged font, user will be able to scroll to see the content. Do I answer your question?

@PeKne PeKne force-pushed the feat/native/seedless-device-landing-screen branch from 76c6f6b to 94fe6b8 Compare January 29, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Suite Lite issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Onboarding - Unitialized Device Welcome Screen
3 participants