feat: add Cmd+Shift+T shortcut, menu item, and full wiring

Add "Reopen Closed Tab" to File menu with CmdOrCtrl+Shift+T accelerator.
Wire onReopenClosedTab through useAppKeyboard, useMenuEvents,
useAppCommands, and App.tsx.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Test
2026-03-11 23:36:42 +01:00
parent 73278f3baf
commit 0d6cce1588
7 changed files with 48 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ function makeHandlers(): MenuEventHandlers {
onInstallMcp: vi.fn(),
onReindexVault: vi.fn(),
onReloadVault: vi.fn(),
onReopenClosedTab: vi.fn(),
activeTabPathRef: { current: '/vault/test.md' } as React.MutableRefObject<string | null>,
handleCloseTabRef: { current: vi.fn() } as React.MutableRefObject<(path: string) => void>,
activeTabPath: '/vault/test.md',
@@ -313,6 +314,13 @@ describe('dispatchMenuEvent', () => {
expect(h.onReloadVault).toHaveBeenCalled()
})
// File menu: reopen closed tab
it('file-reopen-closed-tab triggers reopen closed tab', () => {
const h = makeHandlers()
dispatchMenuEvent('file-reopen-closed-tab', h)
expect(h.onReopenClosedTab).toHaveBeenCalled()
})
// Edge cases
it('unknown event ID does nothing', () => {
const h = makeHandlers()