fix(app): eliminate session switch latency — deferRender, Suspense flash, instant rendering#27912
Open
BYK wants to merge 3 commits into
Open
fix(app): eliminate session switch latency — deferRender, Suspense flash, instant rendering#27912BYK wants to merge 3 commits into
BYK wants to merge 3 commits into
Conversation
…poser timeout Remove the deferRender mechanism that blanked the review panel and composer for one animation frame on every session switch. Remove the 140ms artificial setTimeout in session-composer-region that stacked on top, causing a total ~170ms gap where the composer was invisible. The composer now re-shows after a single rAF yield (~16ms).
The sessionSync createResource was read in JSX ({sessionSync() ?? ""}),
which triggered the nearest <Suspense> boundary (the app-level splash
screen) on every session switch while the sync Promise was pending.
Since the resource returns void (contributes nothing to the DOM), remove
the JSX read entirely — the fetcher still runs reactively from its
source signal regardless.
…session data Widen the messagesReady gate to allow rendering when the session exists in the session list, even before messages have loaded. This eliminates the blank screen on session switch over slow connections. A spinner is shown in the timeline while messages load in the background.
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.
Issue for this PR
Closes #27910, closes #19793
Type of change
What does this PR do?
Fixes three compounding session-switch responsiveness issues:
Remove deferRender mechanism — eliminates the one-frame blank + 140ms
setTimeoutinsession-composer-regionthat caused a ~170ms gap where the composer was invisible on every session switch. The composer now re-shows after a single rAF yield (~16ms).Remove sessionSync JSX read —
{sessionSync() ?? ""}was read in JSX, triggering the app-level<Suspense>boundary (splash screen) on every session switch. Since the resource returns void, the read is removed entirely — the fetcher still runs reactively from its source signal.Widen messagesReady gate — allow rendering when the session exists in the session list, even before messages have loaded. Shows a spinner in the timeline while messages load in the background, eliminating the blank screen on session switch.
How did you verify your code works?
Tested locally by rapidly switching between sessions in the web UI. Verified no blank flashes, no splash screen flicker, and the composer appears instantly. Messages load in the background with a spinner shown during loading.
Screenshots / recordings
N/A — performance/latency improvement.
Checklist