# fix\(web\): the branch toolbar and thread details panel stay cached while a reply streams · PR \#23103 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/23103)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: refactor/split3-chatview-start-from-origin

Target branch: refactor/split3-chatview-banner-lane

Head commit: 937507c6a4cca85c0d72133ac4ddf7ff643172f5

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/23103)

[Commits](https://git.cafe/pingdotgg/t3code/pull/23103/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/23103/diffs?format=markdown)

## Description

---

While a reply streams, `BranchToolbar` and the thread details panel re-rendered on every update. `useComposerSelection`'s `onStartFromOriginChange` closed over the whole `activeThread` shell, which changes with each streamed event, so both components got a new handler each time.

The handler now reads only the thread id, which the compiler can cache on.

Streaming a 12-line reply (median of 3, about 110 commits):

| Component | before | after |
| --- | --- | --- |
| BranchToolbar | 10 | 0 |
| ThreadDetailsSection | 10 | 0 |

Total renders are noise-bound for streaming (2,866 before, 2,891 after; the runs swing by ±20% with response length).

Tested:
- apps/web typecheck and lint on the touched file.
- React Compiler: 0 bailouts on `useComposerSelection.ts`.
- Hands-on in a dev build, draft thread: switch the workspace to New worktree, open the base branch picker, and flip "Start from remote" off and back on.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

