ui: fix crash opening About SimpleX Chat (#6902)

* 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 <evgeny@poberezkin.com>

* Apply suggestion from @epoberezkin

Co-authored-by: Evgeny <evgeny@poberezkin.com>

---------

Co-authored-by: Evgeny <evgeny@poberezkin.com>
This commit is contained in:
Narasimha-sc
2026-04-29 19:58:01 +00:00
committed by GitHub
parent 12e208178d
commit 7ea3db7b3c
@@ -105,7 +105,9 @@ fun SimpleXInfoLayout(
user: User?,
onboardingStage: SharedPreference<OnboardingStage>?
) {
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)
}
}
)