From 4bd203684ae43a9056644dc49899031f32172391 Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Wed, 29 Apr 2026 18:20:55 +0000 Subject: [PATCH] ui: fix crash and logo cutoff on About SimpleX Chat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OnboardingShrinkingLayout calls .first() on each slot's measurables, crashing when the button slot is empty. About passes onboardingStage = null, in which case the button slot emits no children. Have the About branch emit a 0x0 Spacer so the slot always has one measurable. Also add a top inset for the SimpleX logo when reached from About in non-oneHandUI mode — without it the top app bar overlaps the logo. --- .../chat/simplex/common/views/onboarding/SimpleXInfo.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/SimpleXInfo.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/SimpleXInfo.kt index 5b186875fa..a3daa099f5 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/SimpleXInfo.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/SimpleXInfo.kt @@ -105,7 +105,9 @@ fun SimpleXInfoLayout( user: User?, onboardingStage: SharedPreference? ) { - Column(Modifier.fillMaxSize().systemBarsPadding().padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING), horizontalAlignment = Alignment.CenterHorizontally) { + val oneHandUI = remember { appPrefs.oneHandUI.state } + val topAppBarInset = if (onboardingStage == null && !oneHandUI.value) AppBarHeight * fontSizeSqrtMultiplier else 0.dp + Column(Modifier.fillMaxSize().systemBarsPadding().padding(top = topAppBarInset).padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING), horizontalAlignment = Alignment.CenterHorizontally) { Box(Modifier.padding(top = DEFAULT_PADDING * 2).widthIn(max = if (appPlatform.isAndroid) 185.dp else 160.dp), contentAlignment = Alignment.Center) { SimpleXLogo() } @@ -156,7 +158,7 @@ fun SimpleXInfoLayout( ModalManager.fullscreen.showModal { HowItWorks(user, onboardingStage) } }) } - } + } else Spacer(Modifier) } ) }