Skip to content

feat: Add Ui on newMessageFragment - #2989

Open
Elouan1411 wants to merge 27 commits into
protected/reminderfrom
draft-send-options
Open

feat: Add Ui on newMessageFragment#2989
Elouan1411 wants to merge 27 commits into
protected/reminderfrom
draft-send-options

Conversation

@Elouan1411

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a unified send-options screen to the new-message flow, combining scheduled sending with response reminders.

Changes:

  • Adds reminder configuration, feature flag, UI, and translations.
  • Replaces the scheduling bottom sheet with a full send-options screen.
  • Refactors reusable scheduling and settings components.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
OldKotlin/realm-models/.../FeatureFlag.kt Adds the response-reminder flag.
app/src/main/res/values/strings.xml Adds English send-option strings.
app/src/main/res/values-{da,de,el,es,fi,fr,it,nb,nl,pl,pt,sv}/strings.xml Adds localized send-option strings.
app/src/main/res/values/dimens.xml Adds option-content padding.
app/src/main/res/values/attrs.xml Adds configurable icon tint.
app/src/main/res/navigation/new_message_navigation.xml Registers the send-options screen.
app/src/main/res/navigation/main_navigation.xml Updates rescheduling navigation.
app/src/main/res/layout/view_setting_radio_button.xml Adds radio-option descriptions.
app/src/main/res/layout/view_item_setting.xml Adds checkmark and chip containers.
app/src/main/res/layout/fragment_send_options.xml Defines the send-options screen.
app/src/main/res/layout/fragment_new_message.xml Adds schedule and reminder alerts.
app/src/main/java/com/infomaniak/mail/utils/extensions/ViewExt.kt Adds child-padding support.
app/src/main/java/com/infomaniak/mail/utils/date/DateFormatUtils.kt Formats reminder delays.
app/src/main/java/com/infomaniak/mail/ui/newMessage/SendOptionsConfig.kt Defines schedule and reminder state.
app/src/main/java/com/infomaniak/mail/ui/newMessage/sendOptions/DraftSendOptionsFragment.kt Implements send-option selection.
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageViewModel.kt Stores send-option state.
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt Integrates options into composition.
app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadFragment.kt Updates rescheduling references.
app/src/main/java/com/infomaniak/mail/ui/main/settings/SettingRadioGroupView.kt Adds selection clearing.
app/src/main/java/com/infomaniak/mail/ui/main/settings/SettingRadioButtonView.kt Supports descriptions and dynamic items.
app/src/main/java/com/infomaniak/mail/ui/main/settings/ItemSettingView.kt Supports icon tint and checkmarks.
app/src/main/java/com/infomaniak/mail/ui/bottomSheetDialogs/SnoozeBottomSheetDialog.kt Uses the refactored picker.
app/src/main/java/com/infomaniak/mail/ui/bottomSheetDialogs/SimpleSchedulePickerBottomSheet.kt Extracts shared picker behavior.
app/src/main/java/com/infomaniak/mail/ui/bottomSheetDialogs/ScheduleOptionsHelper.kt Generalizes schedule-option setup.
app/src/main/java/com/infomaniak/mail/ui/bottomSheetDialogs/RescheduleDraftBottomSheetDialog.kt Renames and updates rescheduling UI.

Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt Outdated
Comment thread app/src/main/res/layout/fragment_send_options.xml Outdated
@Elouan1411
Elouan1411 force-pushed the draft-send-options branch 3 times, most recently from d726ad9 to cadfe60 Compare July 23, 2026 13:00

@FabianDevel FabianDevel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

First review

Comment thread app/src/main/res/layout/fragment_send_options.xml Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt Outdated
Comment thread app/src/main/res/layout/fragment_send_options.xml Outdated
Comment thread app/src/main/res/values/dimens.xml Outdated
<dimen name="maxHorizontalSwipeTolerance">100dp</dimen>
<dimen name="minVerticalSwipeDistance">32dp</dimen>
<dimen name="marginComplementaryButton">2dp</dimen>
<dimen name="emptyStatePadding">55dp</dimen>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a highly suspicious number.
Are you sure it should not be 56 ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is it named emptyStatePadding ? it's not used for an emptySpate

Comment thread app/src/main/res/values-nb/strings.xml
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageViewModel.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageFragment.kt Outdated
@Elouan1411
Elouan1411 force-pushed the draft-send-options branch 10 times, most recently from a71954a to 5bf0778 Compare July 31, 2026 08:16
customDelayReminder.setCheckMark(displayCheckMark = false)
customDelayReminder.removeSubtitle()
newMessageViewModel.setReminderConfig(
if (minutes != null && isKnownPreset) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add reminderConfig = argument name

.filterIsInstance<SettingRadioButtonView>()
.firstOrNull { it.associatedValue == scheduleStr }

when {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Extract this when in a function to avoid nested when and simplify the code

Comment on lines +269 to +271
customScheduleOption.setCheckMark(displayCheckMark = false)
customScheduleOption.removeSubtitle()
scheduleOptions.check(matchedOption.id)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Extract to a function to avoid duplicating code in the when clauses

@@ -187,33 +182,29 @@ class DraftSendOptionsFragment : Fragment() {
optionsDelays.onItemCheckedListener { _, value, _ ->
val minutes = value?.toIntOrNull()
val isKnownPreset = ReminderPreset.entries.any { preset -> preset.delayMinutes == minutes }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

isValidPreset

Comment on lines +301 to +303
customDelayReminder.setSubtitle(requireContext().formatDelayText(reminderConfig.delayMinutes))
customDelayReminder.setCheckMark(displayCheckMark = true)
optionsDelays.clearCheck()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same, factorize in one function

@Elouan1411
Elouan1411 force-pushed the draft-send-options branch from 5bf0778 to d6a570e Compare July 31, 2026 12:33
@sonarqubecloud

Copy link
Copy Markdown

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.

3 participants