Repository navigation
fix: resolve Windows freeze when switching worktrees with right sidebar open - #628
Merged
Merged
Conversation
Jinwoo-H
force-pushed
the
Jinwoo-H/improve-windows-performance
branch
from
April 14, 2026 07:38
db6ecae to
842a5da
Compare
…ar open
Multiple performance fixes that eliminate the multi-second freeze on Windows
when switching worktrees while the right sidebar is open:
- Defer WebGL context recreation into rAF so the browser paints one frame
with the DOM renderer before blocking on ANGLE→D3D11 context creation
- Add epoch-based fit deduplication to prevent redundant terminal scrollback
reflows between the isActive effect and ResizeObserver paths
- Add proposeDimensions() guard to skip fitAddon.fit() entirely when
terminal dimensions haven't changed (common case on worktree switch)
- Remove key={activeWorktreeId} from sidebar panels to avoid full
unmount/remount IPC storm (watchWorktree + readDir + git:branchCompare)
on every switch; add reset effects for worktree-specific local state
- Add 30s grace period before tearing down @parcel/watcher subscriptions
so rapid worktree switches reuse existing native watchers
- Intercept Ctrl+B/Ctrl+L via before-input-event in main process to
prevent terminal control characters from reaching xterm
- Fix sidebar open transition suppression using useLayoutEffect + direct
DOM style manipulation (the old useState approach had a one-frame race)
Add onToggleLeftSidebar and onToggleRightSidebar mock stubs to the test's window.api.ui mock object so the test doesn't crash when useIpcEvents subscribes to the new sidebar toggle IPC channels.
brennanb2025
added a commit
that referenced
this pull request
Apr 19, 2026
Adds Playwright coverage for two high-regression areas identified from the last 200 PRs: - worktree-lifecycle.spec.ts: guards removeWorktree cleanup (#532), worktree switch with right sidebar open (#598/#628/#726), and cross-worktree tab isolation (#542/#554). - tab-close-navigation.spec.ts: guards visual-neighbor activation on editor/diff close (#693) and Landing fallback when the last visible surface closes (#677).
3 tasks done
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
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
resumeRendering()moved into rAF so the browser paints one frame with the DOM renderer before blocking on ANGLE→D3D11 context creation (100–500ms per pane on Windows)isActiveeffect and ResizeObserver paths using a three-layer guard (staleness → dimension check → dedup)fitAddon.fit()entirely when terminal dimensions haven't changed, avoiding unnecessary_renderService.clear()+terminal.refresh()overheadkey={activeWorktreeId}with worktree-change reset effects, eliminating the IPC storm (watchWorktree+readDir+git:branchCompare+ …) on every switch@parcel/watchersubscriptions so rapid worktree switches reuse existing native watchersbefore-input-eventallowlist to prevent^B/^Lcontrol characters from reaching xtermuseLayoutEffect+ direct DOMstyle.transition = 'none'kills the CSS transition before Chromium can start it (the olduseStateapproach had a one-frame race)Test plan