Skip to content

feat: drag-and-drop uploads and guarded overwrite of existing objects - #51

Open
curlysasha wants to merge 1 commit into
rgcsekaraa:mainfrom
curlysasha:feat/upload-drag-drop-overwrite
Open

curlysasha wants to merge 1 commit into
rgcsekaraa:mainfrom
curlysasha:feat/upload-drag-drop-overwrite

Conversation

@curlysasha

Copy link
Copy Markdown

Summary

  • Drag and drop: files and folders dropped onto an open bucket folder are uploaded there. Tauri delivers OS drops as native paths (onDragDropEvent), not HTML5 drop events, which is why dropping did nothing before. A drop-zone overlay shows the destination while dragging.
  • Existing objects: a new plan_upload command classifies the selected paths (files/folders) and reports which destination keys already exist (HEAD for single files, a scoped listing per folder). If any exist, a dialog offers Overwrite, Skip existing, or Cancel. The same path is used by Upload → Files/Folder and by drag and drop.
  • Guarded overwrite: an approved replacement is sent with If-Match on the reviewed ETag (new replace_etag on the job, used by both single-part PutObject and multipart completion). If the object changed after the check, it is left untouched. Uploads without approval stay create-only (If-None-Match: *) as before.
  • Clearer errors: a rejected ordinary upload now says the object already exists (or changed after approval) instead of a raw PreconditionFailed.

Why

Uploading a file whose name already existed always failed with an opaque precondition error, and there was no way to overwrite or skip. Dragging files onto the window did nothing.

Scope

  • Frontend
  • Rust backend
  • CI/CD
  • Docs (CHANGELOG)

Verification

  • Tested locally (release build installed over 0.2.46 on Windows 11)

  • Added or updated docs

  • Added or updated tests where needed

  • Rust: 149 tests pass, clippy clean. New tests cover path classification and duplicate keys, the create-only conflict message, and If-Match for an approved overwrite.

  • Frontend: typecheck, lint, 122 unit tests pass.

  • Playwright (Chromium): 51 pass, including new tests for dropping files and for the Cancel/Skip/Overwrite conflict choices. WebKit was not run locally.

Notes

queue_upload gains an optional replaceEtag, and queue_folder_upload gains optional replace (key → ETag) and skip lists. Callers that omit them get the previous create-only behavior.

🤖 Generated with Claude Code

Uploads can now be started by dropping files or folders onto a bucket
folder. Before queuing, a new plan_upload command reports destination
objects that already exist, and the user chooses Overwrite, Skip
existing, or Cancel. Overwrites are conditional on the reviewed ETag
(If-Match), so an object changed in the meantime is left untouched;
uploads without approval stay create-only and now explain the conflict
instead of surfacing a raw PreconditionFailed error.

Co-Authored-By: Claude Opus 5.5 <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