Skip to content
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

feat: HTML to Markdown parser integration #3229

Merged

Conversation

pranshuchittora
Copy link
Contributor

@pranshuchittora pranshuchittora commented May 29, 2021

TODO merge this Expensify/expensify-common#381 and then edit commit hash

Details

A small step towards migration to markdown and deprecation of text

Fixed Issues

Fixes #2847

Tests

QA Steps

  1. Navigate to a conversation
  2. Send a message with the following text
Hello 
Space
Test
  1. Edit the comment.

The structure of the message should remain the same i.e. with new lines

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Peek.2021-06-25.21-14.mp4

Mobile Web

Peek.2021-06-25.21-16.mp4

Desktop

Screen.Recording.2021-06-25.at.10.29.34.PM.mov

iOS

Screen.Recording.2021-06-25.at.10.24.34.PM.mov

Android

Peek.2021-06-25.21-34.mp4

@pranshuchittora
Copy link
Contributor Author

Screen.Recording.2021-06-23.at.12.49.32.AM.mov

@pranshuchittora pranshuchittora marked this pull request as ready for review June 22, 2021 19:35
@pranshuchittora pranshuchittora requested a review from a team as a code owner June 22, 2021 19:35
@MelvinBot MelvinBot requested review from Gonals and removed request for a team June 22, 2021 19:35
@pranshuchittora
Copy link
Contributor Author

@roryabraham this PR is ready for review

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Not much to review here, so looks good 👍

However, before we can approve/merge, please update the description of this PR and include screen recordings for all platforms.

@@ -153,7 +154,8 @@ class ReportActionContextMenu extends React.Component {
*/
getActionText() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change the method description here to:

Gets the markdown version of the message in an action.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump – this method doc is no longer accurate

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think we should make this change in ReportActionItemMessageEdit instead of ReportActionContextMenu, because this doesn't work in the case where you edit the previous message using the Up arrow key:

  1. Send a multiline message
  2. Press the Up arrow key
  3. Observe that the draft message in the ReportActionItemMessageEdit does not appear in multiple lines.

@pranshuchittora
Copy link
Contributor Author

pranshuchittora commented Jun 23, 2021

Hi @roryabraham I have updated the PR. Is this the correct approach, let me know for any changes.
Once the approach gets approved I will update all the required screenshots

Peek.2021-06-23.22-44.mp4

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly correct – right now we're saving the draft message using the plain-text version of the message (i.e: reportAction.message.text). See the getAction function in ReportActionContextMenu here. Instead, I think we'll want to start passing the reportAction.message.html to saveReportActionDraft.

Once you've done that, the draftMessage prop of ReportActionItemMessageEdit will be html instead of text, and we shouldn't need the reportAction prop there. Then the only other change should be that we perform the HTML -> MD transform on the draftMessage prop of ReportActionItemMessageEdit in the constructor.

@pranshuchittora
Copy link
Contributor Author

I have updated the PR

src/libs/reportUtils.js Outdated Show resolved Hide resolved
@pranshuchittora
Copy link
Contributor Author

pranshuchittora commented Jun 25, 2021

@roryabraham I have updated all the required screen recordings & updated the PR as well

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed this during my last review, but I still have the one comment about making the comment correct.

@@ -153,7 +154,8 @@ class ReportActionContextMenu extends React.Component {
*/
getActionText() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump – this method doc is no longer accurate

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM 👍

@pranshuchittora
Copy link
Contributor Author

@roryabraham can we merge this soon to avoid any merge conflicts.

@roryabraham roryabraham merged commit 870c3db into Expensify:main Jul 1, 2021
@OSBotify
Copy link
Contributor

OSBotify commented Jul 1, 2021

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@roryabraham
Copy link
Contributor

roryabraham commented Jul 9, 2021

Unfortunately the deploy comments are not working right now. This was deployed to staging yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit comment - Spaces are not displayed in edit box
3 participants