PhoenixKit 1.7.165: A default link for notifications, and email event cleanup
PhoenixKit 1.7.165 lets a site choose where a notification without a link of its own leads, and cleans up duplicate email events with migration V137.
The new Default notification link setting defaults to /dashboard. Clear it to make such notifications plain information: the bell then shows a normal cursor for them, and a click still marks them read. On a site without the user dashboard, the /dashboard default does nothing.
V137 removes duplicate email events, adds unique indexes so they cannot come back, fills in the AWS message id for older events, and adds indexes for searching the email list. Modules can now add their own sources to the sitemap, and a disabled module adds none. Comments on a user show the user’s name and avatar in comment moderation, and comment links to files no longer get the URL prefix twice.
Upgrading
Run mix phoenix_kit.update for V137. On a large email log it can take a while.
Full release notes: PhoenixKit 1.7.165
1.7.165 · 24 June 2026
Added
sitemap_sources/0module callback for zero-config sitemap source registration. External modules can contribute their ownSitemap.Sources.Sourcemodules (e.g. Entities) to the generated sitemap with no host-app configuration, mirroring route / CSS / JS auto-discovery. Collected viaModuleRegistry.all_sitemap_sources/0from enabled modules and appended to the base source list (deduplicated, order-preserving). A hostconfig :phoenix_kit, sitemap: [sources: [...]]now acts as a base list that module sources extend rather than fully replace. (#603)- Migration V137 — email event deduplication +
aws_message_idbackfill. Backs theEmails.Eventschema’s declared unique constraints with real partial unique indexes (one per(email_log_uuid, event_type)for single-occurrence types; one per(email_log_uuid, event_type, occurred_at)for open/click), removing pre-existing duplicates first. Backfills the indexedaws_message_idcolumn from the legacyheadersJSONB (conflict-safe viaDISTINCT ON+NOT EXISTS). Adds pg_trgm substring-search indexes for the admin email list, per-template open/click analytics composites, and an archiver body-compression partial index. Host apps pick this up viamix phoenix_kit.update. (#604) usercomment-resource handler. A comment attached to a user resolves to the user’s display name,/admin/users/view/:uuid, and avatar thumbnail in the comments moderation admin instead of a bare uuid. (#605)notification_default_linksetting. A catch-all destination for notifications that have no link of their own. Defaults to/dashboard(authenticated-only; guarded to a no-op when the user dashboard is disabled); clear the field to make such notifications non-clickable. Built throughRoutes.path/1, so it carries the URL prefix and the recipient’s locale. An opt-inconfig :phoenix_kit, warn_unlinked_notifications: truelogs how to wire a link when a clicked notification has neither. (#605)
Changed
- Link-less notifications read as informational. The notifications bell shows a default cursor (not a pointer) for a notification with no effective target, and clicking it still clears its unread state rather than appearing broken. (#605)
Fixed
- A disabled module’s source no longer leaks into the flat sitemap.
all_sitemap_sources/0now aggregates from enabled modules only, so a disabled module contributes nothing even in flat-sitemap mode — where the generator force-collects sources and bypasses each source’s ownenabled?/0. The previousall_modules/0aggregation relied solely on that per-source gate, which flat mode skips. (#603) - Comment
fileresource links no longer double-prefix under a non-rooturl_prefix. Comment-resource handlers must return a raw path (the comments module appliesRoutes.path/1once); thefilehandler pre-applied it. Both thefileand newuserhandlers now return raw paths, matchingpost. (#605) - Notifications bell reads its default-link setting from cache.
default_link/1used the uncachedSettings.get_setting/2on a hot path (the sticky bell’srefresh/1runs on mount and on every notification PubSub event); it now uses the ETS-backedget_setting_cached/2. (#605)
PhoenixKit 1.7.165. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.