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/FAT 156 - LLM Post onboarding #943

Merged
merged 4 commits into from
Sep 13, 2022

Conversation

ofreyssinet-ledger
Copy link
Contributor

@ofreyssinet-ledger ofreyssinet-ledger commented Aug 16, 2022

📝 Description

Implementation of the post onboarding logic & UI.

After a user is done with setting up a device (onboarding flow), we want to guide this user to some features so that they can get the best out of they device. For that, we are adding a new "post onboarding" flow that will be triggered at the end of the onboarding and that will have 1 (dismissable) entry point on the wallet screen.

For now none of the features that we want to add in the post onboarding hub are developed so this PR just covers the implementation of the logic & of the UI of the post onboarding. The post onboarding is triggered automatically at the end of the onboarding, but as there are no implemented post onboarding actions yet, it will not change anything from a user perspective.

It adds:

  • ledgerjs
    • post onboarding types for the state logic
  • ledger-live-common
    • post onboarding state logic (actions, reducers, hooks)
  • ledger-live-mobile
    • exposing functions to:
      • trigger the post onboarding for a given device model (called at the end of the onboarding for a given device)
      • trigger the completion of a post onboarding action (should be called whenever the flow for a feature that is part of the post onboarding hub is completed)
    • post onboarding UI:
      • post onboarding hub screen
      • post onboarding entry point card (added to the portfolio/wallet screen)
      • post onboarding debug settings screen: allows to trigger a mock post onboarding
      • post onboarding screen to mock a post onboarding action (needed as so far the real features don't exist)
  • native-ui
    • new variant "plain" for the Alert component.

Separately (because different repo): I've documented on the wiki how to implement a new post onboarding action

How to test (for QA) ?

  • The debug screen allows to test different post onboarding flows with mock actions
  • The onboarding of a new device should not trigger a post onboarding for now (as there are no post onboarding actions implemented)
  • This means that the real post onboarding flow (triggered automatically) cannot yet be tested, we will have to QA this whenever we implement the 1st set of real post onboarding actions.

❓ Context

✅ Checklist

  • Test coverage
  • Atomic delivery
  • No breaking changes

📸 Demo

Simulator.Screen.Recording.-.iPhone.13.-.2022-08-18.at.13.03.59.mp4

🚀 Expectations to reach

Please make sure you follow these Important Steps.

Pull Requests must pass the CI and be internally validated in order to be merged.

@vercel
Copy link

vercel bot commented Aug 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
live-common-tools ✅ Ready (Inspect) Visit Preview Sep 13, 2022 at 8:01AM (UTC)
3 Ignored Deployments
Name Status Preview Updated
ledger-live-github-bot ⬜️ Ignored (Inspect) Sep 13, 2022 at 8:01AM (UTC)
native-ui-storybook ⬜️ Ignored (Inspect) Sep 13, 2022 at 8:01AM (UTC)
react-ui-storybook ⬜️ Ignored (Inspect) Sep 13, 2022 at 8:01AM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Aug 16, 2022

🦋 Changeset detected

Latest commit: ee7bbe3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@ledgerhq/live-common Patch
live-mobile Patch
@ledgerhq/types-live Patch
@ledgerhq/native-ui Patch
@ledgerhq/live-cli Patch
ledger-live-desktop Patch
live-common-tools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Aug 16, 2022

Codecov Report

Merging #943 (c489e22) into develop (772f5f8) will increase coverage by 0.13%.
The diff coverage is 87.62%.

❗ Current head c489e22 differs from pull request most recent head ee7bbe3. Consider uploading reports for the commit ee7bbe3 to get more accurate results

@@             Coverage Diff             @@
##           develop     #943      +/-   ##
===========================================
+ Coverage    48.09%   48.22%   +0.13%     
===========================================
  Files          674      687      +13     
  Lines        30085    30219     +134     
  Branches      7840     7857      +17     
===========================================
+ Hits         14468    14573     +105     
- Misses       15557    15586      +29     
  Partials        60       60              
Flag Coverage Δ
test 48.22% <87.62%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...er-live-common/src/featureFlags/defaultFeatures.ts 100.00% <ø> (ø)
...s/ledgerjs/packages/cryptoassets/src/currencies.ts 100.00% <ø> (ø)
...mmon/src/postOnboarding/PostOnboardingProvider.tsx 50.00% <50.00%> (ø)
...c/postOnboarding/hooks/usePostOnboardingContext.ts 75.00% <75.00%> (ø)
...s/ledger-live-common/src/postOnboarding/reducer.ts 76.00% <76.00%> (ø)
...s/ledger-live-common/src/postOnboarding/actions.ts 100.00% <100.00%> (ø)
...ding/hooks/useAllPostOnboardingActionsCompleted.ts 100.00% <100.00%> (ø)
...ooks/usePostOnboardingEntryPointVisibleOnWallet.ts 100.00% <100.00%> (ø)
.../postOnboarding/hooks/usePostOnboardingHubState.ts 100.00% <100.00%> (ø)
libs/ledger-live-common/src/postOnboarding/mock.ts 100.00% <100.00%> (ø)
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link

github-actions bot commented Aug 16, 2022

@ofreyssinet-ledger

Screenshots: ✅

There are no changes in the screenshots for this PR. If this is expected, you are good to go.

@ofreyssinet-ledger ofreyssinet-ledger changed the title Feat/FAT 156 - Post onboarding hub Feat/FAT 156 - LLM Post onboarding Aug 17, 2022
@github-actions github-actions bot added ledgerjs Has changes in the ledgerjs open source libs and removed common Has changes in live-common labels Aug 18, 2022
@ofreyssinet-ledger ofreyssinet-ledger marked this pull request as ready for review August 18, 2022 11:19
author Olivier Freyssinet <[email protected]> 1660815558 +0200
committer Olivier F <[email protected]> 1661187186 +0200

feat: post onboarding

PostOnboardingHub screen ground work + debug settings + screen for mocking features with "done" button

Use correct typo for title & subtitle of hub screen

Add largeLineHeight variant to native-ui text

Use correct typographic styles & colors in post onboarding hub

Move post onboarding types to LLC

Add POST_ONBOARDING_CLEAR_LAST_ACTION_COMPLETED action

fix bracketSizes type

Rename & document hooks

Fix PostOnboardingMockActionScreen

Move post onboarding to own navigator

Clear last action completed when leaving closing hub screen

feat(native-ui): new variant "plain" for Notification component

Implement logic for closing popup in PostOnboardingHub

Fix bad style in native-ui getTextStyle (missing unit in styled component)

Remove "all done" state confettis in hub

Reword "setActionDone" to "setActionCompleted"

Fix import of postOnboardingState (don't add to store if value is falsy)

Add post onboarding entry point on portfolio/wallet screen

Implement new tag variants from figma

Change icons & shorten text of mock post onboarding actions

Use new tag styling

Set logic for mocking post onboarding actions

Add animated success screen

Improve placeholder text

Cleanup (rename mock actions as such, cleanup documentation, remove useless hook)

Improve wording of debug settings

Fix warning in PostOnboardingHub

Fix post rebase

Fix color of placeholder img in entry point card

Fix feature flagging of post onboarding actions

lint

Tag component changesets

Add guides for implementation of post onboarding action for each device model

Add startPostOnboarding at the end of existing onboarding

Fix useStartPostOnboardingCallback not always overriding state

Improve navigation to main screen

lint

changeset

Migrate postOnboarding types to types-live

Add tracking of post onboarding action start

docs & rename ActionState type

Remove placeholder type

Better use of design system spacing & radii scales

Rename `icon` > `Icon` to follow component naming convention

Use deep comparison of post onboarding state before saving it in db

Cleanup some types & comments

Fix potential crash on falsy value

lint

Use Divider from design system

Add todos

Try moving state logic to LLC (not working for now bc of react-redux)

pnpm i

remove /lib/postOnboarding imports

remove /lib imports in postOnboarding/hooks

Revert change on portfolio index

Force react-redux dep in LLM metro config (thank you Julien you saved the day 🙏)

chore: remove react-native from react-redux peer deps

Slightly more elegant way of fixing LLM/LLC react-redux duplicate package issues

live-common changesets

Fix bad use of importPostOnboardingState action creator

lint

install deps post rebase

fix bad merge

fix reducer missing post rebase

Fix ts (post rebase)

Force react-redux dep in LLM metro config

chore: remove react-dom from react-redux peer deps

Fix typing of PostOnboardingProvider props

Move hooks to their own file

rename hooks.tsx to useNavigateToPostOnboardingHubCallback.ts

no import from "."

Remove log

some unit tests, more coming tomorrow

this is boring to death

Add tests for usePostOnboardingHubState

Unit test postOnboarding reducer & actions creators

give this code some room to breathe

fix PostOnboarding routes typing

improve test clarity

fix post rebase

fix doc

remove @ts-expect-error

lint

lint again

lint

Fix post rebase


Fix post rebase


Fix remove bad comment on portfolio


Remove useless hooks


Rename onStartEvent->startEvent, onStartEventProperties->startEventProperties


File apps/ledger-live-mobile/src/locales/en/common.json was updated on ru-RU locale

File apps/ledger-live-mobile/src/locales/en/common.json was updated on de-DE locale

File apps/ledger-live-mobile/src/locales/en/common.json was updated on ko-KR locale

File apps/ledger-live-mobile/src/locales/en/common.json was updated on pt-BR locale

File apps/ledger-live-mobile/src/locales/en/common.json was updated on es-ES locale

File apps/ledger-live-mobile/src/locales/en/common.json was updated on tr-TR locale

File apps/ledger-live-mobile/src/locales/en/common.json was updated on ar-AE locale

File apps/ledger-live-mobile/src/locales/en/common.json was updated on fr-FR locale

File apps/ledger-live-mobile/src/locales/en/common.json was updated on zh-CN locale

File apps/ledger-live-mobile/src/locales/en/common.json was updated on ja-JP locale

Prevent closing the onboarding hub during the end animation


Add delay prop to Transitions.Fade


Fade out the notification at the bottom


doc:ljs


Remove usePostOnboardingDeviceModelId, useSetActionCompletedCallback


lint


fix post rebase
…onboarding (#1251)

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on ru-RU locale

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on de-DE locale

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on ko-KR locale

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on pt-BR locale

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on es-ES locale

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on tr-TR locale

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on ar-AE locale

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on fr-FR locale

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on zh-CN locale

* File apps/ledger-live-mobile/src/locales/en/common.json was updated on ja-JP locale
@ofreyssinet-ledger ofreyssinet-ledger dismissed juan-cortes’s stale review September 13, 2022 08:32

the requested changes (including tests of hooks) have been implemented

@ofreyssinet-ledger ofreyssinet-ledger merged commit 8465b5e into develop Sep 13, 2022
@ofreyssinet-ledger ofreyssinet-ledger deleted the feat/FAT-156-post-onboarding branch September 13, 2022 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common ledgerjs Has changes in the ledgerjs open source libs mobile Has changes in LLM translations Translation files have been touched ui Has changes in the design system library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants