Skip to content

Per-admin unread mail tickets - #1956

Merged
neuromechanist merged 5 commits into
devfrom
feature/mail-unread-badge
Oct 25, 2026
Merged

neuromechanist merged 5 commits into
devfrom
feature/mail-unread-badge

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

The Mail badge in the admin portal counted only open tickets assigned to the viewer, so new unassigned mail showed nothing. This adds per-admin read tracking.

  • Migration 0110: mail_ticket_reads (user_id, ticket_id, read_message_id), a sixth child of mail_tickets (the header says a future rebuild must back it up like 0109).
  • Opening a ticket (GET /admin/mail/tickets/:id) marks it read for that admin only, after the visibility check; a failed marker write never fails the read.
  • TicketSummary.unread on the list, computed in the same query.
  • GET /admin/mail/unread-count: visible, not closed or spam, unread for the caller; reuses the list's visibility predicate, so restricted queues never count for a non-owner.
  • Read markers are dropped in all three release paths via mailReleaseStatements.
  • CLI nemar admin mail list shows a NEW column.
  • ADR 0112 amended.

Part of #1893. Website side: nemarOrg/website (feature/mail-unread-badge).

Test plan

  • Backend mail, ticket, tombstone and migration tests: 230 pass
  • Route inventory, CLI mail and export surface tests: 75 pass
  • Typecheck and lint clean
  • Staging: new inbound mail raises the badge; opening the ticket clears it for that admin only

@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR1956

Version: 0.10.24-PR1956.fa525a0
Commit: fa525a0


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 5bc768d into dev Oct 25, 2026
20 checks passed
@neuromechanist
neuromechanist deleted the feature/mail-unread-badge branch October 25, 2026 21:27

This branch was previously deployed

1 inactive deployment
npm — fa525a05 Deployed Oct 25, 2026 by neuromechanist via publish #3972
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant