feat: add 200 character limit with counter to chat input field
Some checks failed
CI/CD Pipeline / Backend — Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend — Lint & Build (push) Has been cancelled
CI/CD Pipeline / Docker — Build Check (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 00:35:08 +08:00
parent 971f0c33a9
commit 43d5347458

View File

@@ -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))