Repository navigation
Fix stale transcript rendered under a new thread selection (#83) - #102
Merged
currentbits merged 1 commit intoAug 16, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/stale-transcript-shown-under-the-new-sel-28ac1b
branch
October 3, 2026 16:07
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.
Problem
When switching threads,
useCoderkeeps the previous thread'sdetailuntil the newthreads.getresolves, andThreadViewhad no guard thatdetail.thread.idmatches the selection. Over--serve-weblatency the old transcript and composer rendered under the new sidebar selection — and a fast send would go to the NEW thread while the user was still reading the old one.Fix
Gate the detail on the selection at render time.
App.tsxnow derives:and uses
visibleDetailforThreadView,AgentsPanel(workflow/thread/usage), and project resolution. While the fetch for a freshly clicked thread is in flight, the view falls back to the existing "Select a thread" empty state instead of showing the previous thread.Chose the render gate over clearing
detailon selection change inuseCoder: the load effect runs after paint, so clearing there would still flash one stale frame. The gate is correct at render time, andThreadViewalready handlesdetail === null, so no component changes were needed.Test
New app-level regression test in
test/appWiring.test.tsx("never renders the previous thread's transcript under a new selection"): it patches the fake'sthreads.getinto a deferred promise to simulate latency, clicks another thread, asserts the old transcript is gone and the empty state shows, then resolves the fetch and asserts the new transcript renders. Verified non-vacuous — it fails with the gate removed.Full renderer suite 672/672 green,
tsc --noEmitclean.Closes #83