-
Notifications
You must be signed in to change notification settings - Fork 18
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
3029: Add typing indicator for automatic replies in chat #3056
base: main
Are you sure you want to change the base?
Conversation
50de658
to
2a08823
Compare
2a08823
to
529d718
Compare
The typing indicator also appearing before the automatic reply, I have no idea how to limit this behaviour... Any ideas? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good already, I just think the condition when to display the typing indicator is still wrong. I only get it if the last message is not from the user.
@@ -41,6 +54,19 @@ const ChatConversation = ({ messages, hasError, className }: ChatConversationPro | |||
} | |||
}, [messages, messagesCount]) | |||
|
|||
// eslint-disable-next-line consistent-return | |||
useEffect(() => { | |||
if (!lastMessage?.userIsAuthor && lastMessage?.isAutomaticAnswer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I am not really sure abot that condition... shouldn't the typing indicator basically be displayed 60s after the user sends a message? i.e. shouldn't this be
if (!lastMessage?.userIsAuthor && lastMessage?.isAutomaticAnswer) { | |
if (lastMessage?.userIsAuthor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not working with lastMessage because lastMessage is automatic answer, as Sven noted that we should show it only after the automatic answer, but the problem is that we have only two parameters userIsAuthor
and automaticAnswer
, we do not have properties for chatbot and for real person to limit it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misunderstood Svens message, sorry. You implemented it perfectly! See here for clarification: #3029 (comment)
Since you exactly implemented it like this, nothing to do here anymore :)
Also see my question here: #3029 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on firefox, works as expected.
Short description
Typing indicator message (...) for 60 seconds should be shown after automatic answer in chat. It will be a temporary solution untill the websocket implementation
Proposed changes
Side effects
Resolved issues
Fixes: #3029