Notifications: summarize multi-person names in the calendar event title
Some checks failed
CI / backend (push) Successful in 1m39s
CI / naming (push) Successful in 2s
CI / frontend (push) Successful in 8s
CI / migrations-mysql (push) Failing after 8s

A recognition/training notification for many people prefixed the calendar title
with the entire roster ("Name1, Name2, ... , Name20: description"), burying the
description. to_calendar_event now shows "First Person +N" when more than one
person is listed; single-person titles are unchanged and the detail popup still
shows the full employeename. Fixes the cluttered month grid, especially after
the loader began resolving employee SSOs to names.

31 notification/calendar tests pass; naming green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-07-13 13:32:39 -04:00
parent c4690da262
commit 2229db4a70

View File

@@ -159,11 +159,17 @@ class Notification(db.Model):
color = color_aliases.get(raw_color, raw_color if raw_color.startswith('#') else '#14abef')
show_photo = bool(ntype and getattr(ntype, 'showemployeephoto', False))
# Employee-photo types prefix the card with the person's name/SSO.
# Employee-photo types prefix the card with the person's name/SSO. A
# multi-person recognition/training lists many people, so summarize as
# "First Person +N" to keep the calendar title short (the detail popup
# still shows the full employeename).
title = self.title
if show_photo:
employee_display = self.employeename or self.employeesso
if employee_display:
people = [p.strip() for p in employee_display.split(',') if p.strip()]
if len(people) > 1:
employee_display = f"{people[0]} +{len(people) - 1}"
title = f"{employee_display}: {title}"
return {