feat: add 200 character limit with counter to chat input field
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -256,13 +256,23 @@ fun ChatScreen(
|
||||
}
|
||||
OutlinedTextField(
|
||||
value = inputText,
|
||||
onValueChange = { inputText = it },
|
||||
onValueChange = { if (it.length <= 200) inputText = it },
|
||||
placeholder = {
|
||||
Text(if (uiState.editingMessageId != null) "编辑消息..." else "输入消息...")
|
||||
},
|
||||
modifier = Modifier.weight(1f),
|
||||
maxLines = 8,
|
||||
enabled = !uiState.isLoading && !uiState.isStreaming
|
||||
enabled = !uiState.isLoading && !uiState.isStreaming,
|
||||
supportingText = {
|
||||
Text(
|
||||
"${inputText.length}/200",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = if (inputText.length >= 200)
|
||||
MaterialTheme.colorScheme.error
|
||||
else
|
||||
MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user