Emails 0.1.21: Blocklist filters you can bookmark and share
Emails 0.1.21 keeps the state of the Blocklist page in its address, so a filtered list survives a reload, can be bookmarked or shared, and the browser’s Back button steps through your changes.
The search, reason filter, status filter, sort column and direction, and page are now part of the query string. Values left at their default are omitted, so an unfiltered list stays at the plain address. A page number past the end of the list, which a stale or crafted link can now carry, is clamped to the last page instead of rendering one button per skipped page. The page also no longer runs its list and statistics queries twice on each load.
Full release notes: Emails 0.1.21
0.1.21 · 5 August 2026
Added
- The blocklist screen’s state lives in the URL. Search, reason filter, status filter, sort column, sort direction and page are declared through
PhoenixKitWeb.Live.UrlStateand encoded into the query string (?q=&reason=&status=&sort=&dir=&page=), so a filtered list is a real address: shareable, bookmarkable, reproduced by a reload, and walked by the browser’s Back button instead of being left. Values equal to their default are omitted, so an unfiltered list stays at the bare path. (#25)
Fixed
- An out-of-range
?page=no longer renders one button per skipped page. Withpagenow arriving from the URL rather than only from the pagination buttons, it could point far past the end of the list —?page=900on a two-page list, up to the decoder’s ceiling of 1,000,000. The template’smax(1, @page - 2)..min(@total_pages, @page + 2)window then inverted into a descending range, emitting one<button>per skipped page: ~1M DOM nodes from a single crafted or stale link. The page is clamped to the available range before the query runs, and the window carries an explicit//1step. (#25) - The blocklist’s sortable-column whitelist is declared once. The URL decoder and
validate_sort_by/1had separate copies of the same four atoms; a column added to one but not the other is accepted by the header click and then silently dropped by the URL, leaving the click with no visible effect and no error anywhere — the same failure the reason filter hit before merge. (#25) - The blocklist no longer loads its list, count and statistics inside
mount/3, where LiveView’s two-phase mount ran every one of those queries twice per page load. The load moved to the URL-state callback, so one code path serves the first render, a shared link and a Back press alike. (#25)
Changed
- Pruned eight stale
mix.lockentries (igniter,sourceror,rewrite,spitfire,owl,ex_ast,glob_ex,text_diff) left behind by an earlier dependency upgrade.mix precommit’sdeps.unlock --check-unusedstep was failing on them.
Emails 0.1.21. Install or update: {:phoenix_kit_emails, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.