-
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-08-30] [$1000] Web - Markdown pasted from selection-copy is different from clipboard-copy #23659
Comments
Triggered auto assignment to @puneetlath ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~019c94943755b5fa6d |
Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.An extra line is added to the markdown text when the user copy & paste the message which contains code snippet using selection & keyboard shortcut. What is the root cause of that problem?
If we add above message and copy it using clipboard button and keyboard shortcut each other, different html contents are saved in clipboard.
App/src/components/Composer/index.js Lines 298 to 301 in 34d1d95
If we paste it in the composer, above html texts will be parsed by handlePastedHTML function of ExpensiMark class and parsed text will be shown in the composer.
https://github.com/Expensify/expensify-common/blob/9940dd127c2d44809c98ee628a8057f08c93bfc9/lib/ExpensiMark.js#L322-L324
But through rendering of HTML content, What changes do you think we should make in order to solve the problem?App/src/hooks/useCopySelectionHelper.js Lines 8 to 9 in 975146f
We should parse selection in advance, before saving it to clipboard & parsing it using htmlToMarkdown function.We should remove the child <div> tag inside <pre> tag and the problem will be fixed.
We might update this parser function for further updates related to selection, or we can add it to What alternative solutions did you explore? (Optional)We can add new rule to
|
@mollfpr please review when you get a chance, thanks! |
Reviewing |
Need more time for this, I felt unwell and tried again the next day 🙏 |
@akamefi202 Sorry for the delay 🙏
Why should we parse the selection in advance? The selection listener is only called if we make a text selection in the App right? How do we handle the case where we make text selection outside of the App, for example from this OP issue?
It seems you didn't have the In this case, can we correctly handle the parser on pasting the text? |
Yes, the listener is only called if we copy the selection using keyboard shortcut(Ctrl + C) inside the app.
App/src/components/Composer/index.js Lines 298 to 301 in 34d1d95
It will be parsed using |
@akamefi202 Could you attach a working result video? |
@mollfpr Here you go. Please check from 0:55 of video. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Thanks @akamefi202
Are the changes we need to parse the selection before set to the clipboard? You said that the break line tag is removed from Screen.Recording.2023-08-03.at.23.39.17.mov |
@mollfpr |
@mollfpr This is example of html selection from Github. It contains unnecessary attributes and tags.
I suggest to add below two rules.
Working result: |
We can fix it in both if it's the same root cause.
@akamefi202 Why do we need this? Because of this, there's a failure in the jest. Although the solution is working. I want to know why |
@mollfpr
#23659 (comment) |
@mollfpr
But if we copy and pasting using selection and keyboard shortcut.
|
Thanks @akamefi202, that make sense to me. I have tested the proposal, and we only need to add 1 rule to remove the 🎀 👀 🎀 C+ reviewed! |
Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Sorry, just catching up. I think I like this solution better:
That way we handle it on paste, rather than on copy. And that way no matter how many divs exist inside the pre tags, they'd get removed. What do y'all think? |
Yeah, I suggested it and @mollfpr agreed with that solution too. |
Ah ok. The link seemed to be to the earlier proposal, so I wasn't sure. Let's do it then! |
📣 @mollfpr 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @akamefi202 You have been assigned to this job! |
📣 @huzaifa-99 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
I applied to the Upwork job and I believe that the PR will be ready by tomorrow. |
I updated proposal. |
@mollfpr @puneetlath |
@puneetlath @mollfpr @akamefi202 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
@puneetlath @mollfpr It's Aug 30th. Could you please help me with payment? And can we close this issue now? |
All paid. Thanks everyone! |
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:
test heading
Expected Result:
Message copied from selection should be the same that that copied from context menu
Actual Result:
Message copied from selection has an extra line
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.45-8
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
Screen.Recording.2023-07-26.at.2.34.29.PM.mp4
Recording.3922.mp4
Expensify/Expensify Issue URL:
Issue reported by: @huzaifa-99
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690364432300409
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: