-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fix: Remove multiple overlapping spinners #28301
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
ac33280
to
e48a72a
Compare
Builds ready [e48a72a]
Page Load Metrics (2100 ± 81 ms)
Bundle size diffs
|
@pedronfigueiredo are we going to have a direct merge conflict, or maybe even a functional merge conflict? |
Thanks for flagging this @HowardBraham, excited for your PR! However, I checked out your branch and we still see the three issues my PR aims to solve:
Screen.Recording.2024-11-06.at.11.27.16.movSo I think we need both PRs. |
decodedTransferValue: new BigNumber( | ||
value.data[0].params[paramIndex].value.toString(), | ||
) | ||
.dividedBy(new BigNumber(10).pow(Number(decimals))) | ||
.toNumber(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] could use calcTokenAmount here. Then, we could return toFixed
to ensure precision is preserved. Then there would be no need for toNonScientificString
below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears toNonScientificString
is a newly added method in our repo as of a week ago. I think we can remove the need fo toNonScientificString
by avoiding the scientific notation conversion that can be applied when JavaScript handles lengthy digits. This could be done by passing values as strings to BigNumber directly and using toFixed
or toString
instead of toNumber
to display numbers
Builds ready [63168a9]
Page Load Metrics (1772 ± 88 ms)
Bundle size diffs
|
63168a9
to
f56df68
Compare
Builds ready [f56df68]
Page Load Metrics (2227 ± 131 ms)
Bundle size diffs
|
I addressed removing the |
f56df68
to
3de0647
Compare
Builds ready [3de0647]
Page Load Metrics (2015 ± 150 ms)
Bundle size diffs
|
: new Intl.NumberFormat(locale).format(decodedSpendingCap); | ||
return isNFT || parseInt(decodedSpendingCap, 10) < 1 | ||
? decodedSpendingCap | ||
: new Intl.NumberFormat(locale).format(parseInt(decodedSpendingCap, 10)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might cause some precision issues with parseInt here. Examples of supporting precision passing BN to Intl.NumberFormat can be found here
ui/pages/confirmations/components/simulation-details/formatAmount.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! left one minor comment above
17b7015
3de0647
to
17b7015
Compare
Builds ready [17b7015]
Page Load Metrics (1920 ± 98 ms)
Bundle size diffs
|
Description
We were previously using a UI blocking, whole page spinner while loading the redesigned confirmations. This overlapped with the individual component spinners we use on some components that decode transaction data. That second pattern is preferable because the spinner is contained and doesn't block the user from taking action.
The global spinner comes from
routes.component
. The first part of this fix is to bypass it in that file for redesigned confirmations.The second aspect of this fix is to not condense two component spinners into one. Since the transaction flow section always loads before the send heading component, we can omit the spinner for that first component.
Finally, this PR fixes the loading behaviour on the send heading component so that if the decimals amount coming from
useAssetDetails
hasn't been received yet, the heading is not shown, preventing undesireable flickering in the hero value.Related issues
Fixes: #27972
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2024-11-05.at.16.45.16.mov
Pre-merge author checklist
Pre-merge reviewer checklist