Skip to content

Improve Status Handling and Stop Button Logic in Multimodal Input #877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

liby
Copy link

@liby liby commented Mar 19, 2025

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:

  1. 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.
  2. 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.

Copy link

vercel bot commented Mar 19, 2025

@liby is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@gianpaj
Copy link

gianpaj commented Apr 2, 2025

I believe this is the correct logic. As the status could be error and also you can stop a stream that's submitted

#900

@liby liby force-pushed the fix/stop-button-condition branch from 721d1bc to 6a7bb13 Compare April 2, 2025 15:07
@liby liby changed the title Fix Stop Button Display Condition Improve Status Handling and Stop Button Logic in Multimodal Input Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants