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/live 3533 swap provider list #1225

Merged
merged 21 commits into from
Sep 15, 2022
Merged

Conversation

sarneijim
Copy link
Contributor

@sarneijim sarneijim commented Sep 8, 2022

πŸ“ Description

Improving swap page for the user to easily compare options

❓ Context

βœ… Checklist

  • Test coverage
  • Atomic delivery
  • No breaking changes

πŸ“Έ Demo

Screenshot 2022-09-08 at 18 59 40

πŸš€ Expectations to reach

Improving swap page for the user to easily compare options
Pull Requests must pass the CI and be internally validated in order to be merged.

@vercel
Copy link

vercel bot commented Sep 8, 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 14, 2022 at 4:36PM (UTC)
3 Ignored Deployments
Name Status Preview Updated
ledger-live-github-bot ⬜️ Ignored (Inspect) Sep 14, 2022 at 4:36PM (UTC)
native-ui-storybook ⬜️ Ignored (Inspect) Sep 14, 2022 at 4:36PM (UTC)
react-ui-storybook ⬜️ Ignored (Inspect) Sep 14, 2022 at 4:36PM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2022

πŸ¦‹ Changeset detected

Latest commit: e8e0273

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

This PR includes changesets to release 5 packages
Name Type
ledger-live-desktop Minor
@ledgerhq/live-common Minor
@ledgerhq/live-cli Patch
live-mobile 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

@github-actions github-actions bot added common Has changes in live-common desktop Has changes in LLD translations Translation files have been touched labels Sep 8, 2022
@sarneijim sarneijim marked this pull request as draft September 8, 2022 18:06
@github-actions
Copy link

github-actions bot commented Sep 8, 2022

@sarneijim

Screenshots: βœ…

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

@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Base: 85.64% // Head: 43.84% // Decreases project coverage by -41.80% ⚠️

Coverage data is based on head (6e9d136) compared to base (40da984).
Patch coverage: 87.91% of modified lines in pull request are covered.

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

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #1225       +/-   ##
============================================
- Coverage    85.64%   43.84%   -41.81%     
============================================
  Files           12      609      +597     
  Lines          209    25501    +25292     
  Branches        38     6947     +6909     
============================================
+ Hits           179    11180    +11001     
- Misses          30    14275    +14245     
- Partials         0       46       +46     
Flag Coverage Ξ”
test 43.84% <87.91%> (-41.81%) ⬇️

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

Impacted Files Coverage Ξ”
libs/ledger-live-common/src/derivation.ts 61.76% <ΓΈ> (ΓΈ)
libs/ledger-live-common/src/env.ts 80.43% <ΓΈ> (ΓΈ)
...mmon/src/exchange/swap/hooks/useSwapTransaction.ts 50.00% <0.00%> (ΓΈ)
...er-live-common/src/featureFlags/defaultFeatures.ts 100.00% <ΓΈ> (ΓΈ)
...er-live-common/src/families/stellar/api/horizon.ts 22.85% <25.00%> (ΓΈ)
libs/ledger-live-common/src/exchange/swap/mock.ts 39.24% <50.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%> (ΓΈ)
...common/src/exchange/swap/hooks/useProviderRates.ts 94.93% <90.90%> (ΓΈ)
... and 624 more

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

β˜” View full report at Codecov.
πŸ“’ Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@chabroA chabroA left a comment

Choose a reason for hiding this comment

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

Good job overall but the component layout regarding the new rates list needs to be updated. It is currently sub optimal and constantly re-rendered (every second), triggering some UI problems / glitches + overall poor performance

cf. following videos:


Screen.Recording.2022-09-12.at.13.59.54.mov
Screen.Recording.2022-09-12.at.14.27.12.mov
Screen.Recording.2022-09-12.at.14.28.07.mov

In comparaison, here is how it behaves on the current prod version (only the countdown is re-rendered):

Screen.Recording.2022-09-12.at.14.40.32.mov

This is mainly due to how you broke down the component hierarchy of this new provider / rates list. And also due to the fact that you handle the countdown at the root form component (Swap2/Form/index.jsx)

Here is an example of how it could be broken down:

You would only handle the countdown logic in the red component, hence only this component would be re-rendered every second, and not the whole form (it could be broken down even more with just the countdown being it's own atomic component, like it is done today).

Screenshot 2022-09-12 at 14 31 09

For the countdown UI, instead of using a new png image for the timer, you could use the already existing AnimatedCountdown component that is currently used in prod.

libs/ledger-live-common/src/exchange/swap/utils/index.ts Outdated Show resolved Hide resolved
@sarneijim sarneijim force-pushed the feat/LIVE-3533-swap-provider-list branch from d812e8e to 0d96ca2 Compare September 12, 2022 18:31
@sarneijim
Copy link
Contributor Author

sarneijim commented Sep 13, 2022

@sarneijim I think the main 'Providers' heading should be 'Quotes', and 'Float' should be floating. image

Also the info tag for 'Receive' is a bit off center: image

Fixed

This code is not used anymore
add missing type for function props
Copy link
Contributor

@chabroA chabroA left a comment

Choose a reason for hiding this comment

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

Looks good overall. Major issues from previous review are fixed.

PS: I had to fix some dead code, typing and styling issues. It looks like your environment and / or tooling might not be properly setup

@ggilchrist-ledger
Copy link
Contributor

ggilchrist-ledger commented Sep 14, 2022

It looks like the timer is still causing a warning in the dev tools. Not sure if its an issue or not. Can you check? @sarneijim @chabroA

Screen.Recording.2022-09-14.at.09.44.51.mov

@ghost
Copy link

ghost commented Sep 14, 2022

Hi. Did you mentioned correct "alex"?😁 @ggilchrist-ledger

@ggilchrist-ledger
Copy link
Contributor

Oops no I didn't! Sorry @alex-ledger

@ggilchrist-ledger
Copy link
Contributor

Can you fix the wrapping of the text here so it occupies the full space (like the designs)? @sarneijim
Screenshot 2022-09-14 at 10 23 43

}
},
"filter": {
"all": "All",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this viewable as part of this PR or ignore until the DEX/filter PR?

Copy link
Contributor Author

@sarneijim sarneijim Sep 15, 2022

Choose a reason for hiding this comment

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

yes, I am applying here the changes too advance the translations (avoid translation dependency in the next pr)

@ggilchrist-ledger
Copy link
Contributor

@sarneijim Please investigate the quotes refetching before the timer has expired:

Screen.Recording.2022-09-15.at.17.48.21.mov

@sarneijim sarneijim merged commit b6a41bf into develop Sep 15, 2022
@sarneijim sarneijim deleted the feat/LIVE-3533-swap-provider-list branch September 15, 2022 17:02
@ggilchrist-ledger
Copy link
Contributor

The above has been ok'ed as acceptable for now by Xavier

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 desktop Has changes in LLD translations Translation files have been touched
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants