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

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

Open
1 of 8 tasks
jponikarchuk opened this issue May 2, 2025 · 17 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@jponikarchuk
Copy link

jponikarchuk commented May 2, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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 [email protected]
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
@jponikarchuk jponikarchuk added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels May 2, 2025
Copy link

melvin-bot bot commented May 2, 2025

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.

@melvin-bot melvin-bot bot added the Overdue label May 5, 2025
Copy link

melvin-bot bot commented May 5, 2025

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

@dylanexpensify
Copy link
Contributor

reproing tomorrow!

@melvin-bot melvin-bot bot removed the Overdue label May 6, 2025
@bernhardoj
Copy link
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

@melvin-bot melvin-bot bot added the Overdue label May 9, 2025
@dylanexpensify dylanexpensify added the External Added to denote the issue can be worked on by a contributor label May 9, 2025
@melvin-bot melvin-bot bot 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. May 9, 2025
Copy link

melvin-bot bot commented May 9, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 9, 2025
Copy link

melvin-bot bot commented May 9, 2025

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

@melvin-bot melvin-bot bot removed the Overdue label May 9, 2025
@dylanexpensify dylanexpensify changed the title [$250] Android - Chat - While entering :+1 after emoji in edit comment cursor shown at beginning. [$75] Android - Chat - While entering :+1 after emoji in edit comment cursor shown at beginning. May 9, 2025
Copy link

melvin-bot bot commented May 9, 2025

Upwork job price has been updated to $75

@dylanexpensify
Copy link
Contributor

Updated pricing giving size

@bernhardoj
Copy link
Contributor

@dylanexpensify is the price adjusted because of the simple solution?

@mananjadhav
Copy link
Collaborator

@bernhardoj's proposal looks good.

@dylanexpensify Can we bump the price a little bit? We will still need to test it on all platforms, wdyt?

🎀 👀 🎀 C+ reviewed.

Copy link

melvin-bot bot commented May 11, 2025

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

@melvin-bot melvin-bot bot added the Overdue label May 14, 2025
@AndrewGable AndrewGable changed the title [$75] Android - Chat - While entering :+1 after emoji in edit comment cursor shown at beginning. [$150] Android - Chat - While entering :+1 after emoji in edit comment cursor shown at beginning. May 14, 2025
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 14, 2025
Copy link

melvin-bot bot commented May 14, 2025

Upwork job price has been updated to $150

@melvin-bot melvin-bot bot removed the Overdue label May 14, 2025
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 15, 2025
@bernhardoj
Copy link
Contributor

PR is ready

cc: @mananjadhav

@mananjadhav
Copy link
Collaborator

PR is reviewed.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 26, 2025
@melvin-bot melvin-bot bot changed the title [$150] Android - Chat - While entering :+1 after emoji in edit comment cursor shown at beginning. [Due for payment 2025-06-02] [$150] Android - Chat - While entering :+1 after emoji in edit comment cursor shown at beginning. May 26, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 26, 2025
Copy link

melvin-bot bot commented May 26, 2025

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

Copy link

melvin-bot bot commented May 26, 2025

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

Copy link

melvin-bot bot commented May 26, 2025

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

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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
Status: LOW
Development

No branches or pull requests

5 participants