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-4533 LIVE-4532 - Improve decimal handling to show more digits #2037

Conversation

nparigi-ledger
Copy link
Contributor

@nparigi-ledger nparigi-ledger commented Dec 1, 2022

📝 Description

live-common:

  • Add dynamicSignificantDigits parameter to formatCurrencyUnit to show more (or less) digits from value when needed. - Also increased this default parameter value from 4 to 6, so more digits will be displayed throught LLM and LLD.
  • fix an issue with the currency amount formatter where if the first number was 1 or 2, there was an extra number displayed (by @gre )

live-mobile and live-desktop:

use new parameter from formatCurrencyUnit, dynamicSignificantDigits, in all related display value components/utils. Increased this value (to 8) for the display of the account crypto value in Account page so more digits are shown.

❓ Context

✅ Checklist

  • Test coverage
  • Atomic delivery
  • No breaking changes

📸 Demo

Before:

Screenshot_20221129-154445_LL  DEV

Screenshot_20221129-154451_LL  DEV

After:

Screenshot_20221129-154315_LL  DEV

Screenshot_20221129-154322_LL  DEV

🚀 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.

…more digits of value when needed. Also increased this default parameter value from 4 to 6, so more digits will be displayed throught LLM and LLD.
…in all related display value components/utils. Increased this value for the display of the account crypto value in Account page so more digits are shown.
…its, in all related display value components/utils. Increased this value for the display of the account crypto value in Account page so more digits are shown.
@changeset-bot
Copy link

changeset-bot bot commented Dec 1, 2022

🦋 Changeset detected

Latest commit: 9e612dc

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

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

@vercel
Copy link

vercel bot commented Dec 1, 2022

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

Name Status Preview Updated
live-common-tools ✅ Ready (Inspect) Visit Preview Dec 19, 2022 at 2:10PM (UTC)
3 Ignored Deployments
Name Status Preview Updated
ledger-live-github-bot ⬜️ Ignored (Inspect) Dec 19, 2022 at 2:10PM (UTC)
native-ui-storybook ⬜️ Ignored (Inspect) Dec 19, 2022 at 2:10PM (UTC)
react-ui-storybook ⬜️ Ignored (Inspect) Dec 19, 2022 at 2:10PM (UTC)

@github-actions github-actions bot added common Has changes in live-common desktop Has changes in LLD mobile Has changes in LLM labels Dec 1, 2022
…IVE-4533-improve-decimal-handling-to-show-more-digits
@nparigi-ledger nparigi-ledger changed the title Feat/live 4533 improve decimal handling to show more digits Feat/LIVE-4533 LIVE-4532 - Improve decimal handling to show more digits Dec 1, 2022
@nparigi-ledger nparigi-ledger marked this pull request as ready for review December 1, 2022 15:52
@nparigi-ledger
Copy link
Contributor Author

Should resolve #553

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2022

@nparigi-ledger

Screenshots: ❌

It seems this PR contains screenshots that are different from the base branch.
If you are sure all those changes are correct, you can comment on this PR with /generate-screenshots to update those screenshots.

Make sure all the changes are correct before running the command, as it will commit and push the new result to the PR.

windows

Actual Diff Expected
live-disclaimer-accepted-actual live-disclaimer-accepted-diff live-disclaimer-accepted-expected
live-disclaimer-accepted-actual live-disclaimer-accepted-diff live-disclaimer-accepted-expected

…mber was 1 or 2, there was an extra number displayed
…IVE-4533-improve-decimal-handling-to-show-more-digits
@codecov
Copy link

codecov bot commented Dec 13, 2022

Codecov Report

Base: 42.40% // Head: 42.88% // Increases project coverage by +0.48% 🎉

Coverage data is based on head (9e612dc) compared to base (13078a0).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2037      +/-   ##
===========================================
+ Coverage    42.40%   42.88%   +0.48%     
===========================================
  Files          650      654       +4     
  Lines        26753    27189     +436     
  Branches      7386     7481      +95     
===========================================
+ Hits         11345    11661     +316     
- Misses       14203    14311     +108     
- Partials      1205     1217      +12     
Flag Coverage Δ
test 42.88% <100.00%> (+0.48%) ⬆️

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

Impacted Files Coverage Δ
...r-live-common/src/currencies/formatCurrencyUnit.ts 89.47% <100.00%> (ø)
libs/ledger-live-common/src/range.ts 94.87% <0.00%> (-2.57%) ⬇️
libs/ledgerjs/packages/devices/src/index.ts
...dgerjs/packages/hw-app-helium/src/serialization.ts 86.58% <0.00%> (ø)
libs/ledgerjs/packages/hw-app-helium/src/Helium.ts 89.28% <0.00%> (ø)
libs/ledgerjs/packages/errors/src/helpers.ts 81.17% <0.00%> (ø)
libs/ledgerjs/packages/errors/src/index.ts 73.93% <0.00%> (ø)
.../ledgerjs/packages/hw-app-polkadot/src/Polkadot.ts 20.77% <0.00%> (ø)

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.

…IVE-4533-improve-decimal-handling-to-show-more-digits
…IVE-4533-improve-decimal-handling-to-show-more-digits
…IVE-4533-improve-decimal-handling-to-show-more-digits
…IVE-4533-improve-decimal-handling-to-show-more-digits
…IVE-4533-improve-decimal-handling-to-show-more-digits
@nparigi-ledger nparigi-ledger merged commit 3574c62 into develop Dec 20, 2022
@nparigi-ledger nparigi-ledger deleted the feat/LIVE-4533-improve-decimal-handling-to-show-more-digits branch December 20, 2022 09:59
gre added a commit that referenced this pull request Dec 23, 2022
* fix: fix swap rate call v4

* test: fix tests

* chore: add changeset

* LLM - fix ratings modal close behavior

* changelogs added

* Revert hotfix commits (#2091)

* Revert ":fire: hotfix release [skip ci]"

This reverts commit e0e5bb6.

* Revert ":fire: hotfix prerelease [LLD(2.51.0-hotfix.0)]"

This reverts commit 252aa67.

* Revert ":rocket: entering LLD hotfix mode"

This reverts commit 8f708eb.

* Revert ":fire: hotfix release [skip ci]"

This reverts commit 4ca8f86.

* Revert "Update wording"

This reverts commit fea165d.

* Revert "add energy lt for warning message to be display"

This reverts commit 693e44e.

* Revert "add more feelimit to tron trc20"

This reverts commit 1910b23.

* Revert ":fire: hotfix prerelease [LLM(3.12.0)]"

This reverts commit de77a92.

* Revert ":rocket: entering LLM hotfix mode"

This reverts commit 42df4fc.

* 🚀 entering LLD prerelease mode

* chore: fix changesets

* 🚀 release prerelease [LLD(2.51.0-next.0)]

* fix: use existing getProviders call and move decentralizedSwapAvailable to common

* chore: lint fix

* fix: update logic dex provider getExchangeRates

* chore: fix lint

* Bugfix LLD onboarding: Spinner after genuine check isn't displayed (#2122)

* Fix start of post onboarding not being called in the right place

* changeset

* 🚀 release prerelease [LLD(2.51.0-next.1)]

* fix: support binance and polygon and remove extra change

* fix: includes misspelling

* fix: remove providers dependency in swap lld

* fix: add includeDEX variable

* fix: update mobile with provider attribute

* fix: fix index bug

* add BCERT svg icon

Add blockcerts BCERT token icon

* Update BCERT.svg

Removed the complex file, verifying the file can be converted to react native, verifying the requirements are present and avoid what is prohibited.

* Update BCERT.svg

Added the latest requirements and removed what was asked to remove

* Create funny-cat-distillers.md

Commit for the changeset

* feat/LIVE-4953 Rework the Debug menu and tools on LLM

* feat/LIVE-4953 Fix wrong icon size

* feat/LIVE-4953 Added a network screen + brought playground back

* feat/LIVE-4953 Added a command sender tool

* feat/LIVE-4953 Moved QRBenchmark to broken, dont know what it is

* feat/LIVE-4953 Removed direct entry to that broken screen

* feat/LIVE-4953 Refactored the debug appstate screen

* Refacto exchange partner config (#2052)

* Refacto exchange partner config

- use a util function to generate to config based on name, publickey and
signature
- remove curve field from config since it is unused (most of thems had
value `secpk256k1` which is not a valid curve)

* add changeset

* add test

* feat/FAT-738 Renaming stax - cli

* feat/FAT-738 Renaming stax - lld

* feat/FAT-738 Renaming stax - llc

* feat/FAT-738 Renaming stax - llm

* feat/FAT-738 Renaming stax - libs

* Renaming missing stax

* feat/FAT-738 Prevent LLD crash when lastSeenDevice was nanoFTS

* feat/FAT-738 bad merge fix ref to nanofts

* bugfix/FAT-728 Refactor RenameDevice into DeviceAction

* bugfix/FAT-728 UI Polishes

* TS improvements on debugging, chore

* adding wDoge token icon

* Update SVG

* update SVG

* update SVG

* update SVG

* update SVG: reduced size and removed transform tag

* Update SVG

* fix: width & height to 360

* update icon size

Update SVG to match 360 size

* Feat/LIVE-4533 LIVE-4532 - Improve decimal handling to show more digits (#2037)

* Add dynamicSignificantDigits parameter to formatCurrencyUnit to show more digits of value when needed. Also increased this default parameter value from 4 to 6, so more digits will be displayed throught LLM and LLD.

* fix an issue with the currency amount formatter where if the first number was 1 or 2, there was an extra number displayed

* Update coin apps remote branch to the generated one (#2155)

* bugfix/FAT-720 Change custom lockscreen image size LLD

* bugfix/FAT-720 Change custom lockscreen image size LLM

* feat/FAT-738 Pad custom lockscreen image to fit expected fw size

* ratings feature flag renamed in ratingsPrompt

* ratings feature flag renamed in ratingsPrompt

* lint

* bugfix/FAT-742 Prevent crash when app tries to use stored nanoFTS ref (#2157)

* bugfix/FAT-742 Prevent crash when app tries to use stored nanoFTS ref

* bugfix/FAT-742 Missing changeset

* chore: handle nanoFTS on lastConnectedDevice selector

Co-authored-by: Alexandre Magaud <[email protected]>

* Add Stax Lotties animations on LLD (#2138)

* Revert "Merge branch 'main' into release"

This reverts commit b226417, reversing
changes made to e9edef8.

* [LIVE-4876] Bugfix - EVM family bad behaviour with tx type 0 (#2098)

* Remove "from" key in ethers transaction adapter as it will break with tx type 0 (non EIP1559)

* Fix v that can be incorrect with type 0 tx

* changeset

* feat: split webview for v2 api version

Co-authored-by: Junichi Sugiura <[email protected]>

fix: webview v2 export

chore: update podfile.lock

fix: import issues

feat: init Wallet API v2

fix: wallet-api-server import

fix: bump version of wallet-api

feat: migrate LLC platform to walletAPI

feat: implement more handlers

feat: wallet-api integration
added account.request support using the accounts$ observable
fix transaction.sign return value
remove unneeded serialization/deserialization in transaction.broadcast
cleanup some wallet-api files in LLC
fix platform broadcastTransaction deadlock when DISABLE_TRANSACTION_BROADCAST is enabled

refactor: types and some cleanup

fix: added permissions
bump wallet-api versions
cleanup

test: fix logic test

fix: use constants and setWalletAPIVersion

Introduce WebViewV2 for WebPlatformPlayer

[WIP] Request account handler

Add drawer for request acount handler

Give wallet-api permissions

Pass account list observable to select account drawer

Cleanup

Remove Webview.tsx

Add WebView.tsx

Cleanup

Cleanup

test: fix version tests

refactor: cleanup unused code

refactor: cleanup console.log

fix: add missing permissions

* fix: remove matchVersion usage

* fix: v2 transport send not working on desktop

* refactor: move styled components to a shared file

* feat: use manifest permissions

* chore: changelog

* feat(wallet-api): device.transport integration

* fix: missing buffer in dummy-wallet-app for device.exchange
fix onResult for the action

* Setup device related handlers

* Update dummy app

* Fix internal command

* refactor: revert dummy-live-app changes
already present in dummy-wallet-app

* chore: update lockfile

* chore: bump wallet-api and handle more params

* chore: add changesets

* fix: review comments

* feat: IPCTransport for desktop

* refactor: move IPCTransport back to flow
LLD is not setup for typescript, especially eslint

* refactor: remove bidirectional commands

* Feat/live 4839 anon wallet account (#2069)

* add @types/uuid dev dep

* hash the account id and create a uuidToAccountId map

avoid sending account ids to a live app by creating a unique uuid from
said account id and storing this uuid / account id pair in a map for
easy retrival

* add changeset

* update existing test cases

* fix: serialize/deserialize errors for the IPCTransport

* fix: handle errors better with internal transport

* fix: accounts selector

* fix: unused uuidv4

* fix: share channel name constants

* fix: bump libs

* fix: internal transportChannel imports

* fix: add rxjs7 to LLD & LLM

* chore: bump wallet-api versions

* fix: anon for useGetAccountIds used for request.account

* committing for Juan because he's locked out of github lol

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to ar-AE locale

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to zh-CN locale

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to fr-FR locale

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to de-DE locale

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to ja-JP locale

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to ko-KR locale

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to pt-BR locale

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to ru-RU locale

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to es-ES locale

* File apps/ledger-live-desktop/static/i18n/en/app.json was translated to tr-TR locale

* bugfix/FAT-728 Increase hitslop for edit button, disabled rename when no changes

* Feat/NFT Gallery detox tests (#2158)

* test adding testId to tab bar buttons

* Add nft gallery test specs :
- Add app.json with nft accounts
- Disable Skeleton.tsx animations when MOCK env
- Improve docs
- Remove log box when MOCK env

* fix doc

* fix doc

* Gregor's feedback on detox testings

* Gregor's feedback on detox testings

* updated readme for MOCK and added new line

* Precisions in detox doc

Co-authored-by: Gregor Gilchrist <[email protected]>

* Support/improve ruby steps for detox setup (#2169)

added new section for ios setup

added further setup steps

Co-authored-by: Gregor Gilchrist <[email protected]>

* chore: update desktop release notes

* Feature flags UX improvements (#2143)

* Use settings store for persistency of overridden feature flags

* Use LLD settings store for persistency of overridden feature flags

* Remove useless extra "add FF" field in FF settings, add groupedFeatures

* Add grouped features tab

* cleanup

* Add new stax flags in stax group

* Cleanup

* Reuse experimental banner in case flags are locally overridden

* Change default value of featureFlagsBannerVisible

* Remove useless iconNameWeight in groupedFeatures

* lint + changeset

* lint

* chore: comments and cleaning

* feat: specific method to check if a feature flag exists

Avoids unnecessary request errors if a searched feature flag does not exist

Co-authored-by: Alexandre Magaud <[email protected]>

* 🚀 prepare release [skip ci]

* feat: prototype for fetching/displaying dex quotes

* chore: adds providerType to ExchangeRate type.

* feat: filters cex/dex quotes correctly

* fix: fixes issue when there are no filtered rates in swap

* fix: adds undefined rates to the share form

* chore: renames Swap rate components.

* chore: removes decentralizedSwapAvailable logic.

* adds in local flag to show/hide DEX quotes

* fix: correctly shows DEX quotes

* excludes dex quotes from mobile

* fix: adds firebase feature flag for DEX quotes

* chore: update readme.md for feature flags

* fix: ensures selected rate is persisted when filters change

* fix: fixes issue where if there are no filtered rates, remove selected from redux

* fix: fixes type issues

* fix: improves on CEX and DEX provider type

* changelog

* changelog

* fix: fix extra filter in the provider list

* fix: use getProviderConfig util instead dex mock array

* fix: remove extra undefined dex rates

* fix: only shows DEX rates returned from backend

* fix: shows dex quotes for other networks

* chore: comment

* chore: refactors naming

* fix: displays 1inch instead of oneinch

* fix: adds unit tests

* fix: checks currency family

* fix: webview usage with electron 22

* update screenshots (windows-latest)

Co-authored-by: sarneijim <[email protected]>
Co-authored-by: Come Grellard <[email protected]>
Co-authored-by: hzheng-ledger <[email protected]>
Co-authored-by: haammar-ledger <[email protected]>
Co-authored-by: Hakim <[email protected]>
Co-authored-by: Team Live <[email protected]>
Co-authored-by: Thomas Roger Lux <[email protected]>
Co-authored-by: ofreyssinet-ledger <[email protected]>
Co-authored-by: sarneijim <[email protected]>
Co-authored-by: Blockcerts Blockchain Canada Inc <[email protected]>
Co-authored-by: Juan Cortés Ross <[email protected]>
Co-authored-by: Alexandre Chabrolin <[email protected]>
Co-authored-by: Pierre-Louis Crescitz <[email protected]>
Co-authored-by: wanidulf <[email protected]>
Co-authored-by: nparigi-ledger <[email protected]>
Co-authored-by: @greweb <[email protected]>
Co-authored-by: Alexandre Magaud <[email protected]>
Co-authored-by: Valentin D. Pinkman <[email protected]>
Co-authored-by: Kévin Lambert <[email protected]>
Co-authored-by: JunichiSugiura <[email protected]>
Co-authored-by: alalmi-ledger <[email protected]>
Co-authored-by: Ledger Live <[email protected]>
Co-authored-by: nparigi-ledger <[email protected]>
Co-authored-by: Gregor Gilchrist <[email protected]>
Co-authored-by: Gregor Gilchrist <[email protected]>
Co-authored-by: Gregor Gilchrist <[email protected]>
Co-authored-by: Desifly <[email protected]>
Co-authored-by: cjordan-ledger <[email protected]>
Co-authored-by: cjordan-ledger <[email protected]>
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 mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants