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

[$500] Chat - When pressing the left/right arrow keys after typing '@', the text selection does not move #39102

Closed
1 of 6 tasks
lanitochka17 opened this issue Mar 27, 2024 · 34 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Mar 27, 2024

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


Issue found when validating #38383
Version Number: 1.4.57-2
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

1, Open any chat
2, Type a mention to open up the mention suggestion
3, Press the left/right arrow key
4, Observe that the text selection does not move to the left/right

Expected Result:

when right left arrows are pressed, suggestions highlights should reflect the change corresponding to cursor movement in the compose box as it does with emojis

Actual Result:

when right left arrows are pressed, suggestions highlights are not changing corresponding to cursor movement in the compose box. But it does with emojis.

NOTE: Emoji behavior also shown in the video

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Screen.Recording.2024-03-27.at.11.47.04.PM.mp4
Recording.1496.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013f02f19e8b3faf16
  • Upwork Job ID: 1775203737590730752
  • Last Price Increase: 2024-04-02
  • Automatic offers:
    • eh2077 | Reviewer | 0
    • bernhardoj | Contributor | 0
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Mar 27, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Mar 27, 2024

Triggered auto assignment to @stitesExpensify (Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@lanitochka17
Copy link
Author

Production:

Recording.1497.mp4

@lanitochka17
Copy link
Author

@stitesExpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

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

@shubham1206agra
Copy link
Contributor

@lanitochka17 You might be confused here. The staging behaviour is correct indeed.

@yuwenmemon yuwenmemon removed the DeployBlockerCash This issue or pull request should block deployment label Mar 28, 2024
@eh2077
Copy link
Contributor

eh2077 commented Mar 29, 2024

@lanitochka17 You might be confused here. The staging behaviour is correct indeed.

Hi @stitesExpensify , I saw your #38383 (comment) here but I think I agree with @shubham1206agra that this should be the expected behaviour. I tried to search old issues to find a regression test to support my point but couldn't find such one.

@lanitochka17 Are you able to search our existing regression tests to see if we have any tests related to this case?

@bernhardoj
Copy link
Contributor

bernhardoj commented Mar 29, 2024

I think QA expects the mention highlight to move along with the text selection (as stated by @stitesExpensify in #38383 (comment)) just like emoji, but because on prod we can't move the selection at all, QA put a deploy blocker.

The highlight of the mention/emoji is based on the prefix props,

prefix={suggestionValues.mentionPrefix}

the prefix props for mention coming from suggestionValues.mentionPrefix which contains the text after @, however, to correctly update the highlight of the suggestion, the prefix should consider the selection position, just like we did with emoji suggestion.

prefix={value.slice(suggestionValues.colonIndex + 1, selection.start)}

For mention suggestion, the prefix tries to contain the whole string. (notice the leftString)

let suggestionEndIndex;
if (indexOfFirstSpecialCharOrEmojiAfterTheCursor === -1) {
// We didn't find a special char/whitespace/emoji after the cursor, so we will use the entire string
suggestionEndIndex = value.length;
} else {
suggestionEndIndex = indexOfFirstSpecialCharOrEmojiAfterTheCursor + selectionEnd;
}
const afterLastBreakLineIndex = value.lastIndexOf('\n', selectionEnd - 1) + 1;
const leftString = value.substring(afterLastBreakLineIndex, suggestionEndIndex);

We can update it to always use selectionEnd (or selectionStart, there is currently inconsistencies on the selection usage, even on emoji suggestion)

const leftString = value.substring(afterLastBreakLineIndex, selectionEnd);

But this will cause this issue again where the suggestion won't show if we type @@ and put the selection between the @, @|@.

And that's because we check whether the cursor is before a mention code (@)

const isCursorBeforeTheMention = valueAfterTheCursor.startsWith(suggestionWord);
if (!isCursorBeforeTheMention && isMentionCode(suggestionWord)) {

We should remove it as we already update the leftString to slice it only until selectionEnd.

If we want to fix it, I can create a proposal.

@eh2077
Copy link
Contributor

eh2077 commented Mar 29, 2024

@bernhardoj I got your point. Hmm, I just feel that it also makes sense to capture valid prefix as longer as possible. But, yes, it's definitely better to make the behaviour consistent between emoji and mention.

@lanitochka17
Copy link
Author

@eh2077 I'll look again, but so far I don't see any TC related to this issue.

@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
@eh2077
Copy link
Contributor

eh2077 commented Apr 2, 2024

@stitesExpensify I'm happy to be the C+ of this issue if it's going to be external.

@stitesExpensify stitesExpensify added External Added to denote the issue can be worked on by a contributor Daily KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors labels Apr 2, 2024
@melvin-bot melvin-bot bot removed the Overdue label Apr 2, 2024
@melvin-bot melvin-bot bot changed the title Chat - When pressing the left/right arrow keys after typing '@', the text selection does not move [$500] Chat - When pressing the left/right arrow keys after typing '@', the text selection does not move Apr 2, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

Job added to Upwork: https://www.upwork.com/jobs/~013f02f19e8b3faf16

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

@bernhardoj
Copy link
Contributor

I can't do the test yet because, on the latest main, the suggestion doesn't work.

Screen.Recording.2024-04-05.at.11.32.38.mov

@melvin-bot melvin-bot bot added the Overdue label Apr 8, 2024
@eh2077
Copy link
Contributor

eh2077 commented Apr 9, 2024

@bernhardoj I believe the latest main is ready for you to start working on the PR.

@melvin-bot melvin-bot bot removed the Overdue label Apr 9, 2024
@bernhardoj
Copy link
Contributor

Yeah, it works now, thanks for the bump!

@bernhardoj
Copy link
Contributor

PR is ready

cc: @eh2077

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels May 2, 2024
Copy link

melvin-bot bot commented May 2, 2024

This issue has not been updated in over 15 days. @stitesExpensify, @bernhardoj, @eh2077 eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@eh2077
Copy link
Contributor

eh2077 commented May 3, 2024

@stitesExpensify Can you help to add BZ here to handle the payment? I think it's due for payment. Maybe add a Bug label will help to trigger the process.

@stitesExpensify stitesExpensify added the Bug Something is broken. Auto assigns a BugZero manager. label May 3, 2024
Copy link

melvin-bot bot commented May 3, 2024

Triggered auto assignment to @kadiealexander (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Monthly KSv2 labels May 3, 2024
@stitesExpensify
Copy link
Contributor

Hi @kadiealexander ! The work here is done, we just need to pay :)

Copy link

melvin-bot bot commented May 10, 2024

@stitesExpensify, @bernhardoj, @kadiealexander, @eh2077 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@eh2077
Copy link
Contributor

eh2077 commented May 13, 2024

@kadiealexander This issue is due for payment. Can you help with it?

@eh2077
Copy link
Contributor

eh2077 commented May 13, 2024

Checklist

Copy link

melvin-bot bot commented May 20, 2024

@stitesExpensify, @bernhardoj, @kadiealexander, @eh2077 Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented May 22, 2024

@stitesExpensify, @bernhardoj, @kadiealexander, @eh2077 Eep! 4 days overdue now. Issues have feelings too...

@eh2077
Copy link
Contributor

eh2077 commented May 22, 2024

Not overdue, this is waiting for payment.

cc @kadiealexander

@kadiealexander
Copy link
Contributor

Payouts due:

Upwork job is here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

8 participants