Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Pasting of images does not work (on mobile) #370

Open
schlagmichdoch opened this issue Feb 11, 2025 · 7 comments · Fixed by #372
Open

[Bug] Pasting of images does not work (on mobile) #370

schlagmichdoch opened this issue Feb 11, 2025 · 7 comments · Fixed by #372
Labels
bug Something isn't working

Comments

@schlagmichdoch
Copy link
Owner

schlagmichdoch commented Feb 11, 2025

I know about https://pairdrop.net/ but I can't send images via pasting there.

Originally posted by @blamedrop in #651

@schlagmichdoch schlagmichdoch added the bug Something isn't working label Feb 11, 2025
@schlagmichdoch
Copy link
Owner Author

@blamedrop Would be great if you could add some more info:

  • What OS and browser are you using?
  • Whats the exact thing you try to do?
  • Do your browser console logs include any error messages?

@schlagmichdoch schlagmichdoch changed the title [Bug] Apparently pasting of images does not work [Bug] Pasting of images does not work Feb 13, 2025
@blamedrop
Copy link

Hi! Sorry for the late reply.

The issue is that basically nothing happens when I do Ctrl+V in "send text message" modal (where I can write text, and send it - that works) when I have an image in the clipboard; no messages in the UI or the browser console either. When I go, with the same clipboard's contents, for example, to imgur.com/upload and do Ctrl+V there it works, it uploads the image I had in the clipboard as expected.

On snapdrop it used to work, either the image was places inside the text area or just sent right away (not sure if wasn't glitchy a bit, ha). I don't have it running locally so can't reproduce it and show it, but it was working I promise (most of the time, there were some issues, where pasting worked but nothing was sent tho) ;D

Yesterday, I did test it and I got same 'nothing happens' behavior on various OS/browsers:

  • Linux and Firefox/Chromium
  • Windows and Firefox/Chrome
  • iOS and Safari/Firefox Focus

I see you've pushed a fix but I guess it isn't live yet? Ping me when it's up and I'll test it.
Thank you!

@schlagmichdoch
Copy link
Owner Author

On PairDrop you have a share-mode when you paste elements (either text or files/images).

When you drag and drop elements on the background (or when no peers are connected) the share-mode is initiated as well.
When you drag and drop directly on a peer the dragged content gets sent right away to that peer.

On snapdrop it used to work, either the image was places inside the text area or just sent right away (not sure if wasn't glitchy a bit, ha).

It was implemented in such a way, that pasting a file when only one peer was connected would sent the file to that peer directly. Everything else did not work and there was only documentation in the code ;-)

The fixes are on master but are not bundled into a new version yet and therefor are not live on pairdrop.net.
Feel free to test around anyways over here: https://pairdrop-next.onrender.com/
I appreciate it!

@blamedrop
Copy link

Oh, I see!

Indeed, Ctrl+V on main screen already works on previous version on Chromium (and it does not on Firefox).
And now I can confirm it works also on Firefox on the next version you've linked.

Had no idea that there was this mode and that pasting on the main screen would do anything!

I guess you could update the Click to send files or right click to send a message text with something about it, both about drag-and-drop and about just pasting.

But still - on mobile phone, I don't think I can paste it anyhow, other that in the text box where it still does not work.

I guess handling pasting images in the text area could solve both of these issues?

Not gonna lie, SnapDrop's handling of it in the text box after selecting peer was somewhat intuitive, despite that this whole webapp kinda follows Apple's how-the-fuck-I'm-supposed-to-figure-out-that-there-was-this-feature-hidden style of UIs ;)

@schlagmichdoch
Copy link
Owner Author

Indeed, Ctrl+V on main screen already works on previous version on Chromium (and it does not on Firefox).
And now I can confirm it works also on Firefox on the next version you've linked.

Great! Thanks for testing!

Had no idea that there was this mode and that pasting on the main screen would do anything!

FYI: That mode is also used if you install PairDrop as PWA on Android and share files directly from the Android share menu or when using the iOS shortcut to do the same on iOS devices.

We will need to think about how to improve the information architecture though. Anything that is hidden like on the About page will probably never be read so it must be on the main page. Not sure how to keep everything tidy though.

Not gonna lie, SnapDrop's handling of it in the text box after selecting peer was somewhat intuitive

This was not how it was implemented though and worked simply by accident. It just did not check if the message dialog was open and handled it as if something was pasted in the background. When only one peer was connected the file was sent. When more peers were connected nothing happened at all.

I guess handling pasting images in the text area could solve both of these issues?

If users think they have text in their clipboard that would simply be inserted in the text field but instead a file in their clipboard gets sent directly is somewhat unexpected, don't you think?

I would rather have a consistent way of doing this by using the share-mode which is especially useful to share the same file(s)/text/link to multiple users.

I have also thought about adding a possibility to select files in the UI first and select the receiver(s) via the share-mode after.
Maybe this could be combined by adding a (+) icon left to the wireless icon which opens a new dialog.
This dialog has a paste/drop area on top and a button "Select files" on bottom.
The paste area could work like the iOS shortcut dialog: clicking the button to paste:
Screenshot_PairDrop_Clipboard_API

@schlagmichdoch
Copy link
Owner Author

I just recognized that on mobile it works by pasting files in the display name text field ;-)

schlagmichdoch added a commit that referenced this issue Feb 17, 2025
## Enhancements
- Make PWA standalone (#264)
- Bring back background animation after performance optimization (#285)
- Add support for Safari 11-15 (#358)
- Update Twitter icon and URL to (X) (Thanks @realchrislovett)
- Update node dependencies

## Fixes
- Fix pasting of files on background to invoke share-mode and make it available on Firefox (#370)
- Fix padding issue on EditPairedDevicesDialog and Base64Dialog
- Fix hydration of URLs into links in received messages that have exclamation marks in path

## Languages
- Translations updates from Hosted Weblate (Basque, Norwegian Bokmål)
@schlagmichdoch schlagmichdoch changed the title [Bug] Pasting of images does not work [Bug] Pasting of images does not work (on mobile) Feb 17, 2025
@schlagmichdoch
Copy link
Owner Author

This will probably do as well:

Add another line below the current instructions that reads:
(+) Paste, drop, or click to select files in advance
-> Click opens file selector. Selected Files are used in Share-Mode

Analogous to GitHub comments:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants