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:
Mohamed Boudra
2026-03-23 10:06:38 +07:00
parent c0e63f76da
commit 07720f1d99
5 changed files with 57 additions and 8 deletions
@@ -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;