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

[Awaiting checklist] [$250] Mention - Delay in removing mention list when pressing CMD+K #41136

Closed
2 of 6 tasks
lanitochka17 opened this issue Apr 27, 2024 · 36 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Apr 27, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.67-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4523297&group_by=cases:section_id&group_order=asc&group_id=306201
Email or phone of affected tester (no customers): shussain+accoun1@applausemail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open a chat
  2. Enter "@" to open mention list
  3. Now press CMD+K to open search modal
  4. Notice mention (or emoji) list removed after a delay

Expected Result:

Mention list should be removed without delay

Actual Result:

Delay in removing mention list when pressing CMD+K

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

Bug6463598_1714208494851.2024-04-27_14-00-16.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014d621ca194199c72
  • Upwork Job ID: 1784861924277809152
  • Last Price Increase: 2024-05-07
  • Automatic offers:
    • bernhardoj | Contributor | 0
    • ZhenjaHorbach | Contributor | 0
Issue OwnerCurrent Issue Owner: @eVoloshchak
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 27, 2024
Copy link

melvin-bot bot commented Apr 27, 2024

Triggered auto assignment to @twisterdotcom (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.

@lanitochka17
Copy link
Author

@twisterdotcom 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

@bernhardoj
Copy link
Contributor

bernhardoj commented Apr 27, 2024

Proposal

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

The mention suggestion is closed with a delay when we open search page with shortcut.

What is the root cause of that problem?

The mention suggestion list will close when the composer is blurred.

useEffect(() => {
calculateMentionSuggestion(selection.end);
}, [selection, calculateMentionSuggestion]);

if (shouldBlockCalc.current || selectionEnd < 1 || !isComposerFocused) {
shouldBlockCalc.current = false;
resetSuggestions();
return;
}

When we open the search page through shortcut, the focus will shift from the composer to the search page search input after the navigation completes, so it feels delayed.

If we open the search page by mouse, then the composer is immediately blurred when we press the search button, so the issue doesn't happen.

If we open the keyboard shortcut page, then the composer will never be blurred and the suggestion will still be shown.

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

Blur the composer immediately when the shortcut is pressed by blurring the active element.

document.activeElement.blur() // we do this for web only

() => {
Modal.close(Session.checkIfActionIsAllowed(() => Navigation.navigate(ROUTES.CHAT_FINDER)));
},

do for other shortcuts too

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Apr 27, 2024

Proposal

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

Mention - Delay in removing mention list when pressing CMD+K

What is the root cause of that problem?

The main problem with issue is that when we open modal using CMD+K we still have isComposerFocused equal true

And as a result, we have a short period of time when Suggestions menu is still open until the input is blurred

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

To fix this issue we can update this line and add isFocused (or useEffect and blur input when the screen out of focus )

isComposerFocused={textInputRef.current?.isFocused() && isFocused}

OR

    useEffect(() => {
        if (isFocused) {
            return;
        }
        textInputRef.current?.blur();
    }, [isFocused]);

Additional for Emoji suggestions menu we need update some code to make consistence between Emoji and Mention suggestions (These changes are not relevant in the case of useEffect, but for consistence I think these changes should be made in any case)

if (shouldBlockCalc.current || !value || !isComposerFocused) {

if (shouldBlockCalc.current || !value) {

Like here

if (shouldBlockCalc.current || selectionEnd < 1 || !isComposerFocused) {

AND

    useEffect(() => {
        calculateEmojiSuggestion(selection.end);
    }, [selection, calculateEmojiSuggestion]);

useEffect(() => {
if (!isComposerFocused) {
return;
}
calculateEmojiSuggestion(selection.end);
}, [selection, calculateEmojiSuggestion, isComposerFocused]);

Like here

useEffect(() => {
calculateMentionSuggestion(selection.end);
}, [selection, calculateMentionSuggestion]);

Result:

2024-04-27.16.59.51.mov
What alternative solutions did you explore? (Optional)

NA

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Apr 29, 2024
@melvin-bot melvin-bot bot changed the title Mention - Delay in removing mention list when pressing CMD+K [$250] Mention - Delay in removing mention list when pressing CMD+K Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

Job added to Upwork: https://www.upwork.com/jobs/~014d621ca194199c72

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

melvin-bot bot commented Apr 29, 2024

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

@melvin-bot melvin-bot bot added the Overdue label May 1, 2024
Copy link

melvin-bot bot commented May 2, 2024

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

@twisterdotcom
Copy link
Contributor

Bump @eVoloshchak on these proposals!

@melvin-bot melvin-bot bot removed the Overdue label May 3, 2024
@twisterdotcom twisterdotcom removed their assignment May 3, 2024
@twisterdotcom twisterdotcom added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels May 3, 2024
Copy link

melvin-bot bot commented May 3, 2024

Triggered auto assignment to @isabelastisser (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.

@twisterdotcom
Copy link
Contributor

@isabelastisser I'll be OOO next week. Just tagging you in to move this along.

@melvin-bot melvin-bot bot added the Overdue label May 6, 2024
@eVoloshchak
Copy link
Contributor

@bernhardoj's proposal looks good to me!

do for other shortcuts too

I agree, let's have a universal method that would ensure it's called for every shortcut

🎀👀🎀 C+ reviewed!

@melvin-bot melvin-bot bot removed the Overdue label May 6, 2024
@twisterdotcom
Copy link
Contributor

Okay, assigning @ZhenjaHorbach here, thanks for both being so cordial on this one both!

Copy link

melvin-bot bot commented May 15, 2024

📣 @ZhenjaHorbach 🎉 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 📖

@ZhenjaHorbach
Copy link
Contributor

📣 @ZhenjaHorbach 🎉 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 📖

PR will be ready today or tomorrow

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 16, 2024
@eVoloshchak
Copy link
Contributor

PR is ready, will be merged once the merge freeze is over

@AndrewGable
Copy link
Contributor

PR merged

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 6, 2024
@melvin-bot melvin-bot bot changed the title [$250] Mention - Delay in removing mention list when pressing CMD+K [HOLD for payment 2024-06-13] [$250] Mention - Delay in removing mention list when pressing CMD+K Jun 6, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 6, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

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

Copy link

melvin-bot bot commented Jun 6, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.79-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 2024-06-13. 🎊

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

Copy link

melvin-bot bot commented Jun 6, 2024

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:

  • [@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] 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.
  • [@twisterdotcom] 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 Jun 12, 2024
@twisterdotcom
Copy link
Contributor

Payment Summary

Upwork Job

@twisterdotcom twisterdotcom changed the title [HOLD for payment 2024-06-13] [$250] Mention - Delay in removing mention list when pressing CMD+K [Awaiting checklist] [$250] Mention - Delay in removing mention list when pressing CMD+K Jun 14, 2024
@twisterdotcom twisterdotcom removed the Awaiting Payment Auto-added when associated PR is deployed to production label Jun 14, 2024
@melvin-bot melvin-bot bot added the Overdue label Jun 17, 2024
@twisterdotcom
Copy link
Contributor

Still waiting on @eVoloshchak.

@melvin-bot melvin-bot bot removed the Overdue label Jun 17, 2024
@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: unable to pinpoint the exact PR that has caused this, as this was present in the initial implementation
  • 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: N/A
  • 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: I don't think an additional discussion is needed

Regression Test Proposal

  1. Open a chat
  2. Enter "@" or start typing an emoji name to open mentions/emoji list
  3. Press CMD+K to open the search modal
  4. Verify there is no delay when mentions or emoji list is hidden

Do we agree 👍 or 👎

@JmillsExpensify
Copy link

$250 approved for @eVoloshchak

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 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Archived in project
Development

No branches or pull requests

8 participants