PhoenixKit 1.7.130: Shared AI translation for modules, personal annotation colours
PhoenixKit 1.7.130 gives modules one shared way to translate their content with AI, and lets each user keep their own colour palette for annotations in the media viewer. It carries 1.7.129, which was not published on Hex.
AI translation for modules
A module describes how to read and store its translatable fields, and core does the rest: one background job per language, retries on temporary errors, a pause when the AI service limits requests, and an activity entry for each finished translation. Forms get an AI Translate button that opens a modal to pick the endpoint, the prompt and which languages to fill, with Generate Default Prompt and a progress bar. Translated text goes only to the form editing that record, not to site-wide notifications.
Annotation colours
The colours a user sets in the annotation toolbar are saved with their account and follow them to every file. New users start with five default colours. The palette is checked on save and on load, and at most 24 colours are kept. Etcher moves to 0.5.5, with a reworked colour picker.
No migration. Update the dependency.
Full release notes: PhoenixKit 1.7.130
1.7.130 · 4 June 2026
Added
- Generic AI-driven translation pipeline in core, so feature modules plug in
via a small adapter instead of re-implementing the whole stack:
PhoenixKit.Modules.AI.Translatablebehaviour (fetch/2,source_fields/2,put_translation/4, optionalpubsub_topics/1), exposed by a module via the optionalai_translatables/0callback onPhoenixKit.Moduleand discovered throughPhoenixKit.ModuleRegistry.all_ai_translatables/0/find_ai_translatable/1.resource_typestrings must be globally unique; on a collision the first registered module wins.PhoenixKit.Modules.AI.Translationsorchestration — availability, endpoint/prompt defaults, idempotent shared prompt provisioning,enqueue/1+enqueue_all_missing/2(app-level de-dup, fail-open), per-resource + global PubSub topics, andmissing_languages/3.PhoenixKit.Modules.AI.TranslateWorker— generic one-job-per-language Oban worker: retry classification (transient errors incl.:timeoutretry, 5xx retry, deterministic discards),{:snooze, 30}on rate-limit so a burst backs off without consuming attempts, and anai.translation_addedaudit entry on success.
- Shared AI-translate UI for multilang form LiveViews:
PhoenixKitWeb.Components.AITranslate— render-only trigger button, modal (endpoint/prompt selectors, scope picker, generate-default-prompt), inline progress bar, and a “taking a while, runs in the background” stall hint.PhoenixKitWeb.Components.AITranslate.{FormGlue,FormBinding}— the shared LiveView state machine (modal events, scope dispatch, live progress, the stall timer with a per-arm token guard) behind a 3-callback binding, so a consumer wires a tiny adapter + binding and delegates.
Changed
- AI-translation broadcasts keep translated content off broad topics: the
full payload (with
:fields) goes only to the per-resource topic the form consumes; the global + adapter topics receive a content-free summary, so resource text is never fanned out to topics a monitor/dashboard might watch.
Fixed
- Sanitize the per-user Etcher color palette on both write and read.
MediaCanvasViewernow filters the client-suppliedetcher:colors-changedpayload to short, color-shaped strings (deduped, capped at 24) before persisting intocustom_fields, ignoring the event when nothing valid survives;load_user_colors/1runs the same sanitization on read, so a palette stored before the guard shipped — or written by any other path — can never reach<Etcher.layer colors={…}>untrusted.
PhoenixKit 1.7.130. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.