feat(web): mobile image upload to active session via paste dialog#101
Merged
Conversation
- Extend the keyboard accessory paste dialog with an image picker (camera / photo library) plus best-effort image paste, routing selected files through the existing _uploadAndInsertImages pipeline - Re-encode images to standard JPEG/PNG in the browser before upload, so mislabeled gallery images (e.g. MIUI WebP claiming image/jpeg) pass the server magic-byte check; PNG keeps transparency, GIF passes through untouched, decode failures fall back to the original file - Log the real byte header on the paste-image magic-mismatch branch to pin down any remaining format mismatches without a guessing loop - Ignore the runtime .claude-images/ upload directory
Owner
|
Thank you as always for contributing, @TeigenZhang! 🙏 Reviewed and verified locally on the PR branch:
Really like the client-side re-encode to dodge the MIUI WebP/HEIF "declared image/jpeg but magic bytes disagree" trap, the PNG-vs-JPEG branch that preserves transparency, the animated-GIF pass-through, and the graceful fall-back-to-original on decode failure. The server-side magic-mismatch diagnostic is a nice complement. Merging now. |
3 tasks
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
Adds a mobile-friendly way to send images into the active Claude session. A paste dialog (reachable from the mobile keyboard accessory bar) lets the user pick/paste an image, which is uploaded and forwarded to the running session.
Changes
image-input.js: paste-dialog upload flow for the active sessionkeyboard-accessory.js: entry point button on the mobile accessory barsession-routes.ts: backend endpoint to receive the uploaded imagemobile.css: dialog/button styling.gitignore: ignore upload scratch artifactsTest plan
tsc --noEmitpasses