Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a188c82
feat: Add reply Euria button and ask Euria icon on top bar
solrubado Jul 14, 2026
1b15ecd
fix: Remove euria bottom for thread actions
solrubado Jul 16, 2026
9a3fe64
feat: Add reply euria bottomsheet for threadFragment and open ai prop…
solrubado Jul 17, 2026
7a502a4
fix: Restart proposition when navigating to proposition fragment
solrubado Jul 17, 2026
1b676c2
fix: Update and add copyright
solrubado Jul 17, 2026
7679e01
fix: Improve mailbox logic and give last message content as context t…
solrubado Jul 17, 2026
4fcc179
feat: Add new body content payload
Elouan1411 Jul 24, 2026
5ee059e
feat: Insert AI suggestion in new message
Elouan1411 Jul 24, 2026
a27c5aa
fix: Use REPLY_ALL
Elouan1411 Jul 24, 2026
4891678
fix: Remove prompt when reopening bottom sheet
Elouan1411 Jul 24, 2026
72c3af5
fix: Make the "Edit my request" button work
Elouan1411 Jul 24, 2026
2b6f026
fix: Do not use navigation to send the AI body
Elouan1411 Jul 27, 2026
2a4a0c0
fix: Make the "retry" button work
Elouan1411 Jul 27, 2026
630063c
feat: Add trailing content
Elouan1411 Jul 27, 2026
0798619
feat: Add new feature badge
Elouan1411 Jul 27, 2026
d76140a
fix: Add Copilot suggestions
Elouan1411 Jul 27, 2026
4ab3fe4
fix: Load and convert message.body using the same plain-text logic be…
Elouan1411 Jul 27, 2026
b98af19
fix: Change check to see if aiPrompt is hosted by NewMessageActivity …
solrubado Jul 29, 2026
e78ddbb
fix: Display new aiPrompt in loadingPlaceholder when using the "edit …
Elouan1411 Jul 29, 2026
98b3fcd
feat: Add ask euria button
Elouan1411 Jul 31, 2026
2d6c74e
fix: Replace date formatting to reduce space usage
Elouan1411 Jul 31, 2026
215096d
feat: Add matomo
Elouan1411 Jul 31, 2026
0cf75c6
refactor: Delete cache once it is no longer useful and remove the pair
Elouan1411 Aug 3, 2026
d5f4ae3
fix: Use email if name is not provided to avoid Euria error with empt…
Elouan1411 Aug 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/src/main/java/com/infomaniak/mail/MatomoMail.kt
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ object MatomoMail : Matomo {
ReplyMaybe("replyMaybe"),
ReplyNo("replyNo"),
ReplyYes("replyYes"),
ReplyWithEuria("replyWithEuria"),
ReprogramSchedule("reprogramSchedule"),
RequestPassword("requestPassword"),
Restore("restore"),
Expand Down Expand Up @@ -327,6 +328,7 @@ object MatomoMail : Matomo {
Summarize("summarize"),
Translate("translate"),
AskEuria("askEuria"),
AskEuriaShortCut("askEuriaShortCut"),
Switch("switch"),
SwitchAccount("switchAccount"),
SwitchColor("switchColor"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class LocalSettings private constructor(context: Context) : SharedValues {

override val sharedPreferences = context.applicationContext.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE)!!

var alreadyUsedReplyWithEuria by sharedValue("alreadyUsedReplyWithEuriaKey", false)
var cancelDelay by sharedValue("cancelDelayKey", 10)
var emailForwarding by sharedValue("emailForwardingKey", EmailForwarding.IN_BODY)
var includeMessageInReply by sharedValue("includeMessageInReplyKey", true)
Expand Down
27 changes: 27 additions & 0 deletions app/src/main/java/com/infomaniak/mail/data/cache/AiDraftCache.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Infomaniak Mail - Android
* Copyright (C) 2026 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.mail.data.cache

import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class AiDraftCache @Inject constructor() {
var pendingAiSubject: String? = null
var pendingAiContent: String? = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,10 @@ class ThreadAdapter(
isVisible = isExpanded && !message.isScheduledDraft && !message.isScheduledMessage
setOnClickListener { threadAdapterCallbacks?.onMenuClicked?.invoke(message) }
}
askEuriaButton.apply {
isVisible = isExpanded && !message.isScheduledDraft && !message.isScheduledMessage
setOnClickListener { threadAdapterCallbacks?.onAskEuriaClicked?.invoke(message) }
}
sendingProgressText.isVisible = message.isScheduledMessage

recipient.text = if (isExpanded) getAllRecipientsFormatted(message) else context.formatSubject(message.subject)
Expand Down Expand Up @@ -1404,6 +1408,7 @@ class ThreadAdapter(
var onAiBannerClose: ((messageUid: String, aiAction: AiAction) -> Unit)? = null,
var onShowOriginal: ((messageUid: String) -> Unit)? = null,
var getAiState: (() -> AiStateMap)? = null,
var onAskEuriaClicked: ((message: Message) -> Unit)? = null,
)

enum class DisplayType(val layout: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ import com.infomaniak.mail.ui.main.thread.actions.AskEuriaBottomSheetDialogArgs
import com.infomaniak.mail.ui.main.thread.actions.AttachmentActionsBottomSheetDialogArgs
import com.infomaniak.mail.ui.main.thread.actions.ConfirmationToBlockUserDialog
import com.infomaniak.mail.ui.main.thread.actions.EmojiReactionsViewModel
import com.infomaniak.mail.ui.main.thread.actions.EuriaPromptBottomSheetArgs
import com.infomaniak.mail.ui.main.thread.actions.JunkMessagesViewModel
import com.infomaniak.mail.ui.main.thread.actions.MessageActionsBottomSheetDialogArgs
import com.infomaniak.mail.ui.main.thread.actions.ReplyBottomSheetDialogArgs
Expand All @@ -125,6 +126,8 @@ import com.infomaniak.mail.ui.main.thread.actions.ThreadActionsBottomSheetDialog
import com.infomaniak.mail.ui.main.thread.calendar.AttendeesBottomSheetDialogArgs
import com.infomaniak.mail.ui.main.thread.encryption.UnencryptableRecipientsBottomSheetDialogArgs
import com.infomaniak.mail.ui.main.thread.models.MessageUi
import com.infomaniak.mail.ui.newMessage.AiPropositionFragmentArgs
import com.infomaniak.mail.ui.newMessage.AiViewModel
import com.infomaniak.mail.utils.FolderRoleUtils
import com.infomaniak.mail.utils.PermissionUtils
import com.infomaniak.mail.utils.SharedUtils
Expand Down Expand Up @@ -221,6 +224,7 @@ class ThreadFragment : Fragment(), PickerEmojiObserver {
private val junkMessagesViewModel: JunkMessagesViewModel by activityViewModels()
private val twoPaneViewModel: TwoPaneViewModel by activityViewModels()
private val threadViewModel: ThreadViewModel by viewModels()
private val aiViewModel: AiViewModel by activityViewModels()
private val aiActionsViewModel: AiActionsViewModel by viewModels()
private val actionsViewModel: ActionsViewModel by activityViewModels()
private val emojiReactionsViewModel: EmojiReactionsViewModel by viewModels()
Expand Down Expand Up @@ -491,6 +495,9 @@ class ThreadFragment : Fragment(), PickerEmojiObserver {
onAiBannerClose = { messageUid, aiAction -> aiActionsViewModel.dismissAiAction(messageUid, aiAction) },
onShowOriginal = { messageUid -> aiActionsViewModel.dismissAiAction(messageUid, AiAction.TRANSLATE) },
getAiState = { aiActionsViewModel.aiStateMap.value },
onAskEuriaClicked = { message ->
trackMessageActionsEvent(MatomoName.AskEuriaShortCut)
navigateToAskEuriaBottomSheet(message.uid) },
),
)

Expand Down Expand Up @@ -915,6 +922,27 @@ class ThreadFragment : Fragment(), PickerEmojiObserver {
aiActionsViewModel.doAiAction(messageUid, AiAction.TRANSLATE)
}
}

getBackNavigationResult<AiActionNavigationResult>(OPEN_AI_REPLY_BOTTOM_SHEET) { (messageUid, _) ->
aiViewModel.resetAiState()
safeNavigate(
resId = R.id.euriaPromptBottomSheetDialog,
args = EuriaPromptBottomSheetArgs(
messageUid = messageUid
).toBundle(),
)
}

getBackNavigationResult(OPEN_AI_REPLY_PROPOSITION) { messageUid: String ->
aiViewModel.aiPropositionStatusLiveData.value = null
safeNavigate(
resId = R.id.aiPropositionFragment, args = AiPropositionFragmentArgs(
isSubjectBlank = true,
isBodyBlank = true,
messageUid = messageUid
).toBundle()
Comment thread
solrubado marked this conversation as resolved.
)
}
}

private fun executeSavedSnoozeScheduleType(timestamp: Long) {
Expand Down Expand Up @@ -1389,8 +1417,10 @@ class ThreadFragment : Fragment(), PickerEmojiObserver {

const val OPEN_REACTION_BOTTOM_SHEET = "openReactionBottomSheet"
const val OPEN_AI_ACTIONS_BOTTOM_SHEET = "openAiActionsBottomSheet"
const val OPEN_AI_REPLY_BOTTOM_SHEET = "openAiReplyPromptBottomSheet"
const val OPEN_AI_SUMMARY_BOTTOM_SHEET = "openAiSummaryBottomSheet"
const val OPEN_AI_TRANSLATE_BOTTOM_SHEET = "openAiTranslateBottomSheet"
const val OPEN_AI_REPLY_PROPOSITION = "openAiReplyProposition"

private fun allAttachmentsFileName(subject: String) = "infomaniak-mail-attachments-$subject.zip"
private fun allSwissTransferFilesName(subject: String) = "infomaniak-mail-swisstransfer-$subject.zip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ class ActionItemView @JvmOverloads constructor(
setTrailingContentUi(value)
}

var newFeatureBadgeVisible: Boolean
get() = binding.newFeatureBadge.isVisible
set(value) {
binding.newFeatureBadge.isVisible = value
}

init {
attrs?.getAttributes(context, R.styleable.ActionItemView) {
with(binding) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,36 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.navArgs
import com.infomaniak.core.ksuite.data.KSuite
import com.infomaniak.core.legacy.utils.safeBinding
import com.infomaniak.core.legacy.utils.setBackNavigationResult
import com.infomaniak.mail.MatomoMail.MatomoName
import com.infomaniak.mail.MatomoMail.trackBottomSheetThreadActionsEvent
import com.infomaniak.mail.data.LocalSettings
import com.infomaniak.mail.data.models.extensions.kSuite
import com.infomaniak.mail.databinding.BottomSheetAskEuriaActionsBinding
import com.infomaniak.mail.ui.MainViewModel
import com.infomaniak.mail.ui.main.thread.AiActionNavigationResult
import com.infomaniak.mail.ui.main.thread.ThreadFragment.Companion.OPEN_AI_REPLY_BOTTOM_SHEET
import com.infomaniak.mail.ui.main.thread.ThreadFragment.Companion.OPEN_AI_SUMMARY_BOTTOM_SHEET
import com.infomaniak.mail.ui.main.thread.ThreadFragment.Companion.OPEN_AI_TRANSLATE_BOTTOM_SHEET
import com.infomaniak.mail.ui.main.thread.actions.ActionItemView.TrailingContent
import com.infomaniak.mail.ui.main.thread.actions.multiselection.MultiselectionViewModel
import com.infomaniak.mail.utils.openKSuiteProBottomSheet
import com.infomaniak.mail.utils.openMailPremiumBottomSheet
import com.infomaniak.mail.utils.openMyKSuiteUpgradeBottomSheet
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class AskEuriaBottomSheetDialog : ActionsBottomSheetDialog() {

private var binding: BottomSheetAskEuriaActionsBinding by safeBinding()
override val multiselectionViewModel: MultiselectionViewModel by activityViewModels()
private val mainViewModel: MainViewModel by activityViewModels()

@Inject
lateinit var localSettings: LocalSettings
private val navigationArgs: AskEuriaBottomSheetDialogArgs by navArgs()

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
Expand All @@ -55,6 +71,41 @@ class AskEuriaBottomSheetDialog : ActionsBottomSheetDialog() {
trackBottomSheetThreadActionsEvent(MatomoName.Translate)
setBackNavigationResult(OPEN_AI_TRANSLATE_BOTTOM_SHEET, AiActionNavigationResult(messageUid, isAlreadyTranslated))
}

setupReplyAction(messageUid)
}

private fun setupReplyAction(messageUid: String) {
val mailbox = mainViewModel.currentMailbox.value
val kSuite = mailbox?.kSuite

val matomoName = MatomoName.AiWriter.value
binding.reply.trailingContent = when (kSuite) {
KSuite.Perso.Free -> TrailingContent.KSuitePersoChip
KSuite.Pro.Free, KSuite.StarterPack -> TrailingContent.KSuiteProChip
else -> {
binding.reply.newFeatureBadgeVisible = !localSettings.alreadyUsedReplyWithEuria
TrailingContent.None
}
}

if (binding.reply.trailingContent != TrailingContent.None) {
binding.reply.setOnClickListener {
when (kSuite) {
KSuite.Perso.Free -> openMyKSuiteUpgradeBottomSheet(matomoName)
KSuite.Pro.Free -> openKSuiteProBottomSheet(kSuite, mailbox.isAdmin, matomoName)
KSuite.StarterPack -> openMailPremiumBottomSheet(matomoName)
else -> Unit
}
}
} else {
binding.reply.setOnClickListener {
trackBottomSheetThreadActionsEvent(MatomoName.ReplyWithEuria)
localSettings.alreadyUsedReplyWithEuria = true
binding.reply.newFeatureBadgeVisible = false
setBackNavigationResult(OPEN_AI_REPLY_BOTTOM_SHEET, AiActionNavigationResult(messageUid, false))
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Infomaniak Mail - Android
* Copyright (C) 2026 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.mail.ui.main.thread.actions

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.navArgs
import com.infomaniak.core.legacy.utils.safeBinding
import com.infomaniak.core.legacy.utils.setBackNavigationResult
import com.infomaniak.mail.R
import com.infomaniak.mail.databinding.ViewAiPromptBinding
import com.infomaniak.mail.ui.bottomSheetDialogs.EdgeToEdgeBottomSheetDialog
import com.infomaniak.mail.ui.main.thread.ThreadFragment.Companion.OPEN_AI_REPLY_PROPOSITION
import com.infomaniak.mail.ui.newMessage.AiViewModel
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class EuriaPromptBottomSheet : EdgeToEdgeBottomSheetDialog() {

private var binding: ViewAiPromptBinding by safeBinding()
private val aiViewModel: AiViewModel by activityViewModels()
private val navigationArgs: EuriaPromptBottomSheetArgs by navArgs()

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
return ViewAiPromptBinding.inflate(inflater, container, false).also { binding = it }.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

binding.root.bind(
prompt = aiViewModel.aiPrompt,
placeholder = getString(R.string.aiPromptAnswer),
onCloseClick = { dismiss() },
onGenerateClick = {
setBackNavigationResult(OPEN_AI_REPLY_PROPOSITION, navigationArgs.messageUid)
},
onPromptChanged = { aiViewModel.aiPrompt = it },
)
binding.root.focusPrompt()
}
}
Loading
Loading