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

[HOLD react-native-live-markdown #317] [$500] Render shortened mentions with blue/green outline in live markdown preview #38025

Open
puneetlath opened this issue Mar 10, 2024 · 38 comments
Assignees
Labels
External Added to denote the issue can be worked on by a contributor Monthly KSv2 NewFeature Something to build that is a new item.

Comments

@puneetlath
Copy link
Contributor

puneetlath commented Mar 10, 2024

Problem

Our markdown rendering renders mentions with a blue or green outline within the chat body like this:
Screenshot 2024-03-10 at 1 10 07 PM

We also have "live markdown preview" in the composer which is supposed to give a live preview of how the text will be rendered like this:
Screenshot 2024-03-10 at 1 12 53 PM

However, this doesn't currently happen for shortened mentions:
Screenshot 2024-03-10 at 1 18 30 PM

Solution

Add shortened mentions to the live markdown preview rendering that happens in the composer.

Note for potential contributors: live markdown preview currently only exists on mobile apps.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b3ecb2640f3bf7a3
  • Upwork Job ID: 1766890615417413632
  • Last Price Increase: 2024-03-10
@puneetlath puneetlath added External Added to denote the issue can be worked on by a contributor Daily KSv2 NewFeature Something to build that is a new item. labels Mar 10, 2024
@puneetlath puneetlath self-assigned this Mar 10, 2024
@melvin-bot melvin-bot bot changed the title Render mentions with blue/green outline in live markdown preview [$500] Render mentions with blue/green outline in live markdown preview Mar 10, 2024
Copy link

melvin-bot bot commented Mar 10, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01b3ecb2640f3bf7a3

Copy link

melvin-bot bot commented Mar 10, 2024

Current assignee @puneetlath is eligible for the NewFeature assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2 and removed Daily KSv2 labels Mar 10, 2024
Copy link

melvin-bot bot commented Mar 10, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 10, 2024
@puneetlath puneetlath changed the title [$500] Render mentions with blue/green outline in live markdown preview [$500] Render shortened mentions with blue/green outline in live markdown preview Mar 10, 2024
@miroshar-success
Copy link

No problem. Done

Copy link

melvin-bot bot commented Mar 11, 2024

📣 @OskarMast! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@brandonhenry
Copy link
Contributor

Proposal

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

New Feature - The live markdown preview in the composer (mobile app only) does not currently render shortened mentions (e.g., @username without the domain) with the blue/green outline like it does for full mentions (e.g., @[email protected]). This is inconsistent with how mentions actually render in the chat.

What is the root cause of that problem?

The root cause is that the logic for detecting and rendering mentions in the live preview, specifically in the ExpensiMark lib, does not account for the shortened mention format. The regular expressions (REG_EXP.EMAIL_PART and REG_EXP.MARKDOWN_EMAIL) and the userMentions rule only match full mentions with the domain included. As a result, shortened mentions are not detected and rendered with the appropriate styling in the live preview.

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

To solve this issue, we should make the following changes:

  1. Update the REG_EXP.EMAIL_PART constant to also match shortened mentions without the domain part:
readonly EMAIL_PART: "([\\w\\-\\+\\'#]+(?:\\.[\\w\\-\\'\\+]+)*(?:@(?:[\\w\\-]+\\.)+[a-z]{2,})?)";
  1. Update the REG_EXP.MARKDOWN_EMAIL constant to match both full and shortened mentions:
readonly MARKDOWN_EMAIL: "([\\w\\-\\+\\'#]+(?:\\.[\\w\\-\\'\\+]+)*(?:@(?:[\\w\\-]+\\.)+[a-z]{2,})?)";

Now, the userMentions rule will handle both full and shortened mentions, thus adding the new feature we're looking for in the markdown live preview.

@shubham1206agra
Copy link
Contributor

Tagging @robertKozik @tomekzaw as this is related to markdown preview.

@tomekzaw
Copy link
Contributor

@thienlnam We would like to work on it as this probably requires some small changes in Live Markdown library as well.

@SzymczakJ
Copy link
Contributor

Hey! I’m Jakub Szymczak from Software Mansion, an expert agency, and I’d like to work on this issue!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 11, 2024
@thienlnam thienlnam self-assigned this Mar 11, 2024
@brandonhenry
Copy link
Contributor

Personally I don't think this requires any change in markdown live preview, and should only include an update to our expensify-common library. See proposal @thienlnam

@thienlnam
Copy link
Contributor

Any progress on this one Expensify/react-native-live-markdown#317 cc @tomekzaw?

@melvin-bot melvin-bot bot removed the Overdue label May 18, 2024
@tomekzaw
Copy link
Contributor

tomekzaw commented May 20, 2024

@melvin-bot melvin-bot bot added the Overdue label May 27, 2024
@puneetlath
Copy link
Contributor Author

Still on hold, but we're making progress.

@melvin-bot melvin-bot bot removed the Overdue label May 29, 2024
@thienlnam
Copy link
Contributor

Discussion here: https://expensify.slack.com/archives/C01GTK53T8Q/p1716235671381059

Seems like we're currently holding on #42247

@melvin-bot melvin-bot bot added the Overdue label Jun 7, 2024
@puneetlath
Copy link
Contributor Author

Still on hold, but the issues we're held on are making progress.

@melvin-bot melvin-bot bot removed the Overdue label Jun 11, 2024
@melvin-bot melvin-bot bot added the Overdue label Jun 19, 2024
@puneetlath puneetlath added Monthly KSv2 and removed Weekly KSv2 labels Jun 20, 2024
@melvin-bot melvin-bot bot removed the Overdue label Jun 20, 2024
@shubham1206agra
Copy link
Contributor

@thienlnam @puneetlath I think this should be off hold now.

@tomekzaw
Copy link
Contributor

tomekzaw commented Jul 1, 2024

@melvin-bot melvin-bot bot added the Overdue label Jul 22, 2024
@thienlnam
Copy link
Contributor

Still held

@melvin-bot melvin-bot bot removed the Overdue label Jul 23, 2024
@melvin-bot melvin-bot bot added the Overdue label Aug 23, 2024
@puneetlath
Copy link
Contributor Author

Still on hold for Expensify/react-native-live-markdown#317

@thienlnam
Copy link
Contributor

Same ^

@thienlnam
Copy link
Contributor

Looks like the above is closed to getting merged, should be off hold soon

@melvin-bot melvin-bot bot removed the Overdue label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Added to denote the issue can be worked on by a contributor Monthly KSv2 NewFeature Something to build that is a new item.
Projects
None yet
Development

No branches or pull requests

9 participants