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.
This commit is contained in:
Narasimha-sc
2026-04-29 18:20:55 +00:00
parent ab4b056c60
commit 4bd203684a
@@ -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 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)
}
)
}