Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.33k stars 2.76k forks source link

[HOLD] [$500] Currency list for request money/send money not up to date #29822

Closed m-natarajan closed 4 months ago

m-natarajan commented 11 months ago

If you havenโ€™t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.3.85-1 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 Expensify/Expensify Issue URL: Issue reported by: @dhanashree-sawant Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697535573916749

Action Performed:

  1. Open the app
  2. Click on green plus and click on request money/send money
  3. Click on select currency
  4. Search 'AED' or 'AWG' and observe that we don't have symbols for them
  5. Go to settings->workspaces->any workspace->settings->default currency
  6. Search for 'AED' or 'AWG' and observe that we have symbols for them in that currency list

    Expected Result:

    Currency list should be upto date throughout the app

    Actual Result:

    Currency list of request money/ send money has many missing symbols and is not upto date as workspace default currency list

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Android: Native https://github.com/Expensify/App/assets/38435837/6b8fa34d-1dc6-4fca-8360-81490691988b
Android: mWeb Chrome https://github.com/Expensify/App/assets/38435837/f1a8328d-0d7e-456f-b694-fd872ff5d512
iOS: Native https://github.com/Expensify/App/assets/38435837/74ee2fa2-5fb3-41f1-8738-e282dd56c06d
iOS: mWeb Safari https://github.com/Expensify/App/assets/38435837/d306703d-41cf-4383-8ebb-3a6bc8ea915d
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/38435837/6c28e73e-b84f-42fc-bb5d-a2a7db5fc921 https://github.com/Expensify/App/assets/38435837/1138619d-28c8-4384-9be6-07c1d56d6113
MacOS: Desktop https://github.com/Expensify/App/assets/38435837/29c13654-e800-4259-9208-369f5ed4b400

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01726365c65211c39c
  • Upwork Job ID: 1714364607492071424
  • Last Price Increase: 2023-11-07
  • Automatic offers:
    • s77rt | Contributor | 0
Issue OwnerCurrent Issue Owner: @miljakljajic
melvin-bot[bot] commented 11 months ago

Triggered auto assignment to @miljakljajic (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 11 months ago

Job added to Upwork: https://www.upwork.com/jobs/~01726365c65211c39c

melvin-bot[bot] commented 11 months ago

Bug0 Triage Checklist (Main S/O)

rakshitjain13 commented 11 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Currency list for request money/send money not up to date

What is the root cause of that problem?

There is inconsistency about how to show text in the list 1) In Request money https://github.com/Expensify/App/blob/12d366931012b0092b924b688924726930398ac4/src/pages/iou/IOUCurrencySelection.js#L99 2) In selecting the default currency for the workspace https://github.com/Expensify/App/blob/12d366931012b0092b924b688924726930398ac4/src/pages/workspace/WorkspaceSettingsCurrencyPage.js#L58 Above use the concept of https://github.com/Expensify/App/blob/12d366931012b0092b924b688924726930398ac4/src/pages/workspace/WorkspaceSettingsCurrencyPage.js#L34

What changes do you think we should make in order to solve the problem?

We should implement the same logic as we implemented in selecting the default currency for the workspace, i.e., 2 points above

if we go with the second option We have to also update the following things in BaseTextInputWithCurrencySymbol.js

https://github.com/Expensify/App/blob/6389c2d47b3bd21ab6cd9547e510721593d645d3/src/components/TextInputWithCurrencySymbol/BaseTextInputWithCurrencySymbol.js#L11

with

const currencySymbol = props.currencyList[props.selectedCurrencyCode].symbol;

and currencyList will be passed as

export default compose(
    withOnyx({
        currencyList: {key: ONYXKEYS.CURRENCY_LIST},
    }),
)(BaseTextInputWithCurrencySymbolWithRef);

What alternative solutions did you explore? (Optional)

NA

melvin-bot[bot] commented 11 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @robertKozik (External)

Charan-hs commented 11 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Currency list for request money/send money not upto date

What is the root cause of that problem?

here we are using getLocalizedCurrencySymbol to get Currency symbol, which uses Locale, defines which Symbol to use based on locality. for example for the US Dollar, the symbol is "$" if the default locale is the US, while for other locales it may be "US$". If no symbol can be determined, the ISO 4217 currency code is returned.

In workspaces we are using the ISO 4217 list to determine the Currency symbol so it contains all Standard currency symbols.

What changes do you think we should make in order to solve the problem?

here we replace getLocalizedCurrencySymbol with this

CurrencyUtils.getCurrencySymbol(currencyCode)

Note: if we implement this then we lose Locale currency symbol

What alternative solutions did you explore? (Optional)

In workspace we can update to use getLocalizedCurrencySymbol to get the currency symbol. or If we won't get the Currency symbol from getLocalizedCurrencySymbol and rather than returning CurrencyCode, we can add a fallback to CurrencySymbol from CurrencyList.

AliYar-Khan commented 11 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Currency list for request money/send money not upto date. Missing currency symbols

What is the root cause of that problem?

We have inconsistency in the code at both locations where currency with symbols are being placed:

  1. https://github.com/Expensify/App/blob/12d366931012b0092b924b688924726930398ac4/src/pages/workspace/WorkspaceSettingsCurrencyPage.js#L58

  2. https://github.com/Expensify/App/blob/12d366931012b0092b924b688924726930398ac4/src/pages/iou/IOUCurrencySelection.js#L99

What changes do you think we should make in order to solve the problem?

use the workspace settings method we will get the same results i.e currency code with symbols

What alternative solutions did you explore? (Optional)

N/A

DylanDylann commented 11 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Currency list for request money/send money not upto date

What is the root cause of that problem?

  1. In Request Money Flow, we use localized symbol for currency
  2. In the workspace, we use normal symbol for currency

It causes the consistency

What changes do you think we should make in order to solve the problem?

we had both functions to get normal symbol and localized symbol https://github.com/Expensify/App/blob/b38171d0374d52e49ac5131363f920c48ea36eb7/src/libs/CurrencyUtils.ts#L45 and https://github.com/Expensify/App/blob/b38171d0374d52e49ac5131363f920c48ea36eb7/src/libs/CurrencyUtils.ts#L56

First, we need to confirm that we should use normal or localized symbols. And then use that function in the both places to avoid consistency

Updated:

  1. If we decide to use normal symbol in both places. In here https://github.com/Expensify/App/blob/12d366931012b0092b924b688924726930398ac4/src/pages/workspace/WorkspaceSettingsCurrencyPage.js#L58 and https://github.com/Expensify/App/blob/12d366931012b0092b924b688924726930398ac4/src/pages/iou/IOUCurrencySelection.js#L99

We should use getCurrencySymbol instead of in both places

DylanDylann commented 11 months ago

@shawnborton

  1. In Request Money Flow, we use localized symbol for currency
  2. In the workspace, we use normal symbol for currency

It causes the consistency. So we need to confirm that we should use a normal or localized symbol for both places? Could you help to give a suggestion from UX perspective? cc @miljakljajic

shawnborton commented 11 months ago

Can you show me an image with a difference between the two?

I think I lean towards having a local symbol, or however is most common to show that symbol before a numerical amount.

DylanDylann commented 11 months ago

@shawnborton This is the difference

  1. This is localized symbol

    Screenshot 2023-10-20 at 11 13 35
  2. This is a normal symbol

Screenshot 2023-10-20 at 11 12 46
robertKozik commented 11 months ago

@shawnborton waiting for your input. about what kind of symbol is preferable for currency

shawnborton commented 11 months ago

Hmm @JmillsExpensify @trjExpensify @Expensify/design do you have a strong opinion? The "normal symbol" from above feels nicer to me.

Charan-hs commented 11 months ago

I have a suggestion as I mentioned https://github.com/Expensify/App/issues/29822#issuecomment-1767118931 We will use localized symbol in general but if it returns currency code (i.e. no currency symbol returned) then we can use standard symbol as a fallback, so this will make local symbol served based on the location and rare/(not in localized currency list ) too get standard symbol from curreny list

dubielzyk-expensify commented 10 months ago

+1 to the "Normal"

DylanDylann commented 10 months ago

@robertKozik Updated proposal

melvin-bot[bot] commented 10 months ago

@miljakljajic, @robertKozik Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

trjExpensify commented 10 months ago

I don't have a strong preference in the picker, but if we use the "normal" symbol, does that mean that someone not in the US can't distinguish between USD and CAD on a request sent to them for example?

I'm trying to reconcile why we have two different currency lists being used in the first place, and this "local" solution to me sounds like it was something to do with this:

here we are using getLocalizedCurrencySymbol to get Currency symbol, which uses Locale, defines which Symbol to use based on locality. for example for the US Dollar, the symbol is "$" if the default locale is the US, while for other locales it may be "US$". If no symbol can be determined, the ISO 4217 currency code is returned.

So my question is whether this has a wider impact on where we show a currency symbol in the app, not just the pickers shown here.

melvin-bot[bot] commented 10 months ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

melvin-bot[bot] commented 10 months ago

@miljakljajic, @robertKozik Huh... This is 4 days overdue. Who can take care of this?

DylanDylann commented 10 months ago

@shawnborton @dubielzyk-expensify Could you help to check this comment https://github.com/Expensify/App/issues/29822#issuecomment-1775789973 ? And then decide the final decision

dubielzyk-expensify commented 10 months ago

I was referring to the picker only. If changing it to "normal" in the picker has wider ramifications, then I'd say use localized symbol. @shawnborton will know this area better though

shawnborton commented 10 months ago

Hmm this is a good point:

does that mean that someone not in the US can't distinguish between USD and CAD on a request sent to them for example?

At the same time, if you are local to Canada and you see just a $, wouldn't you be used to that and assume it's local currency?

melvin-bot[bot] commented 10 months ago

@miljakljajic, @robertKozik 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

DylanDylann commented 10 months ago

@trjExpensify @shawnborton @dubielzyk-expensify Could you guys help to confirm our final decision?

dubielzyk-expensify commented 10 months ago

If this is for the picker only let's go with the simplified symbol due to it having the full currency next to it. So number 2 in this comment. If this becomes an issue we'll fix it.

trjExpensify commented 10 months ago

Sorry folks, I was out for a few days last week.

@trjExpensify @shawnborton @dubielzyk-expensify Could you guys help to confirm our final decision?

I don't think the question from earlier was answered @DylanDylann. Can you confirm this change only impacts the display of the currencies in the currency pickers? If not, can the proposal show the impact of these changes proposed where currency symbols are displayed in the product holistically. I.e on a request, in an expense/iouReport preview, the expense/iouReport header, payment button etc.

DylanDylann commented 10 months ago

@trjExpensify

So my question is whether this has a wider impact on where we show a currency symbol in the app, not just the pickers shown https://github.com/Expensify/App/issues/29822#issuecomment-1772048930.

My solution will make change only be in 2 pickers here and there are no impact on other places

trjExpensify commented 10 months ago

Perfect, then let's go with #2 then as the preference for the display in the pickers. ๐Ÿ‘

DylanDylann commented 10 months ago

@robertKozik We discussed and decided to display normal symbol in the picker. Could you help to take a look at my proposal https://github.com/Expensify/App/issues/29822#issuecomment-1769865854 ?

rakshitjain13 commented 10 months ago

We have to also update if we go with the normal symbol https://github.com/Expensify/App/blob/6389c2d47b3bd21ab6cd9547e510721593d645d3/src/components/TextInputWithCurrencySymbol/BaseTextInputWithCurrencySymbol.js#L11 with

const currencySymbol = props.currencyList[props.selectedCurrencyCode].symbol;

and currencyList will be passed as

export default compose(
    withOnyx({
        currencyList: {key: ONYXKEYS.CURRENCY_LIST},
    }),
)(BaseTextInputWithCurrencySymbolWithRef);

Thus updating my proposal https://github.com/Expensify/App/issues/29822#issuecomment-1767047432

Charan-hs commented 10 months ago

Hi, If we decided on #2 then, you can consider my proposal https://github.com/Expensify/App/issues/29822#issuecomment-1767118931

melvin-bot[bot] commented 10 months ago

@miljakljajic @robertKozik this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] commented 10 months ago

@miljakljajic, @robertKozik 10 days overdue. Is anyone even seeing these? Hello?

melvin-bot[bot] commented 10 months ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

melvin-bot[bot] commented 10 months ago

@miljakljajic, @robertKozik 12 days overdue. Walking. Toward. The. Light...

miljakljajic commented 10 months ago

@robertKozik any thoughts on @Charan-hs 's proposal?

rakshitjain13 commented 10 months ago

@miljakljajic @robertKozik In my proposal https://github.com/Expensify/App/issues/29822#issuecomment-1767047432 I implemented something which I was not aware that there is same function exists for that in that file , :) new to the codebase. Thanks @Charan-hs for putting that function . I will be happy no matter who's proposal is selected.

sonialiap commented 10 months ago

@robertKozik a new issue was just opened that looks mighty similar to this one. What do you think, are they the same issue? https://github.com/Expensify/App/issues/30595

miljakljajic commented 10 months ago

I think that's a dupe @sonialiap!

melvin-bot[bot] commented 10 months ago

@miljakljajic @robertKozik this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

melvin-bot[bot] commented 10 months ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

DylanDylann commented 10 months ago

@robertKozik We confirmed the final decision here. Could you help to take a look at proposals?

melvin-bot[bot] commented 10 months ago

@miljakljajic, @robertKozik Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

robertKozik commented 10 months ago

Sorry for the delay in there. I believe that it's not a dupe. It's very similar issue but it refers different screen - In my opinion each screen should be referenced separately as there is a possibility that we would want to treat them differently.

As I see in this case we landed on sticking to non-localized version of currency symbol. With this in mind I believe the first proposal to align with selected behaviour is the one from @Charan-hs. It was the first one to propose changing both IOU selector and workspace screen to the non-localised currency.

๐ŸŽ€ ๐Ÿ‘€ ๐ŸŽ€ C+ reviewed

melvin-bot[bot] commented 10 months ago

Triggered auto assignment to @cead22, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

DylanDylann commented 10 months ago

@robertKozik In my proposal, I suggest we should update to use getCurrencySymbol in both places to make it consistency in both places. In @Charan-hs's proposal we only use getCurrencySymbol in IOUCurrencySelection.js and retain old logic in WorkspaceSettingsCurrencyPage.js, It will make inconsistency in some cases. What do you think about this point? One more thing, besides spending time proposing solution, I also spend time to follow and support internal team to make correct decision

robertKozik commented 10 months ago

I greatly appreciate your support and your participation in the ongoing discussion about the expected behavior. However, I had to choose the proposal solely based on its merits. The selected proposal suggests the same approach as yours, and it also mentions changes within the workspace settings page in the alternative solutions section:

In workspace we can update to use getLocalizedCurrencySymbol to get the currency symbol.

cead22 commented 10 months ago

I'm a little confused about this issue, because the root cause of the problem sounds like desired behavior to me: we should use the localized version of currency symbols.

Moreover, I don't know if the proposal does this, but it should also consider the behavior of other currency selectors and ideally make them all consistent, unless there are good reasons for having different behavior.

That said, I think it's possible this issue will be solved by the proposal presented for this issue https://github.com/Expensify/App/issues/29618#issuecomment-1785638160 which is to

make a new component: CurrencySelectionList based on the currency selection list of the IOU Request and use it in IOU request and in the workspace default currency setting.

So I suggest we put this issue on HOLD until that other one is resolved

Sorry for the delay in there. I believe that it's not a dupe. It's very similar issue but it refers different screen - In my opinion each screen should be referenced separately as there is a possibility that we would want to treat them differently.

I think what I'm saying is in disagreement with this, and we should start thinking more holistically about the whole product and all the screens, and only have different behavior when we've identified a good reason to treat them differently, and not based on the possibility that we want to treat them differently.

Given that, I suggest we close this issue https://github.com/Expensify/App/issues/30595, or at minimum, put it on hold

miljakljajic commented 10 months ago

I agree @cead22 - @sonialiap with that in mind do you want to close out your issue? We can put this one on hold until #29618 is resolved.