Skip to content

feat(webchat): show typing indicator as soon as the guest sends a message - #1764

Merged
sung17 merged 3 commits into
mainfrom
feat/webchat-instant-typing
Nov 23, 2026
Merged

sung17 merged 3 commits into
mainfrom
feat/webchat-instant-typing

Conversation

@sung17

@sung17 sung17 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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 sets isTyping after 1s (OPTIMISTIC_TYPING_DELAY_MS) and clears it 15s later (OPTIMISTIC_TYPING_TIMEOUT_MS) if no reply arrives (e.g. no flow matched).
  • Triggered on text sends, file sends and postback buttons (not URL buttons).
  • Any server typing event or outgoing message takes over and cancels the fallback timer; a failed send (markMessageFailed, postback error) hides the bubble.

UI-only change in client state — no new operation, so no public API procedure needed.

Test plan

  • New tests in 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)
  • Webchat test suites pass
  • pnpm lint, pnpm --filter builder check-types
  • Manual: send a message in the webchat and confirm "…" shows after ~1s, then disappears on reply

🤖 Generated with Claude Code

…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]>
@github-actions github-actions Bot added the feature New feature or request label Nov 23, 2026
Deathgiver and others added 2 commits November 23, 2026 14:03
A reply that lands within a second no longer flashes the bubble.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sung17
sung17 merged commit fdd7ccf into main Nov 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant