Skip to content

[PAY 26th AUG][$250] Task - Mark down format is not copied from description system message with mark down #46887

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

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 6, 2024 · 24 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 6, 2024

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: 9.0.17-0
Reproducible in staging?: Y
Reproducible in production?: Y
https://expensify.testrail.io/index.php?/tests/view/4827111
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to any chat
  3. Create a task
  4. Go to task report
  5. Click Description
  6. Add some text with mark down and save it
  7. Right click on the description system message > Copy to clipboard
  8. Paste the content on the composer

Expected Result:

The copied content will include the mark down format

Actual Result:

The copied content does not include the mark down format

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6563184_1722936468104.bandicam_2024-08-06_17-23-51-787.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0145487b2d412d9680
  • Upwork Job ID: 1823315195401604195
  • Last Price Increase: 2024-08-13
  • Automatic offers:
    • etCoderDysto | Contributor | 103506286
Issue OwnerCurrent Issue Owner: @Ollyws
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 6, 2024
Copy link

melvin-bot bot commented Aug 6, 2024

Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@lanitochka17
Copy link
Author

@jliexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@etCoderDysto
Copy link
Contributor

etCoderDysto commented Aug 6, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Mark down format is not copied from description system message with mark down

What is the root cause of that problem?

getReportActionText is using Parser.htmlToText. Parser.htmlToText will convert the html to plain text and we will copy the plain text to the clipboard

function getReportActionText(reportAction: PartialReportAction): string {
const message = getReportActionMessage(reportAction);
// Sometime html can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const text = (message?.html || message?.text) ?? '';
return text ? Parser.htmlToText(text) : '';

And copy the content to clipboard here
const displayMessage = TaskUtils.getTaskReportActionMessage(reportAction).text;
Clipboard.setString(displayMessage);

What changes do you think we should make in order to solve the problem?

Here, we should

  • get text and html value from getTaskReportActionMessage
  • then use setClipboardMessage instead of Clipboard.setString to convert the html to markdown and copy it to clipboard
const {text, html} = TaskUtils.getTaskReportActionMessage(reportAction);
const displayMessage = html ?? text;
setClipboardMessage(displayMessage);

What alternative solutions did you explore? (Optional)

We should use Parser.htmlToMarkdown instead of Parser.htmlToText in getReportActionText as Parser.htmlToMarkdown returns the markdown format of the html

function getReportActionText(reportAction: PartialReportAction): string {
const message = getReportActionMessage(reportAction);
// Sometime html can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const text = (message?.html || message?.text) ?? '';
return text ? Parser.htmlToText(text) : '';

@jliexpensify
Copy link
Contributor

Asked in the channel here - we're de-prioritizing VSB bugs, but I think this might be good to fix. Will loop back with an update.

@jliexpensify
Copy link
Contributor

No response, will bump DB tomorrow

@melvin-bot melvin-bot bot added the Overdue label Aug 12, 2024
@jliexpensify
Copy link
Contributor

jliexpensify commented Aug 12, 2024

Bumped DB in thread

@melvin-bot melvin-bot bot removed the Overdue label Aug 12, 2024
@jliexpensify
Copy link
Contributor

Posted in #react-native channel - https://expensify.slack.com/archives/C06BDSWLDPB/p1723528668518179

Someone from SWM will take it

@etCoderDysto
Copy link
Contributor

Hi @jliexpensify, I have a proposal if you would like to take a look at it

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Aug 13, 2024
@melvin-bot melvin-bot bot changed the title Task - Mark down format is not copied from description system message with mark down [$250] Task - Mark down format is not copied from description system message with mark down Aug 13, 2024
Copy link

melvin-bot bot commented Aug 13, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0145487b2d412d9680

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 13, 2024
Copy link

melvin-bot bot commented Aug 13, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (External)

@jliexpensify
Copy link
Contributor

@etCoderDysto thanks for your patience, we have decided that a Contributor can handle this. For context, markdown issues are primarily handled by an external agency but they have deemed that your proposal seems fine.

However, they have left some feedback:

image

cc @Ollyws when you review

@etCoderDysto
Copy link
Contributor

Thanks @jliexpensify, I will make sure to find other system messages that use this case, and verify that this change won't cause a regression.

@Ollyws
Copy link
Contributor

Ollyws commented Aug 13, 2024

@etCoderDysto's proposal LGTM.
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 13, 2024

Triggered auto assignment to @cristipaval, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 13, 2024
Copy link

melvin-bot bot commented Aug 13, 2024

📣 @etCoderDysto 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 13, 2024
@etCoderDysto
Copy link
Contributor

@Ollyws PR is ready for review

@Ollyws
Copy link
Contributor

Ollyws commented Aug 23, 2024

This is due for payment monday but for some reason the automation isn't working.

@jliexpensify
Copy link
Contributor

@Ollyws will manually adjust, thanks for the heads up. Any checklist needed?

@jliexpensify jliexpensify changed the title [$250] Task - Mark down format is not copied from description system message with mark down [PAY 26th AUG][$250] Task - Mark down format is not copied from description system message with mark down Aug 23, 2024
@jliexpensify
Copy link
Contributor

Payment Summary

Upwork job

@Ollyws
Copy link
Contributor

Ollyws commented Aug 23, 2024

We can add a regression test with these steps:

1. Go to staging.new.expensify.com
2. Go to any chat
3. Create a task
4. Go to task report
5. Click Description
6. Add some text with mark down and save it
7. Right click on the description system message > Copy to clipboard
8. Paste the content on the composer
9. Verify that the pasted system message contains the markdown

@Ollyws
Copy link
Contributor

Ollyws commented Aug 26, 2024

Requested in ND.

@jliexpensify
Copy link
Contributor

Paid and job closed!

@JmillsExpensify
Copy link

$250 approved for @Ollyws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
No open projects
Status: No status
Development

No branches or pull requests

6 participants