* fix(#575): drop description text from slash-command suggestions * fix(#575): show /stop and /interrupt in slash-command menu --------- Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
@@ -717,11 +717,8 @@ private fun ChatInputBar(
|
|||||||
elevation = CardDefaults.cardElevation(defaultElevation = 6.dp),
|
elevation = CardDefaults.cardElevation(defaultElevation = 6.dp),
|
||||||
) {
|
) {
|
||||||
Column {
|
Column {
|
||||||
// Build command list from dynamic catalog (pairs = [name, description])
|
// All catalog commands are offered in the suggestion menu
|
||||||
val allCommands = commandCatalog.pairs.associate { (name, desc) -> name to desc }
|
val commandNames = commandCatalog.pairs.map { it[0] }
|
||||||
// Commands hidden from suggestion menu (still work when manually typed)
|
|
||||||
val hiddenSlashDisplay = setOf("/stop", "/interrupt")
|
|
||||||
val commandNames = allCommands.keys.filter { it !in hiddenSlashDisplay }
|
|
||||||
|
|
||||||
androidx.compose.animation.AnimatedVisibility(
|
androidx.compose.animation.AnimatedVisibility(
|
||||||
visible = inputText.startsWith("/") && !inputText.contains(" "),
|
visible = inputText.startsWith("/") && !inputText.contains(" "),
|
||||||
@@ -747,24 +744,13 @@ private fun ChatInputBar(
|
|||||||
modifier = Modifier.heightIn(max = 200.dp),
|
modifier = Modifier.heightIn(max = 200.dp),
|
||||||
) {
|
) {
|
||||||
items(filteredCommands, key = { it }) { cmd ->
|
items(filteredCommands, key = { it }) { cmd ->
|
||||||
val description = allCommands[cmd] ?: ""
|
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = {
|
text = {
|
||||||
Row(
|
Text(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
cmd,
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
fontWeight = androidx.compose.ui.text.font.FontWeight.Bold,
|
||||||
) {
|
color = MaterialTheme.colorScheme.primary,
|
||||||
Text(
|
)
|
||||||
cmd,
|
|
||||||
fontWeight = androidx.compose.ui.text.font.FontWeight.Bold,
|
|
||||||
color = MaterialTheme.colorScheme.primary,
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
description,
|
|
||||||
style = MaterialTheme.typography.bodySmall,
|
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onClick = { onInputChange(cmd) },
|
onClick = { onInputChange(cmd) },
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user