fix(ui): restore unified release-notification template body #37
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!37
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/release-notification-unified-template"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Triggering a release showed
Unread(1)on the navbar bell icon and the unread-tab counter, but the list below rendered the "no unread notifications" empty state — clicking the badge led nowhere.Root cause
The unified-list template body added by #21 (commit
b54ffb340e) was discarded during the upstream-merge conflict resolution inc737ab0f66— the upstream version oftemplates/user/notification/notification_div.tmplwas taken wholesale.The Go handler at
routers/web/user/notification.go:282still populatesctx.Data["UnifiedNotifications"](issue + release notifications, sorted), and theNotificationUnreadCountcallback at:96-113still sums issue + release unread counts.The template, however, iterates
.Notifications(issue-only) and contains no release branch.Result: the badge sees the release, the list body does not.
Every other piece of the release-notification wiring survived the merge intact — the
UnifiedNotificationstruct,manager_run.go,notify.go,models/codefloe/release_notification.go,head_navbar.tmpl, locale strings, status/purge handlers.Only the template body was clobbered.
Fix
Restore the unified template body from
b54ffb340e:.UnifiedNotificationsinstead of.Notifications{{if $notification.IsRelease}}— tag icon, link to{{.Repo.Link}}/releases/tag/<TagName>, status form postsis_release=trueto matchctx.FormBool("is_release")atrouters/web/user/notification.go:293$totalUnreadCountfor the unread-tab counter and the purge-button visibilityui label{{if not …}} tw-hiddenspacing tweak fromd665904a22on the unread-count badgeThe Go side is unchanged.