feat: move chat search into session overflow menu (#1183)
This commit is contained in:
1 file changed
+27
-16
@@ -503,22 +503,6 @@ fun ChatScreen(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions = {
|
actions = {
|
||||||
// Search toggle
|
|
||||||
IconButton(onClick = { viewModel.toggleSearch() }) {
|
|
||||||
Icon(
|
|
||||||
imageVector =
|
|
||||||
if (searchState.isActive) Icons.Filled.Close else Icons.Filled.Search,
|
|
||||||
contentDescription =
|
|
||||||
if (searchState.isActive) {
|
|
||||||
stringResource(
|
|
||||||
R.string.chat_action_close_search,
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
stringResource(R.string.chat_action_search)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
IconButton(onClick = { viewModel.createNewSession() }) {
|
IconButton(onClick = { viewModel.createNewSession() }) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.Add,
|
imageVector = Icons.Filled.Add,
|
||||||
@@ -542,6 +526,33 @@ fun ChatScreen(
|
|||||||
expanded = showSessionMenu,
|
expanded = showSessionMenu,
|
||||||
onDismissRequest = { showSessionMenu = false },
|
onDismissRequest = { showSessionMenu = false },
|
||||||
) {
|
) {
|
||||||
|
// Chat search lives in this overflow menu (moved from the top bar)
|
||||||
|
DropdownMenuItem(
|
||||||
|
text = {
|
||||||
|
Text(
|
||||||
|
stringResource(
|
||||||
|
if (searchState.isActive) {
|
||||||
|
R.string.chat_action_close_search
|
||||||
|
} else {
|
||||||
|
R.string.chat_action_search
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
leadingIcon = {
|
||||||
|
Icon(
|
||||||
|
imageVector =
|
||||||
|
if (searchState.isActive) Icons.Filled.Close else Icons.Filled.Search,
|
||||||
|
contentDescription = null,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
onClick = {
|
||||||
|
showSessionMenu = false
|
||||||
|
viewModel.toggleSearch()
|
||||||
|
},
|
||||||
|
modifier = Modifier.testTag("chat_menu_search"),
|
||||||
|
)
|
||||||
|
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(stringResource(R.string.session_integrations_menu_item)) },
|
text = { Text(stringResource(R.string.session_integrations_menu_item)) },
|
||||||
leadingIcon = {
|
leadingIcon = {
|
||||||
|
|||||||
Reference in new issue
Block a user