PhoenixKit 2.1.0: Unread notifications come first
PhoenixKit 2.1.0 puts a user’s unread notifications ahead of the ones they have already seen, in the notification bell and in the inbox. Newest first still applies within each group.
Unread first
Before, read and unread notifications were mixed by date. Reading one left it where it was, so what still needed attention was scattered among things already handled. In the bell, which shows ten notifications, a read one could push an unread one out of view, while the badge still counted it.
In the inbox, the unread notifications are now headed Unread · followed by the day, so a day no longer appears twice, once in each group. Notifications created in the same second are now always listed in the same order, so none shows on two pages or on none.
The admin list of everyone’s notifications is unchanged and stays in date order.
Upgrading
No migration and no configuration. Update the dependency. The new order applies at once, in the bell, the inbox and any code of yours that calls Notifications.list_for_user/2 or recent_for_user/2.
Full release notes: PhoenixKit 2.1.0
2.1.0 · 11 August 2026
Notification reads sort unseen first. No schema change — the chain stays at V166.
Changed
-
A user’s notifications now sort unseen-before-seen, newest-first within each group (#702), in both
Notifications.list_for_user/2andrecent_for_user/2. Plain newest-first interleaved the two, so reading a notification left it exactly where it was and anything still outstanding ended up scattered among things already dealt with. It mattered most in the bell: the dropdown shows ten, so an already-read notification could push an unread one off the bottom entirely — the badge counted something opening the bell did not show.admin_list/1is deliberately unchanged. “Seen” belongs to the recipient, and an admin scanning everybody’s notifications is reading a chronological record, not working an inbox. -
Notification ordering is now total.
inserted_atis second-granularity, so a fan-out writing many rows inside one second tied every one of them, and a tie underLIMIT/OFFSETlets Postgres return a row on two pages or on neither.uuidis now the final sort key on all three paginated reads; the keys are UUIDv7, so descending on it agrees with newest-first.
Fixed
- The notifications inbox rendered duplicate day headers.
grouped/1chunked rows into day buckets on the day alone, which was correct only while the list was globally chronological. Under the new order the day sequence restarts at the seen block, so an inbox holding read and unread rows across more than one day showed “Today” twice, a week of history apart. Sections are now keyed on{unread?, day}and the unread run is labelledUnread · <day>, so the outstanding work is named rather than inferred from row tint.
PhoenixKit 2.1.0. Install or update: {:phoenix_kit, "~> 2.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.