Skip to content

feat: Email sending delays#2908

Open
Elouan1411 wants to merge 20 commits into
mainfrom
email-sending-delays
Open

feat: Email sending delays#2908
Elouan1411 wants to merge 20 commits into
mainfrom
email-sending-delays

Conversation

@Elouan1411
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 13:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a “send delay / cancel send” flow: when sending a draft, the API can return a cancel_resource URL allowing the app to show a cancellable “Email sent” snackbar for the configured cancellation period, and scheduled/sending items are reflected in the thread UI and settings.

Changes:

  • Add cancel_resource support to send-draft results and propagate it through the drafts worker pipeline to the UI.
  • Add a configurable cancellation period in Settings and apply it to draft sending (Draft.delay).
  • Update thread UI to better handle “scheduled message” vs “draft” states and show a “Sending…” indicator.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
app/src/main/res/values/strings.xml Adds “Sending…” and “Send cancelled” strings.
app/src/main/res/values-sv/strings.xml Swedish translations for new send-delay UI strings.
app/src/main/res/values-pt/strings.xml Portuguese translations for new send-delay UI strings.
app/src/main/res/values-pl/strings.xml Polish translations for new send-delay UI strings.
app/src/main/res/values-nl/strings.xml Dutch translations for new send-delay UI strings.
app/src/main/res/values-nb/strings.xml Norwegian Bokmål translations for new send-delay UI strings.
app/src/main/res/values-it/strings.xml Italian translations for new send-delay UI strings.
app/src/main/res/values-fr/strings.xml French translations for new send-delay UI strings.
app/src/main/res/values-fi/strings.xml Finnish translations for new send-delay UI strings.
app/src/main/res/values-es/strings.xml Spanish translations for new send-delay UI strings.
app/src/main/res/values-el/strings.xml Greek translations for new send-delay UI strings.
app/src/main/res/values-de/strings.xml German translations for new send-delay UI strings.
app/src/main/res/values-da/strings.xml Danish translations for new send-delay UI strings.
app/src/main/res/navigation/main_navigation.xml Adds navigation action to the cancel-delay setting screen from Settings.
app/src/main/res/layout/item_message.xml Adds a hidden “Sending…” TextView to show progress for scheduled/sending messages.
app/src/main/res/layout/fragment_settings.xml Adds the cancellation period row to the Settings screen.
app/src/main/java/com/infomaniak/mail/workers/MailActionsManager.kt Captures cancel_resource from send response and returns it in worker output data.
app/src/main/java/com/infomaniak/mail/workers/DraftsActionsWorker.kt Adds a new worker output key for cancel_resource.
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageViewModel.kt Applies the configured cancel delay to drafts when sending.
app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Adds unsendDraft() API call and refresh/snackbar handling after cancel.
app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Displays a cancellable “Email sent” snackbar with a custom duration based on cancel delay.
app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadAdapter.kt Adjusts draft/scheduled message UI behaviors and shows “Sending…” state.
app/src/main/java/com/infomaniak/mail/ui/main/SnackbarManager.kt Extends snackbar events to carry a custom duration.
app/src/main/java/com/infomaniak/mail/ui/main/settings/SettingsFragment.kt Shows cancellation period subtitle + navigates to cancel-delay setting.
app/src/main/java/com/infomaniak/mail/ui/main/settings/send/CancelDelaySettingFragment.kt Persists selected cancellation delay value.
app/src/main/java/com/infomaniak/mail/data/models/message/Message.kt Treats scheduled messages differently in expansion rules.
app/src/main/java/com/infomaniak/mail/data/models/draft/SendDraftResult.kt Adds nullable cancel_resource field to send-draft result.
app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/ThreadController.kt Avoids treating scheduled messages as drafts for draft-local-uuid linking.
app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/refreshStrategies/ThreadRecomputations.kt Excludes scheduled messages from “has drafts” recomputation.
app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/MessageController.kt Updates “not draft” query to include scheduled messages.
app/src/main/java/com/infomaniak/mail/data/api/ApiRepository.kt Adds unsendDraft() API call.
Comments suppressed due to low confidence (1)

app/src/main/java/com/infomaniak/mail/ui/main/settings/SettingsFragment.kt:55

  • These imports appear unused in this file (SendSettingsFragmentDirections, animatedNavigation). Please remove them to keep the file warning-free and avoid lint/ktlint failures.
import com.infomaniak.mail.ui.main.settings.send.SendSettingsFragmentDirections
import com.infomaniak.mail.utils.AccountUtils
import com.infomaniak.mail.utils.MyKSuiteDataUtils
import com.infomaniak.mail.utils.UiUtils.saveFocusWhenNavigatingBack
import com.infomaniak.mail.utils.extensions.animatedNavigation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/infomaniak/mail/ui/main/settings/SettingsFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Outdated
@Elouan1411 Elouan1411 force-pushed the email-sending-delays branch 2 times, most recently from cd97a97 to 00924d5 Compare May 21, 2026 12:29
Comment thread app/src/main/java/com/infomaniak/mail/data/api/ApiRepository.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/main/settings/SettingsFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/main/SnackbarManager.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt
@Elouan1411 Elouan1411 force-pushed the email-sending-delays branch from 37016e3 to 6b63b99 Compare May 27, 2026 11:45
@Elouan1411 Elouan1411 enabled auto-merge May 27, 2026 12:08
@Elouan1411 Elouan1411 force-pushed the email-sending-delays branch from 6b63b99 to b10e15a Compare May 27, 2026 12:16
@Elouan1411 Elouan1411 marked this pull request as draft May 28, 2026 07:39
auto-merge was automatically disabled May 28, 2026 07:39

Pull request was converted to draft

@Elouan1411 Elouan1411 force-pushed the email-sending-delays branch from b10e15a to 645c5cc Compare May 28, 2026 07:39
@Elouan1411 Elouan1411 marked this pull request as ready for review May 28, 2026 07:57
@Elouan1411 Elouan1411 force-pushed the email-sending-delays branch 4 times, most recently from c9fac96 to 90f1602 Compare June 1, 2026 13:37
Comment thread app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadAdapter.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/main/SnackbarManager.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Outdated
@Elouan1411 Elouan1411 force-pushed the email-sending-delays branch from 90f1602 to de2ac54 Compare June 2, 2026 11:44
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Outdated
@Elouan1411 Elouan1411 force-pushed the email-sending-delays branch from de2ac54 to 023d26a Compare June 2, 2026 13:05
@Elouan1411 Elouan1411 force-pushed the email-sending-delays branch from 023d26a to 4db3b03 Compare June 2, 2026 13:23
@Elouan1411 Elouan1411 force-pushed the email-sending-delays branch from 4db3b03 to 34582c2 Compare June 2, 2026 13:59
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants