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
2.99k stars 2.5k forks source link

[$4000] Android - Edit message - keyboard is dismissed after selecting an emoji @Tushu17 #9252

Closed kbecciv closed 7 months ago

kbecciv 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 steps:

  1. Send a message in any chat in App
  2. Long press the message and tap on Edit message
  3. Tap on the emoji picker
  4. Select an emoji and observe the keyboard is dismissed

Expected results:

The alphabetical keyboard should not be dismissed after selecting an emoji

Actual Result:

Keyboard doesn't open up after selecting emoji.

Workaround:

Unknown

Platform:

Where is this issue occurring?

Version Number: 1.1.69.2

Reproducible in staging?: Yes

Reproducible in production?: Yes

Email or phone of affected tester (no customers): any

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

https://user-images.githubusercontent.com/93399543/171174709-69b79478-f54a-4c55-b84b-114f7ec51087.mp4

Upwork URL: https://www.upwork.com/jobs/~01f30fad98ca9b6c69

Issue reported by: @Tushu17

Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1650039236885699

View all open jobs on GitHub

Upwork Automation - Do Not Edit

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @trjExpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

melvin-bot[bot] commented 1 year ago

@trjExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

trjExpensify commented 1 year ago

👋 @kbecciv @Tushu17, it took me a second to figure this out based on the steps provided and the issue title. Do you think it's more accurately described as:

Title: Android - Edit message - keyboard is dismissed after selecting an emoji

Action steps:

  1. Send a message in any chat in App
  2. Long press the message and tap on Edit message
  3. Tap on the emoji picker
  4. Select an emoji and observe the keyboard is dismissed

Expected results: The alphabetical keyboard should not be dismissed after selecting an emoji

Let me know and we can update this for clarity.

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @Julesssss (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

trjExpensify commented 1 year ago

Cool, updated. Ready for engineering triage!

Julesssss commented 1 year ago

I can reproduce it, but I think the expected result should be modified to the following:

The alphabetical keyboard should re-open if it was closed when we displayed the emoji picker

Does anyone disagree? It makes more sense to me that we would close the keyboard while the emoji picker is open, then re-open it ONLY if it was open prior to the emoji picker being selected.

trjExpensify commented 1 year ago

Isn't it always open prior when editing? 🤔

Julesssss commented 1 year ago

Not if the user manually closes the keyboard. I do this when writing a long message so i can review the full message in a single screen.

Though rare, I would be annoyed if I finished writing a message, closed the keyboard, added an emoji and then saw the keyboard pop up again. Especially because it's super laggy.

Tushu17 commented 1 year ago

Hey @Julesssss, The behaviour is also inconsistent. The keyboard opens after selecting the emoji at composer.

https://user-images.githubusercontent.com/89839952/173139625-60c1c741-53b7-4d55-b610-2c93d0242f41.mov

.

Julesssss commented 1 year ago

Thanks, @Tushu17.

@trjExpensify this is the case which I believe should be excluded:

https://user-images.githubusercontent.com/10736861/173361430-d66f93e4-077c-417a-809e-a187e1795f88.mp4

trjExpensify commented 1 year ago

^^ Ah right yes, but that's not in edit mode is it?

Julesssss commented 1 year ago

That's true. But I still think our solution should revert the keyboard state to the state it was in prior to opening the emoji menu. This handles both the original bug, and the annoying edge-case I pointed out

Julesssss commented 1 year ago

I think the issue should be 'ensure the keyboard state matches the pre-emoji menu state', and I'll list both use cases as tests. That should ensure we attract good proposals.

trjExpensify commented 1 year ago

Okay cool, I see what you're saying. Let's do it. 👍

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Current assignee @Julesssss is eligible for the Exported assigner, not assigning anyone new.

Julesssss commented 1 year ago

Awaiting proposals

trjExpensify commented 1 year ago

Upwork job here: https://www.upwork.com/jobs/~01f30fad98ca9b6c69

parasharrajat commented 1 year ago

This used to work.

asfandyarsheikh commented 1 year ago

Saw this on upwork. Is it good design practice to open a separate bottom sheet for emojis? Why not use a custom keyboard that allows emoji input via separate tab? Something like this https://wix.github.io/react-native-ui-lib/docs/components/keyboard/KeyboardAccessoryView

yashwant-dangi commented 1 year ago

Proposal

For the EmojiPickerButton component, onModalHide callback if we add a timeout of around 50-100 ms in the Interaction Manager then this issue can be resolved.

https://github.com/software-mansion/react-native-screens/issues/89#issuecomment-514935753

https://user-images.githubusercontent.com/43725028/173767631-25bdc0cc-9202-47d6-b41a-81bab7fc1b3d.mp4

Julesssss commented 1 year ago

Thanks @yashwant-dangi. I'd prefer a solution that doesn't rely on a Timeout preferably.

Julesssss commented 1 year ago

Still awaiting proposals. @trjExpensify can you please double the job price? (I assume we double in UpWork as well as just updating the issue title?)

trjExpensify commented 1 year ago

Yep, done! https://www.upwork.com/jobs/~01f30fad98ca9b6c69

trjExpensify commented 1 year ago

Not overdue, Melv. Awaiting proposals.

Julesssss commented 1 year ago

@trjExpensify please double again

trjExpensify commented 1 year ago

Donezo: https://www.upwork.com/jobs/~01f30fad98ca9b6c69

mdneyazahmad commented 1 year ago

Proposal

There existed the same issue on composer and is fixed by a workaround with setTimeout by this PR.

https://github.com/Expensify/App/blob/d7dc3eea13bdb2af3e606530dc42058ca0a291ee/src/pages/home/report/ReportActionCompose.js#L334-L352

https://github.com/Expensify/App/blob/d7dc3eea13bdb2af3e606530dc42058ca0a291ee/src/pages/home/report/ReportActionCompose.js#L638-L642


Maybe it has been missed there. My proposal is to do the same thing on edit composer. The only reason I propose this way is because we already have deployed the same workaround.

https://github.com/Expensify/App/blob/d7dc3eea13bdb2af3e606530dc42058ca0a291ee/src/pages/home/report/ReportActionItemMessageEdit.js#L227-L231

Let me know whether this proposal is accepted or I think we should also find a solution to the previously deployed workaround.

parasharrajat commented 1 year ago

Ok, I see. Although we have adopted a workaround previously, it does not mean that we should do that always.

Let me know whether this proposal is accepted or I think we should also find a solution to the previously deployed workaround.

Yeah, try to find the solution to the real problem of why the keyboard is not opening? Let's see some root cause analysis.

FYI @mdneyazahmad your proposal matches with https://github.com/Expensify/App/issues/9252#issuecomment-1156088875 .

trjExpensify commented 1 year ago

Any further ideas here @mdneyazahmad?

Julesssss commented 1 year ago

Not overdue

trjExpensify commented 1 year ago

Doubled on upwork: https://www.upwork.com/jobs/~01f30fad98ca9b6c69

melvin-bot[bot] commented 1 year ago

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

parasharrajat commented 1 year ago

Waiting for proposals.

aneequeahmad commented 1 year ago

Proposal

Problem:

Solution: Setting false instead of true here toggleReportActionComposeView(false, VirtualKeyboard.shouldAssumeIsOpen()); fixes the issue

https://user-images.githubusercontent.com/36359331/179383445-05ea0698-b56b-4cf4-b357-ba7205d3c2a5.mov

parasharrajat commented 1 year ago

What is the effect of this change @aneequeahmad?

aneequeahmad commented 1 year ago

@parasharrajat Effect of setting the first argument to false in toggleReportActionComposeView(false, VirtualKeyboard.shouldAssumeIsOpen())

Also, as you mentioned above this used to work. You're right this used to work before 18th May 2022 and these changes were added by this PR in this commit

parasharrajat commented 1 year ago

I am trying to get the context behind onBlur changes.

trjExpensify commented 1 year ago

@parasharrajat @Julesssss are we good with this proposal, what's the next step?

Julesssss commented 1 year ago

This proposal seems to resolve the issue, but I'd like to see the answer to this before we approve:

I am trying to get the context behind onBlur changes.

parasharrajat commented 1 year ago

I got the update on the previous changes and we do want to enable the composer to blur on the edit box. Blur can be triggered via clicking on Save or Cancel buttons as well as a normal blur on the EditBox.

So proposal is not valid.

aneequeahmad commented 1 year ago

@parasharrajat Oh alright i didn't know that this is a feature and we want to enable the composer to blur

Updated Proposal

Problem

Solution:

https://github.com/Expensify/App/blob/c2ecea533a3805bbe547b48d61baa8c24a1f89ef/src/pages/home/report/ReportActionItemMessageEdit.js#L229-L231

trjExpensify commented 1 year ago

@parasharrajat thoughts on the above?

aneequeahmad commented 1 year ago

@marcaaron This is the relevant issue. I came to know that

So i think to solve this keyboard dismiss issue on EmojiPicker we have to stop the method to toggle the composer (toggleReportActionComposeView) as it is preventing the users to take actions like we have done for save and cancel buttons.

cc: @parasharrajat

parasharrajat commented 1 year ago

Testing the proposal in a few hours.

parasharrajat commented 1 year ago

How will this proposal solve the issue on Android @aneequeahmad?

aneequeahmad commented 1 year ago

@parasharrajat when i debugged the issue pressing the emojiPicker button wasn't doing any action. But now it is opening the emojiPicker on latest build 1.1.87-6 so The above proposal is not valid.

PROPOSAL

We only need to add InteractionManager.runAfterInteractions(() => setTimeout(() => this.textInput.focus(), 100)) here onModalHide.

https://github.com/Expensify/App/blob/d6417564acf9d34bad12231dcbc228fcb5c67f98/src/pages/home/report/ReportActionItemMessageEdit.js#L218-L221

AFTER FIX

https://user-images.githubusercontent.com/36359331/182445232-aaa5ba38-e6c8-4c52-9f09-4b2d87aeceb3.mp4

parasharrajat commented 1 year ago

when i debugged the issue pressing the emojiPicker button wasn't doing any action. But now it is opening the emojiPicker on latest build 1.1.87-6 so The above proposal is not valid.

Then how did you test this issue? Issue steps clearly indicate that it happens after opening the emoji picker.

A similar proposal exists. One thing that I noticed during your proposals @aneequeahmad is that you jump between solutions after review. Most of the time, your previous proposals are completely different from new ones. This is not a problem but it indicates that your proposal lacks clear testing and analysis on the issue.

For example, your previous proposal does not solve Android or does not have any effect on Android but the issue clearly indicates that the affected platform is Android. This is a very bad practice and should be avoided at all costs. This exhausts premium review time and also creates a clutter of bogus information on the issues.

Next time, I will reject the proposal without giving reasons. Please do comprehensive testing on your solution before making a proposal. Disclose all the parameters that are necessary for your proposal. Do not assume that the reviewer might know things.

Thank you.