Skip to content

feat: add SFTP file management and file editors - #134

Closed
one2123 wants to merge 8 commits into
timhartmann7:mainfrom
one2123:feat/sftp-file-management
Closed

one2123 wants to merge 8 commits into
timhartmann7:mainfrom
one2123:feat/sftp-file-management

Conversation

@one2123

@one2123 one2123 commented Sep 30, 2026 •

Copy link
Copy Markdown

Summary

Added

  • SFTP file management in the GUI.

    • Browse remote directories and files from the SFTP view.
    • Upload and download individual files.
    • Recursively upload and download directories.
    • Create remote directories.
    • Rename remote files and directories.
    • Delete remote files and directories.
    • Read remote files and display file previews.
    • Edit and write remote files through the SFTP connection.
  • Transfer progress and cancellation.

    • Added transfer IDs for tracking individual operations.
    • Added progress reporting for file and recursive directory transfers.
    • Added cancellation support for uploads and downloads.
    • Added progress reporting for recursive remote directory deletion.
    • Added cancellation support for remote directory deletion.
    • Added progress reporting and cancellation for local directory deletion.
    • Local directory deletion is performed entry-by-entry so cancellation can occur between individual operations.
  • SFTP resource management.

    • Explicitly close remote SFTP file handles after download, upload, preview, read, and write operations.
    • This prevents repeated file operations from exhausting the remote SFTP server's handle limit.
  • Remote file editor support.

    • Added SFTP commands for reading and writing remote files.
    • Added file preview support.
    • Integrated remote file operations with the GUI SFTP view.

Implementation

Core SFTP

crates/omnyssh-core/src/ssh/sftp.rs

Added and extended SFTP command handling for:

  • Download
  • Upload
  • DownloadDir
  • UploadDir
  • CancelTransfer
  • Delete
  • DeleteWithProgress
  • MkDir
  • Rename
  • ReadPreview
  • ReadFile
  • WriteFile

Major implementation areas include:

  • do_download()
  • do_upload()
  • do_download_dir()
  • do_upload_dir()
  • do_read_preview()
  • do_read_file()
  • do_write_file()
  • scan_remote_tree()
  • delete_remote_tree()

Also added transfer cancellation tracking and explicit SFTP file-handle cleanup.

GUI SFTP commands

crates/omnyssh-gui/src/commands/sftp.rs

  • Added GUI-facing SFTP operations for file and directory management.
  • Added transfer ID allocation.
  • Added progress handling for delete operations.
  • Added cancellable remote deletion.
  • Connected SFTP operations to the core transfer/progress event system.

SFTP state/store

crates/omnyssh-gui/ui/src/lib/stores/sftp.ts

  • Added transfer tracking for uploads, downloads, and deletion.
  • Added cancellation handling.
  • Added delete progress handling.

crates/omnyssh-gui/ui/src/lib/stores/sftp.test.ts

  • Added tests for SFTP transfer and deletion state.
  • Added coverage for cancellation and delete progress behaviour.

SFTP view

crates/omnyssh-gui/ui/src/lib/screens/SftpView.svelte

  • Added file-management actions to the SFTP interface.
  • Added transfer and deletion progress display.
  • Added cancellation controls.
  • Added local and remote deletion handling.
  • Added remote file read/write/editor integration.
  • Updated remote operations to use the correct backend/session ID.

Tauri bindings

crates/omnyssh-gui/ui/src/lib/bindings.ts

  • Updated bindings for the SFTP file-management commands.
  • Updated delete command documentation and semantics to reflect progress-aware and cancellable deletion.
  • Updated local deletion semantics so directories are removed entry-by-entry rather than as one recursive operation.

Core events

crates/omnyssh-core/src/event.rs

  • Added/updated events used to report SFTP transfer and deletion progress.

Test plan

  • cargo check --workspace
  • cargo check -p omnyssh-core
  • cargo build -p omnyssh-gui
  • cargo test --workspace
  • SFTP store/frontend tests covering:
    • transfer tracking
    • cancellation
    • delete progress
    • local deletion
    • remote deletion
  • Manual testing against a real SFTP server covering:
    • file upload/download
    • directory upload/download
    • remote mkdir
    • rename
    • remote file deletion
    • recursive remote directory deletion
    • local file/directory deletion
    • cancellation of transfers
    • cancellation of local and remote directory deletion
    • remote file preview/read/write
    • repeated SFTP operations to verify remote handles are released

Related issue

Closes #91

@one2123
one2123 force-pushed the feat/sftp-file-management branch from 22f7789 to 5672d22 Compare October 8, 2026 13:10
@one2123

one2123 commented Oct 17, 2026

Copy link
Copy Markdown
Author

Closing this PR in favor of a replacement PR created from a clean recovery branch. The original branch was affected by a rebase issue, so I recovered and verified the SFTP implementation and pushed it to a new branch to provide a cleaner diff against the latest upstream baseline.

The replacement PR contains the SFTP file-management, remote editing, transfer progress, and cancellation changes.

Please continue the review on the replacement PR: #157

@one2123 one2123 closed this Oct 17, 2026
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.

No way to edit files via SFTP (Feature Request)

2 participants