Skip to content

Commit 85c7c3b

Browse files
committed
fix(android): hide empty sidebar groups
1 parent 063d8dc commit 85c7c3b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ internal fun sidebarSessionPresentation(
139139
val visibleSessions =
140140
if (expanded) recentSessions else recentSessions.take(SIDEBAR_SESSION_LIMIT)
141141
return SidebarSessionPresentation(
142-
sections = groupSessionEntries(visibleSessions, knownGroups),
142+
sections = groupSessionEntries(visibleSessions, knownGroups).filter { it.entries.isNotEmpty() },
143143
canExpand = recentSessions.size > SIDEBAR_SESSION_LIMIT,
144144
)
145145
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ class SidebarShellLogicTest {
146146
val keys = presentation.sections.flatMap { it.entries }.map(ChatSessionEntry::key)
147147
assertEquals(8, keys.size)
148148
assertEquals(setOf("pinned", "session-10", "session-9", "session-8", "session-7", "session-6", "session-5", "session-4"), keys.toSet())
149-
assertEquals(listOf("Pinned", "Personal", "Work", "Ungrouped"), presentation.sections.map { it.title })
149+
assertEquals(listOf("Pinned", "Work", "Ungrouped"), presentation.sections.map { it.title })
150+
assertTrue(presentation.sections.all { it.entries.isNotEmpty() })
150151
assertTrue(presentation.canExpand)
151152
}
152153

0 commit comments

Comments
 (0)