From eeefacca9ec4f88e3b0c2181abca3cf0864b509f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 28 Jul 2026 17:25:34 +0000 Subject: [PATCH] fix(ime): union nav-bar and IME insets on the two remaining bare-Scaffold forms Sweep of every imePadding() in the app for the same nav-bar-over-IME double-count fixed for the chats. Two more bare Material3 Scaffold screens applied the scaffold content padding (which carries the nav-bar inset) and then imePadding() without consuming in between, so the nav bar stacked on top of the IME while the keyboard was up: - NewGeohashChatScreen (geohash create form) - MarmotGroupInfoScreen (has the add-member search field) Both now consumeWindowInsets(pad) before imePadding(), matching the idiom the other forms already use. Every other imePadding() call was verified fine: DisappearingScaffold-based screens are handled by the scaffold's own reservation, dialogs/bottom sheets carry no nav-bar content padding, and the rest either apply imePadding() alone at a root or already use the navigationBarsPadding()/consumeWindowInsets union. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_012dT2RLbPZzan2hULL2cmc6 --- .../screen/loggedIn/chats/geohashChat/NewGeohashChatScreen.kt | 4 ++++ .../loggedIn/chats/marmotGroup/MarmotGroupInfoScreen.kt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/geohashChat/NewGeohashChatScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/geohashChat/NewGeohashChatScreen.kt index ebf206147a..13f71901cd 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/geohashChat/NewGeohashChatScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/geohashChat/NewGeohashChatScreen.kt @@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.imePadding @@ -106,6 +107,9 @@ fun NewGeohashChatScreen( .fillMaxSize() .padding(top = pad.calculateTopPadding(), bottom = pad.calculateBottomPadding()) .padding(horizontal = 16.dp) + // consume the scaffold insets so the trailing imePadding() only adds the part of + // the IME the nav-bar padding above doesn't already cover (union, not a sum). + .consumeWindowInsets(pad) .verticalScroll(rememberScrollState()) .imePadding(), verticalArrangement = Arrangement.spacedBy(20.dp), diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupInfoScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupInfoScreen.kt index 65ccc7dcd9..0d8f4c3428 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupInfoScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupInfoScreen.kt @@ -32,6 +32,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.imePadding @@ -171,6 +172,9 @@ fun MarmotGroupInfoScreen( Modifier .fillMaxSize() .padding(padding) + // consume the scaffold insets so imePadding() unions with the nav-bar inset in + // `padding` instead of stacking on top of it while the keyboard is up. + .consumeWindowInsets(padding) .imePadding(), ) { // Group header section (fixed at top)