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 for payment 2023-05-22] [$2000] Update ExpensiMark to recognize mentions #17882

Closed
puneetlath opened this issue Apr 24, 2023 · 26 comments
Closed
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.

Comments

@puneetlath
Copy link
Contributor

puneetlath commented Apr 24, 2023

This is part of the mentions project and is one of the features that we'd like to ship before EC3

ExpensiMark is the system that converts markdown in chat messages into html for storage (e.g. *bold text* to <strong>bold text</strong>).

We need to update ExpensiMark to:

  1. Recognize text in the form of @email@domain.com in chat messages and replace it with <mention-user>@email@domain.com</mention-user>
  2. Recognize text in the form of @here in chat messages and replace it with <mention-here>@here</mention-here>

We should only replace mentions if the @ symbol comes at the beginning of a word.

Examples that should match for user mentions:

Examples that should not match for user mentions:

Examples that should match for here mentions:

Examples that should not match for here mentions:

  • "hi...@here"
  • "here@ how are you?"
  • "@ here hey"

When something is treated as a mention it should not get treated as an email address (meaning we don't make it a mailto link).

Mentions should be allowed within:

  • bold
  • italic
  • strikethrough
  • quote
  • heading1

Mentions should not be allowed within:

  • codefence
  • inline code block
  • link

We will want to wait to merge this PR until the custom renderers for mention-user (#17885) and mention-here (#17886) have been added.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01227cf510add7dd82
  • Upwork Job ID: 1650508959718178816
  • Last Price Increase: 2023-04-25
@puneetlath puneetlath added Daily KSv2 NewFeature Something to build that is a new item. labels Apr 24, 2023
@puneetlath puneetlath self-assigned this Apr 24, 2023
@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Apr 24, 2023
@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Apr 24, 2023
@melvin-bot melvin-bot bot changed the title Update ExpensiMark to recognize mentions [$1000] Update ExpensiMark to recognize mentions Apr 24, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~01227cf510add7dd82

@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 24, 2023
@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 24, 2023
@MelvinBot
Copy link

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

@getusha
Copy link
Contributor

getusha commented Apr 24, 2023

Proposal

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

Make ExpensiMark recognize mentions to replace to required mention web components.

What is the root cause of that problem?

N/A this is kind of a new feature.

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

We can use two separate mention regexes and add them accordingly, to replace the mentions with required html with the content. the following regex handles the cases for the mention examples provided above.

const mentionUserRegex = /(^|\s)@([\w.@+-]+(?:\.[\w@+-]+)+)\b/g;
const mentionHereRegex = /(^|\s)@here\b/g;

For User mention
Screenshot 2023-04-24 at 8 09 52 AM

For @ here mention
Screenshot 2023-04-24 at 8 12 53 AM

What alternative solutions did you explore? (Optional)

N/A

@mananjadhav
Copy link
Collaborator

Thanks for the proposal @getusha. I think your proposal works, I need to verify it once. I'll update here once I am done.

Meanwhile,

  1. @getusha how are we ensuring that the mentions are not rendered as links?
  2. @puneetlath this issue deals only with regex right? It doesn't cater to any suggestions, popup, etc. right?

@puneetlath
Copy link
Contributor Author

@puneetlath this issue deals only with regex right? It doesn't cater to any suggestions, popup, etc. right?

Yes, this is just the ExpensiMark part of the solution. The actual rendering of <mention-here>@here</mention-here> for example will be handled in separate issues. You can see all the issues that we're working on right now here: https://github.com/orgs/Expensify/projects/31/views/2 in the Todo Before EC3 section.

@puneetlath
Copy link
Contributor Author

For the mention-user regex, we may want to consider leveraging the email regex we already have here.

@getusha
Copy link
Contributor

getusha commented Apr 24, 2023

@getusha how are we ensuring that the mentions are not rendered as links?

@mananjadhav We can put the mention rules above every other rules by doing that we will insure that it will only treats it as mention before other replacement. or just below the codeFence here

@puneetlath puneetlath changed the title [$1000] Update ExpensiMark to recognize mentions [$2000] Update ExpensiMark to recognize mentions Apr 25, 2023
@puneetlath
Copy link
Contributor Author

Going to up the bounty on this since this is a high-priority roadmap issue.

Given the timeline, I'm going to go ahead and assign @getusha as well. I think the proposal seems generally good and we're close enough to an agreement that we can work out the kinks in the PR.

@getusha will you be able to raise a PR asap?

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 25, 2023
@MelvinBot
Copy link

📣 @getusha You have been assigned to this job by @puneetlath!
Please apply to this job in Upwork 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 📖

@MelvinBot
Copy link

Upwork job price has been updated to $2000

@getusha
Copy link
Contributor

getusha commented Apr 25, 2023

@getusha will you be able to raise a PR asap?

I will raise the PR in short ASAP. thanks!

@puneetlath
Copy link
Contributor Author

We're actively working through the PR. Good progress.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 1, 2023
@puneetlath
Copy link
Contributor Author

PR is in good shape, but still on hold until we deploy the custom renderers.

@melvin-bot melvin-bot bot removed the Overdue label May 3, 2023
@puneetlath
Copy link
Contributor Author

User renderer got merged. Just need to wait for the Here renderer now and then this will be able to go off hold.

@melvin-bot melvin-bot bot added the Overdue label May 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 8, 2023

@puneetlath, @mananjadhav, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@puneetlath
Copy link
Contributor Author

PR is still on hold. Will likely be able to merge it tomorrow.

@melvin-bot melvin-bot bot removed the Overdue label May 8, 2023
@puneetlath
Copy link
Contributor Author

@getusha I commented on the PR, but we need to get your commits signed. If you can do that today then we can merge the PR asap. Thanks!

@puneetlath
Copy link
Contributor Author

This is live on staging.

@melvin-bot melvin-bot bot added Overdue Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Overdue Daily KSv2 labels May 11, 2023
@melvin-bot melvin-bot bot changed the title [$2000] Update ExpensiMark to recognize mentions [HOLD for payment 2023-05-22] [$2000] Update ExpensiMark to recognize mentions May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.13-5 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 2023-05-22. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot removed the Overdue label May 15, 2023
@puneetlath
Copy link
Contributor Author

Upwork offers sent.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 21, 2023
@mananjadhav
Copy link
Collaborator

@puneetlath There won't be any checklist for this one as this a feature request. what do you think about regression test? do we add that for new features? I mean are they added during the design phase or during the PR?

@puneetlath
Copy link
Contributor Author

Yes, exactly. We add them as part of the design doc itself, so no need to worry about it.

@puneetlath
Copy link
Contributor Author

All paid. Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.
Projects
None yet
Development

No branches or pull requests

4 participants