-
Notifications
You must be signed in to change notification settings - Fork 3k
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-02] [$2000] Spacing between emojis reduced when editing a message with emojis #15951
Comments
Triggered auto assignment to @twisterdotcom ( |
Bug0 Triage Checklist (Main S/O)
|
Looks good, adding External label. |
Job added to Upwork: https://www.upwork.com/jobs/~0136a41936e77380dc |
Current assignee @sakluger is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.When tapping/clicking the emoji icon and then tapping/clicking the emoji in the emoji picker dialog, a space is added after the emoji What is the root cause of that problem?In our implementation, we are adding a space after emoji in the main composer App/src/pages/home/report/ReportActionCompose.js Lines 452 to 453 in ad1e244
What changes do you think we should make in order to solve the problem?we should put this code
into the utils function ReportUtils like this
and using it in App/src/pages/home/report/ReportActionItemMessageEdit.js
Do the same thing in the App/src/pages/home/report/ReportActionCompose.js What alternative solutions did you explore? (Optional)Or we can remove the space in the main composer directly In here: App/src/pages/home/report/ReportActionCompose.js Lines 452 to 453 in ad1e244
remove this line
|
Triggered auto assignment to @cead22 ( |
Proposal What is the root cause of that problem? When you send emoji there was a bit space but when add emoji on edit there was not space after emoji What changes do you think we should make in order to solve the problem? there was space that was adding after sending emoji remove the space after closing bracket this {emoji} Code: const emojiWithSpace = Correct Line: |
📣 @CodeTheEd! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Format:
|
ProposalPlease re-state the problem that we are trying to solve in this issue.When adding an emoji inside the What is the root cause of that problem?Inside addEmojiToTextBox(emoji) {
const emojiWithSpace = `${emoji} `; but this not happens when editing messages addEmojiToTextBox(emoji) {
const newComment = this.state.draft.slice(0, this.state.selection.start)
+ emoji + this.state.draft.slice(this.state.selection.end, this.state.draft.length); What changes do you think we should make in order to solve the problem?
/**
* Add an emoji to the text inside the Composer when selected from the emoji picker
*
* @param {String} emoji
* @param {String} comment
* @param {Object} selection
* @param {Function} cb
*/
const addEmojiToTextBox = (emoji, comment, selection, cb) => {
const emojiWithSpace = `${emoji} `;
const newComment = comment.slice(0, selection.start)
+ emojiWithSpace
+ comment.slice(selection.end, comment.length);
cb(newComment, emojiWithSpace);
};
export {
getHeaderEmojis,
mergeEmojisWithFrequentlyUsedEmojis,
addToFrequentlyUsedEmojis,
containsOnlyEmojis,
replaceEmojis,
suggestEmojis,
trimEmojiUnicode,
getEmojiCodeWithSkinColor,
addEmojiToTextBox,
};
<EmojiPickerButton
isDisabled={isBlockedFromConcierge || this.props.disabled}
onModalHide={() => this.focus(true)}
onEmojiSelected={(emoji) => {
EmojiUtils.addEmojiToTextBox(emoji, this.comment, this.state.selection, (newComment, emojiWithSpace) => {
this.setState(prevState => ({
selection: {
start: prevState.selection.start + emojiWithSpace.length,
end: prevState.selection.start + emojiWithSpace.length,
},
}));
this.updateComment(newComment);
});
}}
/> <EmojiPickerButton
isDisabled={this.props.shouldDisableEmojiPicker}
onModalHide={() => InteractionManager.runAfterInteractions(() => this.textInput.focus())}
onEmojiSelected={(emoji) => {
EmojiUtils.addEmojiToTextBox(emoji, this.state.draft, this.state.selection, (newComment, emojiWithSpace) => {
this.setState(prevState => ({
selection: {
start: prevState.selection.start + emojiWithSpace.length,
end: prevState.selection.start + emojiWithSpace.length,
},
}));
this.updateDraft(newComment);
});
}}
nativeID={this.emojiButtonID}
/> Also, there is a use case when editing a message that ends with an emoji, in default when sending a message ends with an emoji the empty space will be trimmed, so we need to add it manually when the user tries to edit a message that ends with an emoji.
const parser = new ExpensiMark();
let draftMessage = parser.htmlToMarkdown(this.props.draftMessage);
// eslint-disable-next-line no-misleading-character-class
if (draftMessage.match(/[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]$|[#*0-9]\uFE0F?\u20E3$/gu)) {
draftMessage += ' ';
} What alternative solutions did you explore? (Optional) |
📣 @Karim-30! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Format:
|
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.There is no space when we add an emoji in edit composer. What is the root cause of that problem?The space is not added after we add an emoji for this issue #13343. This should apply to both main and edit composer. However, one of the commits of this PR #14686 accidentaly "reverted" it for main composer, so there is a space added after inserting an emoji. What changes do you think we should make in order to solve the problem?We should reapply what this PR #13875 done, which is to not add a space after inserting an emoji for And based on the latest suggestion, we can create a common function to unify the logic inside
and use it in both main and edit composer.
|
@cead22 What's the expected behavior can you confirm this? |
Proposal Please re-state the problem that we are trying to solve in this issue: When editing a message with emojis, there are no spacing after emojis like in the main composer What is the root cause of that problem: Here 2 variables are used to store the draft & edited emojis in chat. 1. emoji 2. draft
What changes do you think we should make in order to solve the problem: To resolve the spacing issue between edited emoji messages, the solution below can be applied.
What alternative solutions did you explore: NA Expected Output: |
@cead22, @sakluger, @bernhardoj, @Santhosh-Sellavel Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@cead22, @sakluger, @bernhardoj, @Santhosh-Sellavel Still overdue 6 days?! Let's take care of this! |
All good here just waiting for deployment! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.4-0 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-02. 🎊 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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
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:
|
Not overdue |
@cead22 Do you differ from any of the above let me know |
The steps for the PR here look good to me. Regression Steps
👍 or 👎 |
Hi @sakluger , @cead22 , @Santhosh-Sellavel , ping for payment. |
Sorry for the delay! Just sent offers to everyone, I'll check back tomorrow to pay. |
Hey @Santhosh-Sellavel, I'm trying to understand what you meant by the following regarding regressions steps on the bugzero checklist:
Does that mean that we already have regression steps for this? |
@sakluger It's not about wanting regression steps, it's about updating the PR review checklist. |
I think we need regression test steps. Here are the steps |
Got it got it, my bad! |
All paid out 👍 |
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:
Expected Result:
When tapping/clicking the emoji icon and then tapping/clicking the emoji in the emoji picker dialog, no space should be added after the emoji
Actual Result:
When tapping/clicking the emoji icon and then tapping/clicking the emoji in the emoji picker dialog, a space is added after the emoji
Workaround:
n/a
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.83-0
Reproducible in staging?: y
Reproducible in production?: y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
emoji.spacing.issue.mac.mov
Recording.1700.mp4
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1678792710814599
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: