Skip to content

Fix/sftp explorer drag download#72

Draft
BungeeDEV wants to merge 2 commits into
macnev2013:mainfrom
BungeeDEV:fix/sftp-explorer-drag-download
Draft

Fix/sftp explorer drag download#72
BungeeDEV wants to merge 2 commits into
macnev2013:mainfrom
BungeeDEV:fix/sftp-explorer-drag-download

Conversation

@BungeeDEV

Copy link
Copy Markdown
Contributor

This pull request adds support for native OS-level drag-out (dragging files or folders from the app directly to the desktop or Finder/Explorer) for SFTP connections. It introduces a new backend command to stage remote files/directories locally before starting a drag, integrates the tauri-plugin-drag plugin, and improves the upload experience and drag-and-drop UI. Additionally, there are minor dependency and platform compatibility updates.

Native drag-out support:

  • Added the tauri-plugin-drag dependency and enabled it in both the Rust backend (Cargo.toml, lib.rs) and frontend (package.json, pnpm-lock.yaml, default.json) to allow real file handles to be handed to the OS for drag-out operations. [1] [2] [3] [4] [5] [6]
  • Implemented the sftp_download_to_temp command, which stages selected remote files and directories in a temporary local folder, preserving directory structure, and provides a preview icon for the drag session. This ensures the OS receives fully-written files before the drag begins.
  • Registered the new drag-out command in the Tauri backend so it can be invoked from the frontend.

Frontend drag-and-drop improvements:

  • Updated the ExplorerDropZone component to indicate when a drop will upload into a specific folder, improving user feedback during drag-and-drop operations. [1] [2]
  • Extended the ExplorerFileTable props to support a new onDragOut handler, enabling the frontend to initiate native OS drags when supported.

SFTP upload robustness:

  • Improved SFTP upload error handling to ensure that partial or truncated files are cleaned up on the remote server if an upload fails or is cancelled. [1] [2]

Dependency and platform compatibility updates:

  • Updated various native dependencies in pnpm-lock.yaml to specify the correct libc (glibc/musl) for Linux targets, improving compatibility across different Linux distributions. [1] [2] [3] [4] [5]

BungeeDEV and others added 2 commits June 9, 2026 13:05
…2013#7)

Dragging entries from the SFTP Explorer onto the desktop produced a junk
"binary" file and only ever handled one entry. The drag used the HTML5
DataTransfer API (text/plain), which a Tauri webview cannot turn into real
OS files, and only read the grabbed row.

Replace it with a native OS drag session via tauri-plugin-drag:
- New `sftp_download_to_temp` command stages every selected entry to a temp
  dir and awaits completion — files directly, folders recursively — then
  returns the local paths plus a drag-preview icon. The OS drag API needs
  real file handles before the drag begins.
- ExplorerFileTable starts the native drag for any non-empty selection
  (files/folders/mixed) and cancels the broken HTML5 drag; in-app move-drag
  stays as the fallback for providers without OS drag-out (SCP/S3).
- ExplorerView wires `onDragOut` for SFTP sessions.

Adds tauri-plugin-drag (Rust + @crabnebula/tauri-plugin-drag) and the
`drag:default` capability permission.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…eedback

- Drop onto a folder row now uploads INTO that folder (hit-test the drop
  position against the listing) instead of always the current directory
- Gate the OS drag-drop listener on the active tab so a single drop no longer
  uploads into every open SFTP session (issue macnev2013#17 keeps tabs mounted)
- Add an overwrite-confirmation dialog when dropped files already exist remotely
- Surface upload/download failures as toasts; toast on a successful drag-out
- Remove the partial remote file on any mid-transfer upload error, not just cancel
- Stage same-named drag-out entries into separate subdirs to avoid clobbering
- Align the drop-zone highlight with the explorer active-state styling

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant