From 0c01c5c5e5ea33ab9da9d6b91ca8485166dcecb8 Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Thu, 12 Nov 2026 06:33:19 +0000 Subject: [PATCH] fix(tabs): let the shortcut recorder capture workspace shortcuts and open reopened workspaces as user opens --- src/renderer/src/components/reopen-closed-workspace-tab.ts | 4 ++-- .../src/components/terminal-workspace-keydown.test.ts | 4 +++- src/renderer/src/components/terminal-workspace-keydown.ts | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/components/reopen-closed-workspace-tab.ts b/src/renderer/src/components/reopen-closed-workspace-tab.ts index 9c48bde624f..94fd4259b4f 100644 --- a/src/renderer/src/components/reopen-closed-workspace-tab.ts +++ b/src/renderer/src/components/reopen-closed-workspace-tab.ts @@ -12,7 +12,7 @@ export function reopenClosedWorkspaceTab(activeWorktreeId: string | null): void return } if (!activeWorktreeId) { - // History entries may be folder workspace keys; this is the activator history replay uses. - activateAndRevealWorkspace(worktreeId) + // Same activation as history replay: entries may be folder workspace keys, and this is a user open. + activateAndRevealWorkspace(worktreeId, { navigationIntent: 'user-open' }) } } diff --git a/src/renderer/src/components/terminal-workspace-keydown.test.ts b/src/renderer/src/components/terminal-workspace-keydown.test.ts index 9365ca6de9d..80cee970742 100644 --- a/src/renderer/src/components/terminal-workspace-keydown.test.ts +++ b/src/renderer/src/components/terminal-workspace-keydown.test.ts @@ -259,7 +259,9 @@ describe('reopen closed tab from the welcome screen', () => { }) act(() => window.dispatchEvent(event)) expect(reopenClosedTab).toHaveBeenCalledExactlyOnceWith(worktreeId) - expect(activateAndRevealWorkspace).toHaveBeenCalledExactlyOnceWith(worktreeId) + expect(activateAndRevealWorkspace).toHaveBeenCalledExactlyOnceWith(worktreeId, { + navigationIntent: 'user-open' + }) expect(event.defaultPrevented).toBe(true) }) }) diff --git a/src/renderer/src/components/terminal-workspace-keydown.ts b/src/renderer/src/components/terminal-workspace-keydown.ts index 177ac9c5e74..b7c46169f85 100644 --- a/src/renderer/src/components/terminal-workspace-keydown.ts +++ b/src/renderer/src/components/terminal-workspace-keydown.ts @@ -50,6 +50,10 @@ export function handleTerminalWorkspaceKeyDown( mobileEmulatorEnabled, terminalShortcutPolicy } = controller + // Let the focused Settings recorder capture shortcuts without executing them. + if (event.target instanceof Element && event.target.closest('[data-shortcut-recorder-active]')) { + return + } const context = getKeybindingContext(event.target) const floatingWorkspaceFocused = isEventTargetInsideFloatingWorkspacePanel(event.target) || isFloatingWorkspacePanelFocused()