From 954a4330ee822d60b096de7c8dc9cc3da30c5667 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 19 Mar 2026 16:01:44 +0000 Subject: [PATCH] Add notifications for review tasks --- html/template/sync/component/sidebar.html | 10 ++++++++++ platform/notification.go | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/html/template/sync/component/sidebar.html b/html/template/sync/component/sidebar.html index 2d7ad0ed..800df9d9 100644 --- a/html/template/sync/component/sidebar.html +++ b/html/template/sync/component/sidebar.html @@ -84,6 +84,16 @@ > Review + + + unread notifications +
  • diff --git a/platform/notification.go b/platform/notification.go index 8f56a71a..3c61d3b7 100644 --- a/platform/notification.go +++ b/platform/notification.go @@ -30,6 +30,7 @@ type Notification struct { type UserNotificationCounts struct { Communications uint `json:"communication"` Home uint `json:"home"` + Review uint `json:"review"` } // Clear all notifications for a given user with the given path @@ -117,10 +118,17 @@ func NotificationCountsForUser(ctx context.Context, u User) (*UserNotificationCo if err != nil { return nil, fmt.Errorf("Failed to get nuisance notification count: %w", err) } - log.Debug().Int64("reports", count_reports).Int64("home", count_home).Int("user", u.ID).Msg("calculated notification counts") + count_review, err := u.Organization.model.ReviewTasks( + models.SelectWhere.ReviewTasks.Reviewed.IsNull(), + ).Count(ctx, db.PGInstance.BobDB) + if err != nil { + return nil, fmt.Errorf("Failed to get review notification count: %w", err) + } + log.Debug().Int64("reports", count_reports).Int64("home", count_home).Int64("review", count_review).Int("user", u.ID).Msg("calculated notification counts") return &UserNotificationCounts{ Communications: uint(count_reports), Home: uint(count_home), + Review: uint(count_review), }, nil }