From 64d8fca9cd497466203a6e036f71983206c3e69a Mon Sep 17 00:00:00 2001 From: another-simple-pixel Date: Sat, 16 May 2026 12:32:15 -0700 Subject: [PATCH] Migrate views: move all SectionTextFooter / SectionSpacer out of SectionView lambdas Same pre-card-chrome pattern as elsewhere. MigrateToDevice (4 footers) and MigrateFromDevice (9 footers + 1 SectionSpacer in error view) historically wrote captions and inter-card spacers inside their SectionView content lambdas. After PR #6777 added card chrome these rendered inside the white cards. MigrateToDevice fixes (4 footers, one per sub-view): - Confirm network settings footer - Database init failed retry footer - Archive import failed retry footer - Passphrase entering dynamic footer MigrateFromDevice fixes (9 footers + 1 SectionSpacer): - ChatStopFailed view footer - Passphrase confirmation footer - Upload confirmation footer - Upload failed retry footer - Link shown view: archive-will-be-deleted + choose-migrate footers - Finished view: 2 warning footers (must-not-use-two-devices, using-on-two-devices-breaks-encryption) - Implicit SectionSpacer at ChatStopFailed view also moved out Co-Authored-By: Claude Opus 4.7 (1M context) --- .../common/views/migration/MigrateFromDevice.kt | 16 ++++++++-------- .../common/views/migration/MigrateToDevice.kt | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/migration/MigrateFromDevice.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/migration/MigrateFromDevice.kt index 03542ca8af..7695a9a2e5 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/migration/MigrateFromDevice.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/migration/MigrateFromDevice.kt @@ -201,8 +201,8 @@ private fun MutableState.ChatStopFailedView(reason: String) textColor = MaterialTheme.colors.error, click = ::stopChat ){} - SectionTextFooter(stringResource(MR.strings.migrate_from_device_chat_should_be_stopped)) } + SectionTextFooter(stringResource(MR.strings.migrate_from_device_chat_should_be_stopped)) } @Composable @@ -243,8 +243,8 @@ private fun MutableState.PassphraseConfirmationView() { } } ) {} - SectionTextFooter(stringResource(MR.strings.migrate_from_device_confirm_you_remember_passphrase)) } + SectionTextFooter(stringResource(MR.strings.migrate_from_device_confirm_you_remember_passphrase)) } if (verifyingPassphrase.value) { ProgressView() @@ -261,8 +261,8 @@ private fun MutableState.UploadConfirmationView() { textColor = MaterialTheme.colors.primary, click = { state = MigrationFromState.Archiving } ){} - SectionTextFooter(stringResource(MR.strings.migrate_from_device_all_data_will_be_uploaded)) } + SectionTextFooter(stringResource(MR.strings.migrate_from_device_all_data_will_be_uploaded)) } @Composable @@ -319,8 +319,8 @@ private fun MutableState.UploadFailedView(totalBytes: Long, state = MigrationFromState.DatabaseInit(totalBytes, archivePath) } ) {} - SectionTextFooter(stringResource(MR.strings.migrate_from_device_try_again)) } + SectionTextFooter(stringResource(MR.strings.migrate_from_device_try_again)) LaunchedEffect(Unit) { chatReceiver?.stopAndCleanUp() } @@ -361,9 +361,9 @@ private fun MutableState.LinkShownView(fileId: Long, link: S ) } ) {} - SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_archive_will_be_deleted)) - SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_choose_migrate_from_another_device)) } + SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_archive_will_be_deleted)) + SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_choose_migrate_from_another_device)) SectionSpacer() SectionView(stringResource(MR.strings.show_QR_code).uppercase()) { SimpleXLinkQRCode(link, onShare = {}) @@ -410,9 +410,9 @@ private fun MutableState.FinishedView(chatDeletion: Boolean) ) } ) {} - SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_you_must_not_start_database_on_two_device)) - SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_using_on_two_device_breaks_encryption)) } + SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_you_must_not_start_database_on_two_device)) + SectionTextFooter(annotatedStringResource(MR.strings.migrate_from_device_using_on_two_device_breaks_encryption)) if (chatDeletion) { ProgressView() } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/migration/MigrateToDevice.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/migration/MigrateToDevice.kt index cabfbf031e..7c0c1a1b15 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/migration/MigrateToDevice.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/migration/MigrateToDevice.kt @@ -297,8 +297,8 @@ private fun ModalData.OnionView(link: String, legacyLinkSocksProxy: String?, lin } } ){} - SectionTextFooter(stringResource(MR.strings.migrate_to_device_confirm_network_settings_footer)) } + SectionTextFooter(stringResource(MR.strings.migrate_to_device_confirm_network_settings_footer)) SectionSpacer() @@ -374,8 +374,8 @@ private fun MutableState.DownloadFailedView(link: String, cha state = MigrationToState.DatabaseInit(link, netCfg, networkProxy) } ) {} - SectionTextFooter(stringResource(MR.strings.migrate_to_device_try_again)) } + SectionTextFooter(stringResource(MR.strings.migrate_to_device_try_again)) LaunchedEffect(Unit) { chatReceiver?.stopAndCleanUp() File(archivePath).delete() @@ -405,8 +405,8 @@ private fun MutableState.ArchiveImportFailedView(archivePath: state = MigrationToState.ArchiveImport(archivePath, netCfg, networkProxy) } ) {} - SectionTextFooter(stringResource(MR.strings.migrate_to_device_try_again)) } + SectionTextFooter(stringResource(MR.strings.migrate_to_device_try_again)) } @Composable @@ -500,8 +500,8 @@ private fun MutableState.MigrationConfirmationView(status: DB } ) {} } - SectionTextFooter(footer) } + SectionTextFooter(footer) } @Composable