Skip to content

Commit e5e6cf0

Browse files
committed
fix(android): hide nav under command palette
1 parent 4f87400 commit e5e6cf0

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

apps/android/app/src/main/java/ai/openclaw/app/ui/ShellScreen.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ private val shellNavTabs = listOf(Tab.Overview, Tab.Chat, Tab.Voice, Tab.Setting
103103
private val shellContentInsets: WindowInsets
104104
@Composable get() = WindowInsets.safeDrawing.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal)
105105

106+
internal fun shellBottomNavVisible(keyboardVisible: Boolean, commandOpen: Boolean): Boolean = !keyboardVisible && !commandOpen
107+
106108
/** Main post-onboarding shell that owns top-level Android navigation state. */
107109
@Composable
108110
fun ShellScreen(
@@ -150,13 +152,14 @@ fun ShellScreen(
150152

151153
val density = LocalDensity.current
152154
val keyboardVisible = WindowInsets.ime.getBottom(density) > 0
155+
val showBottomNav = shellBottomNavVisible(keyboardVisible = keyboardVisible, commandOpen = commandOpen)
153156

154157
Scaffold(
155158
modifier = modifier.fillMaxSize(),
156159
containerColor = ClawTheme.colors.canvas,
157160
contentWindowInsets = WindowInsets(0, 0, 0, 0),
158161
bottomBar = {
159-
if (!keyboardVisible) {
162+
if (showBottomNav) {
160163
ClawBottomNav(
161164
items = shellNavTabs.map { ClawNavItem(key = it.key, label = it.label, icon = it.icon) },
162165
selectedKey = if (activeTab in shellNavTabs) activeTab.key else Tab.Overview.key,

apps/android/app/src/test/java/ai/openclaw/app/ui/ShellScreenLogicTest.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@ import ai.openclaw.app.GatewayChannelsSummary
55
import ai.openclaw.app.GatewayNodesDevicesSummary
66
import ai.openclaw.app.GatewayPendingDeviceSummary
77
import org.junit.Assert.assertEquals
8+
import org.junit.Assert.assertFalse
9+
import org.junit.Assert.assertTrue
810
import org.junit.Test
911

1012
class ShellScreenLogicTest {
13+
@Test
14+
fun bottomNavHidesForKeyboardAndCommandPalette() {
15+
assertTrue(shellBottomNavVisible(keyboardVisible = false, commandOpen = false))
16+
assertFalse(shellBottomNavVisible(keyboardVisible = true, commandOpen = false))
17+
assertFalse(shellBottomNavVisible(keyboardVisible = false, commandOpen = true))
18+
}
19+
1120
@Test
1221
fun homeAttentionRowsSurfaceGatewayWhenDisconnected() {
1322
val rows =

0 commit comments

Comments
 (0)