perf(app): isolate sidebar from streaming updates and cache thread row derivation#426
Conversation
|
@codex review this |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review and try to find regression and hehaviour difference from main |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
This PR reduces frontend render/compute overhead during thread streaming by isolating sidebar update paths and caching thread row derivation.
Problem
Streaming deltas were causing frequent app rerenders that repeatedly rebuilt sidebar thread structures and action props, creating unnecessary UI churn.
Changes
useSidebarLayoutActionsto provide stable sidebar callback identities.Appwith memoized hook outputs.useThreadRowsderivation keyed by workspace/expanded state with bounded per-key pin-version caching.pinnedThreadsVersionfrom threads storage through layout/sidebar/worktree/cycling paths to invalidate cache correctly on pin changes.Validation
npm run typechecknpm run testRisk
Low. This is internal frontend refactoring/perf work with no API/IPC/RPC contract changes and no intended behavior changes.
Docs
No docs updates required.