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

[HOLD for payment 2023-10-30] [$500] Search text is not selected in emoji search on refocus #28379

Closed
4 of 6 tasks
izarutskaya opened this issue Sep 28, 2023 · 37 comments
Closed
4 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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 Improvement Item broken or needs improvement.

Comments

@izarutskaya
Copy link

izarutskaya commented Sep 28, 2023

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 the app
  2. Open any report
  3. Click on emoji to open emoji picker
  4. Focus and type anything
  5. Click on change skin tone to remove focus from search
  6. Focus again on search and observe that search term is not selected
  7. Open search page and type anything
  8. Lose focus from composer and refocus, observe that it selects the search term
  9. It works similarly in send message search in plus menu

Expected Result:

App should select the search term on refocus to emoji picker search as it does for other searches throughout the app

Following from this Slack discussion, we should never auto-highlight text upon refocus.

Actual Result:

App auto-highlights text upon refocus in some cases (1- In the Command+K chat switcher when you unfocus and refocus, and 2- in the emoji picker search when you unfocus, press any key to refocus, then unfocus and refocus with the mouse), but not in other cases (in the emoji picker search when unfocusing and refocusing).

Workaround:

Unknown

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: v1.3.74-3

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

Notes/Photos/Videos: Any additional supporting documentation

Recording.1664.mp4
windows.chrome.emoji.search.term.not.selected.on.refocus.mp4
android.chrome.emoji.search.term.not.selected.on.refocus.mp4
mac.desktop.mac.chrome.ios.safari.no.full.selection.on.emoji.search.mov

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695750651606789

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0172e2de79a71b9db8
  • Upwork Job ID: 1707331352304119808
  • Last Price Increase: 2023-10-12
  • Automatic offers:
    • DylanDylann | Contributor | 27277120
    • dhanashree-sawant | Reporter | 27277122
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 28, 2023

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

@melvin-bot melvin-bot bot changed the title Search text is not selected in emoji search on refocus [$500] Search text is not selected in emoji search on refocus Sep 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 28, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0172e2de79a71b9db8

@melvin-bot
Copy link

melvin-bot bot commented Sep 28, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 28, 2023

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

@ahmedGaber93
Copy link
Contributor

Proposal

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

Search text is not selected in emoji search on refocus

What is the root cause of that problem?

We already have prop selectTextOnFocus, but the default value of it is undefined

selectTextOnFocus={this.state.selectTextOnFocus}

we only set to true in two places, but not in amount.
// We allow typing in the search box if any key is pressed apart from Arrow keys.
if (this.searchInput && !this.searchInput.isFocused()) {
this.setState({selectTextOnFocus: false});
this.searchInput.focus();
// Re-enable selection on the searchInput
this.setState({selectTextOnFocus: true});
}

focusInputWithTextSelect() {
if (!this.searchInput) {
return;
}
this.setState({selectTextOnFocus: true});
this.searchInput.focus();
}

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

We need to set default value for selectTextOnFocus

this.state = {
   ...
   selectTextOnFocus: true,
}

What alternative solutions did you explore? (Optional)

N/A

@yh-0218
Copy link
Contributor

yh-0218 commented Sep 28, 2023

Proposal

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

Search text is not selected in emoji search on refocus

What is the root cause of that problem?

We are missing state value of selectTextOnFocus in constructor() of EmojiPickerMenu

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

We need to init state value. selectTextOnFocus: true

this.state = {
filteredEmojis: this.emojis,
headerIndices: this.headerRowIndices,
highlightedIndex: -1,
arePointerEventsDisabled: false,
selection: {
start: 0,
end: 0,
},
isFocused: false,
isUsingKeyboardMovement: false,
};

And remove other status change of selectTextOnFocus
if (this.searchInput && !this.searchInput.isFocused()) {
this.setState({selectTextOnFocus: false});
this.searchInput.focus();
// Re-enable selection on the searchInput
this.setState({selectTextOnFocus: true});
}

this.setState({selectTextOnFocus: true});

What alternative solutions did you explore? (Optional)

@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 29, 2023

Proposal

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

  • Search text is not selected in emoji search on refocus

What is the root cause of that problem?

  • The feature that selects all the text search when refocused is mentioned here fix: picker an arrow navigation #3871 (review)
  • Currently, when the EmojiPickerMenu didMount, the selectTextOnFocus is undefined so the "select all text when focusing" logic does not occur when the user clicks on input
  • But when user uses ArrowLeft and ArrowUp when reaching start emoji of the list, it will run focusInputWithTextSelect so the input is focused and all text is selected
    focusInputWithTextSelect() {
    if (!this.searchInput) {
    return;
    }
    this.setState({selectTextOnFocus: true});
    this.searchInput.focus();
    }
  • Additionally, why we should not set selectTextOnFocus is true as constant like we did in other components? We are having the case: We allow typing in the search box if any key is pressed apart from Arrow keys.
    // We allow typing in the search box if any key is pressed apart from Arrow keys.
    , if selectTextOnFocus is true, it will auto-select the current typing text and lead to user-experience issue

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

  • We can call
 if (this.shouldFocusInputOnScreenFocus) {
            this.focusInputWithTextSelect();
        }

in componentDidMount

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@mananjadhav
Copy link
Collaborator

@sakluger @shawnborton Do you agree this is a bug? Do we want to fix this?

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@shawnborton
Copy link
Contributor

Hmm I'm not sure if this is even a bug really. But that being said, I'm curious if you have context why we highlight the search term when you blur and then come back?

cc @Expensify/design for visibility.

@DylanDylann
Copy link
Contributor

DylanDylann commented Oct 2, 2023

@shawnborton The context why we highlight the search text is mentioned in my proposal #28379 (comment)

@shawnborton
Copy link
Contributor

Hmm I still don't follow - why exactly are we doing this for the search input for the chat switcher?

@sakluger
Copy link
Contributor

sakluger commented Oct 2, 2023

I also find it interesting that the behavior is different in each different search context, and for the chat switcher, I'm not really sure why we would highlight the entire field after clicking out and back into it.

@melvin-bot melvin-bot bot added the Overdue label Oct 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

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

@sakluger
Copy link
Contributor

sakluger commented Oct 7, 2023

We're still discussing the desired behavior in Slack.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

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

@sakluger
Copy link
Contributor

Still discussing.

@melvin-bot melvin-bot bot removed the Overdue label Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

@mananjadhav @sakluger @MariaHCD this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

📣 @mananjadhav Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

📣 @DylanDylann 🎉 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
Copy link

melvin-bot bot commented Oct 19, 2023

📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 20, 2023
@DylanDylann
Copy link
Contributor

@mananjadhav PR #29949 is ready for review

@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

🎯 ⚡️ Woah @mananjadhav / @DylanDylann, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @DylanDylann got assigned: 2023-10-19 13:30:44 Z
  • when the PR got merged: 2023-10-20 09:37:33 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 23, 2023
@melvin-bot melvin-bot bot changed the title [$500] Search text is not selected in emoji search on refocus [HOLD for payment 2023-10-30] [$500] Search text is not selected in emoji search on refocus Oct 23, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.88-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-30. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
  • [@mananjadhav] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@mananjadhav] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@mananjadhav] Determine if we should create a regression test for this bug.
  • [@mananjadhav] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@sakluger] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 29, 2023
@sakluger
Copy link
Contributor

Summarizing payouts for this issue:

Reporter: @dhanashree-sawant $50 (paid via Upwork)
Contributor: @DylanDylann $750 (paid via Upwork)
Contributor+: @mananjadhav $750 (payable via Manual Request after BZ checklist is completed)

Above payments include efficiency bonus 🎉
Upwork job: https://www.upwork.com/jobs/~0172e2de79a71b9db8

@mananjadhav
Copy link
Collaborator

Thanks for summary @sakluger. I am not sure if we want to treat this as a bug, as we went through a long discussion before even deciding the expected behavior. The expected result also turned out to be, removing the text selection altogether.

That being said I don't think we need a regression test for this one, as we've remove the text focus. @sakluger If there's any existing regression test for the text focus, we would have to remove/alter that. Possible for you to check?

@sakluger
Copy link
Contributor

Sounds good @mananjadhav. I think we can treat it like a bug as far as payments go because we had one inconsistent behavior and we decided to change it to be consistent. But I agree that most of the BZ checklist is a inappropriate - there was no "regression" because the were disagreements around expected behavior.

I'm going to close out, please request manual payment for the issue (or reach out to me if you need me to reopen the issue until you make the payment request).

@JmillsExpensify
Copy link

$750 payment approved for @mananjadhav based on this summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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 Improvement Item broken or needs improvement.
Projects
None yet
Development

No branches or pull requests

9 participants