fix(chat): make search bar clickable (was overlayed by message list) (#492)
* fix(chat): make search bar clickable by giving ChatMessageList a vertical layout The search bar (AnimatedVisibility) and the message LazyColumn were emitted as siblings with no container. The call site is a Box, which overlays children — so the LazyColumn rendered on top of the search bar, intercepting every pointer event. The bar stayed visible but was dead (nothing inside clickable: input, nav arrows, close). Wrap ChatMessageList's children in a Column so the bar occupies real layout space above the list; the LazyColumn now takes weight(1f) and scrolls independently. Fixes #490. * refactor(chat): simplify search-list LazyColumn modifier Use fillMaxWidth().weight(1f) instead of fillMaxSize().weight(1f) inside the new Column — weight already claims the remaining vertical space, so fillMaxSize was redundant/contradictory (Sourcery review nit). Note: the Sourcery 'use LocalHermesStatusColors' suggestion on the search bar Surface is a false positive — that rule covers SEMANTIC status colors (success/warning/error/info) only. surfaceContainerLow/outline are neutral Material surface chrome, not status colors; LocalHermesStatusColors does not even expose them. The corresponding status dot correctly uses StatusRed.
This commit is contained in:
1 file changed
+7
-1
@@ -1402,6 +1402,11 @@ private fun ChatMessageList(
|
|||||||
onLastAnimatedMessageIdChange: (String?) -> Unit,
|
onLastAnimatedMessageIdChange: (String?) -> Unit,
|
||||||
viewModel: ChatViewModel,
|
viewModel: ChatViewModel,
|
||||||
) {
|
) {
|
||||||
|
// Lay children out vertically so the search bar occupies real layout space
|
||||||
|
// ABOVE the message list. Without this container the call site is a Box,
|
||||||
|
// which overlays the LazyColumn on top of the search AnimatedVisibility and
|
||||||
|
// swallows every tap on the bar (bar visible but not clickable).
|
||||||
|
Column(modifier = Modifier.fillMaxSize()) {
|
||||||
// Search bar
|
// Search bar
|
||||||
androidx.compose.animation.AnimatedVisibility(
|
androidx.compose.animation.AnimatedVisibility(
|
||||||
visible = isSearchActive,
|
visible = isSearchActive,
|
||||||
@@ -1441,7 +1446,7 @@ private fun ChatMessageList(
|
|||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
state = listState,
|
state = listState,
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxWidth().weight(1f),
|
||||||
contentPadding = PaddingValues(vertical = 8.dp),
|
contentPadding = PaddingValues(vertical = 8.dp),
|
||||||
) {
|
) {
|
||||||
itemsIndexed(
|
itemsIndexed(
|
||||||
@@ -1506,6 +1511,7 @@ private fun ChatMessageList(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|||||||
Reference in new issue
Block a user