Skip to content

[Due for payment 2025-06-02] [$150] Android - Chat - While entering :+1 after emoji in edit comment cursor shown at beginning. #61292

Closed

Description

@jponikarchuk

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: V9.1.39-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/6034550
Email or phone of affected tester (no customers): Slottwo1 dasd1@gmail.com
Issue reported by: Applause Internal Team
Device used: Redminote note 10s android 13
App Component: Chat Report View

Action Performed:

  1. Launch app
  2. Open a chat
  3. Send a message
  4. Long press the sent message and select edit comment
  5. Tap emoji picker and select an emoji
  6. Enter :+1
  7. Tap emoji picker and change skin tone
  8. Tap backdrop to close emoji modal

Expected Result:

While entering :+1 after emoji in edit comment cursor must not be shown at beginning.

Actual Result:

While entering :+1 after emoji in edit comment cursor shown at beginning.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021920784691456319514
  • Upwork Job ID: 1920784691456319514
  • Last Price Increase: 2025-05-14
Issue OwnerCurrent Issue Owner: @dylanexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 2, 2025
  2. melvin-bot commented on May 2, 2025

    @melvin-bot

    Triggered auto assignment to @dylanexpensify (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. melvin-bot commented on May 5, 2025

    @melvin-bot

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

  4. dylanexpensify commented on May 6, 2025

    @dylanexpensify
    Contributor

    reproing tomorrow!

  5. bernhardoj commented on May 9, 2025

    @bernhardoj
    Contributor

    Proposal

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

    After closing the emoji picker, the cursor moves back.

    What is the root cause of that problem?

    The test step has unnecessary steps, such as changing the skin tone. This issue happens after we select an emoji once from the emoji picker, type anything, and then open emoji picker again and then close without selecting an emoji.

    For example, if we input and select 😄 from the emoji picker Hi 😄 asd|, when we reopen and then close the emoji picker, the cursor will move to the front of the emoji Hi 😄 |asd.

    When closing the emoji picker, we refocus the composer and pass a emojiPickerSelectionRef as the selection.

    const setUpComposeFocusManager = useCallback(() => {
    ReportActionComposeFocusManager.onComposerFocus(() => {
    focus(true, emojiPickerSelectionRef.current ? {...emojiPickerSelectionRef.current} : undefined);
    }, true);
    }, [focus]);

    It's set when selecting an emoji from the picker.

    const addEmojiToTextBox = (emoji: string) => {
    const newSelection = {
    start: selection.start + emoji.length + CONST.SPACE_LENGTH,
    end: selection.start + emoji.length + CONST.SPACE_LENGTH,
    positionX: 0,
    positionY: 0,
    };
    setSelection(newSelection);
    if (shouldUseForcedSelectionRange) {
    // On Android and Chrome mobile, focusing the input sets the cursor position back to the start.
    // To fix this, immediately set the selection again after focusing the input.
    emojiPickerSelectionRef.current = newSelection;
    }
    updateDraft(insertText(draft, selection, `${emoji} `));
    };

    However, we never clear the ref, that's why when refocus happens, the selection moves back to the front of the previously picked emoji.

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

    Clear the ref after refocus.

    const setUpComposeFocusManager = useCallback(() => {
    ReportActionComposeFocusManager.onComposerFocus(() => {
    focus(true, emojiPickerSelectionRef.current ? {...emojiPickerSelectionRef.current} : undefined);
    }, true);
    }, [focus]);

    emojiPickerSelectionRef.current = undefined;
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    N/A

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 9, 2025
  7. changed the title [-]Android - Chat - While entering :+1 after emoji in edit comment cursor shown at beginning.[/-] [+][$250] Android - Chat - While entering :+1 after emoji in edit comment cursor shown at beginning.[/+] on May 9, 2025
  8. melvin-bot commented on May 9, 2025

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 9, 2025
  10. 27 remaining items

  11. melvin-bot commented on May 26, 2025

    @melvin-bot

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

  12. melvin-bot commented on May 26, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.51-6 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 2025-06-02. 🎊

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

    • @mananjadhav requires payment through NewDot Manual Requests
    • @bernhardoj requires payment through NewDot Manual Requests
  13. melvin-bot commented on May 26, 2025

    @melvin-bot

    @mananjadhav @dylanexpensify @mananjadhav The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  14. melvin-bot commented on Jun 2, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@dylanexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1920784691456319514/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. mananjadhav commented on Jun 3, 2025

    @mananjadhav
    Collaborator

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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: Couldn't pinpoint a specific PR.

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: NA

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    @dylanexpensify Because it is related cursor I think it makes sense to add a regression test.

    Regression Test Proposal

    1. Send a message to a chat
    2. Right-click or long press and choose Edit
    3. Add an emoji from the emoji picker
    4. Type anything
    5. Open the emoji picker again
    6. Now close the emoji picker
    7. Verify the cursor is still at its place

    Do we agree 👍 or 👎

  16. dylanexpensify commented on Jun 4, 2025

    @dylanexpensify
    Contributor

    Payment summary:

    Contributor: @bernhardoj $150 via NewDot
    Contributor+: @mananjadhav $150 via NewDot

    Please apply/request!

  17. mananjadhav commented on Jun 4, 2025

    @mananjadhav
    Collaborator

    @dylanexpensify The payout is $150.

  18. dylanexpensify commented on Jun 4, 2025

    @dylanexpensify
    Contributor

    TY Sir!!

  19. bernhardoj commented on Jun 4, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  20. JmillsExpensify commented on Jun 9, 2025

    @JmillsExpensify
    Contributor

    $150 approved for @bernhardoj

  21. garrettmknight commented on Jun 13, 2025

    @garrettmknight
    Contributor

    $150 approved for @mananjadhav

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething 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