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

[HOLD for payment 2023-05-23] [$1000] Copy pasting suggestion triggering text from sent message does not trigger suggestion emojis #18230

Closed
1 of 6 tasks
kavimuru opened this issue May 1, 2023 · 31 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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

@kavimuru
Copy link

kavimuru commented May 1, 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. Send any suggestion triggering text like: ':pizza'
  4. Select and copy the sent message and paste it in compose box

Expected Result:

App should trigger suggestion emojis as it does on slack and as it does normally for copy to clipboard text

Actual Result:

App does not trigger suggestion emojis when we copy paste suggestion triggering text from previous messages

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.8.8
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

copy.paste.text.emoji.suggestion.does.not.trigger.mp4
Recording.436.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011ee31bf40fe883ce
  • Upwork Job ID: 1654137510019043328
  • Last Price Increase: 2023-05-04
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 1, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented May 1, 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

@bernhardoj
Copy link
Contributor

bernhardoj commented May 2, 2023

Proposal

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

Copying and pasting an emoji code from chat message does not show the emoji suggestion.

What is the root cause of that problem?

Every chat message is appended with LTR unicode.

style={[EmojiUtils.containsOnlyEmojis(text) ? styles.onlyEmojisText : undefined, styles.ltr, ...props.style]}
>
{StyleUtils.convertToLTR(Str.htmlDecode(text))}

/**
* Android only - convert RTL text to a LTR text using Unicode controls.
* https://www.w3.org/International/questions/qa-bidi-unicode-controls
* @param {String} text
* @returns {String}
*/
function convertToLTR(text) {
return `\u2066${text}`;
}

It is to force the text to becomes LTR because the style from styles.ltr uses writingDirection which is not supported on native (the comment mentioned Android only but looks like iOS doesn't support that style too).

Because now we have the extra character (\u2066), when we select a chat message and copy it, it will also copy the LTR unicode. You can validate it by copy the text and decode it here https://www.online-toolz.com/tools/text-unicode-entities-convertor.php.

So, when we paste the text (let say :pizza) to composer, it will be
\u2006:pizza

Currently, an emoji suggestion won't show if there is a character before the colon. There is already a report of this here https://expensify.slack.com/archives/C049HHMV9SM/p1678947124050359 which marked as not a bug.

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

This issue will be fixed once we allow the emoji suggestion to show when there is a character before a colon, but I also think the LTR unicode is redundant for web because we already use the writingDirection: ltr style. So, we can simply apply the convertToLTR only for native.

  1. I don't think it belongs to StyleUtils.js, so let's move convertToLTR from StyleUtils.js to a new platform specific file in libs to have a different logic.
libs
 |--- convertToLTR
         |--- index.js
         |--- index.native.js
  1. In index.js, we simply return the text passed as the param, while in index.native.js, we use the same logic as we have now, which is to append with \u2066

@melvin-bot melvin-bot bot added the Overdue label May 3, 2023
@slafortune
Copy link
Contributor

Issue looks good!

@melvin-bot melvin-bot bot removed the Overdue label May 4, 2023
@slafortune slafortune added the External Added to denote the issue can be worked on by a contributor label May 4, 2023
@melvin-bot melvin-bot bot changed the title Copy pasting suggestion triggering text from sent message does not trigger suggestion emojis [$1000] Copy pasting suggestion triggering text from sent message does not trigger suggestion emojis May 4, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

Current assignee @slafortune is eligible for the External assigner, not assigning anyone new.

@MelvinBot
Copy link

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

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

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

@cead22
Copy link
Contributor

cead22 commented May 5, 2023

Every chat message is appended with LTR unicode. ... It is to force the text to becomes LTR

Out of curiosity, what happens if we don't do this?

@bernhardoj
Copy link
Contributor

It would messed up the text position because of the bidi algorithm when the text contains both RTL and LTR characters.
image

This is how it looks when we force it to be LTR
image

@cead22
Copy link
Contributor

cead22 commented May 5, 2023

This issue will be fixed once we allow the emoji suggestion to show when there is a character before a colon,

I agree with this statement, but that doesn't feel like a solution to this issue

but I also think the LTR unicode is redundant for web because we already use the writingDirection: ltr style. So, we can simply apply the convertToLTR only for native.

I also agree with this, and since there's a difference in behavior between platforms, I think it makes sense to use different logic here. Is the idea to make StyleUtils.convertToLTR simply return the text passed as param for web/desktop, and keep the current behavior for native? If so, can you update your proposal to reflect that?

That sounds ideal to me because

  • I don't think we should be prepending anything to what users send. Said differently, it seems like Bad UX that we're prepending \u2066, cause I wasn't expecting it, and I bet most users won't expect to be copying that when selecting text from a message all the way to the beginning, and then pasting it.
  • However on native, you can't copy \u2066 because you can't really select the text up to the beginning, cause there's no cursor to drag for a selection
  • I tested long pressing > copy to clipboard on a message containing :pizza on iOS, and then pasted it, and the emoji autocomplete dialog showed up, which makes me think when using the context menu item copy to clipboard, we're NOT copying the \u2066 character
  • That means we'd be adding \u2066 only on native but in a way you can't copy it, and we won't be adding it on web/desktop where you would be able to copy it

@bernhardoj
Copy link
Contributor

@cead22 Totally agree with you. Updated my proposal to be more detail.

@melvin-bot melvin-bot bot added the Overdue label May 8, 2023
@thesahindia
Copy link
Member

The proposal makes sense to me. But since this is only needed for android let's use index.android.js

C+ reviewed 🎀👀🎀

cc: @cead22

@melvin-bot melvin-bot bot removed the Overdue label May 8, 2023
@cead22
Copy link
Contributor

cead22 commented May 8, 2023

(the comment mentioned Android only but looks like iOS doesn't support that style too).

Agreed, but let's confirm. If this applies to both iOS and Android, the index.native.js file makes sense. Otherwise let's go with index.android.js

@slafortune can you hire @bernhardoj for this please?

@bernhardoj
Copy link
Contributor

Just tested on iOS. It supports writingDirection, so we only need index.android.js.
https://reactnative.dev/docs/text-style-props#writingdirection-ios

@bernhardoj
Copy link
Contributor

@cead22 Am I allow to open the PR now? Or wait to get assigned?

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

melvin-bot bot commented May 10, 2023

📣 @bernhardoj You have been assigned to this job by @cead22!
Please apply to this job in Upwork 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 📖

@cead22
Copy link
Contributor

cead22 commented May 10, 2023

Yup, sorry for the delay here

@bernhardoj
Copy link
Contributor

No worries. PR is ready

cc: @thesahindia

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

@cead22 @slafortune @bernhardoj @thesahindia this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@cead22
Copy link
Contributor

cead22 commented May 15, 2023

The PR for this is on staging

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Overdue Daily KSv2 labels May 15, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Copy pasting suggestion triggering text from sent message does not trigger suggestion emojis [HOLD for payment 2023-05-23] [$1000] Copy pasting suggestion triggering text from sent message does not trigger suggestion emojis May 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.14-14 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 2023-05-23. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

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:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] 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:
  • [@thesahindia] 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:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] 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.
  • [@slafortune] 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 May 23, 2023
@slafortune
Copy link
Contributor

Offers sent to @thesahindia @bernhardoj @dhairyasenjaliya 👍
@thesahindia can you complete the above check list?

@dhanashree-sawant
Copy link

Thanks @slafortune, I have accepted the offer.

@slafortune
Copy link
Contributor

Ah shoot! @dhairyasenjaliya - I need to type more letters than @dha before hitting enter!

@dhairyasenjaliya
Copy link
Contributor

Seems like no payment due for me here all good @slafortune

@slafortune
Copy link
Contributor

@thesahindia - Shout when you accept the offer. I am OOO but finishing this.

@thesahindia
Copy link
Member

@slafortune, accepted!

@melvin-bot melvin-bot bot added the Overdue label May 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 29, 2023

@cead22, @slafortune, @bernhardoj, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@slafortune
Copy link
Contributor

complete

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

No branches or pull requests

8 participants