Catalogue 0.6.0: AI translation for catalogues, categories and items
Catalogue 0.6.0 lets admins translate the name and description of catalogues, categories and items into the site’s other languages with AI, straight from their edit forms.
AI translation
The catalogue, category and item forms get PhoenixKit’s AI translate button, with its dialog, a progress bar and a hint when a translation takes a while. The translations are saved as the per-language name and description the form already shows under its language tabs. A result is saved even when it is the same as the source, such as a product code or text already in the target language, so it never looks like a failed translation.
The translation itself runs through PhoenixKit core’s shared AI pipeline: the queue, the AI call, retries and the audit log. An AI translation does not show up in other open tabs as a user edit; normal edits still update them.
Status tabs on a catalogue’s page
The Active, Inactive, Discontinued and Deleted tabs now only appear inside a category, next to an actual item list, and only when more than one status has items. A category opens on its first status with items instead of an empty Active tab.
Dragging items into order is hidden when a list has one item, and dropping an item where it already was no longer saves anything. The layout stays the same when a list shrinks to one row.
Upgrading
No migration. AI translation needs a PhoenixKit core release that includes the shared AI translation pipeline; the module adds no new dependency.
Full release notes: Catalogue 0.6.0
0.6.0 · 4 June 2026
Added
- AI translation for catalogue resources (#32) — catalogues, categories, and items can machine-translate their
name+descriptioninto the multilangdataJSONB via core’s shared AI-translation pipeline. APhoenixKitCatalogue.AITranslatableadapter (registered through the newai_translatables/0module callback for"catalogue"/"catalogue_category"/"catalogue_item") handles fetch / source-field extraction / persist for all three resource types, andPhoenixKitCatalogue.AITranslateBindingsupplies the form-side storage glue; the translate button, modal, progress bar, and “taking a while” hint render on each form LiveView. Per-language overrides are written under the multilang_-prefixed keys the form reads, and a result is force-stored even when identical to the source (a product code, text already in the target language) so a field never reads as a failed translation. No newphoenix_kit_aidependency — the enqueue, AI call, retry policy, broadcasts, and audit log all live in core.
Changed
- Catalogue-detail status filter scoped to inside categories (#32) — the category drill step is pure navigation, so the active / inactive / discontinued / deleted tab strip now renders only alongside an actual item list and only when more than one status is populated; a node auto-opens on its first populated status instead of an empty Active.
- Item reorder affordances skip no-ops (#32) — the drag handle is hidden for a single-item list and a same-position drop short-circuits the DB write / broadcast / flash. The handle’s column space is reserved (empty spacer cell) so deleting down to one row doesn’t shift the layout.
- AI-translate LiveView glue delegates to core
FormGlue(#32) — ~570 lines of inline modal / dispatch / PubSub state collapsed into nine delegators plus the small catalogue-specificAITranslateBinding. - Quieter AI-translation writes (#32) — the per-row resource PubSub fan-out is suppressed on AI-translation
update_*writes (they run inside aFOR UPDATEtransaction and would otherwise fire pre-commit and look like a user edit); thebroadcast: falseopt is now forwarded throughupdate_catalogue/3,update_category/3, andupdate_item/3so it actually takes effect. Normal admin edits still broadcast.
Quality
- Post-merge review of #32 (writeup in
dev_docs/pull_requests/2026/32-ai-translation-shared-glue/CLAUDE_REVIEW.md): dropped a dead_ = primarydiscard; replaced a runtimeString.to_existing_atom/1+rescuewith a compile-time field→column map in the AI adapter; flattenedput_translation/4nesting (extractedmerge_translation!/6) and aliased a fully-qualifiedWeb.Helperscall to satisfycredo --strict; expanded the adapter unit tests 10 → 15 (source-field override / legacy-key paths, catalogue + category round-trips). Also dropped a redundantimport Ecto.Query, warn: falsefrom the PDF library context.
Notes
- Requires the shared AI-translation pipeline — catalogue now plugs into PhoenixKitAI (
PhoenixKitAI.{Translatable,Translations}andPhoenixKitAI.Components.AITranslate.{FormGlue,FormBinding}). Catalogue compiles andmix precommit(compile--warnings-as-errors+format --check-formatted+credo --strict+dialyzer) is clean against the corresponding local dependency set. - Verification: ExUnit suites are DB-gated and run against a host whose schema is at core V111+; the new adapter tests pass against a local core (not exercised in CI without a database).
Catalogue 0.6.0. Install or update: {:phoenix_kit_catalogue, "~> 0.6"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.