From a056de64fc70aa34fe8e5fdb3adbd0561e7b900b Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Thu, 18 Jun 2026 20:22:52 -0300 Subject: [PATCH] fix(ui): respect navigation-bar inset on full-screen routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Under enableEdgeToEdge() content draws behind the system bars. Several full-screen routes leaked the bottom navigation bar: - DeckDetailScreen: the custom Scaffold bottomBar ("Start studying") is not auto-inset by Material3 and, being fixed, couldn't scroll into view — it rendered behind the nav bar. Apply navigationBars inset. - Settings / PublishDeck / FriendProfile: applied statusBars only, so bottom-most actions could sit under the nav bar on 3-button devices. Switch to systemBars to inset top and bottom, matching Onboarding and Study. Pager tabs (ShortNavigationBar consumes the nav inset) and topBar-only Scaffolds (auto bottom inset via innerPadding) were already correct. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../com/github/jvsena42/echo/ui/decks/DeckDetailScreen.kt | 4 ++++ .../github/jvsena42/echo/ui/importflow/PublishDeckScreen.kt | 6 +++--- .../github/jvsena42/echo/ui/profile/FriendProfileScreen.kt | 4 ++-- .../com/github/jvsena42/echo/ui/settings/SettingsScreen.kt | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/decks/DeckDetailScreen.kt b/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/decks/DeckDetailScreen.kt index 6ef9b32..51c0f69 100644 --- a/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/decks/DeckDetailScreen.kt +++ b/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/decks/DeckDetailScreen.kt @@ -7,11 +7,14 @@ 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.WindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.navigationBars import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll @@ -201,6 +204,7 @@ private fun DeckDetailContent( Box( modifier = Modifier .fillMaxWidth() + .windowInsetsPadding(WindowInsets.navigationBars) .padding(horizontal = 20.dp, vertical = 16.dp), ) { EchoPrimaryButton( diff --git a/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/importflow/PublishDeckScreen.kt b/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/importflow/PublishDeckScreen.kt index 2b5dc12..a03ea72 100644 --- a/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/importflow/PublishDeckScreen.kt +++ b/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/importflow/PublishDeckScreen.kt @@ -17,7 +17,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.statusBars +import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CircleShape @@ -146,7 +146,7 @@ private fun PublishDeckScreen( modifier = Modifier .fillMaxSize() .background(colors.surfacePrimary) - .windowInsetsPadding(WindowInsets.statusBars) + .windowInsetsPadding(WindowInsets.systemBars) .verticalScroll(rememberScrollState()) .padding(PaddingValues(start = 20.dp, end = 20.dp, top = 8.dp, bottom = 40.dp)), verticalArrangement = Arrangement.spacedBy(18.dp), @@ -679,7 +679,7 @@ private fun PublishedContent( modifier = Modifier .fillMaxSize() .background(colors.surfacePrimary) - .windowInsetsPadding(WindowInsets.statusBars) + .windowInsetsPadding(WindowInsets.systemBars) .padding(PaddingValues(start = 20.dp, end = 20.dp, top = 8.dp, bottom = 40.dp)), verticalArrangement = Arrangement.spacedBy(18.dp, Alignment.CenterVertically), horizontalAlignment = Alignment.CenterHorizontally, diff --git a/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/profile/FriendProfileScreen.kt b/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/profile/FriendProfileScreen.kt index 84b9618..b585c3f 100644 --- a/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/profile/FriendProfileScreen.kt +++ b/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/profile/FriendProfileScreen.kt @@ -13,7 +13,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.statusBars +import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CircleShape @@ -106,7 +106,7 @@ private fun FriendProfileScreen( modifier = Modifier .fillMaxSize() .background(colors.surfacePrimary) - .windowInsetsPadding(WindowInsets.statusBars) + .windowInsetsPadding(WindowInsets.systemBars) .verticalScroll(rememberScrollState()) .padding(PaddingValues(start = 20.dp, end = 20.dp, top = 8.dp, bottom = 100.dp)), verticalArrangement = Arrangement.spacedBy(16.dp), diff --git a/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/settings/SettingsScreen.kt b/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/settings/SettingsScreen.kt index df96310..33c04f2 100644 --- a/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/settings/SettingsScreen.kt +++ b/composeApp/src/androidMain/kotlin/com/github/jvsena42/echo/ui/settings/SettingsScreen.kt @@ -12,7 +12,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.statusBars +import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.rememberScrollState @@ -120,7 +120,7 @@ private fun SettingsScreen( modifier = Modifier .fillMaxSize() .background(colors.surfacePrimary) - .windowInsetsPadding(WindowInsets.statusBars) + .windowInsetsPadding(WindowInsets.systemBars) .verticalScroll(rememberScrollState()) .padding(PaddingValues(start = 20.dp, end = 20.dp, top = 8.dp, bottom = 100.dp)), verticalArrangement = Arrangement.spacedBy(16.dp),