community-platform icon indicating copy to clipboard operation
community-platform copied to clipboard

Feature/comment mentions

Open patrycjapraczyk opened this issue 2 years ago • 18 comments

PR Checklist

PR Type

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Developer experience (improves developer workflows for contributing to the project)

Description

This PR adds a feature for mentioning users in comments under research and howtos.

Users can be mentioned by @user_name. The following is then added to the db: @[id:userId]. This adds a notification to the mentioned users with a link to the relevant comment. Clicking on this link takes the user to the relevant comment via scrolling.

Git Issues

Closes #1543

Screenshots/Videos

https://user-images.githubusercontent.com/35103888/174682439-b21e2ee3-c363-46c7-a94d-a62842103d23.mp4


What happens next?

Thanks for the contribution! We try to make sure all PRs are reviewed ahead of a monthly dev call (first Monday of the month, open to all!).

If the PR is working as intended it'll be merged and included in the next platform release, if not changes will be requested and re-reviewed once updated.

If you need more immediate feedback you can try reaching out on slack in the platform-dev channel.

patrycjapraczyk avatar Jun 20 '22 21:06 patrycjapraczyk



Test summary

51 1 0 0Flakiness 0


Run details

Project onearmy-community-platform
Status Failed
Commit b4f50e901d
Started Sep 5, 2022 8:47 PM
Ended Sep 5, 2022 8:50 PM
Duration 03:09 💡
OS Linux Ubuntu - 20.04
Browser Chrome 105

View run in Cypress Dashboard ➡️


Failures

src/integration/events.spec.ts Failed
1 [Events] > [List events] > [By Everyone]

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

cypress[bot] avatar Jun 20 '22 22:06 cypress[bot]

Nice @patrycjapraczyk Works good here, looking forward to use it! Two questions:

  1. If i'm the author of content (How-to or Research) I get a notification if someone comments + also if someone mentions me in a comment. Double notification , image below. Would it be possible to remove one. Something like: If mentioned in a comment > Don't trigger content comment
afbeelding 2. Is it (easily) possible to extend this behaviour to how-to's and research content? In this way authors can mention contributors or ask specific help from certain members. If not no worries we raise a new issue for it.

davehakkens avatar Jun 21 '22 07:06 davehakkens

Hey @davehakkens.

  1. This may require some refactoring but it should be possible.
  2. Yes, it mentioning could also work for research and how-to text but again would require additional work. Maybe we should create a separate issue for this?

patrycjapraczyk avatar Jun 21 '22 16:06 patrycjapraczyk

Yes, it mentioning could also work for research and how-to text but again would require additional work. Maybe we should create a separate issue for this?

💯 Let's raise a separate Issue to track the item of adding @mention functionality across more parts of the Platform.

thisislawatts avatar Jun 21 '22 19:06 thisislawatts

Also @patrycjapraczyk, a heads up that I am doing some refactoring work around the Notification components atm: https://github.com/ONEARMY/community-platform/pull/1774

thisislawatts avatar Jun 21 '22 19:06 thisislawatts

There's going to be conflicts between this work and your refactor @thisislawatts

patrycjapraczyk avatar Jun 22 '22 20:06 patrycjapraczyk

@patrycjapraczyk, yes I believe there will be merge conflicts. How would you prefer to handle this?

thisislawatts avatar Jun 22 '22 21:06 thisislawatts

@thisislawatts hmm not sure. On one hand, you know your reactors better and it'd be easier for you to refractor the changes I made in this PR. But I don't want to delay you, since you got approval to your PR already. I'm also going on holidays for over a week on Friday and am busy tomorrow, so not sure if I'll have time to push the improvements to this PR soon.

patrycjapraczyk avatar Jun 22 '22 21:06 patrycjapraczyk

Enjoy the holiday @patrycjapraczyk! ✨ There is no urgency here so we can wait for you to get.

thisislawatts avatar Jun 23 '22 19:06 thisislawatts

Hey @davehakkens @thisislawatts I've added the changes addressing your comments. @davehakkens now only one notification is triggered when the user is mentioned under howto/research they're an author of. I changed the format of mentioning users, so the old mentions you tested will not work.

patrycjapraczyk avatar Jul 10 '22 18:07 patrycjapraczyk

nice. thanks for removing that duplicate notification, works good now! But it looks like there are still some conflicts before we can merge 😬 Whats the best way to go about these @thisislawatts?

davehakkens avatar Jul 10 '22 21:07 davehakkens

Hope you had a good holiday break! Would you be up for rebasing this branch @patrycjapraczyk or would you rather I did it?

thisislawatts avatar Jul 11 '22 16:07 thisislawatts

Thanks @thisislawatts it was great indeed!

I am trying to rebase and getting conflicts for every commit I made in this PR. I'm struggling to fix them (resolving them seems to generate errors in the project) and don't have much experience with rebasing. It'd be great if you could do it for me if you don't mind.

patrycjapraczyk avatar Jul 11 '22 20:07 patrycjapraczyk

Sure thing @patrycjapraczyk, happy to take a look. Will pick this up on Thursday evening.

thisislawatts avatar Jul 12 '22 19:07 thisislawatts

Many Thursday evenings have passed since then, and there have been significant changes to the component structure since this PR was raised. I would like to use this as a reference and split the changes into two streams:

  1. Introduce the capability to @mention users with their handle in the following locations,
    1. Comments
    2. Howto introductions
    3. Howto steps
    4. Research introductions
    5. Research updates
  2. Notify a User whenever they have been @mention elsewhere on the Platform.

thisislawatts avatar Sep 18 '22 10:09 thisislawatts

hehe a few Thursdays indeed! Just to double check. You mean starting with the ability to @mention (step 1) and later add the actual notification (step 2)?

davehakkens avatar Sep 18 '22 23:09 davehakkens

That's correct @davehakkens, introduce the @mention everywhere then in a second PR introduce notifications based off of those mentions.

thisislawatts avatar Sep 19 '22 07:09 thisislawatts

sounds good!

davehakkens avatar Sep 19 '22 09:09 davehakkens

Should we make a new issue on this @thisislawatts to take on part two? Notify a User whenever they have been @mention elsewhere on the Platform.

davehakkens avatar Nov 25 '22 23:11 davehakkens

I don't think so @davehakkens, this looks to be pretty well defined within https://github.com/ONEARMY/community-platform/issues/1543, I have assigned both this PR and Issue to me. Will work on this next.

thisislawatts avatar Nov 26 '22 06:11 thisislawatts

hey @patrycjapraczyk. thanks for the work on this! The PR ended up on a different track and got rebuild by @thisislawatts due to a refractor for email notifications. Closing this for now. But thanks for laying the groundwork. 🙏 Hope you are good there :)

davehakkens avatar Feb 10 '23 20:02 davehakkens

100% agree here @davehakkens, @patrycjapraczyk thank you so much for all of the time and thought you put into your original proposal. Really great work. I hope you're doing good and life is treating you well ✨ Hopeful that we will get the opportunity to work together again.

thisislawatts avatar Feb 11 '23 12:02 thisislawatts