fix: lift NestLobby header out of the chat LazyColumn

The room metadata (RoomHeader) and live listener count were items
inside the reverse-layout LazyColumn, so they scrolled with the chat
and forced the chat to share its viewport. Move them to a regular
Column above the LazyColumn so the chat list owns most of the screen
and the header sits as a fixed row on top.

Drop the redundant "Recent chat" label that was only there to
separate the in-list header from messages.
This commit is contained in:
Claude
2026-04-30 20:50:53 +00:00
parent 276b25a448
commit 61bed279fc
@@ -197,30 +197,17 @@ private fun NestLobbyContent(
.consumeWindowInsets(padding)
.imePadding(),
) {
// Same chat list shape as NestFullScreen: a reverse-layout
// LazyColumn keyed by note id. The lobby uses cached
// LocalCache notes instead of an active NestViewModel.chat,
// and stacks the room metadata (header, listener count,
// "Recent chat" label) above the oldest message so the
// user can scroll up through history into the room info.
RoomHeader(event, accountViewModel, nav)
CachedListenerCount(roomATag)
// Reverse-layout LazyColumn keyed by note id, same shape as
// NestFullScreen's chat list. The lobby reads cached
// LocalCache notes instead of an active NestViewModel.chat.
LazyColumn(
modifier = Modifier.weight(1f).fillMaxSize(),
modifier = Modifier.weight(1f).fillMaxWidth(),
state = listState,
reverseLayout = true,
) {
items(
items = messages,
key = { it.idHex },
) { note ->
ChatroomMessageCompose(
baseNote = note,
routeForLastRead = routeForLastRead,
accountViewModel = accountViewModel,
nav = nav,
onWantsToReply = nestScreenModel::reply,
onWantsToEditDraft = nestScreenModel::editFromDraft,
)
}
if (messages.isEmpty()) {
item("chat-empty") {
Text(
@@ -233,19 +220,19 @@ private fun NestLobbyContent(
)
}
}
item("chat-header") {
Text(
text = stringRes(R.string.nest_lobby_recent_chat),
style = MaterialTheme.typography.titleSmall,
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),
items(
items = messages,
key = { it.idHex },
) { note ->
ChatroomMessageCompose(
baseNote = note,
routeForLastRead = routeForLastRead,
accountViewModel = accountViewModel,
nav = nav,
onWantsToReply = nestScreenModel::reply,
onWantsToEditDraft = nestScreenModel::editFromDraft,
)
}
item("listeners") {
CachedListenerCount(roomATag)
}
item("header") {
RoomHeader(event, accountViewModel, nav)
}
}
// The composer sits above the 3-button nav when the keyboard