fix(sidebar): preserve pane widths when toggling right sidebar

AU
20d ago
+313-0

Summary

Adds the opt-in sidebar.keepPaneWidthsOnToggle setting for the right sidebar. When enabled, showing the sidebar expands the main window by its current width and hiding it reverses that resize, preserving terminal pane widths when the active display has room. Fullscreen and edge-constrained windows keep the existing behavior.

Closes #21097.

Validation

  • python3 scripts/verify-local.py --all
  • ./scripts/localize-changes --base origin/main
  • ./scripts/sync-test-wiring --check
  • python3 scripts/localization_catalog.py check
  • Focused native test attempted through nx-remote for RightSidebarWindowResizePolicyTests; the configured host cmux-lawrence-2 was unreachable by DNS, so no native test executed.

Changelog

Fixed: Added an option to preserve terminal pane widths while toggling the right sidebar.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Adds the opt-in sidebar.keepPaneWidthsOnToggle setting that preserves terminal pane widths when toggling the right sidebar. When enabled, showing the sidebar grows the window by the sidebar's current width and hiding it shrinks the window back, as long as the active display has room. Fullscreen windows and windows without room keep the existing reflow behavior.

  • Exposes the setting in the Sidebar settings section, settings search, JSON path mapping, settings schema, and settings reference.
  • Closes #21097.

Summary by CodeRabbit

  • New Features
    • Added a “Keep Pane Widths When Toggling Right Sidebar” setting, off by default. When enabled, opening the sidebar expands the window to preserve terminal pane widths when display space allows.
    • Closing the sidebar reverses the resize when possible. Fullscreen windows are not resized.