From ea338ea81ae9e56efa7c02379a01420a8c5a18dc Mon Sep 17 00:00:00 2001 From: Paul Hitt Date: Wed, 26 Aug 2026 11:00:55 -0400 Subject: [PATCH] The tab bar floated mid-screen, and the Account tab could not be reached MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by opening the two tabs nothing had ever opened. ⚠️ **The tab bar was not pinned.** It and the screen content were plain siblings in a Column with no weight between them, so the bar sat immediately under whatever had been drawn: near the TOP of an empty Alerts tab, above a screen of blank, which reads as a broken layout rather than as an empty state. 🔴 **On the Account tab it was pushed off the bottom entirely, and the screen could not scroll.** Account is taller than the viewport, so the sign-out explanation was unreadable and there was no way to switch tabs from it at all. The content area now takes the weight and the bar sits below it. ⚠️ Only the screens WITHOUT a lazy list scroll — Contacts owns a LazyColumn, and a lazy list inside a vertically scrolling Column is measured with infinite height and crashes outright, which is what the comment there has always warned about. ⚠️ Not a bug, for whoever sees it next: "Flamenet Messenger isn't responding" on the emulator during this work was the SYSTEM starving, not the app. The ANR reason names `Taskbar (server) is not responding, waited 33979ms` with the host at load 35. The app's own restore does its network work inside `withContext(Dispatchers.IO)`; it was not blocking the main thread. ⚠️ Also seen and left alone: the group row shows "You, user 32" for a few seconds after a cold start, because the buddy list has not loaded yet and the fallback prints the raw id. It corrects itself once buddies arrive. Naming it properly would mean carrying member handles on the group record, which the relay does not send today. Co-Authored-By: Claude Opus 5 --- .../io/flamenet/messenger/app/MainActivity.kt | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/io/flamenet/messenger/app/MainActivity.kt b/app/src/main/kotlin/io/flamenet/messenger/app/MainActivity.kt index 4d76c92..2364bf2 100644 --- a/app/src/main/kotlin/io/flamenet/messenger/app/MainActivity.kt +++ b/app/src/main/kotlin/io/flamenet/messenger/app/MainActivity.kt @@ -95,11 +95,38 @@ private fun Root(model: MessengerViewModel = viewModel()) { if (chat != null) { ChatScreen(model, chat, current.error, current.buddies) } else { - when (current.screen) { - MessengerViewModel.Phase.Screen.CONTACTS -> SignedIn(model, current) - MessengerViewModel.Phase.Screen.NOTIFICATIONS -> - NotificationsScreen(model, current) - MessengerViewModel.Phase.Screen.ACCOUNT -> AccountScreen(model, current) + // 🔴 **The content area is weighted, and the tab bar is + // not.** These used to be plain siblings, so the tab bar + // sat immediately under whatever the screen had drawn: + // near the TOP of an empty Alerts tab, and pushed clean + // OFF the bottom by the Account tab, which is taller + // than the screen. Account also could not scroll, so the + // sign-out explanation was unreadable and there was no + // way back to another tab. + // + // ⚠️ Only the screens WITHOUT a lazy list may scroll. + // Contacts owns a LazyColumn, and a lazy list inside a + // vertically scrolling Column is measured with infinite + // height and crashes outright. + Column( + modifier = Modifier + .weight(1f) + .then( + if (current.screen == MessengerViewModel.Phase.Screen.CONTACTS) { + Modifier + } else { + Modifier.verticalScroll(rememberScrollState()) + } + ), + verticalArrangement = Arrangement.spacedBy(12.dp), + ) { + when (current.screen) { + MessengerViewModel.Phase.Screen.CONTACTS -> SignedIn(model, current) + MessengerViewModel.Phase.Screen.NOTIFICATIONS -> + NotificationsScreen(model, current) + MessengerViewModel.Phase.Screen.ACCOUNT -> + AccountScreen(model, current) + } } BottomNav(model, current) }