Skip to content

feat(sftp): support creating archives from the context menu - #3936

Merged
binaricat merged 2 commits into
binaricat:mainfrom
jinshenganyuci:feat/sftp-create-archive
Nov 7, 2026
Merged

binaricat merged 2 commits into
binaricat:mainfrom
jinshenganyuci:feat/sftp-create-archive

Conversation

@jinshenganyuci

@jinshenganyuci jinshenganyuci commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add Compress... to the remote SFTP file list and directory-tree context menus. Select a file, folder, or multiple entries, choose TAR.GZ or ZIP and an archive name, and create the archive on the server for later download or backup. Source files remain unchanged; an existing archive requires a separate replacement confirmation.

Type of Change

  • Bug fix
  • New feature
  • Refactor / code cleanup
  • Documentation update
  • Build / CI change
  • Other (please describe):

Related Issue

Closes #3912

Changes Made

  • Support list/tree selections, a common parent directory for nested selections, and parent/child selection deduplication.
  • Bind the dialog and operation to the originating connection. Show busy/errors and require explicit overwrite confirmation.
  • Create the archive in a private temporary directory before publishing it, preserving existing output on failures and refusing source/directory/symlink replacement.
  • Support remote TAR.GZ and ZIP with existing shell quoting and filename encoding; require the corresponding server tools. Single-channel-only connections retain the existing shell-operation restriction.
  • Add five UI translations, documentation, and regression tests.
  • Merge current main, preserving both archive and Duplicate actions, and update the archive-menu test fixture for the additional menu callback.

Screenshots / Demo

Verified in the actual Electron app connected to an isolated OpenSSH server:

  • File-list folder → TAR.GZ; multi-select text and Chinese/space-named file → ZIP.
  • Format change updates the extension; completed archives appear after automatic refresh.
  • Directory-tree compression detects existing output; Enter does not silently confirm replacement; the explicit replacement button updates the archive.
  • Extracted both UI-created formats and compared contents, checked original files, temporary cleanup, and renderer errors.

Testing

Validation applies to 3f2574fa4021c3f77a445ff6b41bad4b3d6c1c8c:

  • Actual Electron/OpenSSH smoke passed as described above.
  • 45 archive-focused tests passed, including real encrypted SSH, round-trip payloads, conflict/overwrite, missing sources/tools, and failure preservation.
  • 833 related SFTP tests passed.
  • npm run lint, npm run build, and git diff --check origin/main..HEAD passed.
  • GitHub checks passed: lint/full tests/build, both Windows smoke jobs, and macOS/Windows/Linux x64/Linux arm64 packages. The Linux test job required retries after two runner shutdowns; the final attempt completed successfully. Test run · Package run.
  • Two independent local reviewers returned CLEAN on the final head. Remote Codex review completed with no findings or unresolved threads on that same head.
  • Supplemental local Node 22 full run: 16,031 tests, 15,972 passed, 9 failed, 50 skipped. Six failures were missing local example artifacts/workspace dependencies; after restoring the environment, all affected test files passed (37 tests). The remaining two Bash tests and one AI provider test reproduce identically on untouched main 51d9f715d; their relevant sources are unchanged by this PR.

Checklist

  • My code follows the existing project style
  • I have added or updated relevant documentation
  • I have not introduced any breaking changes

@jinshenganyuci
jinshenganyuci marked this pull request as ready for review October 31, 2026 17:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T12:27:47.444033Z 3f2574f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Owner

@codex review

Please review current head 3f2574f, including compatibility with merged main. Focus on issue #3912: remote TAR.GZ/ZIP archive creation from list/tree selections, source preservation, explicit overwrite confirmation, connection binding, and existing SFTP behavior. Report actionable in-scope defects; avoid speculative edge cases and unrelated expansion.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 3f2574fa40

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@binaricat
binaricat merged commit 4a55492 into binaricat:main Nov 7, 2026
16 of 18 checks passed
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.

[Feature] 支持在 SFTP 右键菜单中压缩文件和文件夹

2 participants