fix(chat,langgraph): jank — stable @for tracking + empty-array guard#174
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- chat-message-list: `track message.id` (was `track $index`) so the @for doesn't tear down DOM when the messages array briefly shrinks/refills during streaming. Loses streaming-md renderer state on every teardown → visible flash + missed tokens. - stream-manager: skip publishing an empty `messages` array during streaming (both messages-event and values-event paths). An empty payload mid-stream shouldn't wipe the UI; this was the upstream cause of the transient empty-array we saw via MutationObserver instrumentation. - Bumps: @ngaf/chat 0.0.8 → 0.0.9, @ngaf/langgraph 0.0.2 → 0.0.3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9b6491f to
4bca3da
Compare
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
chat-message-listswitches@forfromtrack \$indextotrack message.id. During streaming the messages array can transiently shrink (and previously even briefly empty) — index-based tracking tore down every chat-message DOM element on each emission, resetting the streaming-md renderer state and causing visible flash/missed tokens.stream-manager.bridgeskips publishing an emptymessagesarray mid-stream (both messages-event and values-event paths). MutationObserver instrumentation showed an empty-array transient between user→assistant emissions; that empty replacement was the upstream cause of the teardown.Versions
@ngaf/chat: 0.0.8 → 0.0.9@ngaf/langgraph: 0.0.2 → 0.0.3Test plan
nx test chat— passes (95 tests)nx test langgraph— passes (95 tests)nx build chat,nx build langgraph— both clean🤖 Generated with Claude Code