App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2021-11-29] $500 Old Edited comments that are still open trigger the keyboard when the user is scrolling the conversation - Reported by: @parasharrajat

Open isagoico opened this issue 5 years ago • 27 comments

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


Action Performed:

  1. Open any chat.
  2. Scroll back in the history.
  3. Edit the message. Leave it as it is. Don't close the editor
  4. Go back to LHN.
  5. Open any other chat.
  6. back to LHN.
  7. Open back the previous chat.
  8. Scroll back in the list slowly.
  9. Screen will jump to the message being edited as soon as you reach closed to it.

Expected Result:

Old edited comment that are still open should not trigger the keyboard when the user is scrolling.

Actual Result:

Old Edited comments that are still open trigger the keyboard when the user is scrolling the conversation

Workaround:

Close or save the comments that are being edited.

Platform:

Where is this issue occurring?

  • iOS
  • Android

Version Number: 1.1.8-0

Reproducible in staging?: Yes Reproducible in production?: Yes

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

Notes/Photos/Videos: Any additional supporting documentation

https://user-images.githubusercontent.com/44479856/137535354-b90dfc55-59f2-4645-9ca9-d8441984030e.mp4

Expensify/Expensify Issue URL:

Issue reported by: @parasharrajat Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1633794986065800

View all open jobs on GitHub

isagoico avatar Oct 15 '21 18:10 isagoico

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

MelvinBot avatar Oct 15 '21 18:10 MelvinBot

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

MelvinBot avatar Oct 15 '21 20:10 MelvinBot

Video

https://user-images.githubusercontent.com/24370807/137549442-cbcc1e10-3121-447e-9ad9-ca53231389b2.mp4

parasharrajat avatar Oct 15 '21 20:10 parasharrajat

Posted on Upwork: https://www.upwork.com/jobs/~018f79ec6f97efcf87

Adding Exported Label.

SofiedeVreese avatar Oct 17 '21 22:10 SofiedeVreese

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

MelvinBot avatar Oct 17 '21 22:10 MelvinBot

Hmm this is kind of an interesting edge case... I think how we fix this depends on how we want to handle moving away from a chat with an active edit. Posted in #expensify-open-source here to get some thoughts on how to move forward.

NikkiWines avatar Oct 18 '21 19:10 NikkiWines

I think, Keyboard should only open when the user clicks to edit a message aka User action trigger.

parasharrajat avatar Oct 18 '21 19:10 parasharrajat

Hey @NikkiWines is this a dupe from https://github.com/Expensify/App/issues/4756 that has been reopened? Feels like this case would fall under that other GH?

SofiedeVreese avatar Oct 20 '21 00:10 SofiedeVreese

mmm, I'd say they're related but not sure if they're exactly the same issue. In this one, it's more that navigating back to this chat and scrolling over an old open message will retrigger keyboard to pop up.

NikkiWines avatar Oct 20 '21 01:10 NikkiWines

They are completely different. This => explained above. #4756 => has to do with draft messages.

parasharrajat avatar Oct 20 '21 01:10 parasharrajat

Thanks for the explanation both, we'll keep this issue open then!

SofiedeVreese avatar Oct 20 '21 01:10 SofiedeVreese

Price increased to $500

SofiedeVreese avatar Oct 27 '21 00:10 SofiedeVreese

Proposal

AFAIK, I think there is only one way we can keep both autofocus and fix this issue. If we only autofocus, when the user edits messages (trigger edit action). Then old message being edited will not be focused when the user is scrolling. I think this is ideal behaviour as well.

If the user is scrolling back in the history, he should click on the edit box to focus it, instead of autofocus. But if a user press edits on any message, then it should be autofocused.

To do this:

  1. Straight way to do this would be to capture the edit trigger in ReportActionItem via.
    componentDidUpdate(prevProps) {
        if (!prevProps.draftMessage && this.props.draftMessage) {
            // eslint-disable-next-line react/no-did-update-set-state
            this.setState({isMessgeEdited: true});
        }
    }

Then pass the Autofocus prop to ReportActionItemMessageEdit which will control the autofocus on underlined text input.

parasharrajat avatar Oct 27 '21 01:10 parasharrajat

I think that makes sense. cc: @SofiedeVreese would you hire @parasharrajat for this one?

NikkiWines avatar Oct 27 '21 17:10 NikkiWines

Yes sure can @NikkiWines.

@parasharrajat can you submit your Upwork proposal so I can hire you there? Thanks!

SofiedeVreese avatar Oct 27 '21 21:10 SofiedeVreese

@SofiedeVreese Job is private.

parasharrajat avatar Oct 27 '21 23:10 parasharrajat

@parasharrajat that should work better now! https://www.upwork.com/jobs/~018f79ec6f97efcf87

SofiedeVreese avatar Oct 28 '21 00:10 SofiedeVreese

I've just hired you in Upwork @parasharrajat !

SofiedeVreese avatar Oct 28 '21 08:10 SofiedeVreese

PR merged and QA ongoing.

SofiedeVreese avatar Nov 07 '21 21:11 SofiedeVreese

PR deployed, adding a payment hold 7 days from deploy.

SofiedeVreese avatar Nov 15 '21 22:11 SofiedeVreese