Skip to content
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

[HOLD for payment 2023-09-08] [$1000] mWeb - Chat - Hide the keyboard on click of confirm button #25570

Closed
2 of 6 tasks
izarutskaya opened this issue Aug 21, 2023 · 28 comments
Closed
2 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 21, 2023

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. go to any chat and send password protected pdf
  2. click on PDF and type wrong password
  3. click on confirm button

example protected PDF.pdf
Password: 25570

Expected Result:

Should not hide the keyboard same as native app

Actual Result:

Keyboard hides and user have to click on input field to open keyboard

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.3.55-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: Any additional supporting documentation

Screen_Recording_20230810_141921_New.Expensify.mp4
Record_2023-08-19-22-58-29.mp4

Expensify/Expensify Issue URL:

Issue reported by: @gadhiyamanan

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691657367673159

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0130b6dd1d51afa360
  • Upwork Job ID: 1694669713222795264
  • Last Price Increase: 2023-08-24
  • Automatic offers:
    • cubuspl42 | Reviewer | 26322364
    • alitoshmatov | Contributor | 26322365
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 21, 2023
@alitoshmatov
Copy link
Contributor

Proposal

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

mWeb - Chat - Hide the keyboard on click of confirm button

What is the root cause of that problem?

When button is pressed, text input is losing focus.

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

We can add

  onMouseDown={e=>e.preventDefault()}

to keep focus in textinput like we are doing in other places.
We add above code to confirm button here:

<Button
text={translate('common.confirm')}
onPress={submitPassword}
style={styles.mt4}
isLoading={shouldShowLoadingIndicator}
pressOnEnter
/>

What alternative solutions did you explore? (Optional)

@alexpensify alexpensify removed the Bug Something is broken. Auto assigns a BugZero manager. label Aug 24, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 24, 2023
@alexpensify alexpensify added Bug Something is broken. Auto assigns a BugZero manager. and removed Overdue labels Aug 24, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 24, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 24, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@alexpensify
Copy link
Contributor

Reassigning another Bug team member: I realized that this one still needs to be reassigned and I'm OOO until Monday, August 28. 😞 I will take it back if it's still open by my return date.

Required action from the team: I ran out of time and have not tested this one. To avoid delaying the process, I've reassigned to test and confirm if there is a bug here. Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Aug 24, 2023
@conorpendergrast
Copy link
Contributor

Looking good!

@conorpendergrast conorpendergrast added the External Added to denote the issue can be worked on by a contributor label Aug 24, 2023
@melvin-bot melvin-bot bot changed the title mWeb - Chat - Hide the keyboard on click of confirm button [$1000] mWeb - Chat - Hide the keyboard on click of confirm button Aug 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 24, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0130b6dd1d51afa360

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 24, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 24, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Aug 24, 2023

Proposal

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

Keyboard hides and user have to click on input field to open keyboard

What is the root cause of that problem?

It's native web behavior that when we tap on a button, the text inputs will be blurred.

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

I've seen this happening many times in a couple of places now. What we used to do is to add onMouseDown={e => e.preventDefault()}. But I'd like to do something further here.

Let's take a look at these comments:

// Prevent losing Composer focus

// Prevent text input blur when Add reaction is clicked

Why are there comments added? Because the code itself is not clear, without the comments nobody understands what that preventDefault is for. That's better than using preventDefault without any comments at all (which we're doing in some other places) since it's not clear at all why we're using that.

So I think we should create a standard persistKeyboardOnTap property for button-related components like Button, Pressable..., and when we want to enable the behavior, we just have to add persistKeyboardOnTap when we use it.

Inside the component, if persistKeyboardOnTap is true, we'll add the preventDefault behavior to onMouseDown.

So to fix this bug, in here we need to add persistKeyboardOnTap. We should also refactor other related places to use it as well, and remove the comments explaining what preventDefault is doing.

This will make sure that:

  • The code to control the behavior is much clearer
  • We never have to put the above comments, since everyone will understand now when they see persistKeyboardOnTap
  • In some components where there's native-specific file, we won't have to add the onMouseDown={e => e.preventDefault()} (since the issue doesn't happen for native). This makes for a small performance improvement (one less event registered).

What alternative solutions did you explore? (Optional)

NA

@cubuspl42
Copy link
Contributor

The solution by @alitoshmatov is straight to the point.

@tienifr I appreciate the effort to clarify the code but I'm not convinced by the suggested approach. Adding a property strictly related to the keyboard feels over-specific; if anything, it should be related to focusing. But that assumes that (un)focusing is the only default User Agent effect of pressing the button, while I'm not completely sure whether it's the case. In short, I agree that the preventDefault contract is a bit unclear, and using it can require a comment, but I'm not sure whether something can be done about it.

I suggest we go with @alitoshmatov here.

C+ reviewed 🎀 👀 🎀

@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Aug 25, 2023

But that assumes that (un)focusing is the only default User Agent effect of pressing the button

@cubuspl42 just curious why do you think it assumes this?

It only says: "if we want to persist focus on tap, we'll preventDefault", which is the same thing as adding the preventDefault explicitly, it doesn't say "preventDefault is only used to persist keyboard on tap"

It only abstracts away the implementation of persist focus on tap, it doesn't assume anything IMO

if anything, it should be related to focusing

yeah persistFocusOnTap sounds better 😄

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Aug 25, 2023

📣 @alitoshmatov 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 28, 2023
@alitoshmatov
Copy link
Contributor

Sorry for the delay, PR is ready - #26025

@alexpensify
Copy link
Contributor

Thanks for the update here @alitoshmatov.

@conorpendergrast - you are a legend, I'm back online and will keep moving this one forward.

@melvin-bot
Copy link

melvin-bot bot commented Aug 31, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @alitoshmatov got assigned: 2023-08-25 10:58:13 Z
  • when the PR got merged: 2023-08-31 11:56:36 UTC
  • days elapsed: 4

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 1, 2023
@melvin-bot melvin-bot bot changed the title [$1000] mWeb - Chat - Hide the keyboard on click of confirm button [HOLD for payment 2023-09-08] [$1000] mWeb - Chat - Hide the keyboard on click of confirm button Sep 1, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

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

If no regressions arise, payment will be issued on 2023-09-08. 🎊

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.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

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

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

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:

  • [@cubuspl42] The PR that introduced the bug has been identified. Link to the PR:
  • [@cubuspl42] 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:
  • [@cubuspl42] 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:
  • [@cubuspl42] Determine if we should create a regression test for this bug.
  • [@cubuspl42] 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.
  • [@alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@cubuspl42
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:
  • 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:
  • 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:
    • No need for additional discussion
  • Determine if we should create a regression test for this bug.
    • No need for a new regression test
  • 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

@parasharrajat
Copy link
Member

I disagree with the above comment. This GH is a feature request rather than a bug.

@cubuspl42
Copy link
Contributor

@parasharrajat You're definitely right that it can also be seen that way. It's a tricky topic, as many Expensify bugs are related to some unexpected user experience, and there's no written down definitive source of truth how the app should behave. When something used to work in a more pleasant way and it changed, then it's easy - we have a regression! A bug. When it never worked the way we, at some point, decide is the right one; then either it was always broken, or it's just a new requirement.

But I don't think it really matters in this case... That issue is long past its regression period, so I don't think my comment did any harm... I was just doing the checklist ✓

@parasharrajat
Copy link
Member

parasharrajat commented Sep 3, 2023

You can leave the checklist empty if not applicable. It matters if we start adding wrong PRs into regression checklist. There are multiple purposes of this checklist.

Can you please fix it?

@cubuspl42
Copy link
Contributor

cubuspl42 commented Sep 3, 2023

@parasharrajat

It matters if we start adding wrong PRs into regression checklist.

The text of the bullet is "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", it doesn't mention anything about a regression explicitly. A regression is when something is working and stops. When a new feature is added with behavior that's later decided to be "wrong", it can be said that it was some kind of a mistake not to make it "right" from the beginning. As long as it's about learning, I can't see any negative consequences of my comment and you didn't mention any.

Maybe the text of the bullet is different than the intention behind it?

Can you please fix it?

As you don't have any direct authority over me, to the best of my knowledge, I will gladly change it when you convince me to.

@parasharrajat
Copy link
Member

Can you please fix it?

It was just a request. Sorry if that sounded rude. It was a little direct.

I already mentioned earlier that this is more of a feature request not a bug. So it does not lie under a mistake from old PR clause.

I don't want to continue discussing this so it's fine if you don't.

Anyway, Thanks for your time.

@alexpensify
Copy link
Contributor

Here is the payment summary:

Upwork Job: https://www.upwork.com/jobs/~0130b6dd1d51afa360

*If applicable, the bonuses will be applied on the final payment

Extra Notes regarding payment: No bonus but everyone has been paid or payment has been prepared in Upwork. Please confirm receipt and I can close. Thanks!

@alexpensify
Copy link
Contributor

Alright, everyone has been paid here. I'm going to close for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants