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
[DDW-1111] Non-recommended decimal place setting alert is not displayed before 1st change of settings #3007
[DDW-1111] Non-recommended decimal place setting alert is not displayed before 1st change of settings #3007
Conversation
…ecommended-decimal-settings-warning-not-shown
|
||
export type WalletLocalData = { |
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.
Moved those to separate file.
decimals: hasSavedDecimals | ||
? savedDecimals | ||
: recommendedDecimals || DEFAULT_DECIMAL_PRECISION, | ||
decimals: hasRecommendedDecimals |
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.
The correct logic is: when the user opens the settings, if the token has recomended decimal, it should use it as the initial value, so it can be saved right away (in fact - fixed). If there is no recommendation we should show the current or fallback value.
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.
What if the user already has saved decimals? Would it display the recommended anyway?
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.
That is my understanding of the requirement. @dmitrii-gaico could you confirm?
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.
Yeah, that also seems a bit weird to me 🤔 I would also think that the saved decimals always trump the recommended ones (if there was anything saved ofc) like it was before
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.
Well, so I personally believe we should never change the initial form value, we should always show the current setting no matter what is recommended. As a user, when I open the edit form, I expect to see the currently applied values, no matter if these are defaults or set by me explicitly. Unless that value can no longer be used (eg. because the value selected is no longer available).
Initially when I tried to understand what was the problem, I really couldn't wrap my head around the UX of this form until I jumped on a call with @dmitrii-gaico and he explained it to me.
I would personally show a red screaming alert that the current setting is different from recommended setting (instead of tiny warning sign with no text) and give the user the chance to decide. Or at least add one more section that shows the current setting, because at the moment the user cannot clearly see what is the currently used decimal (or maybe I still don't understand this feature).
But - this is my personal opionion - and I guess this was already discussed in the past and carefully thought through.
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.
To be fair, as a user of multiple wallets, this is something unique to Daedalus and I was also initially confused in the beginning. But in my experience, initial state is initial (default) state unless there has been a write operation where that bit of state has been overridden.
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.
As discussed with @dmitrii-gaico, this change should be reverted to the original implementation.
TransportDevice, | ||
} from '../../../common/types/hardware-wallets.types'; | ||
|
||
export type WalletLocalData = { |
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.
Moved those from source/renderer/app/api/utils/localStorage.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.
Great work @marcin-mazurek . Tested on 22001 👍
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.
Great job @marcin-mazurek
This PR fixes the issue with non-recommended decimal place setting not displayed before the first change of settings.
Related PR: #2905
Screenshots
No UI changes.
Testing Checklist
Review Checklist
Basics
input-output-hk/daedalus-dev
andinput-output-hk/daedalus-qa
assigned as PR reviewersrun Chromatic
label to PR to trigger the run)release-vNext
,feature
/bug
/chore
,WIP
)yarn manage:translations
produces no changes)yarn storybook
)yarn.lock
file is updatedCode Quality
Testing
After Review