-
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
[$250] Web - Chat - Pasted message not always displays no hyperlink format when paste as plain text #53718
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. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.95-6 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-02-18. 🎊 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] |
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.96-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-02-19. 🎊 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] |
We have reverted the PR due to the below issues where paste/paste as plain text isn't consistent and breaking bcoz of setting the markdown in the "text/plain". I think we should avoid setting markdown for the anchor tag in the current code which I believe is incorrectly implemented here because that isn't pasted correct text for plain text. Screen.Recording.2025-02-13.at.22.49.38.movI suggest revert the changes applied for issue and set the plain text only for "text/plain" instead of the markdown. This is something we discussed earlier in this issue. It means we won't be able to achieve #53832 as android isn't supporting "text/html". @jasperhuangg @prakashbask Let me know your thoughts. |
@Pujan92 @jasperhuangg I fee that "Paste as plain text" should paste only markdown format and not strip out the markdown syntax in order to maintain consistency across different scenarios. (e.g Copy to Clipboard and Copy from composer) |
I believe that this payment is on hold now because the PR was reverted. @Pujan92 please correct me if my summary is incorrect. |
You are correct @alexpensify. |
Thanks for the update! |
@Pujan92 Huh... This is 4 days overdue. Who can take care of this? |
I just raised @prakashbask's point in slack. @prakashbask Have you already requested to join the Slack channel? If yes, then @alexpensify can help to grant access. |
@Pujan92 @alexpensify I submitted a request to join Slack by filling out a Google Form about three months ago using my email ID, [email protected]. However, the request is still pending. |
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: @Pujan92The text was updated successfully, but these errors were encountered: