From 75478872c91f42ccba078f4ab26170e452f1ce7c Mon Sep 17 00:00:00 2001 From: Gothwad Tech Date: Sun, 22 Nov 2026 14:59:52 +0000 Subject: [PATCH 1/2] fix: the app is called Bansify Mail everywhere Reverts the accidental rename to Bansify Email: app label, signed-out and settings copy, error strings, the default signature, class comments, and the release workflow (job name and APK/AAB file names). --- .github/workflows/release.yml | 16 ++++++++-------- README.md | 8 ++++---- .../com/bansify/mail/auth/GothwadEndpoints.kt | 2 +- .../main/java/com/bansify/mail/auth/MailAuth.kt | 2 +- .../com/bansify/mail/auth/NativeAuthModels.kt | 2 +- .../com/bansify/mail/data/model/MailModels.kt | 2 +- .../bansify/mail/data/remote/MailApiClient.kt | 6 +++--- .../bansify/mail/data/remote/MailApiModels.kt | 4 ++-- .../bansify/mail/data/repository/MailMappers.kt | 4 ++-- .../mail/data/repository/MailRepository.kt | 2 +- .../mail/ui/components/AccountSwitcherDialog.kt | 2 +- .../mail/ui/components/MailNavigationDrawer.kt | 2 +- .../bansify/mail/ui/screens/NativeAuthSheet.kt | 2 +- .../bansify/mail/ui/screens/SettingsScreen.kt | 8 ++++---- .../bansify/mail/ui/screens/SignedOutScreen.kt | 6 +++--- .../bansify/mail/ui/viewmodel/MailViewModel.kt | 16 ++++++++-------- app/src/main/res/values/strings.xml | 4 ++-- tools/check_android_scaffold.py | 2 +- 18 files changed, 45 insertions(+), 45 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d89147..fc78cdc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ concurrency: jobs: release: - name: Build, Sign & Publish Bansify Email APK + name: Build, Sign & Publish Bansify Mail APK runs-on: ubuntu-latest timeout-minutes: 45 @@ -152,7 +152,7 @@ jobs: V_NAME="${{ steps.versioning.outputs.v_name }}" DEBUG_APK=$(find app/build/outputs/apk/debug/ -name "*.apk" | head -n 1 || true) if [ -n "$DEBUG_APK" ]; then - cp "$DEBUG_APK" "release_out/BansifyEmail-v${V_NAME}-Debug.apk" + cp "$DEBUG_APK" "release_out/BansifyMail-v${V_NAME}-Debug.apk" fi - name: Sign Release APK & AAB using Repository Keystore Secrets @@ -196,7 +196,7 @@ jobs: cp "$UNSIGNED_APK" "$UNALIGNED_TEMP" fi - RELEASE_APK="release_out/BansifyEmail-v${V_NAME}-Release.apk" + RELEASE_APK="release_out/BansifyMail-v${V_NAME}-Release.apk" "$APKSIGNER" sign \ --ks "$KS_PATH" \ --ks-key-alias "$ACTUAL_ALIAS" \ @@ -211,7 +211,7 @@ jobs: CERT_COLON=$(keytool -list -v -keystore "$KS_PATH" -alias "$ACTUAL_ALIAS" -storepass "$KEYSTORE_PASS" 2>/dev/null | grep -i "SHA256:" | head -n 1 | sed 's/.*SHA256: //I' | tr -d '\r' | xargs || true) CERT_HEX=$(echo "$CERT_COLON" | tr -d ':' | tr '[:upper:]' '[:lower:]') { - echo "### Bansify Email v${V_NAME} Release Signing Identity" + echo "### Bansify Mail v${V_NAME} Release Signing Identity" echo "- Package: \`com.bansify.mail\`" echo "- App Link SHA-256 (\`assetlinks.json\`): \`${CERT_COLON}\`" echo "- D1 \`ecosystem_apps\` SHA-256 (lowercase hex): \`${CERT_HEX}\`" @@ -219,7 +219,7 @@ jobs: fi if [ -n "$UNSIGNED_AAB" ]; then - RELEASE_AAB="release_out/BansifyEmail-v${V_NAME}-PlayStore.aab" + RELEASE_AAB="release_out/BansifyMail-v${V_NAME}-PlayStore.aab" cp "$UNSIGNED_AAB" "$RELEASE_AAB" jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \ -keystore "$KS_PATH" \ @@ -240,17 +240,17 @@ jobs: UNSIGNED_APK=$(find app/build/outputs/apk/release/ -name "*.apk" | head -n 1 || true) UNSIGNED_AAB=$(find app/build/outputs/bundle/release/ -name "*.aab" | head -n 1 || true) if [ -n "$UNSIGNED_APK" ]; then - cp "$UNSIGNED_APK" "release_out/BansifyEmail-v${V_NAME}-Release-UNSIGNED.apk" + cp "$UNSIGNED_APK" "release_out/BansifyMail-v${V_NAME}-Release-UNSIGNED.apk" fi if [ -n "$UNSIGNED_AAB" ]; then - cp "$UNSIGNED_AAB" "release_out/BansifyEmail-v${V_NAME}-PlayStore-UNSIGNED.aab" + cp "$UNSIGNED_AAB" "release_out/BansifyMail-v${V_NAME}-PlayStore-UNSIGNED.aab" fi - name: Write checksums run: | set -euo pipefail cd release_out - sha256sum BansifyEmail-* > SHA256SUMS.txt + sha256sum BansifyMail-* > SHA256SUMS.txt cat SHA256SUMS.txt - name: Upload Build Artifacts diff --git a/README.md b/README.md index 307e161..2ef3f1c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Bansify Email (Android) +# Bansify Mail (Android) -A Material 3 email client for **Bansify Email**, signed in with a **Bansify Account**. +A Material 3 email client for **Bansify Mail**, signed in with a **Bansify Account**. The app contains no demo or prototype data: every message, mailbox setting and account comes -from Bansify Accounts OAuth 2.0 and the Bansify Email Worker REST API. +from Bansify Accounts OAuth 2.0 and the Bansify Mail Worker REST API. ## Features @@ -182,7 +182,7 @@ Link plus the reverse-DNS custom scheme, and the PKCE `code_verifier` never leav ## Manual device checks -1. Cold start with no signed-in account shows the **Welcome to Bansify Email** screen (no demo +1. Cold start with no signed-in account shows the **Welcome to Bansify Mail** screen (no demo mail), with **Sign in with Bansify** and **Use another account**. 2. Signing in opens Custom Tabs; returning through `https://mail.bansify.com/oauth/callback` (or `com.bansify.mail:/oauth/callback`) lands on diff --git a/app/src/main/java/com/bansify/mail/auth/GothwadEndpoints.kt b/app/src/main/java/com/bansify/mail/auth/GothwadEndpoints.kt index 6282ac7..9b96f86 100644 --- a/app/src/main/java/com/bansify/mail/auth/GothwadEndpoints.kt +++ b/app/src/main/java/com/bansify/mail/auth/GothwadEndpoints.kt @@ -1,7 +1,7 @@ package com.bansify.mail.auth /** - * Authoritative Bansify Accounts and Bansify Email endpoints for the `gothwad-mail` client. + * Authoritative Bansify Accounts and Bansify Mail endpoints for the `gothwad-mail` client. * * Values mirror the registration in `Bansify/accounts` and the Mail Worker contract in * `Bansify/mail`. Nothing here is user configurable at runtime: a wrong host would either diff --git a/app/src/main/java/com/bansify/mail/auth/MailAuth.kt b/app/src/main/java/com/bansify/mail/auth/MailAuth.kt index a59dce5..ed2f33a 100644 --- a/app/src/main/java/com/bansify/mail/auth/MailAuth.kt +++ b/app/src/main/java/com/bansify/mail/auth/MailAuth.kt @@ -24,7 +24,7 @@ import kotlinx.coroutines.flow.stateIn /** * Mail's thin facade over the shared Bansify Accounts SDK (`com.github.Bansify.accountsapp:core`). * - * Bansify Email no longer ships its own PKCE client, encrypted token store, callback activity or + * Bansify Mail no longer ships its own PKCE client, encrypted token store, callback activity or * peer broker. The SDK owns credentials, refresh, cross-app discovery and the account centre, so the * sign-in experience is identical in every Bansify app. This class only translates SDK state into * the model types the Mail UI already renders. diff --git a/app/src/main/java/com/bansify/mail/auth/NativeAuthModels.kt b/app/src/main/java/com/bansify/mail/auth/NativeAuthModels.kt index 8902d0d..56d227e 100644 --- a/app/src/main/java/com/bansify/mail/auth/NativeAuthModels.kt +++ b/app/src/main/java/com/bansify/mail/auth/NativeAuthModels.kt @@ -6,7 +6,7 @@ import kotlinx.serialization.Serializable /** * Wire models for the Bansify Accounts native mobile auth API (`/api/mobile/auth/{endpoint}`). * - * These endpoints authenticate straight from the app over OkHttp, so Bansify Email can sign a user + * These endpoints authenticate straight from the app over OkHttp, so Bansify Mail can sign a user * in even when the device has no browser installed. The browser (Custom Tabs) OAuth flow stays * available as a secondary option and both paths produce the same [TokenResponse] pair. */ diff --git a/app/src/main/java/com/bansify/mail/data/model/MailModels.kt b/app/src/main/java/com/bansify/mail/data/model/MailModels.kt index c94890f..84ee5ec 100644 --- a/app/src/main/java/com/bansify/mail/data/model/MailModels.kt +++ b/app/src/main/java/com/bansify/mail/data/model/MailModels.kt @@ -192,7 +192,7 @@ data class MailAccountEntity( val starredMessages: Int = 0, val retentionLimit: Int = 500, val unreadCount: Int = 0, - val signature: String = "Sent from Bansify Email", + val signature: String = "Sent from Bansify Mail", val vacationEnabled: Boolean = false, val vacationMessage: String = "Thanks for your email. I am currently away and will respond soon.", val isActive: Boolean = false diff --git a/app/src/main/java/com/bansify/mail/data/remote/MailApiClient.kt b/app/src/main/java/com/bansify/mail/data/remote/MailApiClient.kt index 5fc682a..997e5a4 100644 --- a/app/src/main/java/com/bansify/mail/data/remote/MailApiClient.kt +++ b/app/src/main/java/com/bansify/mail/data/remote/MailApiClient.kt @@ -203,7 +203,7 @@ class MailApiClient( // The base URL is the only host this client ever talks to, and it is the only host that // ever receives the bearer token: attachment and image URLs bypass this client entirely. val token = tokenProvider.accessToken() - ?: throw MailApiException(401, MailApiErrorCode.UNAUTHENTICATED, "Not signed in to Bansify Email") + ?: throw MailApiException(401, MailApiErrorCode.UNAUTHENTICATED, "Not signed in to Bansify Mail") builder.header("Authorization", "Bearer $token") val request = builder.method(method, body).build() val response = try { @@ -237,7 +237,7 @@ class MailApiClient( return MailApiException( statusCode = response.code, code = code, - message = "Bansify Email request failed with HTTP ${response.code} ($code)", + message = "Bansify Mail request failed with HTTP ${response.code} ($code)", retryAfterSeconds = retryAfter, ) } @@ -253,7 +253,7 @@ class MailApiClient( */ fun assertSameHost(base: HttpUrl, url: HttpUrl) { require(url.scheme == base.scheme && url.host == base.host && url.port == base.port) { - "Refusing to send a Bansify Email request to ${url.host}" + "Refusing to send a Bansify Mail request to ${url.host}" } } diff --git a/app/src/main/java/com/bansify/mail/data/remote/MailApiModels.kt b/app/src/main/java/com/bansify/mail/data/remote/MailApiModels.kt index 7394f69..ea3a73c 100644 --- a/app/src/main/java/com/bansify/mail/data/remote/MailApiModels.kt +++ b/app/src/main/java/com/bansify/mail/data/remote/MailApiModels.kt @@ -194,8 +194,8 @@ fun sendFailureMessage(error: Throwable): String = when { error is MailApiException && error.isUnauthenticated -> "Your Bansify Account session expired. Sign in again." error is MailApiException && error.isForbidden -> - "This Bansify Account cannot send mail from Bansify Email" - error is java.io.IOException -> "Could not reach Bansify Email. Check your connection and retry." + "This Bansify Account cannot send mail from Bansify Mail" + error is java.io.IOException -> "Could not reach Bansify Mail. Check your connection and retry." else -> "Could not send the message. Try again." } diff --git a/app/src/main/java/com/bansify/mail/data/repository/MailMappers.kt b/app/src/main/java/com/bansify/mail/data/repository/MailMappers.kt index 087cb46..03013de 100644 --- a/app/src/main/java/com/bansify/mail/data/repository/MailMappers.kt +++ b/app/src/main/java/com/bansify/mail/data/repository/MailMappers.kt @@ -190,7 +190,7 @@ object MailMappers { starredMessages = existing?.starredMessages ?: 0, retentionLimit = existing?.retentionLimit ?: ApiMailSettings.RETENTION_500, unreadCount = existing?.unreadCount ?: 0, - signature = existing?.signature ?: "Sent from Bansify Email", + signature = existing?.signature ?: "Sent from Bansify Mail", vacationEnabled = existing?.vacationEnabled ?: false, vacationMessage = existing?.vacationMessage ?: "Thanks for your email. I am currently away and will respond soon.", @@ -226,7 +226,7 @@ object MailMappers { starredMessages = existing?.starredMessages ?: 0, retentionLimit = existing?.retentionLimit ?: ApiMailSettings.RETENTION_500, unreadCount = existing?.unreadCount ?: 0, - signature = existing?.signature ?: "Sent from Bansify Email", + signature = existing?.signature ?: "Sent from Bansify Mail", vacationEnabled = existing?.vacationEnabled ?: false, vacationMessage = existing?.vacationMessage ?: "Thanks for your email. I am currently away and will respond soon.", diff --git a/app/src/main/java/com/bansify/mail/data/repository/MailRepository.kt b/app/src/main/java/com/bansify/mail/data/repository/MailRepository.kt index 5bd9b47..59b9142 100644 --- a/app/src/main/java/com/bansify/mail/data/repository/MailRepository.kt +++ b/app/src/main/java/com/bansify/mail/data/repository/MailRepository.kt @@ -25,7 +25,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map /** - * Offline-first bridge between the Bansify Email Worker API and the per-account Room cache. + * Offline-first bridge between the Bansify Mail Worker API and the per-account Room cache. * * Every operation follows the same shape: update Room optimistically so the UI reacts instantly, * then call the Worker API and reconcile. All reads are scoped by the active account's email, so diff --git a/app/src/main/java/com/bansify/mail/ui/components/AccountSwitcherDialog.kt b/app/src/main/java/com/bansify/mail/ui/components/AccountSwitcherDialog.kt index 7020fc9..67db96e 100644 --- a/app/src/main/java/com/bansify/mail/ui/components/AccountSwitcherDialog.kt +++ b/app/src/main/java/com/bansify/mail/ui/components/AccountSwitcherDialog.kt @@ -74,7 +74,7 @@ fun AccountSwitcherDialog( } Spacer(modifier = Modifier.weight(1f)) Text( - text = "Bansify Email", + text = "Bansify Mail", style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.onSurface diff --git a/app/src/main/java/com/bansify/mail/ui/components/MailNavigationDrawer.kt b/app/src/main/java/com/bansify/mail/ui/components/MailNavigationDrawer.kt index 4f5da47..3a1c569 100644 --- a/app/src/main/java/com/bansify/mail/ui/components/MailNavigationDrawer.kt +++ b/app/src/main/java/com/bansify/mail/ui/components/MailNavigationDrawer.kt @@ -95,7 +95,7 @@ fun MailNavigationDrawerSheet( } Spacer(modifier = Modifier.width(12.dp)) Text( - text = "Bansify Email", + text = "Bansify Mail", style = MaterialTheme.typography.headlineSmall, fontWeight = FontWeight.Bold, color = MaterialTheme.colorScheme.onSurface diff --git a/app/src/main/java/com/bansify/mail/ui/screens/NativeAuthSheet.kt b/app/src/main/java/com/bansify/mail/ui/screens/NativeAuthSheet.kt index 7ef58e9..e44c767 100644 --- a/app/src/main/java/com/bansify/mail/ui/screens/NativeAuthSheet.kt +++ b/app/src/main/java/com/bansify/mail/ui/screens/NativeAuthSheet.kt @@ -51,7 +51,7 @@ import com.bansify.mail.ui.state.NativeAuthUiState * 100% native Jetpack Compose sign-in, sign-up, two-factor and password-recovery sheet. * * It talks to `https://accounts.bansify.com/api/mobile/auth/{endpoint}` through the view model, so - * Bansify Email can sign in on a device with no browser at all. The browser flow stays available + * Bansify Mail can sign in on a device with no browser at all. The browser flow stays available * from the same screen as the secondary "Sign in with browser" button. */ @OptIn(ExperimentalMaterial3Api::class) diff --git a/app/src/main/java/com/bansify/mail/ui/screens/SettingsScreen.kt b/app/src/main/java/com/bansify/mail/ui/screens/SettingsScreen.kt index 6ce7317..b7d3cfd 100644 --- a/app/src/main/java/com/bansify/mail/ui/screens/SettingsScreen.kt +++ b/app/src/main/java/com/bansify/mail/ui/screens/SettingsScreen.kt @@ -206,7 +206,7 @@ fun SettingsScreen( HorizontalDivider(modifier = Modifier.padding(vertical = 8.dp)) Text( - text = "Bansify Email storage", + text = "Bansify Mail storage", style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.primary, modifier = Modifier.padding(horizontal = 16.dp, vertical = 10.dp) @@ -253,7 +253,7 @@ fun SettingsScreen( SettingsRow( icon = Icons.Rounded.LinkOff, title = "Disconnect Mail grant on the server", - subtitle = "Revokes Bansify Email access in your Bansify Account", + subtitle = "Revokes Bansify Mail access in your Bansify Account", onClick = onDisconnectFromServer ) @@ -267,7 +267,7 @@ fun SettingsScreen( SettingsRow( icon = Icons.Rounded.PrivacyTip, title = "Privacy", - subtitle = "How Bansify Email handles your mail and tokens", + subtitle = "How Bansify Mail handles your mail and tokens", onClick = onOpenPrivacyPolicy ) } @@ -317,7 +317,7 @@ fun SettingsScreen( title = { Text("Sign out of this account?") }, text = { Text( - "Your Bansify Email tokens will be removed from this device. " + + "Your Bansify Mail tokens will be removed from this device. " + "The Mail grant stays active in your Bansify Account, so other devices keep working." ) }, diff --git a/app/src/main/java/com/bansify/mail/ui/screens/SignedOutScreen.kt b/app/src/main/java/com/bansify/mail/ui/screens/SignedOutScreen.kt index 7a5d564..a76bda9 100644 --- a/app/src/main/java/com/bansify/mail/ui/screens/SignedOutScreen.kt +++ b/app/src/main/java/com/bansify/mail/ui/screens/SignedOutScreen.kt @@ -44,7 +44,7 @@ import com.bansify.mail.ui.state.AuthScreenState import com.bansify.mail.ui.state.MailUiState /** - * Clean Bansify Email welcome screen shown when no account holds a Mail grant. + * Clean Bansify Mail welcome screen shown when no account holds a Mail grant. * * It offers the primary Bansify sign-in, the Accounts account chooser, and one-tap sign-in for any * accounts discovered on this device through the verified peer directory. @@ -91,14 +91,14 @@ fun SignedOutScreen( Spacer(modifier = Modifier.height(22.dp)) Text( - text = "Bansify Email", + text = "Bansify Mail", style = MaterialTheme.typography.headlineMedium, fontWeight = FontWeight.SemiBold, textAlign = TextAlign.Center ) Spacer(modifier = Modifier.height(6.dp)) Text( - text = "Welcome to Bansify Email", + text = "Welcome to Bansify Mail", style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onSurfaceVariant, textAlign = TextAlign.Center diff --git a/app/src/main/java/com/bansify/mail/ui/viewmodel/MailViewModel.kt b/app/src/main/java/com/bansify/mail/ui/viewmodel/MailViewModel.kt index a650f0a..eca8eec 100644 --- a/app/src/main/java/com/bansify/mail/ui/viewmodel/MailViewModel.kt +++ b/app/src/main/java/com/bansify/mail/ui/viewmodel/MailViewModel.kt @@ -249,7 +249,7 @@ class MailViewModel( com.bansify.mail.auth.DisconnectOutcome.AlreadyInvalidOnServer -> "Signed out; the grant was already invalid" com.bansify.mail.auth.DisconnectOutcome.OfflineRemovedLocally -> "Signed out on this device; the server grant could not be confirmed" - com.bansify.mail.auth.DisconnectOutcome.LocalOnly -> "Signed out of Bansify Email" + com.bansify.mail.auth.DisconnectOutcome.LocalOnly -> "Signed out of Bansify Mail" } private fun describeFailure(failure: MailAuthFailure): String = when (failure) { @@ -623,8 +623,8 @@ class MailViewModel( "Your Bansify Account session expired. Sign in again." } else { error.message?.takeIf { message -> message.isNotBlank() } - ?.let { message -> "Could not sync Bansify Email: $message" } - ?: "Could not sync Bansify Email" + ?.let { message -> "Could not sync Bansify Mail: $message" } + ?: "Could not sync Bansify Mail" }, ) } @@ -632,8 +632,8 @@ class MailViewModel( localState.update { it.copy( syncError = error.message?.takeIf { message -> message.isNotBlank() } - ?.let { message -> "Could not sync Bansify Email: $message" } - ?: "Could not sync Bansify Email", + ?.let { message -> "Could not sync Bansify Mail: $message" } + ?: "Could not sync Bansify Mail", ) } } finally { @@ -807,12 +807,12 @@ class MailViewModel( fun snoozeThread(thread: EmailThreadEntity, untilLabel: String) { _snackbarEvents.tryEmit( - MailSnackbarEvent.SimpleMessage("Snooze is not available for Bansify Email yet — $untilLabel"), + MailSnackbarEvent.SimpleMessage("Snooze is not available for Bansify Mail yet — $untilLabel"), ) } fun updateLabels(thread: EmailThreadEntity, labels: List) { - _snackbarEvents.tryEmit(MailSnackbarEvent.SimpleMessage("Labels are not available for Bansify Email yet")) + _snackbarEvents.tryEmit(MailSnackbarEvent.SimpleMessage("Labels are not available for Bansify Mail yet")) } /** `DELETE /api/mail/trash` for the active account. */ @@ -985,7 +985,7 @@ class MailViewModel( viewModelScope.launch { if (scheduledForMillis != null) { _snackbarEvents.emit( - MailSnackbarEvent.SimpleMessage("Scheduled send is not available for Bansify Email yet"), + MailSnackbarEvent.SimpleMessage("Scheduled send is not available for Bansify Mail yet"), ) return@launch } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 812c96b..a863285 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - Bansify Email + Bansify Mail Search in mail Compose Mail @@ -18,7 +18,7 @@ Messages you organize or receive here will appear cleanly in this folder. No matching emails Try searching another keyword, sender name, or clearing your filters. - Welcome to Bansify Email + Welcome to Bansify Mail Sign in with your Bansify Account to read and send email Sign in with Bansify Use another account diff --git a/tools/check_android_scaffold.py b/tools/check_android_scaffold.py index b51afef..91303c6 100644 --- a/tools/check_android_scaffold.py +++ b/tools/check_android_scaffold.py @@ -1,4 +1,4 @@ -"""Static resource/config checks for Bansify Email; deliberately NOT a substitute for Gradle tests. +"""Static resource/config checks for Bansify Mail; deliberately NOT a substitute for Gradle tests. Mirrors `tools/check_android_scaffold.py` in GothwadTech/accountsapp (XML well-formedness, version catalog, pinned wrapper JAR) and adds the Mail-specific invariants that would otherwise only break From ac7133c087bc367186764a2f60f6952828de14e6 Mon Sep 17 00:00:00 2001 From: Gothwad Tech Date: Sun, 22 Nov 2026 18:36:30 +0000 Subject: [PATCH 2/2] fix: show the sync error instead of an empty inbox The ViewModel already recorded syncError but nothing rendered it, so a failed fetch looked exactly like an empty mailbox. The navigation graph now shows a banner with the message and a Retry action. --- .../mail/ui/navigation/MailNavGraph.kt | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/bansify/mail/ui/navigation/MailNavGraph.kt b/app/src/main/java/com/bansify/mail/ui/navigation/MailNavGraph.kt index aa45de1..64aaca2 100644 --- a/app/src/main/java/com/bansify/mail/ui/navigation/MailNavGraph.kt +++ b/app/src/main/java/com/bansify/mail/ui/navigation/MailNavGraph.kt @@ -1,5 +1,13 @@ package com.bansify.mail.ui.navigation +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.material3.TextButton +import androidx.compose.ui.Alignment import androidx.compose.runtime.Composable import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.ui.unit.dp @@ -108,10 +116,33 @@ fun MailNavGraph( return } - NavHost( - navController = navController, - startDestination = InboxRoute - ) { + Column(modifier = Modifier.fillMaxSize()) { + // A failed sync used to leave the inbox silently empty; surface the reason instead. + uiState.syncError?.let { message -> + Surface( + color = MaterialTheme.colorScheme.errorContainer, + modifier = Modifier.fillMaxWidth(), + ) { + Row( + modifier = Modifier.padding(horizontal = 16.dp, vertical = 10.dp), + verticalAlignment = Alignment.CenterVertically, + ) { + Text( + text = message, + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onErrorContainer, + modifier = Modifier.weight(1f), + ) + TextButton(onClick = { viewModel.refreshCurrentFolder(showSpinner = true) }) { + Text("Retry") + } + } + } + } + NavHost( + navController = navController, + startDestination = InboxRoute + ) { composable { InboxScreen( uiState = uiState, @@ -292,4 +323,5 @@ fun MailNavGraph( ) } } + } }