Move internal backup details down further on the screen.

This commit is contained in:
Greyson Parrelli
2026-01-20 14:44:32 -05:00
parent 471b214b4a
commit d1010eb886
3 changed files with 27 additions and 18 deletions

View File

@@ -895,17 +895,6 @@ private fun LazyListScope.appendBackupDetailsItems(
Texts.SectionHeader(text = stringResource(id = R.string.RemoteBackupsSettingsFragment__backup_details))
}
if (state.backupMediaDetails != null) {
item {
Column(modifier = Modifier.horizontalGutters()) {
Text("[Internal Only] Backup Media Details")
Text("Awaiting Restore: ${state.backupMediaDetails.awaitingRestore.toUnitString()}")
Text("Offloaded: ${state.backupMediaDetails.offloaded.toUnitString()}")
Text("Last Proto Size: ${state.backupMediaDetails.protoFileSize.toUnitString()}")
}
}
}
if (state.backupCreationError != null) {
item {
BackupCreateErrorRow(
@@ -934,12 +923,6 @@ private fun LazyListScope.appendBackupDetailsItems(
}
}
if (state.includeDebuglog != null) {
item {
IncludeDebuglogRow(state.includeDebuglog) { contentCallbacks.onIncludeDebuglogClick(it) }
}
}
val isRestoringDatabase = backupRestoreState is BackupRestoreState.Restoring && backupRestoreState.state.restoreState == RestoreState.RESTORING_DB
if (!isRestoringDatabase && (backupProgress == null || backupProgress.state == ArchiveUploadProgressState.State.None || backupProgress.state == ArchiveUploadProgressState.State.UserCanceled)) {
item {
@@ -1008,6 +991,29 @@ private fun LazyListScope.appendBackupDetailsItems(
)
}
if (state.internalUser) {
item {
Texts.SectionHeader(text = "INTERNAL ONLY")
}
if (state.includeDebuglog != null) {
item {
IncludeDebuglogRow(state.includeDebuglog) { contentCallbacks.onIncludeDebuglogClick(it) }
}
}
if (state.backupMediaDetails != null) {
item {
Column(modifier = Modifier.horizontalGutters()) {
Text("Backup Media Details")
Text("Awaiting Restore: ${state.backupMediaDetails.awaitingRestore.toUnitString()}")
Text("Offloaded: ${state.backupMediaDetails.offloaded.toUnitString()}")
Text("Last Proto Size: ${state.backupMediaDetails.protoFileSize.toUnitString()}")
}
}
}
}
item {
Dividers.Default()
}
@@ -1543,7 +1549,7 @@ private fun IncludeDebuglogRow(
) {
Rows.ToggleRow(
checked = enabled,
text = "[INTERNAL ONLY] Include debuglog?",
text = "Include debuglog?",
label = "If enabled, we will capture a debuglog and include it in the backup file.",
onCheckChanged = onToggle
)
@@ -1882,6 +1888,7 @@ private fun RemoteBackupsSettingsInternalUserContentPreview() {
),
hasRedemptionError = false,
isOutOfStorageSpace = false,
internalUser = true,
includeDebuglog = true
),
statusBarColorNestedScrollConnection = null,

View File

@@ -28,6 +28,7 @@ data class RemoteBackupsSettingsState(
val lastBackupTimestamp: Long = 0,
val dialog: Dialog = Dialog.NONE,
val snackbar: Snackbar = Snackbar.NONE,
val internalUser: Boolean = false,
val includeDebuglog: Boolean? = null,
val canBackupMessagesJobRun: Boolean = false,
val backupMediaDetails: BackupMediaDetails? = null,

View File

@@ -76,6 +76,7 @@ class RemoteBackupsSettingsViewModel : ViewModel() {
lastBackupTimestamp = SignalStore.backup.lastBackupTime,
canBackUpUsingCellular = SignalStore.backup.backupWithCellular,
canRestoreUsingCellular = SignalStore.backup.restoreWithCellular,
internalUser = RemoteConfig.internalUser,
includeDebuglog = SignalStore.internal.includeDebuglogInBackup.takeIf { RemoteConfig.internalUser },
backupCreationError = SignalStore.backup.backupCreationError,
lastMessageCutoffTime = SignalStore.backup.lastUsedMessageCutoffTime