PhoenixKit 1.7.107: Live Sessions pages turn again, and calmer user search
PhoenixKit 1.7.107 fixes paging on the Live Sessions page at /admin/users/live-sessions. Clicking a page number sent an event the page did not handle, and the page crashed.
On the Users page, search now waits until you stop typing for 300 ms instead of asking the server on every key. Sorting on Live Sessions now starts ascending on the first click of a column and toggles after that. Module authors get sort_header_cell/1 and search_toolbar/1 for their own tables.
Full release notes: PhoenixKit 1.7.107
1.7.107 · 10 May 2026
Added
- Two opt-in stateless helpers on
PhoenixKitWeb.Components.Core.TableDefault(PR #528)sort_header_cell/1— clickable<th>withhero-chevron-up-mini/-down-miniicon when active, inert label-only<th>whensortattr isnil. Configurableevent(default"toggle_sort"),target,align(:left/:right/:center). Thealignis applied to the<th class>(text-right/text-center) so non-sortable columns honour it consistently with the sortable onessort_header_cell/1emitsaria-sort="ascending"|"descending"|"none"on the<th>when sortable, omitted when inert. Pinned by 4 regression tests covering all three states + omittedsearch_toolbar/1— daisyUIinput-smwithhero-magnifying-glassicon andphx-debounce(default 300ms). Optional<form>wrap whenon_submitis set. Placeholder defaults todgettext("default", "Search...").phx-targetpropagates to both the<form>and<input>so submit-on-Enter retargets correctly when embedded in aLiveComponenttest/phoenix_kit_web/components/core/table_default_test.exs— new directory + 18 component tests; closes part of the standingcore/test-coverage TODO fromCLAUDE.md
change_pageevent handler inPhoenixKitWeb.Live.Users.LiveSessions— pagination on/admin/users/live-sessionswas bound tophx-click="goto_page"with no matchinghandle_event/3clause, so clicking any page number raisedFunctionClauseErrorand crashed the LV (PR #528 follow-up). Renamed the binding tochange_pageand added the handler mirroring the siblingusers.ex:121convention
Changed
PhoenixKitWeb.Live.Users.LiveSessions— collapsed:sort_by+:sort_orderassigns into a single:sort = %{by, dir}map; renamed event"sort_by"→"toggle_sort"with"by"param. First click on a new column sorts ascending (was descending); subsequent clicks toggle.flip_dir/1tightened fromflip_dir(_)catch-all to explicit:descclause so unintended values surface as a crash rather than silent coercion (PR #528)lib/phoenix_kit_web/live/users/live_sessions.html.heexandlib/phoenix_kit_web/live/users/users.html.heex— both call sites of<.search_toolbar>dropped the redundanton_submit="search". The input’s debouncedphx-change="search"already covers the same event; keeping both made Enter fire"search"twice (immediate submit + 300ms-later debounced change) (PR #528 follow-up)
Fixed
lib/phoenix_kit_web/live/users/users.html.heex— replaced bare search form (every keystroke hit the server) with<.search_toolbar>carrying the 300msphx-debounce(PR #528)<.search_toolbar>form variant double-boundphx-changeon both<form>and<input>, doubling work per keystroke.phx-changeis now bound only on the<input>; the<form>carriesphx-submitonly.phx-targetnow propagates to both so LiveComponent embedding works end-to-end. Two regression tests pin both behaviours (PR #528, commitdfc91238)
i18n
mix gettext.extract --mergeresync — adds"Search..."msgid +et/rutranslations and surfaces accumulated drift from prior commits where extract wasn’t run (PR #528, separate commita7c1d35b)
Hygiene
.gitignore— adds/priv/static/assets/vendor/somix phoenix_kit.installruns against/appitself don’t leave an outdated copy of the source JS in tree (PR #528)mix.lock—db_connection2.10.0 → 2.10.1,igniter0.7.9 → 0.8.0 (pulls inex_ast0.11.0 as new transitive). Routine patch bumps
PhoenixKit 1.7.107. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.