Skip to content

Upload files and folders from the UI#112

Open
goanpeca wants to merge 10 commits into
mainfrom
feat/issue-56-upload-ui
Open

Upload files and folders from the UI#112
goanpeca wants to merge 10 commits into
mainfrom
feat/issue-56-upload-ui

Conversation

@goanpeca

@goanpeca goanpeca commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add user-facing B2 uploads for bucket and folder targets from the tree context menu and view title, including a bucket destination picker when no target is selected.
  • Support recursive local file and folder uploads, empty-folder markers, overwrite confirmation, cancelable progress, stable overwrite preflight progress, sorted overwrite previews, and b2/x-auto content type through the SDK upload path.
  • Add OS file and folder drag-and-drop for bucket and folder nodes while accepting VS Code file transfer lists and rejecting synthetic text/uri-list or non-file URI payloads.
  • Harden review follow-ups by moving upload target helpers to a shared model, bounding and timing out overwrite HEAD preflight, surfacing ambiguous cancellation side effects, keeping upload out of inline tree row actions, and guarding selected-tree access.
  • Harden local folder discovery with cancellation-aware bounds, symlink and root-escape checks, Windows root detection, and reduced duplicate directory validation.

Linked issue

Fixes #56

Tests run

  • conda run -n b2-vscode-issue-56 npm run check
  • conda run -n b2-vscode-issue-56 npm test

Follow-up notes

  • Encryption, retention, and legal hold choices remain out of scope for this issue.

Copilot AI review requested due to automatic review settings July 2, 2026 14:50
@goanpeca goanpeca added this to the v0.3.0 milestone Jul 2, 2026
@goanpeca goanpeca added enhancement New feature or request priority: high High priority sdk-parity SDK capability not yet exposed in the extension UI labels Jul 2, 2026
@goanpeca goanpeca self-assigned this Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Extension Build Ready

Download the VSIX from the workflow artifacts above.

Installation

VS Code UI: Extensions > ... > Install from VSIX...

CLI:

code --install-extension b2-vscode-*.vsix

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class UI support for uploading local files and folders into Backblaze B2 from the VS Code explorer, covering both an explicit command and OS drag-and-drop, with progress reporting, cancellation, overwrite confirmation, and empty-folder markers.

Changes:

  • Introduces b2.uploadFiles command (menus + view title action) and upload orchestration (src/commands/uploadFiles.ts).
  • Adds tree drag-and-drop support for OS file/folder drops onto bucket/folder nodes (B2TreeDragAndDropController), wired in during extension activation.
  • Extends transfer plumbing to pass through upload contentType, and adds/updates test stubs + command tests for the new UI flows.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/test/suite/windowStubs.ts Extends UI stubs to support and assert showOpenDialog usage in tests.
src/test/suite/extension.test.ts Adds b2.uploadFiles to the expected contributed command list.
src/test/suite/commands.test.ts Adds tests for file upload, recursive folder upload (incl. empty markers), and overwrite warning behavior.
src/services/fileTransfers.ts Adds optional contentType support for streaming uploads (and empty-object uploads).
src/providers/b2TreeDragAndDropController.ts Implements OS drag-and-drop URI extraction and delegates to upload logic.
src/extension.ts Wires drag-and-drop controller into the B2 tree view and provides selection-based upload targeting.
src/commands/uploadFiles.ts New command + shared upload implementation: entry collection, overwrite detection, progress/cancel, and error handling.
src/commands/index.ts Registers b2.uploadFiles and passes required services (tree refresh, auth, selection).
scripts/release-contract.js Updates release contract to include the new command and contributed manifest hash.
package.json Contributes b2.uploadFiles command and adds it to view title + context menus for bucket/folder nodes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/commands/uploadFiles.ts Outdated
Comment thread src/providers/b2TreeDragAndDropController.ts Outdated
Copilot AI review requested due to automatic review settings July 2, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread src/providers/b2TreeDragAndDropController.ts
Comment thread src/commands/uploadFiles.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread src/commands/uploadFiles.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread src/commands/uploadFiles.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread src/commands/uploadFiles.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment thread src/commands/uploadFiles.ts
Comment thread src/commands/uploadFiles.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread src/extension.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

@goanpeca
goanpeca marked this pull request as ready for review July 2, 2026 16:33
Copilot AI review requested due to automatic review settings July 8, 2026 23:14
@goanpeca
goanpeca force-pushed the feat/issue-56-upload-ui branch from ce2f50a to 5a3e652 Compare July 8, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

fs.mkdirSync(folderPath);
fs.mkdirSync(secretPath);
fs.writeFileSync(path.join(secretPath, "credentials.txt"), "secret");
fs.symlinkSync(secretPath, path.join(folderPath, "secrets"), "dir");
const result = await callOriginalReaddir(...args);
if (String(args[0]) === folderPath && !swapped) {
fs.rmSync(nestedPath, { recursive: true, force: true });
fs.symlinkSync(secretPath, nestedPath, "dir");
mutableBucket.head = async () => {
if (!swapped) {
fs.rmSync(nestedPath, { recursive: true, force: true });
fs.symlinkSync(secretPath, nestedPath, "dir");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: high High priority sdk-parity SDK capability not yet exposed in the extension UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upload files and folders from the UI (command + drag-and-drop)

2 participants