Chat Input Persistence Issue
1. Summary
In the Arcsphere chat interface, the input field does not consistently clear or disable immediately after the user submits a message. This allows for rapid "double-asking" or leaves the previous message text in the bar, leading to user confusion regarding whether the message was successfully sent.
2. Steps to Reproduce
- Open the Arcsphere application or navigate to the chat section.
- Enter a query into the AI chat input field.
- Click the Send button or press Enter.
- Observe the input field immediately after the message appears in the chat history.
- (Optional) Attempt to click "Send" again quickly before the AI starts responding.
3. Expected Result
- The input field should be cleared immediately upon submission.
- The "Send" button should be disabled or replaced by a loading state until the AI begins its response to prevent multiple overlapping requests.
4. Actual Result
- The text input occasionally remains filled with the previous message.
- The input remains active, allowing users to send the same prompt multiple times, which can trigger race conditions or rate limits.
- No visual feedback (like a loading icon) is provided to indicate the system is processing the first request.
5. Suggested Fixes
- Immediate Reset: Implement a function to reset the input field value to an empty string (
"") the moment the submit event is triggered. - Input Debouncing: Disable the "Send" icon for 1–2 seconds after a click to prevent duplicate "asks".
- Visual State Change: Add a loading spinner or change the button color once the message is sent to confirm the action to the user.