feat: Translate an email#2905
Open
Elouan1411 wants to merge 26 commits into
Open
Conversation
…e translation features ^ Conflicts: ^ app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadFragment.kt
…summary is already saved in Realm
There was a problem hiding this comment.
Pull request overview
Adds an "Translate an email" feature powered by Euria. A new translate action is exposed in the message/thread bottom sheets, the AI banner block is reworked to support multiple AI actions (summary + translate) side by side, the message Body model gains a translatedValue field, and a new aiTranslate API call is added.
Changes:
- Introduce translate action UI (icon, action item, banner state, "show original" flow) and persist
translatedValueonBody. - Refactor
InformationBlockView,ThreadAdapter, andThreadFragmentto handle two parallel AI banners (summary/translate) with a shared dismiss/retry/state pipeline and a newDismissedstate. - Add
OPEN_AI_TRANSLATE_BOTTOM_SHEETnavigation,aiTranslateAPI endpoint, translated strings in all locales, andisAlready{Translated,Summarized}nav args.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values*/strings.xml | New translate-related strings across all locales. |
| app/src/main/res/values/dimens.xml | Adds marginComplementaryButton dimension. |
| app/src/main/res/navigation/main_navigation.xml | Adds isAlreadyTranslated/isAlreadySummarized args to message/thread action dialogs. |
| app/src/main/res/layout/view_information_block.xml | Converts to ConstraintLayout to support close button + button progress layout. |
| app/src/main/res/layout/item_message.xml | Replaces single AI banner with two InformationBlockViews for summary and translate. |
| app/src/main/res/layout/item_bottom_sheet_action.xml | Applies disabled tint/text colors. |
| app/src/main/res/layout/bottom_sheet_actions_menu.xml | Adds "Translate" action item. |
| app/src/main/res/drawable/ic_translate.xml | New translate icon. |
| views/InformationBlockView.kt | New properties/helpers (close button, animation, button progress, margins). |
| utils/MessageBodyUtils.kt | Adds (currently unused) imports. |
| utils/ErrorCode.kt | Adds TRANSLATION_TARGET_SAME_AS_SOURCE. |
| ui/main/thread/ThreadViewModel.kt | Splits/handles translated body, adds save/remove translation methods. |
| ui/main/thread/ThreadState.kt | Adds translate state map, cached translated split bodies, Dismissed state. |
| ui/main/thread/ThreadFragment.kt | Wires translate flow, dismissal, banners and per-action retry timers. |
| ui/main/thread/ThreadAdapter.kt | Generalizes banner binding for SUMMARY/TRANSLATE; uses new InformationBlockView API. |
| ui/main/thread/PrintMailFragment.kt | Exposes aiTranslateStateMap. |
| ui/main/thread/actions/*BottomSheetDialog.kt + ActionItemView.kt + MailActionsBottomSheetDialog.kt | Translate action handler, enabled/visibility helpers, disabled state for ActionItemView. |
| MatomoMail.kt | Adds Translate Matomo name. |
| data/models/message/Body.kt | Adds translatedValue and isTranslated. |
| data/api/ApiRoutes.kt + ApiRepository.kt | Adds aiTranslate endpoint and call. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a846843 to
7b12c2b
Compare
b3fe527 to
53f899b
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.