feat(composer): paste, drag/drop, and inline image preview for uploads #44

Merged
nrupard merged 1 commit from feat/composer-paste-drop-preview into main 2026-05-06 17:04:06 +02:00
Owner
  • The merged uploads feature wired a paperclip + /api/upload endpoint but the user still had to click the button and pick a file. Add a paste listener on the message textarea so an image copied to the clipboard uploads on Ctrl+V; pastes that contain only text are not intercepted so normal text paste keeps working.
  • Add document-level drag/drop handlers and a fixed full-pane "Drop file to attach" overlay. A counter tracks dragenter/dragleave so the overlay does not flicker as the cursor passes over child elements; dragover is only intercepted when the drag carries files.
  • Show a 48x48 thumbnail in the staged-attachment row for image uploads using URL.createObjectURL. The object URL is revoked on clear, retry, or successful send so we do not leak blobs across many uploads in a single session.
  • The drop and paste paths reuse the same uploadStaged() helper as the file input so all three entry points share preview, error handling, and the clear/replace flow.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

- The merged uploads feature wired a paperclip + `/api/upload` endpoint but the user still had to click the button and pick a file. Add a `paste` listener on the message textarea so an image copied to the clipboard uploads on Ctrl+V; pastes that contain only text are not intercepted so normal text paste keeps working. - Add document-level drag/drop handlers and a fixed full-pane "Drop file to attach" overlay. A counter tracks `dragenter`/`dragleave` so the overlay does not flicker as the cursor passes over child elements; `dragover` is only intercepted when the drag carries files. - Show a 48x48 thumbnail in the staged-attachment row for image uploads using `URL.createObjectURL`. The object URL is revoked on clear, retry, or successful send so we do not leak blobs across many uploads in a single session. - The drop and paste paths reuse the same `uploadStaged()` helper as the file input so all three entry points share preview, error handling, and the clear/replace flow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- The merged uploads feature wired a paperclip + `/api/upload` endpoint but the user still had to click the button and pick a file. Add a `paste` listener on the message textarea so an image copied to the clipboard uploads on Ctrl+V; pastes that contain only text are not intercepted so normal text paste keeps working.
- Add document-level drag/drop handlers and a fixed full-pane "Drop file to attach" overlay. A counter tracks `dragenter`/`dragleave` so the overlay does not flicker as the cursor passes over child elements; `dragover` is only intercepted when the drag carries files.
- Show a 48x48 thumbnail in the staged-attachment row for image uploads using `URL.createObjectURL`. The object URL is revoked on clear, retry, or successful send so we do not leak blobs across many uploads in a single session.
- The drop and paste paths reuse the same `uploadStaged()` helper as the file input so all three entry points share preview, error handling, and the clear/replace flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nrupard deleted branch feat/composer-paste-drop-preview 2026-05-06 17:04:06 +02: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
psa-systems/lets-chat!44
No description provided.