feat(web): attach images with a file picker, not just paste and drop - #18
Open
Antisophy wants to merge 1 commit into
Open
feat(web): attach images with a file picker, not just paste and drop#18Antisophy wants to merge 1 commit into
Antisophy wants to merge 1 commit into
Conversation
This was referenced Aug 21, 2026
The composer accepts images by paste and by drag-and-drop, which between them cover a desktop and nothing else: a phone has no file drag source, and mobile browsers do not reliably put a photo on the DOM clipboard, so there is no way to attach an image there at all. Add an attach control backed by a hidden file input (accept="image/*", multiple), which is what reaches the system photo picker. The input is visually hidden rather than display:none, since only the former is reliably clickable from script across engines, and it is cleared after each selection so the same photo can be picked again after removing it. Also reject image types the agent APIs do not accept (anything outside JPEG, PNG, GIF and WebP) with a message in the composer, rather than attaching a file whose send then fails: a photo picked out of a file manager can still be HEIC even where the camera path transcodes to JPEG. The control is an inline svg in the same idiom as the sidebar's icons, so it takes its colour from the theme and renders identically everywhere.
Antisophy
force-pushed
the
feat/attach-images
branch
from
August 21, 2026 22:51
eb87eb0 to
7cfbf7a
Compare
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.
The composer accepts images by paste and by drag-and-drop, which between them cover a desktop and nothing else. A phone has no file drag source, and mobile browsers do not reliably put a photo on the DOM clipboard, so there is currently no way to attach an image from one at all.
This adds an attach control backed by a hidden file input (
accept="image/*",multiple), which is what reaches the system photo picker.Details worth knowing:
display: none, since only the former is reliably clickable from script across engines, and it is cleared after each selection so the same photo can be picked again after being removed.svgin the same idiom as the sidebar's icons, so it takes its colour from the theme and renders identically everywhere.Covered by unit tests for the picker wiring, preview creation, the unsupported-type refusal, and re-picking the same file twice.
One of five independent changes for using cydo on a phone: #15 (composer spacing), #16 (the page dragging sideways), #17 (hiding the composer while reading history), #19 (replaying a window of history, with older messages on demand). They touch different code and can merge in any order.