-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[Paid: Final Steps] [$1000] Web - Chat - When copying part of a multiline message, the entire message is copied #17868
Comments
Triggered auto assignment to @conorpendergrast ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.In Safari, when we try to select a part of a multiline message, then right click the selected text and press What is the root cause of that problem?Let's look at the flow of the executeSecondaryInteractionOnContextMenu() function, which would be triggered when we right click a message. Basically, the current logic is App/src/components/PressableWithSecondaryInteraction/index.js Lines 38 to 48 in 931e15f
The inconsistency lies in this piece of code. The In short, after blurring the text, the selection on Safari is cleared, while it is not on Chrome. Therefore, when the I believe this is a regression from #15375, where the blurring logic was added. A very similar issue of the selection API inconsistency after a component is blurred on Chrome and Safari (in another repo) can be found here. A possibility is that there is a difference between the way Safari and Chrome handle the blurring event. What changes do you think we should make in order to solve the problem?Changing the order from - if (this.props.withoutFocusOnSecondaryInteraction && this.pressableRef) {
- this.pressableRef.blur();
- }
- this.props.onSecondaryInteraction(e);
+ this.props.onSecondaryInteraction(e);
+ if (this.props.withoutFocusOnSecondaryInteraction && this.pressableRef) {
+ this.pressableRef.blur();
+ }
I think this is a reasonable change, since
What alternative solutions did you explore? (Optional)Alternatively, we could add a + setTimeout(() => {
this.pressableRef.blur();
+ }, 0) RecordsWorking well after the fix Screen.Recording.2023-04-24.at.15.30.07.mov |
This isn't a bug: the context menu applies to all parts of the message, not individual components within the message. Closing as it's not a bug! |
@conorpendergrast |
Oh that's very weird - I didn't spot that this was inconsistent in the OP (there's no platforms selected) |
Reopening as this is an inconsistency that we should resolve either as copying the full message, or copying the selected part of the message |
Interesting, I was doubly wrong! When you select text and then click Copy to Clipboard, that should copy only the selected text #2665 |
Updated the OP to include the platform! |
Job added to Upwork: https://www.upwork.com/jobs/~01075913f2cc61e719 |
Current assignee @conorpendergrast is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
Triggered auto assignment to @jasperhuangg ( |
@tienifr Thank you for the great explanation. However, this issue does not affect code blocks. Please check the video below. Do you have any explanation for that? Screen.Recording.2023-04-25.at.5.18.18.PM.mov |
@fedirjh Thank you for the response, that’s a nice catch! I’m not sure with the underlying principle of how Safari handle the blurring event, but after some more careful examination, here is my observation: When we are copying a normal text on Safari, the flow would be
In this situation, the modal On the other hand, when we are copying a codeblock text, the flow would be
In both of the situations, the Meanwhile, the This is only happening of Safari, so IMO the root cause lay in some difference in the way Safari handle the blurring action, which may affect the order of the actual actions being executed. The order is different between when we select a pure text and when we select a code block. |
This is not addressing the |
After conducting additional research, I confirm that Safari sets the selection after setting the focus (as described in https://bugs.webkit.org/show_bug.cgi?id=27019#c1), which is in line with @tienifr's explanation here.
@tienifr the solution you provided makes sense to me. However, it does not resolve all cases. For instance, when we select text from two messages, the selected text is not fully copied in this particular edge case. Screen.Recording.2023-04-28.at.11.05.02.PM.mov |
@fedirjh Thank you for the input, and also the very helpful link! I can confirm that this is happening on Safari (and not on Chrome). The copied text would be a single word that the pointer was hovered in when the right click event is triggered. I'm taking a deeper look into this. |
Apparently, the Still finding a proper way to address this. |
@fedirjh @conorpendergrast I'm still trying to fix the edge cases |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
After some investigation, I am still not able to find a resolution for this. The issue remains in the way Safari handle selection, which I have explained earlier. I did some further digging on other messaging apps, and here is my sum up. Action: Select text across 2 different messages -> Right click -> Copy text. Notice that we are selecting across different messages, not across lines in a single message. Behavior of my proposal
Behavior of other messaging apps
Given that, I think this edge case should be addressed on the Webkit side, or on another issue, and it is out of scope in the current context (copying multiline text). Thoughts? |
Thank you for investigating and providing an update @tienifr. I have tested Slack on Safari and can confirm that the edge cases are present there as well, which indicates that this bug is not within our app codebase. I agree with you that Webkit should address this edge case. Given that, I think we should proceed with @tienifr's solution. 🎀 👀 🎀 C+ reviewed |
@jasperhuangg Waiting for your review to confirm and assign @tienifr |
📣 @tienifr You have been assigned to this job by @jasperhuangg! |
As this is a simple fix, the PR is ready for review: #18700. |
🎯 ⚡️ Woah @fedirjh / @tienifr, great job pushing this forwards! ⚡️ The pull request got merged within 2 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉
On to the next one 🚀 |
Offers sent via Upwork, will pay after the regression wait period |
|
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.
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:
|
Pay day, moving to Daily |
Paid via Upwork. @fedirjh Final step is the checklist! |
Regression Test Proposal
Do we agree 👍 or 👎 |
I agree with those reproduction steps. Created the regression test request, and all done! |
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:
Only selected text should be copied
Actual Result:
The whole message has been copied at the Safari
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.4.0
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
Bug6028917_Screen_Recording_2023-04-23_at_00.24.37.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: