PhoenixKit 1.7.117: Shared AI translation and calmer table headers
PhoenixKit 1.7.117 gives feature modules one shared way to translate fields with AI and changes the default look of admin table headers.
<.table_default_header> now uses a neutral grey background instead of the primary colour. Every table header without its own class changes on upgrade. Pass class="bg-primary text-primary-content" to keep the old look.
PhoenixKit.Modules.AI.Translation sends a set of fields to the AI module and returns them translated, and records each request in the activity log. With the new ai_translate option, the language switcher shows a button for each missing language and one to translate all missing languages. It is off unless a module turns it on, and PhoenixKit.Modules.AI.available?/0 tells a module whether the AI module is installed.
The media gallery can limit how many images are chosen; in single mode its add button is disabled once an image is picked. Table card views can show a thumbnail above each card, and the table or card view can be set from the page.
Full release notes: PhoenixKit 1.7.117
1.7.117 · 21 May 2026
Added
PhoenixKit.Modules.AI— core-side conveniences for the optionalPhoenixKitAIplugin.available?/0is a module-loadability check (loaded AND exportsask_with_prompt/4); gate AI-driven UI on it so apps without the plugin fall back to non-AI behavior automatically (PR #557).PhoenixKit.Modules.AI.Translation— shared AI-translation orchestration reused by every feature module that wants AI translation.translate_fields/6takes a%{field_name => text}map and returns the same shape, or a normalized{:error, atom_or_tuple}covering every failure mode (missing endpoint/prompt, plugin absent, duplicate/partial markers, AI exception/exit).parse_response/2is the public, case-insensitive---FIELD_NAME---parser. Each dispatch writes onecore.ai_translation.requestedactivity entry for a unified token-spend audit trail (PR #557).ai_translateattr onLanguageSwitcher.language_switcher_dropdown— opt-in affordance that renders a per-missing-language sparkle button plus a bulk “translate all missing” CTA. The component is pure event-emit (noPhoenixKitAIreference): it fires the host’sphx-clickevent and the host enqueues its own translation worker.nil/enabled: false= today’s behavior (PR #557).max_countattr onPhoenixKitWeb.Components.MediaGallery— caps the number of selected images in:multiplemode and disables the Add button at the limit (defence-in-depth:apply_selectionalso clamps).nil= unlimited;:singlemode implies a limit of 1 (PR #556).card_mediaslot onPhoenixKitWeb.Components.Core.TableDefault— optional media region (thumbnail / cover image / document preview) rendered above the card body in card view; the slot owns its own padding/background (PR #556).- Controlled
view_mode(+view_event) onTableDefault— passview_mode="card"|"table"to take the card⇄table toggle from assigns instead of the default JS hook + localStorage. The component then renders only that view and the toolbar buttons emitview_eventwithphx-value-mode, so the view choice can be URL-backed (push_patch) or survive LV navigation (PR #556). classattr onTableDefault.table_default_header— override the header styling per call site (PR #556).
Changed
TableDefault.table_default_headerdefault changed frombg-primary text-primary-contenttobg-base-300— a calmer, theme-neutral header that reads as a subtle separator from<tbody>. This affects every<.table_default_header>that does not pass an explicitclass. Passclass="bg-primary text-primary-content"to restore the previous look, orclass=""for a bare header (PR #556).MediaGalleryin:singlemode now disables the Add button once an image is selected; replace the image via the per-thumbnail Remove (✕) then Add. The selection cap of 1 is unchanged (PR #556).
PhoenixKit 1.7.117. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.