Repository navigation
feat(webchat): show typing indicator as soon as the guest sends a message - #1764
Merged
Merged
Conversation
…sage The bot's typing bubble only appeared once the server replied, so slow flows felt unresponsive. Show it optimistically on text, file and postback sends, hide it on failure, and fall back after 15s when no reply comes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A reply that lands within a second no longer flashes the bubble. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The webchat typing bubble ("…") only appeared once the server sent a typing event or a reply, so a slow flow made the bot feel unresponsive. This shows it on the client 1s after the guest sends something; a reply within that second skips the bubble.
showOptimisticTyping()in the guest session store setsisTypingafter 1s (OPTIMISTIC_TYPING_DELAY_MS) and clears it 15s later (OPTIMISTIC_TYPING_TIMEOUT_MS) if no reply arrives (e.g. no flow matched).markMessageFailed, postback error) hides the bubble.UI-only change in client state — no new operation, so no public API procedure needed.
Test plan
apps/builder/__tests__/webchat-guest-session.test.ts(shows after the delay / reply within the delay never shows it / times out / server event cancels timer / failed send hides)pnpm lint,pnpm --filter builder check-types🤖 Generated with Claude Code