-
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-09-29] [$500] Chat - Emoji suggestion does not auto close after inserting eye emoji #27156
Comments
Triggered auto assignment to @sophiepintoraetz ( |
Job added to Upwork: https://www.upwork.com/jobs/~01e13c88c48491a5e5 |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to @abekkala ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Emoji suggestion does not autoclose after inserting eye emoji What is the root cause of that problem?This because we only call App/src/pages/home/report/ReportActionCompose/SuggestionEmoji.js Lines 196 to 206 in 5c13816
What changes do you think we should make in order to solve the problem?We can do with several ways: const updateComment = useCallback(() => {
...
if (commentValue !== newComment) {
const remainder = ComposerUtils.getCommonSuffixLength(commentRef.current, newComment);
// if the comment replaces emoji and selection not change `resetSuggestions`
if (selection.end === newComment.length - remainder){
suggestionsRef.current.resetSuggestions();
}
...
}
// add selection to deps
}, [selection, ...]); solution 2: use setSelection directly in Composer props onSelectionChange={setSelection} and replace onSelectionChange function here with this useEffect useEffect(() => {
if (!suggestionsRef.current) {
return;
}
suggestionsRef.current.onSelectionChange({nativeEvent : {selection}});
}, [suggestionsRef, selection, value]); solution 3: use setSelection directly in Composer props like solution 2 and create onCommetValueChange in Sugguestions.js which has useEffect(() => {
if (!suggestionsRef.current) {
return;
}
suggestionsRef.current.onCommetValueChange(selection.end);
}, [suggestionsRef, selection, value]); What alternative solutions did you explore? (Optional)we can also move the logic to Suggestions.js or SuggestionEmoji and SuggestionMention with the same idea. |
@ahmedGaber93 Thanks for the proposal! Could you clarify a bit more as to why the selection doesn't change specifically for the eye emoji? |
ProposalPlease re-state the problem that we are trying to solve in this issue.Typing 👁️ emoji code don't close the emoji suggestion. What is the root cause of that problem?When we type a complete emoji code, it should also close the emoji suggestion. This is currently handled by App/src/pages/home/report/ReportActionCompose/SuggestionEmoji.js Lines 178 to 190 in d32fd31
App/src/pages/home/report/ReportActionCompose/SuggestionEmoji.js Lines 196 to 206 in d32fd31
However,
In the case of
If we remove the whitespace added to emoji from here, the issue is gone. What changes do you think we should make in order to solve the problem?Hide the emoji suggestion when an emoji is replaced here App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js Lines 181 to 184 in d32fd31
|
@jjcoffee After some search I found not all emoji length is 2, but it up to 7.
also removing the whitespace added to emoji may fix this issue, but not fix the root cause because we still may have emojis with a typed length equal replaced length for now or future. |
Happy to go with @ahmedGaber93's proposal here. The RCA is correct, though it could use a bit more detail (as in @bernhardoj's proposal), and the first solution seems good. I would just add that I don't think it's necessary to check whether the selection has changed; we can just always reset the suggestions if we're replacing an emoji. @bernhardoj's proposal has a much more detailed RCA, which I appreciate a lot, but the solution is basically the same as in @ahmedGaber93's proposal. 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
I thought the proposal should have a correct RCA, so I posted mine 😅. Btw, hiding the suggestion inside this App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js Lines 181 to 184 in d32fd31
|
Thanks @jjcoffee, I will take care about including more details from the first time rather than explain it if needed. |
📣 @jjcoffee 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @ahmedGaber93 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
Not overdue, just assigned |
@ahmedGaber93 don't forget to let us know when we can expect a PR, thanks! |
🎯 ⚡️ Woah @jjcoffee / @ahmedGaber93, great job pushing this forwards! ⚡️ The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 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-09-29. 🎊 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.
For reference, here are some details about the assignees on this issue:
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:
|
@dhanashree-sawant @ahmedGaber93 have been paid - @jjcoffee - I'll pay once the BZ checklist is completed! |
Bump for you @jjcoffee! |
|
Regression Test Proposal
Do we agree 👍 or 👎 |
@sophiepintoraetz Checklist complete, apologies for the delay! |
All paid! |
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:
App should close the suggestion automatically once emoji is inserted as it does for emojis like 😂 (joy), ❤️ (heart)
Actual Result:
App does not close the suggestion automatically for 👁️ (eye) emoji
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: v1.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
suggestion.not.autoclosed.eye.emoji.mp4
Recording.1495.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693927993330749
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: