Description
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:
- Open the app
- Open any report
- Type emoji text in following way: first type 2 colons and then type emoji text like joy, heart in between colons in composer box
- Observe that it adds space after emoji
- Send any normal message and edit it
- Type emoji text in that edit message in similar format as explained in step 3 and observe that it does not add space after emoji
Expected Result:
App should either not add space after emoji in compose box or add space after emoji in edit box to maintain consistency
Actual Result:
App adds space after emoji in compose box and does not add space after emoji in edit box
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.67.1
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
no.space.after.emoji.in.edit.mp4
Recording.4402.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694176420343339
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~0195c2171640e5c29b
- Upwork Job ID: 1701328787879800832
- Last Price Increase: 2023-09-25
- Automatic offers:
- neg-0 | Contributor | 26880380
- dhanashree-sawant | Reporter | 26880383
Activity
[-]Web - Inconsistency bug: App adds space after emoji in composer box but does not add space after emoji in edit[/-][+][$500] Web - Inconsistency bug: App adds space after emoji in composer box but does not add space after emoji in edit[/+]melvin-bot commentedon Sep 11, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0195c2171640e5c29b
melvin-bot commentedon Sep 11, 2023
Triggered auto assignment to @mallenexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Sep 11, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Sep 11, 2023
Triggered auto assignment to @trjExpensify (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.melvin-bot commentedon Sep 11, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (
External)Krishna2323 commentedon Sep 11, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Web - Inconsistency bug: App adds space after emoji in composer box but does not add space after emoji in edit
What is the root cause of that problem?
We are not adding spaces captured by emoji when we are setting selection.
App/src/pages/home/report/ReportActionItemMessageEdit.js
Lines 183 to 194 in 7f2cf16
What changes do you think we should make in order to solve the problem?
We need to add spaces captured by emojis with newDraft length and then subtract it.
Result:
fixed.mp4
neg-0 commentedon Sep 11, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
There's an inconsistency between the compose and edit boxes. When typing out an emoji there is sometimes a space after and sometimes not.
What is the root cause of that problem?
There is a difference in the way the selection pointer is calculated in the ReportActionItemMessageEdit editor box vs the ComposerWithSuggestions composer box.
Editor:
App/src/pages/home/report/ReportActionItemMessageEdit.js
Lines 183 to 192 in 7f2cf16
Composer:
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js
Lines 186 to 194 in 7f2cf16
Note the Composer uses the ComposerUtils.getCommonSuffixLength to calculate the cursor position.
What changes do you think we should make in order to solve the problem?
By utilizing the same ComposerUtils.getCommonSuffixLength function inside of the editor box, the cursor position is calculated correctly.
Recording.2023-09-11.174251.mp4
What alternative solutions did you explore? (Optional)
We could also create a separate helper function so that we do not use "composer" utils alongside an editor component, however, it would be a duplication of code.
39 remaining items
melvin-bot commentedon Oct 3, 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:
eVoloshchak commentedon Oct 11, 2023
If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic), this was just a case that was missed during implementationThis is a very minor bug, an edge case that a few users would have ever encountered. In addition to that, it doesn't prevent users from using the app. I don't think a regression test is needed here
eVoloshchak commentedon Oct 16, 2023
Requested the $500 payment via NewDot
mallenexpensify commentedon Oct 16, 2023
Issue reporter: @dhanashree-sawant paid $50 via Upwork
Contributor: @neg-0 paid $500 via Upwork
Contributor+: @eVoloshchak due $500 via NewDot
@eVoloshchak err on the side of proposing to create regression tests because QA/Applause keeps a separate doc/list of edge cases they check once a month. Thx
JmillsExpensify commentedon Oct 16, 2023
$500 payment approved for @eVoloshchak based on summary above.
eVoloshchak commentedon Oct 16, 2023
Regression Test Proposal
:joy:)Do we agree 👍 or 👎
JmillsExpensify commentedon Oct 16, 2023
Re-opening for the regression test.
mallenexpensify commentedon Oct 17, 2023
Thanks!