codefloe/forgejo-codefloe
Watch
4
12
Fork
You've already forked forgejo-codefloe
0

fix(ui): restore unified release-notification template body #37

Merged
pat-s merged 1 commit from fix/release-notification-unified-template into v15.0/forgejo-codefloe 2026-06-01 16:03:26 +00:00
Owner

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 in c737ab0f66 — the upstream version of templates/user/notification/notification_div.tmpl was taken wholesale.

The Go handler at routers/web/user/notification.go:282 still populates ctx.Data["UnifiedNotifications"] (issue + release notifications, sorted), and the NotificationUnreadCount callback at :96-113 still 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 UnifiedNotification struct, 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:

  • Iterate .UnifiedNotifications instead of .Notifications
  • Branch on {{if $notification.IsRelease}} — tag icon, link to {{.Repo.Link}}/releases/tag/<TagName>, status form posts is_release=true to match ctx.FormBool("is_release") at routers/web/user/notification.go:293
  • Use the combined $totalUnreadCount for the unread-tab counter and the purge-button visibility
  • Preserve the upstream ui label{{if not …}} tw-hidden spacing tweak from d665904a22 on the unread-count badge

The Go side is unchanged.

## 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 in `c737ab0f66` — the upstream version of `templates/user/notification/notification_div.tmpl` was taken wholesale. The Go handler at `routers/web/user/notification.go:282` still populates `ctx.Data["UnifiedNotifications"]` (issue + release notifications, sorted), and the `NotificationUnreadCount` callback at `:96-113` still 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 `UnifiedNotification` struct, `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`: - Iterate `.UnifiedNotifications` instead of `.Notifications` - Branch on `{{if $notification.IsRelease}}` — tag icon, link to `{{.Repo.Link}}/releases/tag/<TagName>`, status form posts `is_release=true` to match `ctx.FormBool("is_release")` at `routers/web/user/notification.go:293` - Use the combined `$totalUnreadCount` for the unread-tab counter and the purge-button visibility - Preserve the upstream `ui label{{if not …}} tw-hidden` spacing tweak from `d665904a22` on the unread-count badge The Go side is unchanged.
fix(ui): restore unified release-notification template body
All checks were successful
testing / frontend-checks (pull_request) Successful in 2m38s
testing / backend-checks (pull_request) Successful in 14m3s
testing / test-e2e (pull_request) Successful in 31m49s
testing / test-sqlite (pull_request) Successful in 40m13s
testing / test-pgsql (pull_request) Successful in 43m17s
testing / test-remote-cacher (garnet) (pull_request) Successful in 5m46s
testing / test-remote-cacher (valkey) (pull_request) Successful in 5m48s
testing / test-unit (pull_request) Successful in 12m56s
testing / test-remote-cacher (redict) (pull_request) Successful in 5m4s
testing / test-mysql (pull_request) Successful in 33m53s
testing / test-remote-cacher (redis) (pull_request) Successful in 4m44s
milestone / set (pull_request_target) Has been skipped
issue-labels / backporting (pull_request_target) Has been skipped
41c1ff1653
The upstream-merge conflict resolution in c737ab0f66 dropped the unified-list template body from b54ffb340e (PR #21), so the page iterates `.Notifications` (issues only) while the bell badge and tab counter use the combined unread count from `NotificationUnreadCount` (issues + releases).
Net effect: triggering a release shows `Unread(1)` on the navbar bell and the tab, but the list below renders the "no unread" empty state because the release notification only lives in `.UnifiedNotifications`.

Restore the unified template body — `.UnifiedNotifications` iteration with `IsRelease` branching for the release row (tag icon, link to `/releases/tag/<tag>`, `is_release=true` on the status form) — and keep the upstream `ui label{{if not …}} tw-hidden` spacing tweak from d665904a22 on the unread-count badge.
pat-s merged commit bfdacb4d2f into v15.0/forgejo-codefloe 2026-06-01 16:03:26 +00:00
pat-s deleted branch fix/release-notification-unified-template 2026-06-01 16:03:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
codefloe/forgejo-codefloe!37
No description provided.