From 7fbdba9c3613b5b9f5fcfe4fe602e8478681293d Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sat, 1 Nov 2025 03:56:13 +0900 Subject: [PATCH] appview/models: add `NotificationTypeUserMentioned` notif type Change-Id: ooutnottqmnszutmqsyopsxzspysxzsx Signed-off-by: Seongmin Lee --- appview/models/notifications.go | 5 +++++ appview/pages/templates/notifications/fragments/item.html | 2 ++ 2 files changed, 7 insertions(+) diff --git a/appview/models/notifications.go b/appview/models/notifications.go index c4081b92..c1896074 100644 --- a/appview/models/notifications.go +++ b/appview/models/notifications.go @@ -20,6 +20,7 @@ const ( NotificationTypeIssueReopen NotificationType = "issue_reopen" NotificationTypePullClosed NotificationType = "pull_closed" NotificationTypePullReopen NotificationType = "pull_reopen" + NotificationTypeUserMentioned NotificationType = "user_mentioned" ) type Notification struct { @@ -63,6 +64,8 @@ func (n *Notification) Icon() string { return "git-pull-request-create" case NotificationTypeFollowed: return "user-plus" + case NotificationTypeUserMentioned: + return "at-sign" default: return "" } @@ -113,6 +116,8 @@ func (prefs *NotificationPreferences) ShouldNotify(t NotificationType) bool { return prefs.PullCreated // same pref for now case NotificationTypeFollowed: return prefs.Followed + case NotificationTypeUserMentioned: + return true // always notify on mention default: return false } diff --git a/appview/pages/templates/notifications/fragments/item.html b/appview/pages/templates/notifications/fragments/item.html index ef4e5476..a5689344 100644 --- a/appview/pages/templates/notifications/fragments/item.html +++ b/appview/pages/templates/notifications/fragments/item.html @@ -54,6 +54,8 @@ reopened a pull request {{ else if eq .Type "followed" }} followed you + {{ else if eq .Type "user_mentioned" }} + mentioned you {{ else }} {{ end }} {{ end }} -- 2.43.0