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.55k stars 2.9k forks source link

[HOLD for payment 2023-03-23] [$1000] Inconsistency while selecting dropdown in mWeb and Android #15506

Closed kavimuru closed 1 year ago

kavimuru commented 1 year 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!


Action Performed:

  1. Open the app in Android
  2. Navigate to Settings > Workspaces > Select any workspace
  3. Reimburse expenses
  4. Click on Unit Input
  5. Do the exact same steps for mWeb
  6. Notice that the dropdown input's border gets green when focused in mWeb but in Android this only happens when we click on the input

Expected Result:

Behavior should be consistent.

Actual Result:

The behavior of the field isn't consistent

Workaround:

unknown

Platforms:

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

Version Number: 1.2.76-7 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:

https://user-images.githubusercontent.com/43996225/221579483-aab7a1f8-0181-42b6-bf90-6465848868e0.mp4

https://user-images.githubusercontent.com/43996225/221579538-8a836cfc-a657-46ec-9789-d6896fb08e91.mp4

Expensify/Expensify Issue URL: Issue reported by: @daraksha-dk Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1677253047142869

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010c6b32476cf961bc
  • Upwork Job ID: 1631088899411161088
  • Last Price Increase: 2023-03-02
MelvinBot commented 1 year ago

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

MelvinBot commented 1 year ago

Bug0 Triage Checklist (Main S/O)

arielgreen commented 1 year ago

Reproducible.

MelvinBot commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~010c6b32476cf961bc

MelvinBot commented 1 year ago

Current assignee @arielgreen is eligible for the External assigner, not assigning anyone new.

MelvinBot commented 1 year ago

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

MelvinBot commented 1 year ago

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

bernhardoj commented 1 year ago

Same issue here.

redstar504 commented 1 year ago

Proposal

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

The Picker component on mobile web and mobile native shows inconsistent behavior in displaying the green bottom border indicator.

What is the root cause of that problem?

The isOpen state of the Picker component changes the border color, but the events that trigger the state change are different for mobile web and mobile native. The onClose event only supports mobile native, whereas the implemented events that apply to mobile web are onFocus and onBlur. Since picking an item does not blur the Picker element, the border does not change back to its original color.

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

To fix this issue, we need to add additional events to the Picker component to achieve the intended behavior on mobile web. We can disable the green border when a picker item is selected by adding additional logic for changing the isOpen state through onValueChange and onClick events. After manipulating the state using these events, the indicator functions as expected on mobile web:

https://user-images.githubusercontent.com/1311325/222307120-e92559c0-ae60-4e0e-80ba-f8cb7be1d9e3.mp4

As demonstrated above:

onClick -> setState({isOpen: true}) onValueChange -> setState({isOpen: false})

What alternative solutions did you explore? (Optional)

Another option might be to blur the picker in onValueChange. To achieve this we would have to use a ref since onValueChange does not emit an event. The implementation of the Picker is different on each platform (ie. Android uses a TextInput and Web uses a <select> element, so we would have to be sure to blur the right target.

thesahindia commented 1 year ago

The solution sounds good to me!

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

cc: @marcaaron

marcaaron commented 1 year ago

Ah, is it me or is it debatable which behavior is correct? The proposal sounds good though I am unsure which is the preferred direction to go here.

Would making a selection not return the focus to the field itself? Can native match the behavior that mobile web has?

Curious to get @shawnborton's take here. I think we can hire @redstar504 for this one. Though - I would like to get some consensus on the correct behavior first if we can.

MelvinBot commented 1 year ago

๐Ÿ“ฃ @redstar504 You have been assigned to this job by @marcaaron! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review ๐Ÿง‘โ€๐Ÿ’ป Keep in mind: Code of Conduct | Contributing ๐Ÿ“–

redstar504 commented 1 year ago

@marcaaron Thank you. I debated that as well when digging into this. The existing logic seemed to lean towards changing the colour back when the picker is closed. I am not sure it provides much benefit to the user to keep the field highlighted after they have chosen an option and moved on.

shawnborton commented 1 year ago

Yeah, this is an interesting one. I think I agree with @redstar504's proposal though to remove the "focus" feeling after something is picked.

marcaaron commented 1 year ago

Ok cool sounds good to me. Let's go with the O.G. proposal. Thanks all.

arielgreen commented 1 year ago

@thesahindia @daraksha-dk @redstar504

offers sent in Upwork

MelvinBot commented 1 year ago

@redstar504, @marcaaron, @arielgreen, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

marcaaron commented 1 year ago

Solution is on staging now - just waiting for it to hit production.

MelvinBot commented 1 year ago

Reviewing label has been removed, please complete the "BugZero Checklist".

MelvinBot commented 1 year ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.2.85-1 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-03-23. :confetti_ball:

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

MelvinBot commented 1 year ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

MelvinBot commented 1 year ago

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

arielgreen commented 1 year ago

Calculating bonus: 2/2/23 - contributor assigned to issue 2/15/23 - PR merged - 9 business days - no bonus/no penalty

$250 to @daraksha-dk $1000 to @redstar504 $1000 to @thesahindia

Issuing payments now

arielgreen commented 1 year ago

@marcaaron @thesahindia please see and complete checklist

thesahindia commented 1 year ago

It wasn't a regression so we can skip the first three items.

Let's just add the regression steps

Regression test proposal

  1. Go to setting > Workspaces
  2. Select any workspace > General settings
  3. Open the currency selector > Select a different value
  4. Verify the picker is not highlighted after it gets closed
marcaaron commented 1 year ago

It wasn't a regression so we can skip the first three items.

๐Ÿ‘

arielgreen commented 1 year ago

Excellent, we are good to close then.