Skip to content

[HOLD for payment 2023-05-29] [$1000] Contact suggestion focus/selection does not reset after selecting a contact #18844

Closed

Description

@kavimuru

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. Open a chat and write “@” only to mention a contact
  2. Use the down arrow key on the keyboard to navigate through the contact suggestion list and select the second contact in the suggestion list and hit enter key
  3. Write "@" again

Expected behavior:

The contact suggestion selection should start from the first contact again

Actual behavior:

The contact suggestion selection remains on the previously selected contact

NOTE : This behavior is inconsistent with the emoji suggestion functionality (video attached)

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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: 1.3.13.0
Reproducible in staging?: y
Reproducible in production?:
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

2023-05-11.14.16.35.mp4
2023-05-11.14.10.18.mp4
Recording.575.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Nathan-Mulugeta
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683803719905009

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013072759f95d2c09f
  • Upwork Job ID: 1657773872119492608
  • Last Price Increase: 2023-05-14

Activity

  1. added
    Daily
    Bug
    on May 12, 2023
  2. melvin-bot commented on May 12, 2023

    @melvin-bot

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

  3. melvin-bot commented on May 12, 2023

    @melvin-bot

    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
  4. PrashantMangukiya commented on May 12, 2023

    @PrashantMangukiya
    Contributor

    Proposal

    Posting proposal early as per new guidelines

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

    Contact suggestion focus/selection does not reset after selecting a contact.

    What is the root cause of that problem?

    When we press enter it will run this code.

    if ((e.key === CONST.KEYBOARD_SHORTCUTS.ENTER.shortcutKey || e.key === CONST.KEYBOARD_SHORTCUTS.TAB.shortcutKey) && suggestionsExist) {
    e.preventDefault();
    if (this.state.suggestedEmojis.length > 0) {
    this.insertSelectedEmoji(this.state.highlightedEmojiIndex);
    }
    if (this.state.suggestedMentions.length > 0) {
    this.insertSelectedMention(this.state.highlightedMentionIndex);
    }
    return;
    }

    We can see we are not resetting the index after suggesting. This is the root cause of the problem.

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

    We have to reset index as shown in code below i.e. this.setState({highlightedMentionIndex: 0});

    if ((e.key === CONST.KEYBOARD_SHORTCUTS.ENTER.shortcutKey || e.key === CONST.KEYBOARD_SHORTCUTS.TAB.shortcutKey) && suggestionsExist) {
        e.preventDefault();
        if (this.state.suggestedEmojis.length > 0) {
            this.insertSelectedEmoji(this.state.highlightedEmojiIndex);
        }
        if (this.state.suggestedMentions.length > 0) {
            this.insertSelectedMention(this.state.highlightedMentionIndex);
            this.setState({highlightedMentionIndex: 0});     // ***  Add this
        }
        return;
    }

    This will solve the issue as shown in result video.

    What alternative solutions did you explore? (Optional)

    If we have to match code similar to emoji suggestion then we have to add highlightedMentionIndex: 0 for next state here.

    const nextState = {
    suggestedMentions: [],
    atSignIndex,
    mentionPrefix: prefix,
    };

    So updated code looks as under

    const nextState = {
        suggestedMentions: [],
        highlightedMentionIndex: 0, // *** ADD THIS ***
        atSignIndex,
        mentionPrefix: prefix,
    };

    This will also solve the issue and give same results.

    Result
    18844-MentionHighlight.mov
  5. isabelastisser commented on May 12, 2023

    @isabelastisser
    Contributor

    I won't be able to act on this until next Tuesday (Compliance deadlines), reassigning!

  6. removed their assignment
    on May 12, 2023
  7. added
    Bug
    and removed
    Bug
    on May 12, 2023
  8. melvin-bot commented on May 12, 2023

    @melvin-bot

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

  9. melvin-bot commented on May 12, 2023

    @melvin-bot

    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
  10. alexpensify commented on May 13, 2023

    @alexpensify
    Contributor
  11. added
    External
    on May 14, 2023
  12. 46 remaining items

  13. alexpensify commented on May 27, 2023

    @alexpensify
    Contributor

    @mananjadhav, @PrashantMangukiya, and @Nathan-Mulugeta - To prepare for the payment date, please apply to the job in Upwork:

    https://www.upwork.com/jobs/~013072759f95d2c09f

    Thanks!

  14. PrashantMangukiya commented on May 27, 2023

    @PrashantMangukiya
    Contributor

    @alexpensify Can you please invite me for the job. I have not enough Upwork connect balance to apply. This is my Upwork profile https://www.upwork.com/freelancers/~01c718889ed7821f82 Thank you for your time.

  15. mananjadhav commented on May 27, 2023

    @mananjadhav
    Collaborator

    We added the Mentions support in this PR #18469, where we didn't reset the index. I don't see any need for a regression test, nor updating the checklist. This can be categorized as missing test case/mistake.

    I've commented on the offending PR to let the contributors know.

    @amyevans do you think we need a regression test here?

  16. alexpensify commented on May 28, 2023

    @alexpensify
    Contributor

    Thank you for that update @mananjadhav!

  17. added
    Daily
    and removed
    Weekly
    on May 29, 2023
  18. mananjadhav commented on May 29, 2023

    @mananjadhav
    Collaborator

    @alexpensify this is ready for payout.

  19. amyevans commented on May 30, 2023

    @amyevans
    Contributor

    @amyevans do you think we need a regression test here?

    No I think we're fine without.

  20. alexpensify commented on May 30, 2023

    @alexpensify
    Contributor

    Sorry, I should have flagged that I was offline yesterday for the US Bank Holiday but most of the team was offline too. I will work on the payment process today.

  21. alexpensify commented on May 30, 2023

    @alexpensify
    Contributor

    Flagging the urgency bonus here: #18844 (comment)

  22. alexpensify commented on May 30, 2023

    @alexpensify
    Contributor

    Alright, it's payment time-- ring the bell!

    @mananjadhav, @PrashantMangukiya, and @Nathan-Mulugeta - please accept in Upwork and I can complete the payment process. Thanks!

  23. PrashantMangukiya commented on May 30, 2023

    @PrashantMangukiya
    Contributor

    @alexpensify Offer accepted on Upwork.

  24. Nathan-Mulugeta commented on May 31, 2023

    @Nathan-Mulugeta

    Just accepted offer @alexpensify

  25. alexpensify commented on May 31, 2023

    @alexpensify
    Contributor

    Alright, @mananjadhav, @PrashantMangukiya, and @Nathan-Mulugeta have been paid via Upwork. Great work here, the job is closed now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions