Update copy for backup education screen.

This commit is contained in:
Alex Hart
2026-03-26 16:14:50 -03:00
parent 25452fefa5
commit f533ad1533
4 changed files with 72 additions and 15 deletions

View File

@@ -142,7 +142,12 @@ class MessageBackupsFlowFragment : ComposeFragment(), InAppPaymentCheckoutDelega
composable(route = MessageBackupsStage.Route.BACKUP_KEY_EDUCATION.name) {
MessageBackupsKeyEducationScreen(
onNavigationClick = viewModel::goToPreviousStage,
onNextClick = viewModel::goToNextStage
onNextClick = viewModel::goToNextStage,
mode = if (SignalStore.backup.newLocalBackupsEnabled) {
MessageBackupsKeyEducationScreenMode.REMOTE_WITH_LOCAL_ENABLED
} else {
MessageBackupsKeyEducationScreenMode.DEFAULT
}
)
}

View File

@@ -50,9 +50,9 @@ import org.signal.core.ui.R as CoreUiR
enum class MessageBackupsKeyEducationScreenMode {
/**
* Displayed when the user is enabling remote backups and does not have unified local backups enabled
* Displayed when the user is enabling remote backups, or local backups without remote enabled.
*/
REMOTE_BACKUP_WITH_LOCAL_DISABLED,
DEFAULT,
/**
* Displayed when the user is upgrading legacy to unified local backup
@@ -60,9 +60,14 @@ enum class MessageBackupsKeyEducationScreenMode {
LOCAL_BACKUP_UPGRADE,
/**
* Displayed when the user has unified local backup and is enabling remote backups
* Displayed when the user has remote backups enabled and is enabling local backups
*/
REMOTE_BACKUP_WITH_LOCAL_ENABLED
LOCAL_WITH_REMOTE_ENABLED,
/**
* Displayed when the user has local backups enabled and is enabling remote backups
*/
REMOTE_WITH_LOCAL_ENABLED
}
/**
@@ -72,7 +77,7 @@ enum class MessageBackupsKeyEducationScreenMode {
fun MessageBackupsKeyEducationScreen(
onNavigationClick: () -> Unit = {},
onNextClick: () -> Unit = {},
mode: MessageBackupsKeyEducationScreenMode = MessageBackupsKeyEducationScreenMode.REMOTE_BACKUP_WITH_LOCAL_DISABLED
mode: MessageBackupsKeyEducationScreenMode = MessageBackupsKeyEducationScreenMode.DEFAULT
) {
val scrollState = rememberScrollState()
@@ -105,14 +110,19 @@ fun MessageBackupsKeyEducationScreen(
)
when (mode) {
MessageBackupsKeyEducationScreenMode.REMOTE_BACKUP_WITH_LOCAL_DISABLED -> {
MessageBackupsKeyEducationScreenMode.DEFAULT -> {
RemoteBackupWithLocalDisabledInfo()
}
MessageBackupsKeyEducationScreenMode.LOCAL_BACKUP_UPGRADE -> {
LocalBackupUpgradeInfo()
}
MessageBackupsKeyEducationScreenMode.REMOTE_BACKUP_WITH_LOCAL_ENABLED -> {
MessageBackupsKeyEducationScreenMode.LOCAL_WITH_REMOTE_ENABLED -> {
LocalBackupWithRemoteEnabledInfo()
}
MessageBackupsKeyEducationScreenMode.REMOTE_WITH_LOCAL_ENABLED -> {
RemoteBackupWithLocalEnabledInfo()
}
}
@@ -145,9 +155,8 @@ fun MessageBackupsKeyEducationScreen(
@Composable
private fun getTitleText(mode: MessageBackupsKeyEducationScreenMode): String {
return when (mode) {
MessageBackupsKeyEducationScreenMode.REMOTE_BACKUP_WITH_LOCAL_DISABLED -> stringResource(R.string.MessageBackupsKeyEducationScreen__your_backup_key)
MessageBackupsKeyEducationScreenMode.LOCAL_BACKUP_UPGRADE -> stringResource(R.string.MessageBackupsKeyEducationScreen__your_new_recovery_key)
MessageBackupsKeyEducationScreenMode.REMOTE_BACKUP_WITH_LOCAL_ENABLED -> stringResource(R.string.MessageBackupsKeyEducationScreen__your_recovery_key)
else -> stringResource(R.string.MessageBackupsKeyEducationScreen__your_recovery_key)
}
}
@@ -176,6 +185,31 @@ private fun LocalBackupUpgradeInfo() {
}
}
@Composable
private fun LocalBackupWithRemoteEnabledInfo() {
val normalText = stringResource(R.string.MessageBackupsKeyEducationScreen__remote_backup_with_local_enabled_description)
val boldText = stringResource(R.string.MessageBackupsKeyEducationScreen__local_backup_with_remote_enabled_description_bold)
DescriptionText(
normalText = normalText,
boldText = boldText
)
UseThisKeyToContainer {
UseThisKeyToRow(
icon = ImageVector.vectorResource(R.drawable.symbol_folder_24),
text = stringResource(R.string.MessageBackupsKeyEducationScreen__restore_on_device_backup)
)
Spacer(modifier = Modifier.padding(vertical = 16.dp))
UseThisKeyToRow(
icon = ImageVector.vectorResource(CoreUiR.drawable.symbol_backup_24),
text = stringResource(R.string.MessageBackupsKeyEducationScreen__restore_your_signal_secure_backup)
)
}
}
@Composable
private fun RemoteBackupWithLocalEnabledInfo() {
val normalText = stringResource(R.string.MessageBackupsKeyEducationScreen__remote_backup_with_local_enabled_description)
@@ -313,10 +347,10 @@ private fun InfoRow(@DrawableRes iconId: Int, @StringRes textId: Int) {
@DayNightPreviews
@Composable
private fun MessageBackupsKeyEducationScreenRemoteBackupWithLocalDisabledPreview() {
private fun MessageBackupsKeyEducationScreenDefaultPreview() {
Previews.Preview {
MessageBackupsKeyEducationScreen(
mode = MessageBackupsKeyEducationScreenMode.REMOTE_BACKUP_WITH_LOCAL_DISABLED
mode = MessageBackupsKeyEducationScreenMode.DEFAULT
)
}
}
@@ -333,10 +367,20 @@ private fun MessageBackupsKeyEducationScreenLocalBackupUpgradePreview() {
@DayNightPreviews
@Composable
private fun MessageBackupsKeyEducationScreenRemoteBackupWithLocalEnabledPreview() {
private fun MessageBackupsKeyEducationScreenLocalBackupWithRemoteEnabledPreview() {
Previews.Preview {
MessageBackupsKeyEducationScreen(
mode = MessageBackupsKeyEducationScreenMode.REMOTE_BACKUP_WITH_LOCAL_ENABLED
mode = MessageBackupsKeyEducationScreenMode.LOCAL_WITH_REMOTE_ENABLED
)
}
}
@DayNightPreviews
@Composable
private fun MessageBackupsKeyEducationScreenRemoteBackupWithLocalEnabledPreview() {
Previews.Preview {
MessageBackupsKeyEducationScreen(
mode = MessageBackupsKeyEducationScreenMode.REMOTE_WITH_LOCAL_ENABLED
)
}
}

View File

@@ -110,7 +110,13 @@ class LocalBackupsFragment : ComposeFragment() {
MessageBackupsKeyEducationScreen(
onNavigationClick = { backPressedDispatcher?.onBackPressedDispatcher?.onBackPressed() },
onNextClick = { backstack.add(LocalBackupsNavKey.RECORD_RECOVERY_KEY) },
mode = MessageBackupsKeyEducationScreenMode.LOCAL_BACKUP_UPGRADE
mode = if (args.triggerUpdateFlow) {
MessageBackupsKeyEducationScreenMode.LOCAL_BACKUP_UPGRADE
} else if (SignalStore.backup.areBackupsEnabled) {
MessageBackupsKeyEducationScreenMode.LOCAL_WITH_REMOTE_ENABLED
} else {
MessageBackupsKeyEducationScreenMode.DEFAULT
}
)
}

View File

@@ -8950,6 +8950,8 @@
<string name="MessageBackupsKeyEducationScreen__remote_backup_with_local_enabled_description">Your recovery key is a 64-character code that lets you restore your backups when you re-install Signal.</string>
<!-- Screen body shown when enabling Signal Secure Backups while on-device backups are already enabled (part 2, bolded). -->
<string name="MessageBackupsKeyEducationScreen__remote_backup_with_local_enabled_description_bold">This is the same as your on-device recovery key.</string>
<!-- Screen body shown when enabling on-device backups while Signal Secure Backups are already enabled (part 2, bolded). -->
<string name="MessageBackupsKeyEducationScreen__local_backup_with_remote_enabled_description_bold">This is the same as your Signal Secure Backups recovery key.</string>
<!-- Label shown above a list of actions that the recovery key can be used for. -->
<string name="MessageBackupsKeyEducationScreen__use_this_key_to">Use this key to:</string>
<!-- Row label indicating that the recovery key can be used to restore an on-device backup. -->