refactor: remove tab bar — single note open at a time
Replace the multi-tab model with single-note navigation. One note is open at a time; clicking any note (sidebar, wikilink, relationship) replaces the current note in the editor. Back/Forward history still works via Cmd+[/]. Removed: TabBar component, useClosedTabHistory, tab reorder/close/ reopen logic, Cmd+W/Cmd+Shift+T shortcuts, Close Tab and Reopen Closed Tab menu items, tabLayout utility, and all related tests. Simplified: useTabManagement (single-note), useAppNavigation (no tab lookup), useKeyboardNavigation (note nav only), useNoteCreation (no close-tab cleanup), useDeleteActions (deselect instead of close tab), Editor (no TabBar render), Rust menu (removed 2 menu items). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,6 @@ function makeActions() {
|
||||
onZoomOut: vi.fn(),
|
||||
onZoomReset: vi.fn(),
|
||||
activeTabPathRef: { current: '/vault/test.md' } as React.MutableRefObject<string | null>,
|
||||
handleCloseTabRef: { current: vi.fn() } as React.MutableRefObject<(path: string) => void>,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,13 +86,6 @@ describe('useAppKeyboard', () => {
|
||||
expect(actions.onOpenDailyNote).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('Cmd+W closes the active tab', () => {
|
||||
const actions = makeActions()
|
||||
renderHook(() => useAppKeyboard(actions))
|
||||
fireKey('w', { metaKey: true })
|
||||
expect(actions.handleCloseTabRef.current).toHaveBeenCalledWith('/vault/test.md')
|
||||
})
|
||||
|
||||
it('Alt+4 does not trigger any view mode', () => {
|
||||
const actions = makeActions()
|
||||
renderHook(() => useAppKeyboard(actions))
|
||||
@@ -183,23 +175,6 @@ describe('useAppKeyboard', () => {
|
||||
expect(actions.onZoomReset).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('Cmd+Shift+T triggers reopen closed tab', () => {
|
||||
const actions = makeActions()
|
||||
const onReopenClosedTab = vi.fn()
|
||||
renderHook(() => useAppKeyboard({ ...actions, onReopenClosedTab }))
|
||||
fireKey('t', { metaKey: true, shiftKey: true })
|
||||
expect(onReopenClosedTab).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('Cmd+Shift+T does not trigger other shortcuts', () => {
|
||||
const actions = makeActions()
|
||||
const onReopenClosedTab = vi.fn()
|
||||
renderHook(() => useAppKeyboard({ ...actions, onReopenClosedTab }))
|
||||
fireKey('t', { metaKey: true, shiftKey: true })
|
||||
expect(actions.onQuickOpen).not.toHaveBeenCalled()
|
||||
expect(actions.onCreateNote).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('Cmd+I triggers toggle AI chat', () => {
|
||||
const actions = makeActions()
|
||||
const onToggleAIChat = vi.fn()
|
||||
|
||||
Reference in New Issue
Block a user