Merge pull request #2671 from vitorpamplona/claude/fix-nestlobby-layout-ofVC0
Refactor NestLobbyScreen layout: move header outside LazyColumn
This commit is contained in:
+18
-31
@@ -197,30 +197,17 @@ private fun NestLobbyContent(
|
|||||||
.consumeWindowInsets(padding)
|
.consumeWindowInsets(padding)
|
||||||
.imePadding(),
|
.imePadding(),
|
||||||
) {
|
) {
|
||||||
// Same chat list shape as NestFullScreen: a reverse-layout
|
RoomHeader(event, accountViewModel, nav)
|
||||||
// LazyColumn keyed by note id. The lobby uses cached
|
CachedListenerCount(roomATag)
|
||||||
// LocalCache notes instead of an active NestViewModel.chat,
|
|
||||||
// and stacks the room metadata (header, listener count,
|
// Reverse-layout LazyColumn keyed by note id, same shape as
|
||||||
// "Recent chat" label) above the oldest message so the
|
// NestFullScreen's chat list. The lobby reads cached
|
||||||
// user can scroll up through history into the room info.
|
// LocalCache notes instead of an active NestViewModel.chat.
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.weight(1f).fillMaxSize(),
|
modifier = Modifier.weight(1f).fillMaxWidth(),
|
||||||
state = listState,
|
state = listState,
|
||||||
reverseLayout = true,
|
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()) {
|
if (messages.isEmpty()) {
|
||||||
item("chat-empty") {
|
item("chat-empty") {
|
||||||
Text(
|
Text(
|
||||||
@@ -233,19 +220,19 @@ private fun NestLobbyContent(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item("chat-header") {
|
items(
|
||||||
Text(
|
items = messages,
|
||||||
text = stringRes(R.string.nest_lobby_recent_chat),
|
key = { it.idHex },
|
||||||
style = MaterialTheme.typography.titleSmall,
|
) { note ->
|
||||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),
|
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
|
// The composer sits above the 3-button nav when the keyboard
|
||||||
|
|||||||
Reference in New Issue
Block a user