community-platform
community-platform copied to clipboard
Feature/comment mentions
PR Checklist
- [x] - Commit messages are descriptive, it will be used in our Release Notes
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.
Test summary
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 ![]() |
1 ![]() |
|
---|---|---|---|
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
Nice @patrycjapraczyk Works good here, looking forward to use it! Two questions:
- 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

Hey @davehakkens.
- This may require some refactoring but it should be possible.
- 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?
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.
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
There's going to be conflicts between this work and your refactor @thisislawatts
@patrycjapraczyk, yes I believe there will be merge conflicts. How would you prefer to handle this?
@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.
Enjoy the holiday @patrycjapraczyk! ✨ There is no urgency here so we can wait for you to get.
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.
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?
Hope you had a good holiday break! Would you be up for rebasing this branch @patrycjapraczyk or would you rather I did it?
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.
Sure thing @patrycjapraczyk, happy to take a look. Will pick this up on Thursday evening.
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:
- Introduce the capability to
@mention
users with their handle in the following locations,- Comments
- Howto introductions
- Howto steps
- Research introductions
- Research updates
- Notify a User whenever they have been
@mention
elsewhere on the Platform.
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)?
That's correct @davehakkens, introduce the @mention
everywhere then in a second PR introduce notifications based off of those mentions.
sounds good!
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.
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.
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 :)
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.