fix(desktop): 扩充应用菜单与元数据快捷键

This commit is contained in:
2026-09-08 00:01:03 +08:00
parent acc0ba167d
commit 2b18b8b2a2
9 changed files with 220 additions and 24 deletions
@@ -18,3 +18,15 @@ it('fetches external entries while keeping folder state and ignoring stale respo
release([]); await old
expect(store.fileTree).toHaveLength(1)
})
it('clears document tabs only after another vault opens successfully', async () => {
const store = useWorkspaceStore()
store.openFile('/old.md')
vi.spyOn(service, 'openVault').mockResolvedValue({ vault_id: 'new-vault', path: 'D:/notes', name: 'notes' })
vi.spyOn(service, 'getFileTree').mockResolvedValue([{ id: 'new', path: '/new.md', name: 'new.md', type: 'file' }])
await store.openVault('D:/notes')
expect(store.openFiles).toEqual([])
expect(store.activeFilePath).toBeNull()
expect(store.fileTree.map(item => item.path)).toEqual(['/new.md'])
})