Repository navigation
Fix excessive re-renders causing UI lag - #26
Closed
brennanb2025 wants to merge 1 commit into
Closed
brennanb2025 wants to merge 1 commit into
brennanb2025 wants to merge 1 commit into
Conversation
Root cause: broad Zustand store subscriptions in the component tree caused cascading re-renders on every interaction. A single worktree click triggered App → Terminal → TabBar → all TerminalPanes to re-render unnecessarily. Key fixes: - Remove worktreesByRepo subscription from Terminal.tsx; track mounted worktrees in local state instead of subscribing to the full map - Wrap Terminal, TabBar, TerminalPane in React.memo to prevent cascade re-renders from parent updates - Fix inline onPtyExit callback that defeated React.memo by creating stable per-tab handlers via a ref-backed Map - Consolidate 4 separate keydown listeners into 1 in TerminalPane - Attach sidebar resize listeners only during drag instead of always - Extract session/UI persistence effects into useSessionPersistence hook so that persisted-value changes (sidebarWidth, activeTabId, etc.) trigger IPC calls without re-rendering the App component tree Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Found to be not the issue |
sinkerine
pushed a commit
to sinkerine/orca
that referenced
this pull request
Sep 12, 2026
…r-per-worktree-device fix(emulator): let each worktree attach its own device
6 tasks
This was referenced Oct 26, 2026
1 of 13 tasks
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.
Summary
worktreesByReposubscription from Terminal.tsx — tracked mounted worktrees in local state instead of subscribing to the full worktree map that changes on any worktree updateReact.memo— prevents cascade re-renders when parent components re-render with unchanged propsonPtyExitcallback — was creating new function references per tab per render, defeating React.memo. Now uses stable per-tab handlers via a ref-backed Mapdocument, firing on every mouse moveuseSessionPersistencehook — removed 7 store subscriptions from App.tsx that were only needed for IPC persistence, so changes to sidebarWidth, groupBy, etc. no longer re-render the entire component treeTest plan
pnpm devand click around between worktrees — should feel responsivepnpm typecheck— passes clean🤖 Generated with Claude Code