-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-03-31] [$250] Web - Chat - Pasted message not always displays no hyperlink format when paste as plain text #53718
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
Comments
Triggered auto assignment to @alexpensify ( |
Edited by proposal-police: This proposal was edited at 2024-12-06 21:28:37 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Web - Chat - Pasted message not always displays no hyperlink format when paste as plain text What is the root cause of that problem?We are setting the plain text to a markdown value if it is anchor tag and plain text value if it is not
but anchor regex test passes intermittently for the same value as explained here because:
What changes do you think we should make in order to solve the problem?This isAnchorRegex check is introduced in #42147 to achieve copy paste consistency across web and native platforms but to achieve it the correct way to do it is to copy the mardown content to the plain clipboard here App/src/pages/home/report/ContextMenu/ContextMenuActions.tsx Lines 47 to 52 in 476f397
then convert from markdown > text here for web App/src/hooks/useHtmlPaste/index.ts Lines 93 to 98 in 476f397
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?We can make a unit test for What alternative solutions did you explore? (Optional) |
Job added to Upwork: https://www.upwork.com/jobs/~021866332344495527627 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 ( |
@Pujan92 - Can you please review and confirm if one of these proposals will fix the issue? Thanks! |
Please re-state the problem that we are trying to solve in this issue.Web - Chat - Pasted message not always displays no hyperlink format when paste as plain text What is the root cause of that problem?ContextMenuActions.tsx (lines 45–55) The root cause is that the plain text fallback wasn't being reliably set as the primary clipboard content before the HTML, leading to inconsistent behavior during the first "Paste as plain text" operation. What changes do you think we should make in order to solve the problem?After: const plainText = isAnchorTag ? Parser.htmlToMarkdown(content) : Parser.htmlToText(content);
// First, set the plain text to the clipboard to ensure it is prioritized
Clipboard.setString(plainText);
// Then, set the HTML content with plain text fallback
Clipboard.setHtml(content, plainText); What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?To prevent reintroducing this issue in the future, automated tests should cover a range of scenarios to verify clipboard behavior and ensure consistency across environments. What alternative solutions did you explore? (Optional) |
📣 @AK-web! 📣
|
Edited by proposal-police: This proposal was edited at 2024-12-10 15:20:03 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Chat - Pasted message is not always displayed without hyperlink format when paste as plain text What is the root cause of that problem?There are two problems here
App/src/pages/home/report/ContextMenu/ContextMenuActions.tsx Lines 50 to 52 in df7ab48
App/src/hooks/useHtmlPaste/index.ts Lines 79 to 81 in 9fe5511
What changes do you think we should make in order to solve the problem?We should create a new instance of RegExp. The updated code in
To handle root cause (2), we should check and convert the markdown to plain text in App/src/hooks/useHtmlPaste/index.ts Line 81 in 9fe5511
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?None What alternative solutions did you explore? (Optional) |
@alexpensify, @Pujan92 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Thanks for the proposals. @FitseTLT and @prakashbask's proposal of regex new instance won't solve the problem as it will only make it consistent(isAnchorTag gets true) and paste will be always the link format. @AK-web's RCA and solution don't look correct to me.
I agree with the @prakashbask RCA but why do we need the text extraction within the useHTMLPaste? Isn't the right plainText should be passed from ContextMenuActions |
@Pujan92 You have misunderstood the problem. The problem is that isAnchorTag is being inconsistent and the solution is to make it consistent. You have to first understand the purposes of |
@FitseTLT The problem isn't only making |
As a hint, I would like to suggest checking whether #40564 is an actual issue or correct behavior. |
That's a nice idea. My first proposal was like your suggestions but after digging deep I found out the PR and that's why I proposed the fix for the RCA of the inconsistency. In case your expectation is accepted I have Updated to incorporate it to my alt solution Ok @Pujan92 Let's ask for the expected behaviour 👍 |
@alexpensify Could you plz confirm the expected behavior for this issue as @FitseTLT is requesting? To me, it looks correct. |
@Pujan92 @alexpensify We will need to club this 53832 issue also to discuss the expected behaviour |
@alexpensify To make it clear for you. The problem here is inconsistency in the paste behaviour as mentioned in the Actual Result
We have no doubt on fixing the inconsistency. What we want from you is to confirm on the behaviour of paste as a plain text for links. what should be pasted? In all other cases for past as plain we paste the text without the formating, for instance, if it was a bold text markdown when we paste as plain we paste only the raw text without formatting but the problem is they have made an exception for anchor links in this PR to fix an issue That change made links to be pasted with the link for both normal paste and paste as plain text options. WDYT is the expected behaviour? Should we revert the change by that PR or fix the inconsistency based on the expectations from that PR. |
Agree @prakashbask, both can be clubbed. The only platform that differs is Android as it doesn't support HTML paste and we need to consider it a special case for deriving plainText. cc @ZhenjaHorbach
I might be wrong here @FitseTLT, I think that issue needs to be generic to render all markdowns on Android instead of plain text. |
PR #58701 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.17-1 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 2025-03-31. 🎊 For reference, here are some details about the assignees on this issue:
|
@Pujan92 @alexpensify @Pujan92 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
Triggered auto assignment to @CortneyOfstad ( |
🚨 Heads up! I'll be offline until Monday, April 7, 2025, and won’t be actively monitoring this GitHub during that time. @CortneyOfstad - I went ahead and reassigned this one since the payment date is next week, and I’ll be offline. I appreciate your help with the required action here. Thanks! |
I think checklist isn't needed here bcoz we have changed the behavior for the copy of the plain text. So maybe it isn't considered a bug. Regression Test Proposal
Do we agree 👍 or 👎 |
I am so sorry about that — this was reassigned to me while I was also OoO until the 7th. Getting this sorted now! |
Payment Summary@Pujan92 — to be paid $250 via NewDot Regression Test |
$250 approved for @Pujan92 |
Uh oh!
There was an error while loading. Please reload this page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: undefined
Reproducible in staging?: Yes
Reproducible in production?: Yes
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
When choosing "Paste as plain text", the message is pasted without any hyperlink format
Actual Result:
The first time paste as plain text, the message is pasted with hyperlink format, the second time it is pasted without hyperlink format as expected
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6679622_1732842325268.Recording__740_1_.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @CortneyOfstadThe text was updated successfully, but these errors were encountered: