fix(tabs): let the shortcut recorder capture workspace shortcuts and open reopened workspaces as user opens

This commit is contained in:
Kelvin Amoaba
2026-11-12 06:34:17 +00:00
parent 69144f6131
commit 0c01c5c5e5
3 changed files with 9 additions and 3 deletions
@@ -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' })
}
}
@@ -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)
})
})
@@ -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()