Add attachment upload: drop, paste, picker with progress - #8
Merged
Conversation
… on /new Drag & drop, paste-from-clipboard, and a picker button upload files to the vault storage endpoint, then insert the right markdown ( for images, [filename](url) otherwise). On /notes/:id/edit attachments link to the note immediately; on /new they stage and link after create to avoid orphan storage blobs on cancel. XHR backs the upload so we can show per-file progress and cancel mid-flight. Inline images in the preview go through VaultImage, which blob-fetches past the auth-gated storage endpoint. Size cap 100 MB and extension allowlist (wav/mp3/m4a/ogg/webm/png/jpg/jpeg/ gif/webp) are enforced client-side before any network request. PDF + mp4 tracked upstream in parachute-vault#127. Attachment sidebar is read-only this PR; remove button is sequenced to #8.5 after the vault DELETE endpoint lands. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
for images,[filename](url)otherwise) is inserted at the cursor on success/notes/:id/editlinks attachments immediately;/newstages uploads and links them after the note is created (no orphan blobs if the draft is cancelled)useAttachmentUploaderVaultImage, which blob-fetches past the auth-gated storage endpointwav/mp3/m4a/ogg/webm/png/jpg/jpeg/gif/webp) — rejected with a toast before any network call; PDF + mp4 tracked in parachute-vault#127Sequencing
Attachment sidebar is read-only this PR. Remove button is sequenced to PR #8.5, after the vault-side
DELETE /api/notes/:id/attachments/:attIdendpoint lands.Test plan
bun run lint— cleanbun run typecheck— cleanbun run test— 100/100 pass (14 files), including:client.test.ts: uploadStorageFile multipart + Bearer + progress; 401 →VaultAuthError; 413 →VaultUploadError; abort →AbortError;linkAttachmentPOST + 401NoteNew.test.tsx: drop → upload → insert + stage; paste-image; oversized-file rejected; happy-path drop → stage → create → linkNoteEditor.test.tsx: drop → upload → insert + immediate link; oversized-file rejectedbun run build— green (1.18 MB gzip 381 KB; bundle-split follow-up already filed)🤖 Generated with Claude Code