From 69e05160a34beeca9f81fd79dc0d59a55f19b1c1 Mon Sep 17 00:00:00 2001 From: Ernesto Barrera <44771579+ernestobarrera@users.noreply.github.com> Date: Sat, 25 Mar 2023 13:11:30 +0100 Subject: [PATCH] Added character count to alert message (#135) This improvement adds additional information to the alert that is displayed when the user enters more characters than allowed in the rich text element. Now, the alert also shows the number of characters that the user has entered, which helps to provide clearer and more useful feedback to the use --- components/Chat/ChatInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Chat/ChatInput.tsx b/components/Chat/ChatInput.tsx index f9c3474..8e686f3 100644 --- a/components/Chat/ChatInput.tsx +++ b/components/Chat/ChatInput.tsx @@ -20,7 +20,7 @@ export const ChatInput: FC = ({ onSend, messageIsStreaming, model, stopCo const maxLength = model.id === OpenAIModelID.GPT_3_5 ? 12000 : 24000; if (value.length > maxLength) { - alert(`Message limit is ${maxLength} characters`); + alert(`Message limit is ${maxLength} characters. You have entered ${value.length} characters.`); return; }