v0.6.9: drag-and-drop upload on share-upload pages (#194) #195

Merged
Cordy merged 2 commits from ship-v0.6.9 into main 2026-08-11 17:02:57 +00:00
Owner

#194 — Drag-and-drop upload on the public share-upload page

The share-upload page is server-rendered by internal/share/public.go renderListing, which previously emitted only a file-picker <form> (no JS). This adds, when AllowUpload is set, a drop zone and a small inline script that:

  • prevents the browser from navigating to dropped files,
  • POSTs each dropped file as multipart to the current share URL (location.pathname) — the same endpoint and file field the picker form already uses,
  • reloads the listing on success, shows Upload failed (<status>) otherwise.

Uploads land flat in the shared directory, matching the existing form's behavior. Scoped to upload shares only; the password form and strong-share viewer are untouched.

Test: TestShareUploadHasDropZone — an AllowUpload dir share's page contains the drop zone; a read-only share does not.

Validation

One-shot workflow: gofmt, node --check on the extracted drop-handler JS, go vet ./..., go test ./... (all green, incl. the new test), dual-arch build.

Closes #194.

## #194 — Drag-and-drop upload on the public share-upload page The share-upload page is server-rendered by `internal/share/public.go` `renderListing`, which previously emitted only a file-picker `<form>` (no JS). This adds, when `AllowUpload` is set, a drop zone and a small inline script that: - prevents the browser from navigating to dropped files, - POSTs each dropped file as multipart to the current share URL (`location.pathname`) — the same endpoint and `file` field the picker form already uses, - reloads the listing on success, shows `Upload failed (<status>)` otherwise. Uploads land flat in the shared directory, matching the existing form's behavior. Scoped to upload shares only; the password form and strong-share viewer are untouched. Test: `TestShareUploadHasDropZone` — an `AllowUpload` dir share's page contains the drop zone; a read-only share does not. ## Validation One-shot workflow: `gofmt`, **`node --check`** on the extracted drop-handler JS, `go vet ./...`, `go test ./...` (all green, incl. the new test), dual-arch build. Closes #194.
add v0.6.9 one-shot: drag-and-drop upload on share pages (#194)
All checks were successful
ship-v069 / ship (push) Successful in 36s
85a07ec07d
v0.6.9: drag-and-drop upload on share-upload pages (#194)
All checks were successful
ci / test-and-build (pull_request) Successful in 35s
46c357e11d
Cordy merged commit f497e7dc1c into main 2026-08-11 17:02:57 +00:00
Cordy deleted branch ship-v0.6.9 2026-08-11 17:03:00 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#195
No description provided.