-
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
[$1000] Chat - Copy-pasting emoji names with keyboard shortcut doesn't paste the right emoji name #24399
Comments
Triggered auto assignment to @bfitzexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Chat - Copy-pasting emoji names with keyboard shortcut doesn't paste the right emoji name What is the root cause of that problem?What changes do you think we should make in order to solve the problem?
Add styles.userSelectNone in this line
style={{maxWidth: variables.mobileResponsiveWidthBreakpoint, ...styles.userSelectNone}} ResultScreen.Recording.2023-08-11.at.9.43.20.AM.movWhat alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.When we triple-click the emoji code in the reaction list, the user's default avatar SVG style text also gets copied. What is the root cause of that problem?We can easily reproduce this issue by dragging the text selection to also include the avatar and copy it (ctrl/cmd+c), see the below video. Screen.Recording.2023-08-11.at.15.36.51.movWhen we paste it, we will see the style text of the Avatar svg. This happens because of our faulty selection logic. The selection is handled by SelectionScraper. When we are doing a selection copy (ctrl/cmd+c), First, it will get the HTML selection ( ![]() Next, we parse the HTML ( App/src/libs/SelectionScraper/index.js Lines 107 to 112 in dd0d98f
The problem is, inline style text is also a type of text, thus the Avatar SVG inline style text content is also included. What changes do you think we should make in order to solve the problem?The solution is to not include the style text content. There is no way to know whether the text is a CSS or a normal text, except from its parent. There are 3 ways to fix this (all in
(the final dom will include both style and its content element but without any data)
(the final dom will include style tag only without children)
(the final dom won't include style tag) I prefer the 3rd option. |
Reproduced |
Job added to Upwork: https://www.upwork.com/jobs/~01de88e41de20d9ce9 |
Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak ( |
@eVoloshchak couple of proposals ready for review here |
ProposalPlease re-state the problem that we are trying to solve in this issueCopy-pasting emoji names with keyboard shortcut doesn't paste the right emoji name What is the root cause of that problem?The function attempts to get the selected text using This leads to incorrect behavior when copying and pasting emoji names, as the function does not properly handle the case when an emoji is selected and tries to convert it to an emoji name. What changes do you think we should make in order to solve the problem?In this solution, we only need to use the getEmojiNameByUnicode function from EmojiUtils to get the emoji name by its Unicode on useCopySelectionHelper.js. If an emoji name is found, we wrap it with colons : (which is the standard way to represent emojis in text), otherwise, we use the selected text as it is. This ensures that when an emoji is selected and copied, its name is copied instead of the emoji itself.
What alternative solutions did you explore? (Optional)None Demo
Copy.Pasting.Emoji.Names.Working.mov
Copy.Pasting.Names.Colons.Working.movcc: @eVoloshchak |
@studentofcoding you need to triple-click so that the colons on each side (and hidden text) are copied. Just copying the text is not broken |
Noted @joh42, the triple-click (or copy of all the colons) already covered in my solution too ;) |
Triggered auto assignment to @sakluger ( |
Heading ooo for a week - @sakluger, we're still in the proposal review stage here, so no action required from you at the moment. I can take this back over next week when I return. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@sobitneupane were you able to review proposals? |
Thanks for the proposal everyone. Proposal from @bernhardoj looks good to me. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Can you share why we have to do such a complicated changes where we only needed to include getEmojiNameByUnicode function like I Proposed ? Thanks Copy.Pasting.Names.Colons.Working.mov |
@studentofcoding The issue is not confined to emoji. Please go through the RCA section of the proposal for other instances of the issue. |
As I recall, the expected behavior should be pasting the Emoji name with the : symbol And for this could you share why we pursue A manual implementation of dom & nodes (that more like workaround) when we can simply use our EmojiUtils function instead? Am I missing something @sobitneupane ? |
@studentofcoding We always try to find the root cause and solve the issue there. Root Cause Analysis in this proposal looks promising. Please let us know if you find any issue with the solution. |
The thing is
Here is my RCA summary
But it's just my concern, and whoever gets selected, it's serve the same result |
@sakluger @sobitneupane @marcaaron @bfitzexpensify this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks! |
@sakluger @bfitzexpensify this bug feels like a waste of time to me. |
@marcaaron I agree, I didn't look too closely at the issue when it was reassigned to me. I'm not sure if anyone actually would copy the emoji name from that menu in real life, and if they did, it would likely be someone who could figure out how to edit the name to work properly. |
Could you share more why this is a waste of time @marcaaron ? Also given mind that the user can and possibly do this, that behaviour itself its making this bug valid, no @sakluger ? Im just want to ask and clarify things as its not clear why its abruptly being closed where this is a valid bug Thanks |
Agree with @studentofcoding. The bug itself is actually not specific to selecting the emoji code, but rather our SelectionScrapper logic includes text inside <style> tag into the selection. I see most of our SVG has <style> tag. I think it's low value but it can easily be reproduced by doing text selection. |
I'd give the same reasoning as @sakluger. It's just not really something that a user seems like they would do. I don't think anyone has said it's "invalid" though. The complexity in fixing it don't align with the value we would get by fixing it. |
I beg to differ on the complexity in fixing it. In the end its just a simple fix, with using 'getEmojiNameByUnicode' from 'EmojiUtils' With this in mind, did it really wasting the effort here? |
@marcaaron The solution is actually very simple, as simple as one line
Even the chance of user copying the emoji name from the reaction list is small, I think the fix worths the value as this issue happen to all text selection. |
Apologies in advance if I'm not aligned with anyone's opinion. I personally don't find this issue valuable to fix since it's not something a user will do in most cases. I'd say if we keep on fixing such bugs saying simple or small then we will end up with not utilising available resources (C++ & internal team time, then testing team time and of course money is another player in the game). Since we already reduced bounty price to make open source sustainable for long run. |
Thats totally ok, and I understand you POV, especially for Issue after the price reduction is announced But in this case, 1. Its not a part of price reduction, and 2. Its a still a valid bug, and The solution is simple. Its just dont fair for external contributor, to close and change the procedure middle way dont you think? On another aspect, I think I and @bernhardoj will understand if this issue are decreased to half ($500) as we also have a mechanism for low-priority bug |
I'll wait for Internal Team to shed a light on this |
Well if I am in the same boat and also feel in the same way you guys feel. But it's just not worth it, that's the only view I am having here. |
I'll defer to @sobitneupane as they should be managing this issue and selecting a proposal. The linked proposal has 3 different solutions. There is also various discussion happening and challenges to that proposal. @sobitneupane Please be decisive, manage this conversation, and offer us a path forward. If the final proposal is clear and looks easy to implement then I will agree to reopen it and get it done. |
I agree with @marcaaron and @sakluger. I don't think the issue carries much value. The reproduction step is very specific and rare. So, my vote is on closing the issue. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
The right emoji name should be pasted
Actual Result:
Wrong, long emoji name is pasted
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.53.1
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Screencast.from.2023-08-03.13-55-36.mp4
Recording.2898.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691060569144289
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: