Repository navigation
fix: keep composer drafts per thread instead of carrying text across switches - #13
Merged
currentbits merged 2 commits intoAug 14, 2026
Conversation
… When we are running a project using orchestration the worker
One Composer instance serves every thread, so plain useState carried unsent text across a switch. Drafts now live in a map keyed by threadId, mirroring the existing templateByThread pattern; switching back restores the thread's own draft. Fixes #12 Co-Authored-By: Claude Fable 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/chat-input-is-not-bound-per-thread-typed-5a15dd
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.
Fixes #12.
What changed
ThreadViewmounts a singleComposerand swaps itsthreadIdprop when you change threads, but the input text was plainuseState("")on that one instance — so an unsent draft typed in thread A followed you into thread B.Drafts now live in a
Record<threadId, string>map insideComposer, withvalue/setValuederived for the current thread (mirroring the existingtemplateByThreadpattern in the same file). Switching to another thread shows that thread's own (or empty) input, and switching back restores the original draft. Sending still clears only the sending thread's draft, even if you switch threads mid-send, since the callback captures its thread id.Testing
test/composer.test.tsxrenders one Composer, swapsthreadIdwithout remounting (a remount would mask the bug), and asserts thread B starts empty and thread A's draft is restored on return. Red before the fix, green after.App memory wiringintest/appWiring.test.tsx) also fails on a clean tree, so it's pre-existing.npm run typecheckis clean.Deliberately not persisted across app restarts — in-memory covers the reported bug.