fix(desktop): restore remote file picker attachments

This commit is contained in:
helix4u 2026-07-01 12:29:02 -06:00 committed by brooklyn!
parent eb506e656a
commit c19bfb50ad
2 changed files with 12 additions and 2 deletions

View file

@ -142,12 +142,22 @@ describe('desktop filesystem facade', () => {
expect(selectPaths).not.toHaveBeenCalled()
})
it('uses the local Electron picker for remote file selection', async () => {
const remoteSelect = vi.fn(async () => ['/remote/project'])
$connection.set({ mode: 'remote' } as never)
setDesktopFsRemotePicker({ selectPaths: remoteSelect })
await expect(selectDesktopPaths({ directories: false, multiple: false })).resolves.toEqual(['/local'])
expect(selectPaths).toHaveBeenCalledWith({ directories: false, multiple: false })
expect(remoteSelect).not.toHaveBeenCalled()
})
it('limits the remote picker to single-directory selection', async () => {
const remoteSelect = vi.fn(async () => ['/remote/project'])
$connection.set({ mode: 'remote' } as never)
setDesktopFsRemotePicker({ selectPaths: remoteSelect })
await expect(selectDesktopPaths({ directories: false, multiple: false })).resolves.toEqual([])
await expect(selectDesktopPaths({ directories: true })).resolves.toEqual(['/remote/project'])
expect(remoteSelect).toHaveBeenCalledWith({ directories: true, multiple: false })

View file

@ -179,7 +179,7 @@ export async function selectDesktopPaths(options?: HermesSelectPathsOptions): Pr
}
if (!options?.directories) {
return []
return desktop.selectPaths(options)
}
return remotePicker ? remotePicker.selectPaths({ ...options, multiple: false }) : []