feat: Attachments reminder alert added#2857
Conversation
PR Reviewer Guide 🔍(Review updated until commit d822e16)Here are some key observations to aid the review process:
|
|
Failed to generate code suggestions for PR |
b1e411e to
8626072
Compare
|
Failed to generate code suggestions for PR |
0507f65 to
b06d87c
Compare
|
Failed to generate code suggestions for PR |
Ajout des regex dans les 13 langues pour détecter dans le corp du mail l'intention d'envoyer une piece jointe Récupération des textes de descriptions pour la boite de dialogue depuis loco Ajout des variable dans Matomo Ajout du OnDismiss dans les DescriptionAlertDialog
Refactor du code pour être plus lisible
Use a JS function to retrieve only the body instead of everything
902aa96 to
d822e16
Compare
|
Persistent review updated to latest commit d822e16 |
|
Failed to generate code suggestions for PR |
fd4c9cf to
433c325
Compare
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
Pull request overview
Adds an “attachment reminder” flow in the new-message composer: when the user mentions an attachment (via regex detection) but hasn’t added any file, the app prompts before sending.
Changes:
- Introduce a multi-language attachment-keyword regex utility and wire it into the send flow to show a confirmation dialog when no attachments are present.
- Replace the previous “is editor body empty” JS with a
getEditorBody()function used for both AI proposition logic and attachment detection. - Add localized strings and Matomo tracking events for the new reminder dialog.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
settings.gradle.kts |
Adds mavenLocal() to dependency resolution repositories. |
app/src/main/res/values*/strings.xml |
Adds title/description strings for the attachment reminder dialog (multiple locales). |
app/src/main/res/raw/get_editor_body.js |
Introduces getEditorBody() JS helper returning editor text (excluding signature/quotes). |
app/src/main/java/com/infomaniak/mail/utils/HtmlFormatter.kt |
Renames script loader to getEditorBodyScript() and points to the new raw script. |
app/src/main/java/com/infomaniak/mail/utils/AttachmentsReminderRegex.kt |
Adds AttachmentReminderUtils.hasAttachmentKeyword() with a combined multi-language regex. |
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageViewModel.kt |
Adds shouldShowAttachmentReminder() to centralize reminder condition. |
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt |
Fetches editor body via JS and shows subject/attachment confirmation dialogs before send. |
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageAiManager.kt |
Switches AI “body blank” calculation to getEditorBody() result. |
app/src/main/java/com/infomaniak/mail/ui/alertDialogs/DescriptionAlertDialog.kt |
Adds optional onDismiss callback support to dialog API. |
app/src/main/java/com/infomaniak/mail/MatomoMail.kt |
Adds Matomo events for sending without attachment (prompt + confirm). |
Comments suppressed due to low confidence (1)
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageAiManager.kt:48
- There are now unused imports (getEditorBodyScript and the INFOMANIAK_* class name constants) after switching to calling getEditorBody() directly. Kotlin treats unused imports as compilation errors, so these should be removed.
import com.infomaniak.mail.utils.HtmlFormatter.Companion.getEditorBodyScript
import com.infomaniak.mail.utils.MessageBodyUtils.INFOMANIAK_FORWARD_QUOTE_HTML_CLASS_NAME
import com.infomaniak.mail.utils.MessageBodyUtils.INFOMANIAK_REPLY_QUOTE_HTML_CLASS_NAME
import com.infomaniak.mail.utils.MessageBodyUtils.INFOMANIAK_SIGNATURE_HTML_CLASS_NAME
import com.infomaniak.mail.utils.WebViewUtils.Companion.evaluateJs
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…clarity - Change visibility of showSubjectDialog and showSubjectDialog from public to private - Rename regex variable from ALL_CAPS_WITH_UNDERSCORES to lowerCamelCase - Update body to isBodyBlank to better reflect its purpose
|
Failed to generate code suggestions for PR |
|
Failed to generate code suggestions for PR |
|
|
Failed to generate code suggestions for PR |



Ajout d'une boîte de dialogue lorsqu'une mention de pièce jointe (ou équivalent) est détectée par une expression régulière, afin de prévenir un éventuel oubli.