feat: support mounted vault workspaces

This commit is contained in:
lucaronin
2026-05-11 16:37:06 +02:00
parent 5c05347690
commit 07edfac400
176 changed files with 8868 additions and 1535 deletions

View File

@@ -44,8 +44,8 @@ export function useFileActions({
})
}, [setToastMessage, vaultPath])
const resolveFolderPath = useCallback((folderPath: string) => (
folderAbsolutePath({ vaultPath, folderPath })
const resolveFolderPath = useCallback((folderPath: string, rootPath?: string) => (
folderAbsolutePath({ vaultPath: rootPath ?? vaultPath, folderPath })
), [vaultPath])
const folderActions = useMemo<FolderFileActions>(() => ({
@@ -62,13 +62,18 @@ export function useFileActions({
const revealSelectedFolder = useCallback(() => {
if (selection.kind !== 'folder') return
folderActions.revealFolder(selection.path)
}, [folderActions, selection])
revealFile(resolveFolderPath(selection.path, selection.rootPath))
}, [resolveFolderPath, revealFile, selection])
const copySelectedFolderPath = useCallback(() => {
if (selection.kind !== 'folder') return
folderActions.copyFolderPath(selection.path)
}, [folderActions, selection])
const absolutePath = resolveFolderPath(selection.path, selection.rootPath)
void copyLocalPath(absolutePath)
.then(() => setToastMessage('Folder path copied'))
.catch((error) => {
setToastMessage(fileActionErrorMessage('copy folder path', error))
})
}, [resolveFolderPath, selection, setToastMessage])
return useMemo(() => ({
copyFilePath,