fix(chat): eliminate conversation switch flicker - #390
Open
AprilNEA wants to merge 1 commit into
Open
Conversation
AprilNEA
marked this pull request as ready for review
August 2, 2026 07:37
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.
What changed
virtua's external-scroll offset synchronized while row measurements settle before the first paintRoot cause
The session surface still derived its active conversation from
useDeferredValue(selectedId). That deferral was introduced with the old View Transition path, but remained after View Transitions were removed, so a click intentionally committed one more frame of the outgoing conversation.After that stale frame was removed, the existing synchronous DOM snap exposed a second timing gap:
virtuatracks an external scroller from scroll events. As measured row heights settled, the DOM reached the bottom before the virtualizer learned the new offset, leaving the first paint about 9.75 px above the tail.Impact
Switching conversations now paints the selected conversation directly at its latest message. The optional smooth-follow setting from #385 remains unchanged for users who explicitly enable it.
Verification
pnpm check:cipnpm test— 302 files passed, 3 skipped; 2,435 tests passed, 5 skippedpnpm -F @linkcode/webview e2e:browseruseDeferredValuefails withFirst paint still showed "Wire the workbench to the daemon"Tracks CODE-259.