PhoenixKit 1.7.226: Audio files in the media pickers
PhoenixKit 1.7.226 makes audio a file type of its own in the media pickers, and files an uploaded mp3 as audio no matter where it was dropped.
The media selector gets an Audio Only filter. Until now, each upload path decided a file’s type with its own copy of the rules: the media browser stored audio as a document and the upload API as “other”, so the same mp3 could be found or not depending on where it was uploaded. All upload paths now share one rule, which also reads the file extension for audio that browsers report as application/octet-stream, such as .m4a, .flac, .opus and .ogg. Files uploaded before this release keep their stored type.
Smaller fixes: SearchPicker rows and the theme menu options show a pointer cursor again, and the call-to-action block is centred and no longer links to # when it has no action.
Full release notes: PhoenixKit 1.7.226
1.7.226 · 1 August 2026
Added
- Audio is a first-class type in the media pickers (#676) — an audio filter in
the selector modal (grid query,
acceptlist, server-side upload gate, copy and the “Audio Only” dropdown option), pluslock_file_typeon the modal andonly_file_typeonMediaBrowser, which turn a type filter from a starting point into a constraint: the control is hidden, the change event is refused on the server, and an off-type upload is refused rather than stored out of sight. Storage.determine_file_type/2— the one classifier behind thefile_typecolumn, now public and documented. It takes the filename as well as the mime type, so the extensions browsers report asapplication/octet-stream(.m4a,.flac,.opus,.ogg) are still classified correctly instead of being invited by a picker’sacceptlist and then refused by its own type gate.
Fixed
- An mp3 was stored as a document, so the audio filter never found it (#676) —
determine_file_type/1was copied into all four upload paths and the copies drifted: only the selector modal’s knew about audio, while the media browser classified audio as"document"and the upload controller and full-page selector as"other". Since each copy’s result is written straight tofile_type, and both new filters query that column literally, the same file was findable or invisible depending on which dropzone it was dropped on. All four now callStorage.determine_file_type/2. Unknown mime types uploaded through the media browser are now"other"(in theFileallowlist) rather than"document". - Buttons that didn’t look clickable (#676) — Tailwind v4’s preflight stopped
setting
cursor: pointeronbutton, leaving the SearchPicker’s dropdown rows (server- and hook-rendered) and the theme dropdown’s options with an arrow cursor.cursor-pointeralso joins the SearchPicker’s safelist span, since the hook writes the class from JavaScript. EmailStatusBadgeleakedformat_status/1andstatus_class/1into every LiveView (#676) — it is blanket-imported byuse PhoenixKitWeb, :live_view, so any consumer with its ownformat_status/1failed to compile pointing at code that never mentioned email. The import is narrowed to the component itself.- The call-to-action block sat flush left and linked nowhere (#676) — it now
renders inside a centring wrapper, drops the
inline-blockthat was overriding daisyUI’s.btn, and renders without anhrefwhen it has no action instead of defaulting to"#", which scrolled the reader to the top of the page.
i18n
- The five new audio strings translated in all seven locales.
gettext.extract --mergefuzzy-matches each of them onto its video sibling — so “Only audio files can be added here.” would otherwise have rendered as the translation of “only video files” — and fuzzy entries do render.
Tests
test/modules/storage/determine_file_type_test.exs— DB-free coverage of the shared classifier, including theapplication/octet-streamfilename fallback.- The registration-changeset block that shares a describe-level
setupnow registers a unique address per test; it was exhausting the 3-per-hour-per-email registration limit, and the refusal landed insetupreading as “registration is broken”. The “explicit username wins” case keeps its saved user — the block is about editing one.
PhoenixKit 1.7.226. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.