diff --git a/packages/app/src/app/_layout.tsx b/packages/app/src/app/_layout.tsx index c212b7e87..a35cb1eb0 100644 --- a/packages/app/src/app/_layout.tsx +++ b/packages/app/src/app/_layout.tsx @@ -437,7 +437,6 @@ function AppContainer({ enabled: chromeEnabled, isMobile: isCompactLayout, toggleAgentList, - selectedAgentId, toggleFileExplorer, toggleBothSidebars, toggleFocusMode, diff --git a/packages/app/src/hooks/use-keyboard-shortcuts.ts b/packages/app/src/hooks/use-keyboard-shortcuts.ts index 9031d2b0c..8f5ecece3 100644 --- a/packages/app/src/hooks/use-keyboard-shortcuts.ts +++ b/packages/app/src/hooks/use-keyboard-shortcuts.ts @@ -15,7 +15,6 @@ import { type MessageInputKeyboardActionKind, type KeyboardShortcutPayload, } from "@/keyboard/actions"; -import { canToggleFileExplorerShortcut } from "@/keyboard/keyboard-shortcut-routing"; import { keyboardActionDispatcher } from "@/keyboard/keyboard-action-dispatcher"; import { type ChordState, @@ -32,7 +31,6 @@ export function useKeyboardShortcuts({ enabled, isMobile, toggleAgentList, - selectedAgentId, toggleFileExplorer, toggleBothSidebars, toggleFocusMode, @@ -41,7 +39,6 @@ export function useKeyboardShortcuts({ enabled: boolean; isMobile: boolean; toggleAgentList: () => void; - selectedAgentId?: string; toggleFileExplorer?: () => void; toggleBothSidebars?: () => void; toggleFocusMode?: () => void; @@ -262,19 +259,9 @@ export function useKeyboardShortcuts({ } return true; case "sidebar.toggle.right": - if (!toggleFileExplorer) { - return false; + if (toggleFileExplorer) { + toggleFileExplorer(); } - if ( - !canToggleFileExplorerShortcut({ - selectedAgentId, - pathname, - toggleFileExplorer, - }) - ) { - return false; - } - toggleFileExplorer(); return true; case "view.toggle.focus": if (toggleFocusMode) { @@ -353,11 +340,6 @@ export function useKeyboardShortcuts({ isDesktop: isDesktopApp, focusScope, commandCenterOpen: store.commandCenterOpen, - hasSelectedAgent: canToggleFileExplorerShortcut({ - selectedAgentId, - pathname, - toggleFileExplorer, - }), }, chordState: chordStateRef.current, onChordReset: () => { @@ -438,7 +420,6 @@ export function useKeyboardShortcuts({ openProjectPickerAction, pathname, resetModifiers, - selectedAgentId, toggleAgentList, toggleFileExplorer, toggleFocusMode, diff --git a/packages/app/src/keyboard/keyboard-shortcuts.test.ts b/packages/app/src/keyboard/keyboard-shortcuts.test.ts index 15c20d3f9..38509393a 100644 --- a/packages/app/src/keyboard/keyboard-shortcuts.test.ts +++ b/packages/app/src/keyboard/keyboard-shortcuts.test.ts @@ -29,7 +29,6 @@ function shortcutContext( isDesktop: false, focusScope: "other", commandCenterOpen: false, - hasSelectedAgent: true, ...overrides, }; } diff --git a/packages/app/src/keyboard/keyboard-shortcuts.ts b/packages/app/src/keyboard/keyboard-shortcuts.ts index 554a1ea5e..92a8ef714 100644 --- a/packages/app/src/keyboard/keyboard-shortcuts.ts +++ b/packages/app/src/keyboard/keyboard-shortcuts.ts @@ -16,7 +16,6 @@ export type KeyboardShortcutContext = { isDesktop: boolean; focusScope: KeyboardFocusScope; commandCenterOpen: boolean; - hasSelectedAgent: boolean; }; export type KeyboardShortcutMatch = { @@ -57,8 +56,6 @@ interface ShortcutWhen { terminal?: false; /** false = disabled when command center is open */ commandCenter?: false; - /** true = requires a selected agent */ - hasSelectedAgent?: true; /** Exact focus scope match */ focusScope?: KeyboardFocusScope; } @@ -659,7 +656,7 @@ const SHORTCUT_BINDINGS: readonly ShortcutBinding[] = [ id: "sidebar-toggle-right-cmd-e-mac", action: "sidebar.toggle.right", combo: "Cmd+E", - when: { mac: true, hasSelectedAgent: true, commandCenter: false }, + when: { mac: true, commandCenter: false }, help: { id: "toggle-right-sidebar", section: "panels", @@ -671,7 +668,7 @@ const SHORTCUT_BINDINGS: readonly ShortcutBinding[] = [ id: "sidebar-toggle-right-ctrl-e-non-mac", action: "sidebar.toggle.right", combo: "Ctrl+E", - when: { mac: false, hasSelectedAgent: true, commandCenter: false, terminal: false }, + when: { mac: false, commandCenter: false, terminal: false }, help: { id: "toggle-right-sidebar", section: "panels", @@ -683,7 +680,7 @@ const SHORTCUT_BINDINGS: readonly ShortcutBinding[] = [ id: "sidebar-toggle-right-ctrl-backquote", action: "sidebar.toggle.right", combo: "Ctrl+`", - when: { hasSelectedAgent: true, commandCenter: false }, + when: { commandCenter: false }, }, // --- Toggle both sidebars --- @@ -743,7 +740,7 @@ const SHORTCUT_BINDINGS: readonly ShortcutBinding[] = [ id: "view-toggle-focus-cmd-shift-f-mac", action: "view.toggle.focus", combo: "Cmd+Shift+F", - when: { mac: true, hasSelectedAgent: true, commandCenter: false }, + when: { mac: true, commandCenter: false }, help: { id: "toggle-focus", section: "panels", @@ -755,7 +752,7 @@ const SHORTCUT_BINDINGS: readonly ShortcutBinding[] = [ id: "view-toggle-focus-ctrl-shift-f-non-mac", action: "view.toggle.focus", combo: "Ctrl+Shift+F", - when: { mac: false, hasSelectedAgent: true, commandCenter: false, terminal: false }, + when: { mac: false, commandCenter: false, terminal: false }, help: { id: "toggle-focus", section: "panels", @@ -1015,7 +1012,6 @@ function matchesWhen(when: ShortcutWhen | undefined, context: KeyboardShortcutCo if (when.desktop !== undefined && when.desktop !== context.isDesktop) return false; if (when.terminal === false && context.focusScope === "terminal") return false; if (when.commandCenter === false && context.commandCenterOpen) return false; - if (when.hasSelectedAgent === true && !context.hasSelectedAgent) return false; if (when.focusScope !== undefined && context.focusScope !== when.focusScope) return false; return true; }