PhoenixKit 1.7.132: Comments on media files post their text again
PhoenixKit 1.7.132 fixes comments on the media detail page. With the Leaf editor, Post Comment posted an empty comment, because the page did not pass the editor’s content on to the comments component.
Migration V131 adds a general metadata column to staff people. The Staff module uses it first to remember a person’s status before they are moved to the trash. For developers, use PhoenixKitWeb.Components.AITranslate.Embed adds the event handling of the AI translate modal to a LiveView, so a module no longer copies it by hand. The media selector, markdown editor and media gallery now document the wiring a host must add.
Upgrading
Run mix phoenix_kit.update for V131.
Full release notes: PhoenixKit 1.7.132
1.7.132 · 7 June 2026
Added
PhoenixKitWeb.Components.AITranslate.Embed— ause-able macro that wires the host side of the AI-translate modal so consumers stop hand-copying it. Viaattach_hooklifecycle hooks it injects the sixai_*handle_eventclauses (ai_toggle_modal,ai_select_endpoint,ai_select_prompt,ai_select_scope,ai_generate_prompt,ai_translate_lang) and the{:ai_translation, …}handle_infoclause, composing with the host’s own handlers (non-AI events/messages pass straight through). Form re-sync defaults to assigning both:changesetand:form; hosts whose sync differs overrideai_translate_assign_form/2. Because lifecycle hooks run before the host’s own callbacks and:halton the events they own, a host clause for those AI events is shadowed — the moduledoc documents this so the AI clauses aren’t re-implemented in the host.- V131 migration adds a generic
metadata JSONB NOT NULL DEFAULT '{}'column tophoenix_kit_staff_people(mirrors theentity_datashape). The first consumer is staff soft-delete, which stashes the prior lifecycle status undermetadata["trashed_from_status"]; the column is general-purpose so future per-person metadata needs no new migration. IdempotentADD COLUMN IF NOT EXISTS;@current_version→ 131.
Fixed
- Media detail comments: forward Leaf editor events to the embedded
CommentsComponent. The Leaf rich-text composer reports its content to the host LiveView via a{:leaf_changed, …}process message;media_detailwasn’t forwarding it, so “Post Comment” silently posted empty content. Adds the runtime forward (resolved against the optionalphoenix_kit_commentsdep) plus ahandle_infocatch-all so unmatched messages don’t crash the LV.
Changed
- Extract
PhoenixKitWeb.CommentsForwarding.forward_leaf_changed/2— the{:leaf_changed, _}forwarding contract (optional-dep guard + runtimeapply/3+:pass/contract-drift handling, logging unexpected returns) now lives in one module.MediaBrowser.EmbedandMediaDetailboth delegate to it instead of carrying near-verbatim copies, so a futureforward_leaf_event/2contract change touches one call site. As a side effect theMediaBrowser.Embedmacro no longer injectsrequire Loggerinto every host (the onlyLoggeruse moved into the shared module). - Document required host wiring on the callback-message components
MediaSelectorModal,MarkdownEditor, andMediaGallery— loud “required host wiring / silent failure otherwise” moduledoc contracts. These stay docs-only by design (per-consumer handling, not uniform boilerplate, so no Embed macro).MediaSelectorModalalso documents the:notifyalternative for LiveComponent consumers. - Dependency bumps (
mix.lock):bandit1.11.1 → 1.12.0,etcher0.6.5 → 0.6.6,fresco0.6.3 → 0.7.1,spitfire0.3.12 → 0.3.13,tesla1.18.3 → 1.20.0.
PhoenixKit 1.7.132. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.