perf: keep right sidebar mounted when closed to avoid remount freeze#640
Merged
Conversation
ecdd69b to
46a8439
Compare
The RightSidebar component was fully unmounted when closed and remounted on every Ctrl+L toggle. Each remount triggered FileExplorer mount → watchWorktree + readDir IPC, SourceControl mount → git:branchCompare, and a terminal scrollback reflow from the container resize — freezing Windows for seconds. Keep the component mounted (width 0, overflow-hidden when closed) so child components, filesystem watchers, and cached directory trees survive across open/close toggles. Switch to overflow-visible when open so the resize handle remains interactive.
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
RightSidebarcomponent mounted when closed (width 0) instead of fully unmounting it on every Ctrl+L toggleoverflow-hidden(closed) andoverflow-visible(open) to prevent activity bar icons from leaking past the 0-width boundary while keeping the resize handle interactive when openrightSidebarOpenselector from App.tsxWhy
The previous conditional render (
rightSidebarOpen ? <RightSidebar /> : null) caused a full remount on every sidebar toggle. Each remount triggered:watchWorktree+readDirIPC callsgit:branchCompareIPCOn Windows this froze the app for several seconds on every first Ctrl+L.
Test plan