fix(ChatMessages): re-evaluate streaming indicator on each render - #244
Merged
Conversation
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
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.
Upstream
5c986dd—fix(ChatMessages): re-evaluate streaming indicator on each render (#6673)Change — direct 1:1
Convert
showIndicatorfrom acomputedto a plain function called asshowIndicator().@ai-sdk/vuestores messages in ashallowRefgrown by in-place mutation +triggerRef, so neither the array nor the message objects change identity — acomputedcaches its result on the firststreamingrender (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.vuematched upstream exactly; applied verbatim (computedstays 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/vueshallowRef+triggerRefmodel regardless ofaiv6/v7.Tests
Ported the upstream spec case verbatim (
hides the streaming indicator once the assistant message produces parts) — reproduces theshallowRef+triggerRefmodel via aParentwrapper re-rendering on aspacingOffsettick (b24ui'sChatMessageshas 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
.sync/log/5c986dd….md— port rationale.sync/nuxt-ui.json— add5c986ddasport, advance cursor; reconcile prior53e88a4→ PR feat(Drawer): add close and closeIcon props #243 /7cb7f642.🤖 Generated with Claude Code
Generated by Claude Code