Skip to content

perf: keep right sidebar mounted when closed to avoid remount freeze#640

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/fix-first-sidebar-open
Apr 14, 2026
Merged

perf: keep right sidebar mounted when closed to avoid remount freeze#640
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/fix-first-sidebar-open

Conversation

@Jinwoo-H

Copy link
Copy Markdown
Contributor

Summary

  • Keep RightSidebar component mounted when closed (width 0) instead of fully unmounting it on every Ctrl+L toggle
  • Switch between overflow-hidden (closed) and overflow-visible (open) to prevent activity bar icons from leaking past the 0-width boundary while keeping the resize handle interactive when open
  • Remove unused rightSidebarOpen selector from App.tsx

Why

The previous conditional render (rightSidebarOpen ? <RightSidebar /> : null) caused a full remount on every sidebar toggle. Each remount triggered:

  • FileExplorer mount → watchWorktree + readDir IPC calls
  • SourceControl mount → git:branchCompare IPC
  • Terminal container resize → synchronous scrollback reflow

On Windows this froze the app for several seconds on every first Ctrl+L.

Test plan

  • Ctrl+L to open sidebar — no freeze on first or subsequent opens
  • Ctrl+L to close sidebar — content hidden, no visual leakage
  • Activity bar icons not visible when sidebar is closed
  • Resize handle works when sidebar is open
  • Sidebar content correct after open (FileExplorer shows files, SourceControl shows status)
  • macOS — verify no regressions

@Jinwoo-H Jinwoo-H force-pushed the Jinwoo-H/fix-first-sidebar-open branch 2 times, most recently from ecdd69b to 46a8439 Compare April 14, 2026 19:49
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.
@Jinwoo-H Jinwoo-H merged commit 0186891 into main Apr 14, 2026
1 check passed
@Jinwoo-H Jinwoo-H deleted the Jinwoo-H/fix-first-sidebar-open branch April 14, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant