From 1705e67eebdb7f0d0673ad52e0fe15017f44553f Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Sat, 8 Aug 2026 22:11:35 +0200 Subject: [PATCH] feat(components): let scrolling actions inherit the content inset Pinned actions keep their own 24dp margin; scrolling ones sit inside the content column, so the caller's inset decides how wide they run. --- .../floret/components/Onboarding.kt | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/components/src/main/kotlin/de/jeanlucmakiola/floret/components/Onboarding.kt b/components/src/main/kotlin/de/jeanlucmakiola/floret/components/Onboarding.kt index 2bfdefe..b82e6fd 100644 --- a/components/src/main/kotlin/de/jeanlucmakiola/floret/components/Onboarding.kt +++ b/components/src/main/kotlin/de/jeanlucmakiola/floret/components/Onboarding.kt @@ -100,7 +100,13 @@ fun OnboardingScaffold( bottomBar = { // Pinned actions carry the navigation-bar inset themselves; scrolling // ones get it from the scaffold's own content padding. - if (!scrollingActions) ActionsColumn(insetBottom = true, content = actions) + if (!scrollingActions) { + ActionsColumn( + horizontalPadding = OnboardingSpace.md, + insetBottom = true, + content = actions, + ) + } }, ) { innerPadding -> Column( @@ -115,7 +121,15 @@ fun OnboardingScaffold( hero() Spacer(Modifier.height(OnboardingSpace.lg)) body() - if (scrollingActions) ActionsColumn(insetBottom = false, content = actions) + // No inset of its own: scrolling actions sit inside the content + // column, so they line up with whatever is above them. + if (scrollingActions) { + ActionsColumn( + horizontalPadding = 0.dp, + insetBottom = false, + content = actions, + ) + } Spacer(Modifier.height(OnboardingSpace.md)) } } @@ -124,6 +138,7 @@ fun OnboardingScaffold( /** The call-to-action stack, wherever the shell has put it. */ @Composable private fun ActionsColumn( + horizontalPadding: Dp, insetBottom: Boolean, content: @Composable ColumnScope.() -> Unit, ) { @@ -131,7 +146,7 @@ private fun ActionsColumn( modifier = Modifier .fillMaxWidth() .then(if (insetBottom) Modifier.navigationBarsPadding() else Modifier) - .padding(horizontal = OnboardingSpace.md, vertical = OnboardingSpace.sm), + .padding(horizontal = horizontalPadding, vertical = OnboardingSpace.sm), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(4.dp), content = content,