ai-chatbot
ai-chatbot copied to clipboard
Improve Status Handling and Stop Button Logic in Multimodal Input
This PR refines the status handling and improves the display logic for the action button (Send/Stop) in the MultimodalInput component based on recent feedback.
Key changes include:
-
Stop Button Display: The Stop button is now displayed when the chat status is either
'submitted'or'streaming'. This ensures the user can stop the request both immediately after submission and while the response is actively streaming. -
Error Toast Condition: The condition for displaying the "Please wait for the model to finish its response!" toast notification has been updated. It now specifically checks if
status === 'submitted' || status === 'streaming'before preventing a new submission via the Enter key. This avoids showing the message incorrectly when the status might be'error'.
These changes ensure a more accurate and user-friendly interaction flow within the chat input component.
@liby is attempting to deploy a commit to the Vercel Team on Vercel.
A member of the Team first needs to authorize it.
I believe this is the correct logic. As the status could be error and also you can stop a stream that's submitted
https://github.com/vercel/ai-chatbot/pull/900