Skip to content

fix(ChatMessages): re-evaluate streaming indicator on each render - #244

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-5c986dd
Jul 10, 2026
Merged

fix(ChatMessages): re-evaluate streaming indicator on each render#244
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-5c986dd

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Upstream

5c986ddfix(ChatMessages): re-evaluate streaming indicator on each render (#6673)

Change — direct 1:1

Convert showIndicator from a computed to a plain function called as showIndicator(). @ai-sdk/vue stores messages in a shallowRef grown by in-place mutation + triggerRef, so neither the array nor the message objects change identity — a computed caches its result on the first streaming render (empty assistant message) and never recomputes, leaving the typing indicator stuck. A per-render function ties the indicator to the render that shows the streamed content.

b24ui's ChatMessages.vue matched upstream exactly; applied verbatim (computed stays imported, still used elsewhere).

Not entangled with the deferred AI-SDK-v7 migration — this is a Vue-reactivity/render fix that holds under the existing @ai-sdk/vue shallowRef+triggerRef model regardless of ai v6/v7.

Tests

Ported the upstream spec case verbatim (hides the streaming indicator once the assistant message produces parts) — reproduces the shallowRef+triggerRef model via a Parent wrapper re-rendering on a spacingOffset tick (b24ui's ChatMessages has that prop), asserting [data-slot="indicator"] appears then disappears. Behavioural fix, no snapshot churn. Suite 5277 passed (+2).

Verify (CI=true)

dev:prepare · lint · typecheck · test · build — all green.

Ledger

🤖 Generated with Claude Code


Generated by Claude Code

Port of upstream nuxt/ui 5c986dd (#6673).

Convert `showIndicator` from a `computed` to a plain function called as
`showIndicator()`. @ai-sdk/vue stores messages in a shallowRef grown by in-place
mutation + triggerRef, so a computed caches on the first streaming render (empty
assistant message) and never recomputes, leaving the typing indicator stuck. A
per-render function ties the indicator to the render that shows the streamed
content.

Ports the upstream spec case reproducing the shallowRef+triggerRef model.
Behavioural fix; no snapshot changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik
IgorShevchik merged commit fffec68 into main Jul 10, 2026
1 check passed
@IgorShevchik
IgorShevchik deleted the sync/nuxt-5c986dd branch July 10, 2026 09:07
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.

2 participants