Skip to content

feat(widget): bouncing-dots loading that survives thread switches - #60

Open
AmitAvital1 wants to merge 1 commit into
feat/widget-thread-listfrom
feat/widget-message-loading
Open

feat(widget): bouncing-dots loading that survives thread switches#60
AmitAvital1 wants to merge 1 commit into
feat/widget-thread-listfrom
feat/widget-message-loading

Conversation

@AmitAvital1

Copy link
Copy Markdown
Collaborator

Stack 4/4 · base: feat/widget-thread-list (#59)

Shows a bouncing-dots indicator while the assistant has no answer text yet, and keeps it visible when the user leaves a streaming thread and returns. Messages now live in a per-conversation map keyed by the id captured at submit time, so switching threads only swaps the view — the in-flight stream keeps writing to its own bucket. typing means "stream in flight" (set at submit, cleared at completion); reduceStreamEvent is reduced to content accumulation only, fixing dots that could otherwise linger on an empty final answer.

Verified: widget typecheck, test:widget, and Playwright e2e (incl. a new switch-away-and-back test) all green.

🤖 Generated with Claude Code

Show a bouncing-dots indicator while the assistant has no answer text
yet, and keep it visible when the user leaves a streaming thread and
returns.

Messages now live in a per-conversation map keyed by the id captured at
submit time, so switching threads only swaps the view — the in-flight
stream keeps writing to its own bucket. `typing` means "stream in
flight" (set at submit, cleared at completion); reduceStreamEvent is
reduced to content accumulation only, fixing dots that could otherwise
linger on an empty final answer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AmitAvital1 AmitAvital1 added the ui enhancement User-facing UI improvement label Jul 27, 2026
@AmitAvital1
AmitAvital1 requested a review from Asaf-prog July 27, 2026 17:25
@Asaf-prog

Copy link
Copy Markdown
Collaborator

The new per-conversation message state is a good improvement.

However, methods like stream(), send(), loadHistory(), and loadUsage() still read the active conversation ID from local storage.

This can cause a problem if the user switches conversations while a request is still running. The request may start in conversation A, but later use conversation B from local storage.

I suggest passing the conversation ID directly to every method:

stream(conversationId, text)
send(conversationId, text)
loadHistory(conversationId)
loadUsage(conversationId)

Local storage should only remember the last selected conversation. It should not decide which conversation an active request belongs to.

I would fix this before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui enhancement User-facing UI improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants