Mentions Notification View #2948
Jake Ceballos opened 3 weeks ago

Similar to OD-1995 but with a focused scope to minimize noise.

I frequently interact with users through issue comments. The problem is that I have no way of knowing when I have been mentioned in an issue that needs my attention. It would be nice to have a view that provides a direct link to the issue comment where I am mentioned.

Potential scope:

  • New dropdown in topbar-right to show mention notifications
  • Opening dropdown marks notifications as seen
  • Clicking notification item navigates to issue/comment page
  • System db cleanup of seen notifications (e.g. after 14 days)

Nice to have:

  • User profile setting to enable/disable email notifications
  • Other comment areas (e.g. PR, code)
  • Zak Siddiqui referenced from other issue 2 weeks ago
  • Service Desk commented 2 weeks ago

    Implementation plan

    Related note from issue OD-2989: since mentions span projects, expose a cross-project surface under Global Views.

    Current behavior

    Mentions today are membership flags only (IssueMention / PullRequestMention / CodeCommentMention, unique per entity+user). They drive mentioned me queries, authorize/watch side effects, and "(Mentioned You)" emails, but have no timestamp, source comment, or seen/unread state. The existing "Mentioned me" saved query is therefore not enough for an inbox with deep links.

    This issue stays narrower than issue OD-1995 (general notification center).

    Proposed design

    1. New MentionNotification entity (server-core)

    Keep existing mention join tables for query/auth/watch. Add a separate inbox row per mention event:

    • Recipient user, actor, date
    • Seen flag / seen date
    • Target type + ids needed to open the right page with comment anchor (issue / pull request / code comment)
    • Indexes suitable for (user, seen, date) listing

    Write rows from existing mention handling in IssueNotificationManager (and PR / code-comment managers in the same feature or a follow-up). Prefer one notification per mentioning event even if the join-table mention already exists, so re-mentions stay visible.

    2. Topbar dropdown (primary UX)

    Mirror the Alerts dropdown in LayoutPage (topbar-right):

    • Icon + unread badge
    • Opening the dropdown marks listed items as seen
    • Row click navigates via UrlService to the entity URL with comment anchor
    • Live refresh via the same observer/websocket pattern as alerts

    3. Global Views page (cross-project)

    Add a Mentions entry under Global Views (main menu), with a cross-project list page in the same family as ~issues / ~pulls:

    • Shows the current user's mention notifications across projects
    • Deep-links to the mentioning comment
    • Complements the dropdown (dropdown = recent/unread; page = fuller history while retained)

    4. Cleanup

    Daily scheduled task (same idea as chat retention): delete seen notifications older than about 14 days.

    5. Nice-to-haves (can be follow-ups)

    • Profile setting (near Notify Own Events) to enable/disable mention emails
    • First-class PR and code-comment mentions in the same table/UI

    Out of scope here

    • Full notification center / watch / build bells (issue OD-1995)
    • Replacing email with in-app-only delivery

    Suggested order

    1. Entity + service + write path for issue mentions
    2. Topbar dropdown + mark-seen + cleanup
    3. Global Views list page + menu entry
    4. PR/code-comment coverage + optional email preference

    Please review/adjust before implementation.

  • Zak Siddiqui commented 1 week ago

    @robin I didn't realize that this change may require schema modification and event-based actions.

    What are your thoughts on how to achieve this? Is there an existing framework for event-based actions within OneDev server?

  • Robin Shen commented 1 week ago

    I am thinking of addressing this as part of OD-2115

1/1
Type
New Feature
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
OD-2948
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover