From f79c954ee3bc9ab63ef51e9b4a07226794411806 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Tue, 28 Jul 2026 19:36:18 -0400 Subject: [PATCH 1/3] fix(ui): restore BottomBar padding after Modal migration PR #1128 migrated BottomBarContainer to the shared Modal composable but inherited Modal's own layout defaults, changing how the bar renders: - top inset padding was halved (inset -> grid.x2) - an extra bottom gap was added (grid.x2, on top of the button's own padding) - item spacing tightened (grid.x3 -> grid.x2) - title/subtitle became center-aligned instead of start-aligned Parameterize Modal with contentPadding and horizontalAlignment (defaults unchanged, so other callers like ReceivedFundsConfirmation are unaffected) and pass the original BottomBarView values from BottomBarContainer. --- .../src/main/kotlin/com/getcode/ui/components/Modal.kt | 10 ++++++++-- .../getcode/ui/components/bars/BottomBarContainer.kt | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ui/components/src/main/kotlin/com/getcode/ui/components/Modal.kt b/ui/components/src/main/kotlin/com/getcode/ui/components/Modal.kt index 0ecd88834..366b425de 100644 --- a/ui/components/src/main/kotlin/com/getcode/ui/components/Modal.kt +++ b/ui/components/src/main/kotlin/com/getcode/ui/components/Modal.kt @@ -3,6 +3,7 @@ package com.getcode.ui.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ColumnScope +import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.navigationBars @@ -21,6 +22,11 @@ import com.getcode.theme.CodeTheme fun Modal( modifier: Modifier = Modifier, backgroundColor: Color = CodeTheme.colors.brandContainer, + contentPadding: PaddingValues = PaddingValues( + horizontal = CodeTheme.dimens.inset, + vertical = CodeTheme.dimens.grid.x2 + ), + horizontalAlignment: Alignment.Horizontal = Alignment.CenterHorizontally, verticalArrangement: Arrangement.Vertical = Arrangement.spacedBy(CodeTheme.dimens.grid.x2), content: @Composable ColumnScope.() -> Unit ) { @@ -36,9 +42,9 @@ fun Modal( modifier = Modifier .fillMaxWidth() .wrapContentHeight() - .padding(horizontal = CodeTheme.dimens.inset, vertical = CodeTheme.dimens.grid.x2) + .padding(contentPadding) .windowInsetsPadding(WindowInsets.navigationBars), - horizontalAlignment = Alignment.CenterHorizontally, + horizontalAlignment = horizontalAlignment, verticalArrangement = verticalArrangement, ) { content() diff --git a/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt b/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt index c6ea654f1..412e78921 100644 --- a/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt +++ b/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt @@ -13,6 +13,7 @@ import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -205,6 +206,13 @@ fun BottomBarView( ) { Modal( backgroundColor = bottomBarMessage.type.backgroundColor(), + contentPadding = PaddingValues( + top = CodeTheme.dimens.inset, + start = CodeTheme.dimens.inset, + end = CodeTheme.dimens.inset, + ), + horizontalAlignment = Alignment.Start, + verticalArrangement = Arrangement.spacedBy(CodeTheme.dimens.grid.x3), ) { if (bottomBarMessage.title.isNotEmpty()) { CompositionLocalProvider(LocalContentColor provides White) { From 2f2743924e6174a3240d0897b8e2fffa31edc658 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Tue, 28 Jul 2026 19:42:22 -0400 Subject: [PATCH 2/3] fix(ui): use textLarge for BottomBar title and caption for message --- .../com/getcode/ui/components/bars/BottomBarContainer.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt b/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt index 412e78921..244f87de8 100644 --- a/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt +++ b/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt @@ -221,12 +221,12 @@ fun BottomBarView( verticalArrangement = Arrangement.spacedBy(CodeTheme.dimens.grid.x2) ) { Text( - style = CodeTheme.typography.textMedium, + style = CodeTheme.typography.textLarge, text = bottomBarMessage.title ) if (bottomBarMessage.subtitle.isNotEmpty()) { Text( - style = CodeTheme.typography.textSmall, + style = CodeTheme.typography.caption, text = bottomBarMessage.subtitle, color = LocalContentColor.current.copy(alpha = 0.8f) ) From 1b7ce6a67bebfa7ebff61adf6e90346aa010d668 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Tue, 28 Jul 2026 20:10:27 -0400 Subject: [PATCH 3/3] fix(ui): keep BottomBar content during exit so slide-out animation is visible The manager clears the active message immediately on close (so other screens don't re-show it), which set bottomBarMessage to null before the AnimatedContent exit transition finished. BottomBarView early-returns on a null message, so the outgoing frame rendered nothing and the bar appeared to vanish instantly instead of sliding out. Retain the last non-null message and render that during the transition so the slide-out animation is visible. --- .../getcode/ui/components/bars/BottomBarContainer.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt b/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt index 244f87de8..c8bdedf10 100644 --- a/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt +++ b/ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt @@ -73,6 +73,14 @@ fun BottomBarContainer( ) { val scope = rememberCoroutineScope() val bottomBarMessage by barMessages.bottomBar.collectAsStateWithLifecycle() + // The manager clears the message immediately on close (see onClose) so other + // screens don't re-show it. Retain the last non-null message so the exit + // transition still has content to render, otherwise the bar blanks out and + // the slide-out animation isn't visible. + var exitingMessage by remember { mutableStateOf(bottomBarMessage) } + LaunchedEffect(bottomBarMessage) { + if (bottomBarMessage != null) exitingMessage = bottomBarMessage + } val bottomBarVisibleState = remember(bottomBarMessage?.id) { MutableTransitionState(false) } var bottomBarMessageDismissId by remember { mutableLongStateOf(0L) } val animationScale by rememberAnimationScale() @@ -172,7 +180,7 @@ fun BottomBarContainer( scope.launch { onClose(selection, false) } } BottomBarView( - bottomBarMessage = bottomBarMessage, + bottomBarMessage = exitingMessage, onShown = onShown, onClose = closeWith, onBackPressed = { closeWith(SelectedBottomBarAction(-1)) }