Skip to content

fix: Migrate onboarding from Campur Activity / Compose to Compose #166

@kcw-grunt

Description

@kcw-grunt

Problem

Currently the production version successfully onboard users to set up their Brainwallet.
New users set their PIN/Passcode and confirm their seed phrase and sync starts
Returning users set their PIN/Passcode and restore their seed phrase and sync starts

We are migrating to a new design and while we do this we want to migrate the views into a compose paradigm and unwrap the problematic legacy design where the code was tied between UI and business logic. This old code was a terrible design choice and makes it very difficult to understand the runtime.

Currently, the event bus is a way to allow the design to work. But the ideal thing is to remove the EventBus entirely and migrate business logic into the corresponding ViewModels to set data and SharedPreferences, etc.

Current Strategy

We are trying to rectify it by using @andhikayuana design of MVVM introduced with the new Onboarding screens. So we want to copy the current path (from Production). But, the destination Route should be at the MainScreen. There we can merge the other mini subs and so on.

  • Use the Compose Screens and VM, Event, State Classes
  • Remove calls to the EventBus and migrate them into ViewModels
  • Leverage UiEffects for navigation in a Compose paradigm
  • Reorder the SetPasscode to be the same for Ready and Restore
  • Completion of Onboarding navigates to the MainScreen in both cases
  • Completion of Onboarding activates sync to the Litecoin network

Design: Ready / New Wallet

Welcome -> Set Passcode -> Confirm Passcode -> Your Seed Words -> Your Words Prove It -> Top Up -> Main Screen / Bento
Image

Design: Restore Wallet

Welcome -> Set Passcode -> Confirm Passcode -> Restore your Brainwallet -> Top Up -> Main Screen / Bento
Image

Discussion on migration

Currently there is a branch where much of the migration is close to complete: fix/restore-to-main-bug.
Problems:

  • When migrating Java methods into the ViewModels its not consistently working
  • Navigating from the RestoreScreen to TopUpScreen (where the seed is confirmed and is syncing) doesnt work

Notes: There is a branch where the Ready path is correct but uses the old Activity method. : task/add-gamehub-bento-section

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions