Skip to content

feat: support mention in Research descriptions, updates and comments#2072

Merged
davehakkens merged 10 commits intomasterfrom
feat/research-mention-notifications
Feb 16, 2023
Merged

feat: support mention in Research descriptions, updates and comments#2072
davehakkens merged 10 commits intomasterfrom
feat/research-mention-notifications

Conversation

@thisislawatts
Copy link
Contributor

@thisislawatts thisislawatts commented Jan 23, 2023

PR Checklist

PR Type

  • Bug fix (non-breaking change which fixes an issue)
  • 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

What this PR does

Git Issues

Closes #

Screenshots/Videos

If useful, provide screenshot or capture to highlight main changes


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 Discord in the Community Platform development channel.

@thisislawatts thisislawatts force-pushed the feat/research-mention-notifications branch 3 times, most recently from a4eaf75 to 04c1531 Compare January 23, 2023 18:05
@thisislawatts thisislawatts changed the title feat/research mention notifications feat: support mention in Research descriptions, updates and comments Jan 23, 2023
@thisislawatts thisislawatts force-pushed the feat/research-mention-notifications branch from 04c1531 to cab3bf2 Compare January 23, 2023 18:13
@thisislawatts thisislawatts force-pushed the feat/research-mention-notifications branch 2 times, most recently from 20a1449 to 16a2b20 Compare January 23, 2023 20:02
@cypress
Copy link

cypress bot commented Jan 23, 2023

Passing run #2920 ↗︎

0 53 0 0 Flakiness 0

Details:

Merge branch 'master' into feat/research-mention-notifications
Project: onearmy-community-platform Commit: fed2800108
Status: Passed Duration: 02:54 💡
Started: Feb 16, 2023 7:28 AM Ended: Feb 16, 2023 7:31 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@thisislawatts thisislawatts self-assigned this Jan 25, 2023
@thisislawatts thisislawatts force-pushed the feat/research-mention-notifications branch from f3c4dec to f464e51 Compare January 25, 2023 20:59
@thisislawatts thisislawatts marked this pull request as ready for review January 26, 2023 07:26
@thisislawatts thisislawatts requested a review from a team as a code owner January 26, 2023 07:26
@davehakkens davehakkens added the Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview label Jan 26, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2023

Visit the preview URL for this PR (updated for commit fed2800):

https://onearmy-next--pr2072-feat-research-mentio-rtlzpbzd.web.app

(expires Mon, 20 Mar 2023 13:54:16 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6d65e4f8fee2f6ab2da0c1c3b85b8797d66afa59

@davehakkens
Copy link
Contributor

davehakkens commented Jan 26, 2023

Thanks @thisislawatts nice feature!
All seems to work here, mentions are linked + notifications triggered.
Only thing is that the text of the notification is empty.
The last four blanc notifications are

  1. Mentioned in first post
  2. Mentioned in a step
  3. Mentioned in research comment
  4. Mentioned in research comment
  5. (Does work for how-to)

afbeelding

@thisislawatts
Copy link
Contributor Author

@davehakkens what should the wording be for these notifications. Do we want to specify whether a user was mentioned in a Research description, Update or comment?

@davehakkens
Copy link
Contributor

We could make it very basic and say for all mentions (content + comment) the same:
[username] mentioned you here
Direct to wherever the mention is made.

However you already made some better/ more advanced behaviour in the howto mentions. Separating a comment from the content.

  • Mentioned in a how-to
  • Mentioned in a comment

So I would continue like this and do the same for research

  • Mentioned in a research (description + update)
  • Mentioned in a comment

@thisislawatts thisislawatts force-pushed the feat/research-mention-notifications branch from f464e51 to c3d80f2 Compare January 29, 2023 06:59
@thisislawatts
Copy link
Contributor Author

When testing this manually with a URL like: http://localhost:3000/research/testing-mentions#update-0-comment-2, there is a UX problem here. The user has been mentioned in the 3rd comment under the 1st update. Whilst that information is present in the document fragment #update-0-comment-2 the page does not reflect that. The comments are collapsed and hidden from view.

@thisislawatts
Copy link
Contributor Author

thisislawatts commented Jan 29, 2023

@davehakkens have you seen notifications that match the format you've described here?

However you already made some better/ more advanced behaviour in the howto mentions. Separating a comment from the content.

  • Mentioned in a how-to
  • Mentioned in a comment

Looking at the existing code I can't see anything which suggests the system is capable of generating them. This is the current implementation:

case 'howto_mention':
  return (
    <Box>
      You were mentioned in a
      <InternalLink to={notification.relevantUrl || ''}>
        how-to
      </InternalLink>
      by
      <InternalLink to={'/u/' + notification.triggeredBy.userId}>
        {notification.triggeredBy.displayName}
      </InternalLink>
    </Box>
 )

I agree that it would be good to distinguish between the different locations but perhaps that can be addressed in a follow up work item. This has already been dragging on for a while and it would be good to merge and unblock the email notifications work.

@thisislawatts thisislawatts force-pushed the feat/research-mention-notifications branch from 1b5d2b6 to 8d94797 Compare January 29, 2023 10:09
@thisislawatts
Copy link
Contributor Author

Ready for a re-review ✨

@davehakkens
Copy link
Contributor

davehakkens commented Jan 29, 2023

@davehakkens have you seen notifications that match the format you've described here?

Pretty sure I did. but cant seem to find it anymore either 🤔
Perhaps I was mixing these two notifications:

For how-to author:
New comment on your how-to by projectkamp

For being mentioned in how-to comment:
You were mentioned in a how-to by projectkamp

But agree its good to release this one. Looks good like this.
One small thing I noticed (not sure its a local problem)
When you click the notification, it doesnt scroll to the correct step (but the step-comments are opened)
Video below

no.scroll.mov

@thisislawatts
Copy link
Contributor Author

Good catch @davehakkens, I had adjusted the way we declare addresses for comments in Research articles. I've added a test to explicitly capture this behaviour. Please pull down and generate a new mention to test the behaviour. Any old notifications created locally will not work. This only impacts people who have been reviewing this branch.

@davehakkens
Copy link
Contributor

works now!

Copy link
Member

@chrismclarke chrismclarke left a comment

Choose a reason for hiding this comment

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

Thanks @thisislawatts , there's quite a bit here but it all makes sense to me so thanks for the addition.
I've added one (semi) blocking nit related to the regex used to check whether the page url references mentions, and then just a couple other minor bits of code tidying.

Let me know if you think you will get a chance to review these in the next week or so, if not I can just include my suggested fix for the regex and do any other tidying at some point in the future.

@thisislawatts thisislawatts force-pushed the feat/research-mention-notifications branch from 77e0aa4 to 8a4df92 Compare February 14, 2023 19:57
@thisislawatts thisislawatts force-pushed the feat/research-mention-notifications branch from 23e260a to 58a873e Compare February 14, 2023 20:42
@thisislawatts thisislawatts force-pushed the feat/research-mention-notifications branch from 58a873e to 686091b Compare February 14, 2023 20:51
Copy link
Member

@chrismclarke chrismclarke 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 all the changes @thisislawatts, looks good to go to me!

@davehakkens davehakkens merged commit 98a3e81 into master Feb 16, 2023
@davehakkens davehakkens deleted the feat/research-mention-notifications branch February 16, 2023 09:49
@cypress cypress bot mentioned this pull request Feb 16, 2023
@onearmy-bot
Copy link
Collaborator

🎉 This PR is included in version 1.38.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Research 🧪 Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants