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

BE - Process mentions on annotation creation #9304

Closed
mtomilov opened this issue Jan 31, 2025 · 2 comments
Closed

BE - Process mentions on annotation creation #9304

mtomilov opened this issue Jan 31, 2025 · 2 comments
Assignees

Comments

@mtomilov
Copy link
Contributor

When an annotation is created, check if it contains mentions and create them appropriately.

The raw process should look close to:

  1. Extract terms prefixed with @, as potential username mentions.
  2. Check which of them belong to actual users from the group in which the annotation is posted.
  3. Pick the first N unique users (We talked about limiting it to 5 mentions per annotation)
  4. Replace the @username entries for those with the corresponding @pubid.
  5. Create mentions entries for all the mentions created during this process (depends on https://github.com/orgs/hypothesis/projects/153/views/1?pane=issue&itemId=92950044).
@acelaya
Copy link
Contributor

acelaya commented Jan 31, 2025

Just to clarify, there's a few outdated points in the issue description, which do not correspond with the latest state of things.

  1. Extract terms prefixed with @, as potential username mentions.

This is no longer correct. Only mentions using the special tag format should be eligible for an actual user mention. Any appearance of @whatever which is not wrapped in the special tag should be ignored and considered plain text.

  1. Replace the @username entries for those with the corresponding @pubid.

We decided to not use pubids in the end. The user will be identified by their userid, which will be set in the data-userid attribute of the special mention tag.

@mtomilov
Copy link
Contributor Author

mtomilov commented Feb 5, 2025

The thread were all the mention filtering logic was discussed

In essense

  • limiting number of mentions to 5 by default
  • nipsa users can neither send nor receive mentions
  • no mentions from private annotations
  • mentions allowed only either in world group or if mentioned user belongs to the same group as that of the annotation

@mtomilov mtomilov self-assigned this Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants