Notification bell: received + sent peering transfers in a dropdown, with mark-all-read #147
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/Cairn#147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
From the #106 dogfood, decided with Nikola: the first successful A↔B transfer arrived silently — the #105 inbox dot is too subtle, and for unscoped admins (who don't use the Personal nav) it is invisible entirely.
Spec (Nikola's): a notification bell left of the user circle in the top bar. Dropdown lists what arrived (peering deliveries into the user's Inbox) and what was sent out (their outbound transfers, with status). A "Mark all read" button clears in bulk.
Implementation sketch:
GET /api/v1/peering/transfers). Inbound = listing/home/<user>/Inbox/*/via the unscoped store (works for admins too), newest first.GET /api/v1/notifications→{ items: [{kind: received|sent, file, peer, at, status}], unread: N }(capped, newest first).POST /api/v1/notifications/read-all.unread > 0(consistent with the #105 decision: dot, no count). Poll on the existing UI cadence.Shipped in v0.4.11 (PR #148), live on both dogfood instances.
What was built:
navdotwhen there are unread items. Hidden automatically on instances where the feed endpoint doesn't exist.fmtTime/trStatehelpers. i18n en/de/fr/it.Architecture choice: no event framework. The feed is a view over state that already exists — received from the
/home/<user>/Inbox/<peer>/tree (read via the unscoped store, so it works for unscoped admins, whose own browsing never touches/home), sent from the outbound transfers store. The only new persistence isinternal/notify: one timestamp per user, atomic JSON beside the other runtime state (notify-seen.json), round-trip tested. On the dogfood PVCs the read-state survives redeploys.Endpoints:
GET /api/v1/notifications→{items, unread};POST /api/v1/notifications/read-all→ 204. Poll on the existing 60s cadence.Verified: gofmt/vet clean, full
go test ./...incl. the new watermark test,node --checkboth blocks; imagecordy/cairn:v0.4.11Running 1/1 on enc and beta.