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

[$500] In edit message, cursor shifts back on inserting emoji #27273

Closed
1 of 6 tasks
kbecciv opened this issue Sep 12, 2023 · 19 comments
Closed
1 of 6 tasks

[$500] In edit message, cursor shifts back on inserting emoji #27273

kbecciv opened this issue Sep 12, 2023 · 19 comments
Assignees
Labels
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

@kbecciv
Copy link

kbecciv commented Sep 12, 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. Write some text and write wrong emoji text like :hheart:
  4. Rectify the emoji and observe that cursor shifts to end of emoji after emoji is inserted
  5. Send the message with or without emoji
  6. Edit the message and again write wrong emoji text like :hheart:
  7. Rectify and observe that cursor shifts few characters back

Expected Result:

Cursor should shift to end of text after emoji is added

Actual Result:

Cursor shifts back few characters after emoji is rectified in edit mode

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: 1.3.68.12
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

cursor.shifts.back.after.rectifying.emoji.edit.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694189660065529

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c31527ad022a2246
  • Upwork Job ID: 1701643656830824448
  • Last Price Increase: 2023-09-12
  • Automatic offers:
    • ahmedGaber93 | Contributor | 26674793
@kbecciv kbecciv 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 12, 2023
@melvin-bot melvin-bot bot changed the title [HOLD] - In edit message, cursor shifts back on inserting emoji [$500] [HOLD] - In edit message, cursor shifts back on inserting emoji Sep 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 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 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

Triggered auto assignment to @kevinksullivan (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented Sep 12, 2023

Proposal

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

In edit message, cursor shifts back on inserting emoji

What is the root cause of that problem?

the root cause is incorrect calculation for selection after text lenght change
this issue is fixed here #17275 for main composer but not fixed for edit composer.

const remainder = ComposerUtils.getCommonSuffixLength(commentRef.current, newComment);

for more details about root cause see #17275

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

apply the same fix here

const remainder = prevDraft.slice(prevSelection.end).length;

const remainder = ComposerUtils.getCommonSuffixLength(prevDraft, newDraft);

What alternative solutions did you explore? (Optional)

we can also use commentRef.current instead of prevDraft

@ArekChr
Copy link
Contributor

ArekChr commented Sep 14, 2023

The proposal from @ahmedGaber93 LGTM 👌

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

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

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

melvin-bot bot commented Sep 14, 2023

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

@amyevans
Copy link
Contributor

I don't think the [HOLD] in this title is valid 🤔 I'm going to remove it, but someone please correct me if I'm wrong

@amyevans amyevans changed the title [$500] [HOLD] - In edit message, cursor shifts back on inserting emoji [$500] In edit message, cursor shifts back on inserting emoji Sep 14, 2023
@amyevans
Copy link
Contributor

Okay sorry, just checked the linked Slack thread, I think the HOLD was intentional. So @ahmedGaber93 please don't start on a PR yet.

@amyevans amyevans changed the title [$500] In edit message, cursor shifts back on inserting emoji [$500] [HOLD 27195] In edit message, cursor shifts back on inserting emoji Sep 14, 2023
@amyevans
Copy link
Contributor

Held on #27195

@amyevans amyevans added Weekly KSv2 and removed Daily KSv2 labels Sep 14, 2023
@ahmedGaber93
Copy link
Contributor

Ok, I will wait #27195, thanks @amyevans.

@melvin-bot melvin-bot bot added the Overdue label Sep 25, 2023
@amyevans
Copy link
Contributor

Still on hold

@melvin-bot melvin-bot bot removed the Overdue label Sep 26, 2023
@stephanieelliott
Copy link
Contributor

Still on hold for #27195,

1 similar comment
@stephanieelliott
Copy link
Contributor

Still on hold for #27195,

@stephanieelliott
Copy link
Contributor

Looks like #27195 was merged -- we suspected that PR may also fix this issue. @kbecciv would you mind retesting this one?

@stephanieelliott stephanieelliott changed the title [$500] [HOLD 27195] In edit message, cursor shifts back on inserting emoji [$500] In edit message, cursor shifts back on inserting emoji Oct 17, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 25, 2023
@amyevans
Copy link
Contributor

Friendly bump @kbecciv

@melvin-bot melvin-bot bot removed the Overdue label Oct 25, 2023
@stephanieelliott
Copy link
Contributor

I went ahead and tested, I am not seeing the behavior anymore so it seems like this is fixed. Closing!

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

No branches or pull requests

6 participants