Skip to content

feat: modernize FetchingMailSettings#11044

Merged
wmontwe merged 25 commits into
thunderbird:mainfrom
shamim-emon:fix-issue-11040
Jun 16, 2026
Merged

feat: modernize FetchingMailSettings#11044
wmontwe merged 25 commits into
thunderbird:mainfrom
shamim-emon:fix-issue-11040

Conversation

@shamim-emon

@shamim-emon shamim-emon commented May 25, 2026

Copy link
Copy Markdown
Collaborator

This PR migrates the Fetching Mail Settings screen (including the Advanced version) from the old XML to Jetpack Compose. It is part of the ongoing Thunderbird for Android UI modernization effort and fully replaces the legacy UI while preserving all existing functionality.

What changed

  • Added a new reusable Compose component ActionText (with preview) and integrated it into SettingItem

  • Added necessary string resources and FetchingMailSettingsId

  • Updated Gradle dependencies, navigation (AccountSettingsRoute, FeatureLauncherTarget), and legacy AccountSettingsFragment

  • Introduced the full Compose architecture:

  • FetchingMailSettingsContract

  • FetchingMailSettingsBuilder

  • UpdateFetchingMailSettings UseCase + implementation

  • FetchingMailSettingsViewModel

  • FetchingMailSettingsContent / FetchingMailSettingsScreen

  • AdvancedFetchingMailSettingsContent / AdvancedFetchingMailSettingsScreen

  • Follows the established MVI (Model-View-Intent) architecture with Unidirectional Data Flow (UDF) using the Contract pattern already adopted across the app

  • Added unit tests for the builder, ViewModel, and UseCase

@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Validation Passed: All report and feature-flag labels are correctly set.

@shamim-emon shamim-emon added the report: include Include changes in user-facing reports. label May 25, 2026

@wmontwe wmontwe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I noticed that selecting "all messages" for "Local folder size" crashes with:

FATAL EXCEPTION: main
Process: net.thunderbird.android.debug, PID: 28075
java.lang.NumberFormatException: For input string: "all"
	at java.lang.Integer.parseInt(Integer.java:781)
	at java.lang.Integer.parseInt(Integer.java:897)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsViewModel$event$1.invokeSuspend(FetchingMailSettingsViewModel.kt:82)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:375)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
	at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:358)
	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:134)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:53)
	at kotlinx.coroutines.BuildersKt.launch(Unknown Source:1)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:44)
	at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source:1)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsViewModel.event(FetchingMailSettingsViewModel.kt:77)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsViewModel.event(FetchingMailSettingsViewModel.kt:25)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsScreenKt$FetchingMailSettingsScreen$$inlined$observe$1.invoke(UnidirectionalViewModel.kt:91)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsScreenKt$FetchingMailSettingsScreen$$inlined$observe$1.invoke(UnidirectionalViewModel.kt:91)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsScreenKt.FetchingMailSettingsScreen$lambda$2$0(FetchingMailSettingsScreen.kt:62)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsScreenKt.$r8$lambda$pw_EuYy65ZLZRboTGXTpMlP1X1w(Unknown Source:0)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsScreenKt$$ExternalSyntheticLambda1.invoke(D8$$SyntheticClass:0)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsContentKt.handleSettingChange(FetchingMailSettingsContent.kt:114)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsContentKt.FetchingMailSettingsContent$lambda$4$0(FetchingMailSettingsContent.kt:46)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsContentKt.$r8$lambda$HfQQi4skxu_JhLB-bQs0nx0cLqA(Unknown Source:0)
	at net.thunderbird.feature.account.settings.impl.ui.fetchingMail.FetchingMailSettingsContentKt$$ExternalSyntheticLambda5.invoke(D8$$SyntheticClass:0)
	at net.thunderbird.core.ui.setting.dialog.ui.DialogSettingViewKt.DialogSettingView$lambda$8$0(DialogSettingView.kt:65)
	at net.thunderbird.core.ui.setting.dialog.ui.DialogSettingViewKt.$r8$lambda$7htRzfBqr7chm_wiE21baDwxgpg(Unknown Source:0)
	at net.thunderbird.core.ui.setting.dialog.ui.DialogSettingViewKt$$ExternalSyntheticLambda4.invoke(D8$$SyntheticClass:0)
	at net.thunderbird.core.ui.setting.dialog.ui.components.dialog.value.SelectDialogViewKt.SelectDialogView$lambda$5$0(SelectDialogView.kt:32)
	at net.thunderbird.core.ui.setting.dialog.ui.components.dialog.value.SelectDialogViewKt.$r8$lambda$RZTkFonzeZ3waNIsR5a1CfCYHDQ(Unknown Source:0)
	at net.thunderbird.core.ui.setting.dialog.ui.components.dialog.value.SelectDialogViewKt$$ExternalSyntheticLambda2.invoke(D8$$SyntheticClass:0)
	at androidx.compose.foundation.ClickableNode.onPointerEvent-H0pRuoY(Clickable.kt:935)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:446)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:432)
	at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:285)

@wmontwe

wmontwe commented Jun 12, 2026

Copy link
Copy Markdown
Member

When I change "Fetch messages up to" the shown dialog cuts of the "any size (no limit)" selection at the bottom:

grafik

@wmontwe wmontwe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your great work!

I think some of the mappings could be simplyfied and there are bugs with the setting option I commented earlier on.

@shamim-emon shamim-emon requested a review from wmontwe June 13, 2026 19:01
@wmontwe wmontwe changed the title Modernize FetchingMailSettings feat: modernize FetchingMailSettings Jun 16, 2026

@wmontwe wmontwe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@wmontwe wmontwe merged commit 4d9d659 into thunderbird:main Jun 16, 2026
18 checks passed
@thunderbird-botmobile thunderbird-botmobile Bot added this to the Thunderbird 21 milestone Jun 16, 2026
@shamim-emon shamim-emon deleted the fix-issue-11040 branch June 16, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

report: include Include changes in user-facing reports.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modernize Fetching Mail Settings Using Jetpack Compose

2 participants