feat(keyboard): add Cmd+./Ctrl+. shortcut to toggle both sidebars
Reassign Cmd+. (Mac) and Ctrl+. (Win/Linux) from toggling the left sidebar to toggling both sidebars at once. If either is open, both close; if both are closed, both open. Left sidebar toggle on non-Mac now uses Ctrl+B to match the Mac Cmd+B binding.
This commit is contained in:
@@ -33,12 +33,14 @@ export function useKeyboardShortcuts({
|
||||
toggleAgentList,
|
||||
selectedAgentId,
|
||||
toggleFileExplorer,
|
||||
toggleBothSidebars,
|
||||
}: {
|
||||
enabled: boolean;
|
||||
isMobile: boolean;
|
||||
toggleAgentList: () => void;
|
||||
selectedAgentId?: string;
|
||||
toggleFileExplorer?: () => void;
|
||||
toggleBothSidebars?: () => void;
|
||||
}) {
|
||||
const pathname = usePathname();
|
||||
const hosts = useHosts();
|
||||
@@ -228,6 +230,11 @@ export function useKeyboardShortcuts({
|
||||
case "sidebar.toggle.left":
|
||||
toggleAgentList();
|
||||
return true;
|
||||
case "sidebar.toggle.both":
|
||||
if (toggleBothSidebars) {
|
||||
toggleBothSidebars();
|
||||
}
|
||||
return true;
|
||||
case "sidebar.toggle.right":
|
||||
if (!toggleFileExplorer) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user