You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for BugZero Checklist] [$1000] current currency is not highlighted and not marked with ✔️ #17372
current currency should be highlighted and marked with ✔️ (same as Timezone, Pronouns)
Actual Result:
current currency not highlighted
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: v1.2.99-4 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
@NicMendonca please click the currency marked with yellow square in your image, it will open Select currency screen. On that screen CA is not highlighted with bold and marked with green check mark.
So in this issue we are talking about it. You can go to Timezone, Pronouns page to see the exact behaviour what should be expected result for this issue.
Here is quick video I recorded to make it more clear. So this issue should not be closed.
Posting proposal early as per new guidelines for the eventual review
Please re-state the problem that we are trying to solve in this issue.
In this issue, we can notice that on the Select a currency page, the Options selector does not have the selected / default currency marked with a tick, as in other pages like Timezone, Language, Pronouns.
What is the root cause of that problem?
Unlike other pages, we do not have a customIcon and the boldStyle set for the options that are displayed on the OptionsSelector on the IOUCurrencySelection page. This results in the default currency not being checkmarked and neither being bold.
In order for an item to be checkmarked, when we are creating the objects for the options that will be displayed on the OptionsList via the OptionsSelector, the object must have the customIcon and boldStyle key, which is missing on the OptionsSelector.
What changes do you think we should make in order to solve the problem?
To solve this issue, we need to account for the selected currency that is chosen by the user by default and set the custom icon to a green checkmark and apply a bold style to that currency. In order to do that, we will have to perform the following additions:
To get the default currency that is chosen by the user, we need the Onyx key ONYXKEYS.IOU. We will import that by adding the key for that in the withOnyx call for IOUCurrencySelection.
Next, we will declare the respective propTypes and defaultProps for iou prop.
Next, we need to import the green checkmark. This will be done by using the following code and adding the relevant dependencies:
Once this is done, we need to modify the getCurrencyOptions method on the IOUCurrencySelection page. We need to include the customIcon as a key in the object where if the iterated currency code equals the default currency mode, we will set the icon as the green checkmark else as undefined.
We also need to include the boldStyle key in the object such that if the iterated currency code equals the default currency mode, we will set the value of boldStyle to true.
Once this has been done, the green checkmark and bold style will be applied to the selected option. However, in order to improve the experience and be consistent with other pages, we also need to scroll the OptionsList to the default selected currency when the page is initially opened. To do this, we need to add a prop initiallyFocusedOptionKey to the OptionsSelector where it's value will be this.props.iou.selectedCurrencyCode.
Hmmm, I still think this is a stylistic preference and not a bug. Timezone and Pronouns are setting you set in your profile, and the currency you use for sending/ requesting money is ad-hoc but seems to be some passion about it here 😊
The PR that introduced the bug has been identified. Link to the PR: This is a consistency bug. We added a checkmark to timezone selection in this PR. But it's out of scope of PR to go and update all pages to add a checkmark.
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N.A.
Determine if we should create a regression test for this bug. No
If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again N.A.
Activity
MelvinBot commentedon Apr 13, 2023
Triggered auto assignment to @NicMendonca (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.MelvinBot commentedon Apr 13, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)NicMendonca commentedon Apr 14, 2023
Hmm, I think this is a stylistic preference, not a bug. I think it's is very clear which is the current currency:
PrashantMangukiya commentedon Apr 14, 2023
@NicMendonca please click the currency marked with yellow square in your image, it will open Select currency screen. On that screen CA is not highlighted with bold and marked with green check mark.
So in this issue we are talking about it. You can go to Timezone, Pronouns page to see the exact behaviour what should be expected result for this issue.
Here is quick video I recorded to make it more clear. So this issue should not be closed.
Currency.mov
Prince-Mendiratta commentedon Apr 18, 2023
@NicMendonca I too think this issue is about the list itself, not the label
Prince-Mendiratta commentedon Apr 18, 2023
Proposal
Posting proposal early as per new guidelines for the eventual review
Please re-state the problem that we are trying to solve in this issue.
In this issue, we can notice that on the
Select a currencypage, the Options selector does not have the selected / default currency marked with a tick, as in other pages like Timezone, Language, Pronouns.What is the root cause of that problem?
Unlike other pages, we do not have a
customIconand theboldStyleset for the options that are displayed on theOptionsSelectoron theIOUCurrencySelectionpage. This results in the default currency not being checkmarked and neither being bold.In order for an item to be checkmarked, when we are creating the objects for the options that will be displayed on the
OptionsListvia theOptionsSelector, the object must have thecustomIconandboldStylekey, which is missing on theOptionsSelector.What changes do you think we should make in order to solve the problem?
To solve this issue, we need to account for the selected currency that is chosen by the user by default and set the custom icon to a green checkmark and apply a bold style to that currency. In order to do that, we will have to perform the following additions:
ONYXKEYS.IOU. We will import that by adding the key for that in thewithOnyxcall forIOUCurrencySelection.iouprop.App/src/pages/settings/Profile/TimezoneSelectPage.js
Line 19 in 5d69c8e
getCurrencyOptionsmethod on theIOUCurrencySelectionpage. We need to include thecustomIconas a key in the object where if the iterated currency code equals the default currency mode, we will set the icon as the green checkmark else as undefined.boldStylekey in the object such that if the iterated currency code equals the default currency mode, we will set the value ofboldStyletotrue.App/src/pages/iou/IOUCurrencySelection.js
Lines 78 to 82 in 0763be5
OptionsListto the default selected currency when the page is initially opened. To do this, we need to add a propinitiallyFocusedOptionKeyto theOptionsSelectorwhere it's value will bethis.props.iou.selectedCurrencyCode.App/src/pages/iou/IOUCurrencySelection.js
Line 122 in 0763be5
What alternative solutions did you explore? (Optional)
None
PrashantMangukiya commentedon Apr 18, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Current currency is not highlighted and not marked with checkmark.
What is the root cause of that problem?
Within
IOUCurrencySelection.jswe are creating currency options viagetCurrencyOptions()functionApp/src/pages/iou/IOUCurrencySelection.js
Lines 77 to 83 in 42bea4b
We can see that here there is not any condition to highlight the selected currency. This is the root cause of the problem.
What changes do you think we should make in order to solve the problem?
We have to update
getCurrencyOptions()function, so it will set thecustomIconandboldStylefor selected currency as shown below:We have to import
iouas props using withOnyx as shown in pseudo code below, we also need to define iou prop type.It will solve the issue and works as expected as shown in results video.
What alternative solutions did you explore? (Optional)
None
Results
Web.mov
gadhiyamanan commentedon Apr 21, 2023
bump @NicMendonca
NicMendonca commentedon Apr 21, 2023
Hmmm, I still think this is a stylistic preference and not a bug. Timezone and Pronouns are setting you set in your profile, and the currency you use for sending/ requesting money is ad-hoc but seems to be some passion about it here 😊
57 remaining items
melvin-bot commentedon May 23, 2023
Triggered auto assignment to @sonialiap (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon May 23, 2023
sonialiap commentedon May 25, 2023
@rushatgabhane checklist please :) #17372 (comment)
rushatgabhane commentedon May 25, 2023
The PR that introduced the bug has been identified. Link to the PR: This is a consistency bug. We added a checkmark to timezone selection in this PR. But it's out of scope of PR to go and update all pages to add a checkmark.
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/12201/files#r1206076584
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N.A.
Determine if we should create a regression test for this bug. No
If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again N.A.
rushatgabhane commentedon May 25, 2023
Hi @sonialiap, I completed the checklist. We can now close this issue.
sonialiap commentedon May 29, 2023
Thanks @rushatgabhane !