App icon indicating copy to clipboard operation
App copied to clipboard

[$500] Chat - Compose box is shown again after user is in edit mode and dismiss keyboard

Open lanitochka17 opened this issue 1 year ago β€’ 21 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.32-2 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: Applause - Internal Team Slack conversation:

Issue found when executing PR https://github.com/Expensify/App/pull/34404

Action Performed:

Pre-requisite: user must be logged in and have sent a message to any chat

  1. Go to a chat where you have sent a message
  2. Tap and hold on the message
  3. Select "Edit comment"
  4. Tap on the box to edit the comment for the keyboard to appear
  5. Tap "Done" button on the top right corner of the keyboard

Expected Result:

tapping the "done" button on the keyboard should close the edited chat message and the keyboard should be dismissed

Actual Result:

The compose box is shown again after the keyboard is dismissed

Workaround:

Unknown

Platforms:

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

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [ ] iOS: Native
  • [x] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/bf07c8c7-4e96-4aed-9617-e83c2aa9b477

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ade0e4b570684292
  • Upwork Job ID: 1750604363283750912
  • Last Price Increase: 2024-02-01

lanitochka17 avatar Jan 25 '24 19:01 lanitochka17

Job added to Upwork: https://www.upwork.com/jobs/~01ade0e4b570684292

melvin-bot[bot] avatar Jan 25 '24 19:01 melvin-bot[bot]

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

melvin-bot[bot] avatar Jan 25 '24 19:01 melvin-bot[bot]

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

melvin-bot[bot] avatar Jan 25 '24 19:01 melvin-bot[bot]

We think that this bug might be related to #vip-vsp CC @quinthar

lanitochka17 avatar Jan 25 '24 19:01 lanitochka17

Proposal

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

Chat - Compose box is shown again after user is in edit mode and dismiss keyboard

What is the root cause of that problem?

when we click on the done button, we trigger onBlur

https://github.com/Expensify/App/blob/caf91aefc70e8bb82813a421097fd37b412bb137/src/pages/home/report/ReportActionItemMessageEdit.tsx#L443-L451

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

Actually, this is Quite a difficult task

I checked documentation RN and StackOverflow and couldn't find a listener who was able to track done button (Including onSubmitEditing is not suitable as in the second proposition)

All propositions from StackOverflow are associated with a focusout event But to call this event just press on the area outside the input

https://stackoverflow.com/questions/4971061/capture-done-button-click-in-iphones-virtual-keyboard-with-javascript

I also thought about using InputAccessoryViewwhich replaces the original accessory view with a custom one

https://reactnative.dev/docs/inputaccessoryview

And it works perfect for native IOS. We can add just custom done button and use it

Screenshot 2024-02-03 at 09 15 30

But unfortunately This is a very crude component in React-native-web

Screenshot 2024-02-03 at 09 17 03

But since this problem is relevant only for iOS web

I decided to compare the events of pressing outside the input and pressing the done button

And notice that these events differ event.nativeEvent?.relatedTarget It's actually logical Because when we press outside the input We are interacting with another component on the screen anyway Unlike the done button where interaction is limited to the keyboard

So I think we can update onBlur function and add new condition And when relatedTargetId is null We will close draft input

https://github.com/Expensify/App/blob/efd81f5906e2b60d5f60abbed5d2ecdf57860f85/src/pages/home/report/ReportActionItemMessageEdit.tsx#L439-L447

What alternative solutions did you explore? (Optional)

NA

ZhenjaHorbach avatar Jan 26 '24 10:01 ZhenjaHorbach

oh yep, I can reproduce this following the steps in the OP. I wonder if this is a regression but I can't find any recently closed GHs that might be linked to this. @parasharrajat what do you think?

Christinadobrzyn avatar Jan 26 '24 16:01 Christinadobrzyn

I think we're waiting for proposals unless we can link this as a regression to another job

Christinadobrzyn avatar Jan 29 '24 19:01 Christinadobrzyn

@parasharrajat can you review this proposal to see if it will work? https://github.com/Expensify/App/issues/35179#issuecomment-1911836686

Christinadobrzyn avatar Jan 30 '24 17:01 Christinadobrzyn

I don't think this is a bug. And same goes for the issue related to the linked PR https://github.com/Expensify/App/issues/33466.

When we blur the focus the composer pops back.

@lanitochka17 Could you please confirm if this bug was found via old regression steps or its a new one?

parasharrajat avatar Jan 31 '24 08:01 parasharrajat

@Christinadobrzyn Could you please raise this internally and confirm if this is a valid bug?

parasharrajat avatar Jan 31 '24 08:01 parasharrajat

Yep! I'll reach out to the team and get their thoughts on what we want here. I think this is a valid bug because the "done" button essentially doesn't respond or close the edited chat.

https://github.com/Expensify/App/assets/51066321/f851a48b-68f6-4cd3-9e08-874b20b527ea

asking here - https://expensify.slack.com/archives/C066HJM2CAZ/p1706732856940989

Christinadobrzyn avatar Jan 31 '24 20:01 Christinadobrzyn

Issue found when executing PR https://github.com/Expensify/App/pull/34404

lanitochka17 avatar Jan 31 '24 21:01 lanitochka17

So it means it is a new find. @Christinadobrzyn Yes please get this confirmed. I don't suggest making unnecessary changes to the focus flow. More here https://github.com/Expensify/App/issues/33466#issuecomment-1918606829

parasharrajat avatar Feb 01 '24 11:02 parasharrajat

πŸ“£ 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] avatar Feb 01 '24 16:02 melvin-bot[bot]

Slack convo with David- we DO want to fix this but it can be a low priority to #vip-vsb.

@parasharrajat can you let me know if any proposals will work for this?

Christinadobrzyn avatar Feb 03 '24 00:02 Christinadobrzyn

@Christinadobrzyn

Sorry for the stupid question But what exactly is the result we expect?)

ZhenjaHorbach avatar Feb 03 '24 00:02 ZhenjaHorbach

Ah great question @ZhenjaHorbach!

We would like the 'Done' button on the keyboard to close the edited message and the keyboard should be dismissed. I'll add that to the OP details.

Christinadobrzyn avatar Feb 03 '24 00:02 Christinadobrzyn

Ah great question @ZhenjaHorbach!

We would like the 'Done' button on the keyboard to close the edited message and the keyboard should be dismissed. I'll add that to the OP details.

I don't have access to the slacks to read the convo but:

Tieing the 'Keyboard' done to a submit action only for edit is what you're going for?

The main composer doesn't behave this way, and the edit composer did not behave this way either before https://github.com/Expensify/App/issues/33466#issuecomment-1867223195 either.

If you tie the keyboard done button to the submit of edit, it will be non standard phone behavior. It's just used to minimize the keyboard.

Examples: www.google.com, type something. Hit 'done' just dismisses keyboard www.youtube.com, type something. hit 'done' just dismisses keyboard

jeremy-croff avatar Feb 03 '24 05:02 jeremy-croff

Proposal

Problem

The 'Done' button on the message editing page does not submit the edited message, and there is no action defined for it.

Root Cause

The lack of an implementation for the 'Done' button presses causes the message not to be saved.

Solution

We can use the 'onSubmitEditing' function from the React Native text input component to capture the 'Done' button press event and trigger the 'publishDraft' method that saves the message. We can add this new prop to the 'Edit Component' in the following file: https://github.com/Expensify/App/blob/3ab4e6e12d9ff38e69493321f0d31f032481b373/src/pages/home/report/ReportActionItemMessageEdit.tsx#L409

jeremy-croff avatar Feb 03 '24 06:02 jeremy-croff

@jeremy-croff has a good point. I agree with those points. I will try to capture the possible cases of UX and see if the expected behaviour fits them.

parasharrajat avatar Feb 05 '24 13:02 parasharrajat

Hey @parasharrajat let me know if I can help with anything here - are we still troubleshooting the issues or reviewing proposals? Can you give me an update?

Christinadobrzyn avatar Feb 06 '24 22:02 Christinadobrzyn

@parasharrajat @Christinadobrzyn 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] avatar Feb 08 '24 15:02 melvin-bot[bot]

πŸ“£ 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] avatar Feb 08 '24 16:02 melvin-bot[bot]

I will be taking this over https://expensify.slack.com/archives/C02NK2DQWUX/p1707413964286239

ishpaul777 avatar Feb 08 '24 17:02 ishpaul777

@ishpaul777 will be taking it over as C+ while I am unavailable.

parasharrajat avatar Feb 08 '24 18:02 parasharrajat

πŸ“£ @ishpaul777 πŸŽ‰ 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[bot] avatar Feb 08 '24 23:02 melvin-bot[bot]

Thanks @ishpaul777 can you provide an update when you are caught up? Thanks!

Christinadobrzyn avatar Feb 08 '24 23:02 Christinadobrzyn

i'll take look at existing proposal tomorrow (9 feb)

ishpaul777 avatar Feb 08 '24 23:02 ishpaul777

Thanks for your proposal @ZhenjaHorbach @jeremy-croff,

@ZhenjaHorbach Sorry but i dont think you solution is a reliable way, to detect the done button press and looks like a workaround.

@jeremy-croff do you mind providing a test video and working branch with the solution i dont find it working for me, maybe i am missing something?

ishpaul777 avatar Feb 09 '24 08:02 ishpaul777

Thanks for your proposal @ZhenjaHorbach @jeremy-croff,

@ZhenjaHorbach Sorry but i dont think you solution is a reliable way, to detect the done button press and looks like a workaround.

@jeremy-croff do you mind providing a test video and working branch with the solution i dont find it working for me, maybe i am missing something?

I don't mind, but this can be expected at the end of my working day in approx 8 hours. Thanks!

jeremy-croff avatar Feb 09 '24 14:02 jeremy-croff