Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lunars97
Copy link
Contributor

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

  • Add typing indicator function
  • Style typing indicator in a similar manner

Side effects

  • none

Resolved issues

Fixes: #3029


@lunars97 lunars97 force-pushed the 3029-add-typing-indicator-for-automatic-replies branch from 50de658 to 2a08823 Compare January 29, 2025 08:29
@lunars97 lunars97 force-pushed the 3029-add-typing-indicator-for-automatic-replies branch from 2a08823 to 529d718 Compare January 29, 2025 09:11
@lunars97 lunars97 changed the title Add typing indicator for automatic replies in chat 3029: Add typing indicator for automatic replies in chat Jan 29, 2025
@lunars97
Copy link
Contributor Author

The typing indicator also appearing before the automatic reply, I have no idea how to limit this behaviour... Any ideas?

Copy link
Member

@steffenkleinle steffenkleinle left a 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.

web/src/components/ChatConversation.tsx Outdated Show resolved Hide resolved
web/src/components/ChatConversation.tsx Outdated Show resolved Hide resolved
web/src/components/ChatConversation.tsx Outdated Show resolved Hide resolved
web/src/components/ChatConversation.tsx Outdated Show resolved Hide resolved
web/src/components/ChatConversation.tsx Outdated Show resolved Hide resolved
@steffenkleinle
Copy link
Member

Also see my question here: #3029 (comment)

Copy link
Member

@steffenkleinle steffenkleinle left a 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.

web/src/components/ChatMessage.tsx Outdated Show resolved Hide resolved
web/src/components/ChatConversation.tsx Outdated Show resolved Hide resolved
Comment on lines 43 to 44
const showIndicatorOfTyping =
messages[messages.length - 1]?.userIsAuthor || messages[messages.length - 2]?.userIsAuthor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that if the message before the last one is a user it will show the 3 dot.
Shouldn't be shown just if the last message is coming from a user?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point and I think you are right. Seems like I was a little tired already when I made my review, sorry :D Probably we would need a condition in the following way:
Show the indicator if either

  • the last message was sent by the user OR
  • there is only one message yet that was NOT sent by the user (as that is the automatic answer)

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.

Add "Typing" message for automatic replies
3 participants