From 7ea3db7b3cb147bee540e9559725ec5312a48e9d Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Wed, 29 Apr 2026 19:58:01 +0000 Subject: [PATCH] ui: fix crash opening About SimpleX Chat (#6902) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ui: fix crash and logo cutoff on About SimpleX Chat 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. * style Co-authored-by: Evgeny * Apply suggestion from @epoberezkin Co-authored-by: Evgeny --------- Co-authored-by: Evgeny --- .../chat/simplex/common/views/onboarding/SimpleXInfo.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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..74dadcd671 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 topBar = onboardingStage == null && !appPrefs.oneHandUI.state.value + val modifier = Modifier.fillMaxSize().systemBarsPadding().padding(horizontal = DEFAULT_ONBOARDING_HORIZONTAL_PADDING) + Column(if (topBar) modifier.padding(top = AppBarHeight * fontSizeSqrtMultiplier) else modifier, 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,6 +158,8 @@ fun SimpleXInfoLayout( ModalManager.fullscreen.showModal { HowItWorks(user, onboardingStage) } }) } + } else { + Spacer(Modifier) } } )