From e945609b2dffbae47e336bad8a8cf83d420c7c17 Mon Sep 17 00:00:00 2001 From: michaelcanova Date: Fri, 25 Sep 2026 11:44:35 -0400 Subject: [PATCH 1/2] [Notifications] Adding Proposal Contribution Notification --- .../Notification/lib/formatNotification.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/components/Notification/lib/formatNotification.ts b/components/Notification/lib/formatNotification.ts index c80ef6b88..87650c635 100644 --- a/components/Notification/lib/formatNotification.ts +++ b/components/Notification/lib/formatNotification.ts @@ -127,6 +127,11 @@ const NOTIFICATION_TYPE_MAP = { useAvatar: false, title: 'Funding payout', }, + FUNDRAISE_CONTRIBUTION: { + icon: 'fund', + useAvatar: true, + title: 'New contribution', + }, RSC_SUPPORT_ON_DIS: { icon: 'fund', useAvatar: true, @@ -262,7 +267,11 @@ function notificationMessageIncludesAmount(message: string): boolean { } export function getRSCAmountForBadge(notification: Notification, message: string): number | null { - if (notification.type === 'FUNDING_CREDITS_REMINDER') { + // Contribution copy already includes its amount in the original currency (USD or RSC). + if ( + notification.type === 'FUNDING_CREDITS_REMINDER' || + notification.type === 'FUNDRAISE_CONTRIBUTION' + ) { return null; } @@ -475,6 +484,12 @@ export function formatNotificationMessage( return `${userName} supported your work "${truncatedTitle}" with RSC`; // Fundraising notifications + case 'FUNDRAISE_CONTRIBUTION': + return ( + stripHtml(notification.body.map((segment) => segment.value).join('')) || + `${userName} submitted a contribution to your proposal "${truncatedTitle}"` + ); + case 'FUNDRAISE_PAYOUT': return 'Your fundraising payout has been processed'; From 0e962203cd4d45f87b25b046efd524bf380c5590 Mon Sep 17 00:00:00 2001 From: michaelcanova Date: Fri, 25 Sep 2026 11:49:44 -0400 Subject: [PATCH 2/2] [Notifications] Updating notification message --- components/Notification/lib/formatNotification.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/Notification/lib/formatNotification.ts b/components/Notification/lib/formatNotification.ts index 87650c635..16edb5ac8 100644 --- a/components/Notification/lib/formatNotification.ts +++ b/components/Notification/lib/formatNotification.ts @@ -485,9 +485,19 @@ export function formatNotificationMessage( // Fundraising notifications case 'FUNDRAISE_CONTRIBUTION': + // Stored notifications may contain only the contributor's first name. return ( - stripHtml(notification.body.map((segment) => segment.value).join('')) || - `${userName} submitted a contribution to your proposal "${truncatedTitle}"` + stripHtml( + notification.body + .map((segment, index) => + index === 0 && + segment.type === 'link' && + (actionUser?.firstName || actionUser?.lastName) + ? actionUser.fullName + : segment.value + ) + .join('') + ) || `${userName} submitted a contribution to your proposal "${truncatedTitle}"` ); case 'FUNDRAISE_PAYOUT':