Add top-right titlebar button to toggle right sidebar
Summary
- Add a top-right titlebar accessory button that toggles the right sidebar (
FileExplorerState), mirroring the existing top-left sidebar toggle. - Implemented as a separate
NSTitlebarAccessoryViewControllerwithlayoutAttribute = .right, so it stays pinned to the top-right corner with the same vertical centering as the left toggle and does not move with sidebar/explorer state. - Reuses
TitlebarControlButtonstyling andAppDelegate.shared?.toggleRightSidebarInActiveMainWindow(the same shared mutation path used by the keyboard shortcut and CLI), and follows the existing minimal-mode/full-screen visibility behavior of the left controls. - Adds
titlebar.rightSidebar.accessibilityLabelandtitlebar.rightSidebar.tooltiptoLocalizable.xcstrings(en, ja).
Testing
./scripts/reload.sh --tag rsbtog(build only) succeeded.- E2E coverage not added: there is no existing XCUITest class for titlebar accessories that could be extended without significantly more scaffolding; behavior is covered by the shared
toggleRightSidebarInActiveMainWindowpath which is already exercised by the keyboard-shortcut and CLI entrypoints.
Related
- Task: top-right sidebar toggle button request (mirror of top-left
sidebar.lefttoggle inSources/Update/UpdateTitlebarAccessory.swift)
[!NOTE]
Low Risk
Low risk UI-only change that adds a new titlebar accessory and localized strings; main risk is minor layout/visibility regressions in minimal mode/fullscreen window handling.
Overview
Adds a new top-right titlebar toggle (via TitlebarRightSidebarToggleAccessoryViewController) that invokes AppDelegate.shared?.toggleRightSidebarInActiveMainWindow and reuses existing titlebar button styling.
Updates the titlebar accessory attachment/visibility logic to manage this new right-side accessory alongside the existing left controls, including hiding/showing behavior in minimal mode and fullscreen.
Introduces new localized accessibility label and tooltip strings (titlebar.rightSidebar.accessibilityLabel, titlebar.rightSidebar.tooltip) in Localizable.xcstrings.
Reviewed by Cursor Bugbot for commit ce2f5ca3a77ed2840f21eebd8babc34a7c5dafef. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Adds a top-right titlebar button to toggle the right sidebar, matching the existing left toggle. It stays pinned to the top-right, aligns with the left controls, and hides in minimal mode and full screen.
- New Features
- Added a right-side
NSTitlebarAccessoryViewControllerfor the toggle; uses existingTitlebarControlButtonstyling and the sharedAppDelegate.toggleRightSidebarInActiveMainWindowpath. - Integrated with existing visibility rules in titlebar logic, including
ContentView.setTitlebarControlsHidden, so it hides in minimal mode and full screen. - Added localized strings:
titlebar.rightSidebar.accessibilityLabelandtitlebar.rightSidebar.tooltip(en, ja).
- Added a right-side
Summary by CodeRabbit
- New Features
- Introduced a right sidebar toggle button in the titlebar for quick access to show/hide the right sidebar, enhancing navigation efficiency.
- Added comprehensive localization support for the new control, including English and Japanese translations for accessibility labels and tooltips.