Projects 0.5.0: AI translation for projects, templates and tasks
Projects 0.5.0 adds AI translation to the module’s forms. An AI Translate button on the project, template and task forms translates names and descriptions into the site’s other languages in the background. Templates become translatable, and project progress now counts partly finished tasks.
AI translation
The button sits above the language tabs on the project, template and library task edit forms, and shows how many languages are missing. It opens an AI Translation dialog where you pick an AI endpoint and a prompt (or create a default prompt), then choose what to translate: only the missing languages, all other languages (overwriting what is there), or only the current tab. The button is hidden when the AI module is not available, and on forms for new records.
The work runs as a background job, and the form updates as each language finishes. Only the translations are filled in, so unsaved changes on the form survive. A translation that fails for a reason that will not go away is dropped rather than retried, so it does not keep spending tokens, and the same translation cannot be queued twice while one is running.
Translatable templates and partial progress
The template form gets the same language tabs and translatable name and description that projects already had. A project’s overall progress is now the average of each task’s progress, instead of counting only finished tasks. A project still completes only when every task is done.
Fixes
- An embedded project page crashed when its comments drawer was opened.
- Forms opened in the popup were held to a narrow width inside it. They now fill the popup, and an app can set the popup’s width with the
modal_box_classsession key.
Upgrading
Projects 0.5 needs PhoenixKit 1.7.117 or later, which carries the translation helper the job uses. Update core first. No migration. To use AI translation, set up the AI module with an endpoint.
Full release notes: Projects 0.5.0
0.5.0 · 21 May 2026
AI-driven translation for projects, templates, and tasks — an Oban-backed worker plus an in-form translate UI — alongside a batch of field-report fixes (embedded-mount crash, partial-progress rollup, translatable templates, popup width).
Added
- AI translation —
PhoenixKitProjects.Translationspublic API (enqueue/1,enqueue_all_missing/2, AI endpoint/prompt resolution, and default-prompt provisioning) backed byPhoenixKitProjects.Workers.TranslateResourceWorker, an Oban worker that translatesProject/Template/Task/Assignmenttranslatable fields via the shared translation helper. Deterministic failures discard instead of retrying (no token burn), and failure reasons are sanitized before logging / activity-metadata writes. <.ai_translate_bar>+ AI Translation modal on the project / template / task form LVs — a compact trigger above the multilang tabs with endpoint/prompt selectors and a scope picker (missing-only / all-overwrite / current tab). Hidden when AI is unavailable or on:new. Status streams over scoped per-resource PubSub; completion patches only thetranslationsfield of the live changeset, so unsaved edits survive a job finishing mid-edit.- Translatable templates —
TemplateFormLivegains the multilang plumbing (tabs, language switcher, translatable name + description) already present on projects. - Partial-progress rollup — overall project progress now averages each assignment’s
progress_pctinstead of counting onlydone. Project auto-completion stays binary (flips to:completedonly when every assignment isdone). Projects.get_projects/1— batch%{uuid => Project}lookup so host list views can avoid a per-row N+1.session["modal_box_class"]—PopupHostLiveaccepts a host-supplied modal-box width (defaultw-11/12 max-w-6xl).
Changed
- Minimum
phoenix_kitis now~> 1.7.117— it ships the shared translation parser/helper that the translation worker delegates to. - Popup child frames now fill the modal box —
PopupHostLiveinjects a full-widthwrapper_classunless the host passes its own, fixing form LVs that stacked their standalonemax-w-xlcap inside the popup.
Fixed
- Embedded
ProjectShowLivecomments-drawer crash — switched bang-form@phoenix_kit_current_scopeto bracket access, so off-routerlive_rendermounts (which skip core’son_mount) no longer raiseKeyErrorwhen the drawer opens. - AI unique-job window —
TranslateResourceWorkernow setsunique: [period: :infinity, …]. The omitted period defaulted to 60s, which let a translation slower than a minute be enqueued a second time and burn tokens twice. - AI overwrite vs. open form — the “all”/overwrite scope now overwrites translations in the open form too (mirroring the worker’s persisted merge) instead of leaving stale values that a save would silently revert; missing/current scopes keep the blank-only edit protection.
- AI mount cost + flash accuracy — the five Settings/plugin lookups now run only on the connected mount (
mount/3fires twice), and an empty-source completion flashes an accurate message instead of “Translated”.
Tests
- New
translations_test.exs+translate_resource_worker_test.exs(argument validation, deterministic-failure discard, broadcast fan-out, merge + source-lang semantics, overwrite-flag propagation),ai_translate_form_helpers_test.exs+ai_translate_bar_test.exs(missing-language detection, merge policy, scope/visibility), and anembedding_test.exsregression that grepslib/for any@phoenix_kit_*bang-form reference.
Projects 0.5.0. Install or update: {:phoenix_kit_projects, "~> 0.5"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.