Skip to content

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

Closed

Description

@lanitochka17

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 27, 2024
  2. melvin-bot commented on Apr 27, 2024

    @melvin-bot

    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.

  3. lanitochka17 commented on Apr 27, 2024

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

  4. lanitochka17 commented on Apr 27, 2024

    @lanitochka17
    Author

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

  5. bernhardoj commented on Apr 27, 2024

    @bernhardoj
    Contributor

    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

  6. ZhenjaHorbach commented on Apr 27, 2024

    @ZhenjaHorbach
    Contributor

    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:

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

    NA

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 29, 2024
  8. changed the title [-] Mention - Delay in removing mention list when pressing CMD+K[/-] [+][$250] Mention - Delay in removing mention list when pressing CMD+K[/+] on Apr 29, 2024
  9. melvin-bot commented on Apr 29, 2024

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 29, 2024
  11. melvin-bot commented on Apr 29, 2024

    @melvin-bot

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

  12. 48 remaining items

  13. melvin-bot commented on Jun 6, 2024

    @melvin-bot

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

  14. melvin-bot commented on Jun 6, 2024

    @melvin-bot

    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:

  15. melvin-bot commented on Jun 6, 2024

    @melvin-bot

    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:
  16. twisterdotcom commented on Jun 14, 2024

    @twisterdotcom
    Contributor

    Payment Summary

    Upwork Job

  17. 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[/+] on Jun 14, 2024
  18. twisterdotcom commented on Jun 17, 2024

    @twisterdotcom
    Contributor

    Still waiting on @eVoloshchak.

  19. eVoloshchak commented on Jun 18, 2024

    @eVoloshchak
    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 👎

  20. JmillsExpensify commented on Jun 19, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @eVoloshchak

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions