Repository navigation
Commit 8d2261e
perf(mobile): worktree setup updates commit the thread screen once
useWorktreeSetup copied each new setup snapshot into held state from an
effect after commit. LiveThreadRouteController, the route-level controller
for the whole thread screen, therefore committed twice for every worktree
setup progress update.
Hold the snapshot by adjusting state during render instead. React re-runs
the hook before committing, and resolveWorktreeSetupSnapshot returns the
held object by identity on that pass, so the update settles after one
commit. The effect and its set-state-in-effect lint disable go away.
Effects: use-worktree-setup.ts 1 -> 0.
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 79f6cd3 commit 8d2261e
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments