From ad10f891b63a072d12108fed44b451f5d6dd80d8 Mon Sep 17 00:00:00 2001 From: christopher Date: Thu, 17 Sep 2026 04:47:45 -0400 Subject: [PATCH] Fix double window-inset padding from the mini-player Scaffold hoist Hoisting the mini-player into an outer Scaffold (previous commit) introduced a real regression: extra space above the top header, and a dead gap between the bottom tab bar and the mini-player. Root cause: TopAppBar and Material3's NavigationBar (used by BottomNavBar) are self-inset-aware - they only ever looked correct because they sat directly at the true screen edges. Now they're nested one level deeper inside the outer Scaffold's content area: - The outer Scaffold has no topBar, so with its default contentWindowInsets it fell back to reserving the raw status-bar inset itself as top padding on the NavHost - on top of MainScreen's own TopAppBar doing the same thing a second time. - BottomNavBar unconditionally pads itself for the navigation-bar inset regardless of what's below it, but MiniPlayerBar (which already self-pads for that inset) now always sits below it - so BottomNavBar was reserving space for an inset it's no longer adjacent to. Fixed by zeroing contentWindowInsets on the outer Scaffold (it has nothing of its own to protect beyond MiniPlayerBar's already-real measured height) and zeroing BottomNavBar's own windowInsets (since MiniPlayerBar is now what's genuinely bottom-adjacent). Verified on-device across Home/Library/ArtistDetail/Settings: tight header spacing restored, tab bar sits flush against the mini-player with no gap. Co-Authored-By: Claude Sonnet 5 --- .../deepwave/ui/components/BottomNavBar.kt | 6 +++++- .../deepwave/ui/navigation/DeepwaveNavHost.kt | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/InfernalAquatics/deepwave/ui/components/BottomNavBar.kt b/app/src/main/java/com/InfernalAquatics/deepwave/ui/components/BottomNavBar.kt index e276002..dbd3e80 100644 --- a/app/src/main/java/com/InfernalAquatics/deepwave/ui/components/BottomNavBar.kt +++ b/app/src/main/java/com/InfernalAquatics/deepwave/ui/components/BottomNavBar.kt @@ -1,6 +1,7 @@ package com.InfernalAquatics.deepwave.ui.components import android.content.res.Configuration +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Home import androidx.compose.material.icons.filled.LibraryMusic @@ -28,7 +29,10 @@ enum class BottomTab(val labelRes: Int, val icon: ImageVector) { @Composable fun BottomNavBar(selectedTab: BottomTab, onTabSelected: (BottomTab) -> Unit) { - NavigationBar { + // Zero: MiniPlayerBar always sits below this now, so this is never actually the true + // bottom-most element - it would otherwise pad itself for a nav-bar inset that isn't + // adjacent to it anymore, leaving a dead gap above MiniPlayerBar. + NavigationBar(windowInsets = WindowInsets(0, 0, 0, 0)) { BottomTab.entries.forEach { tab -> val label = stringResource(tab.labelRes) NavigationBarItem( diff --git a/app/src/main/java/com/InfernalAquatics/deepwave/ui/navigation/DeepwaveNavHost.kt b/app/src/main/java/com/InfernalAquatics/deepwave/ui/navigation/DeepwaveNavHost.kt index 44d976a..e79721f 100644 --- a/app/src/main/java/com/InfernalAquatics/deepwave/ui/navigation/DeepwaveNavHost.kt +++ b/app/src/main/java/com/InfernalAquatics/deepwave/ui/navigation/DeepwaveNavHost.kt @@ -1,6 +1,7 @@ package com.InfernalAquatics.deepwave.ui.navigation import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.material3.CircularProgressIndicator @@ -52,6 +53,13 @@ fun DeepwaveNavHost( } ?: false Scaffold( + // Zero: this Scaffold has no topBar, and MiniPlayerBar already handles its own + // bottom nav-bar inset. Without this, Scaffold falls back to reserving the raw + // system-bar insets itself (since there's no topBar to "own" them), stacking on + // top of what each screen's own Scaffold below already does - double top padding, + // and a BottomNavBar that no longer sits at the true bottom edge padding for a + // nav-bar inset that isn't there anymore. + contentWindowInsets = WindowInsets(0, 0, 0, 0), bottomBar = { if (showMiniPlayer) { MiniPlayerBar(