Drag-and-drop and paste attachment into compose box
Is your feature request related to a problem?
I often attach images to the posts I compose, for example because I'd like to share a screenshot I've just taken on my PC, or a song that I have playing in my music player.
Currently, Phanpy is the only Fediverse frontend I'm aware of that doesn't allow using drag-and-drop or pasting in the compose box to attach a file to the post being drafted, which is a bit of shame, given its completeness in all other aspects...!
Describe the solution you'd like
Let's say I press Print Screen and take a screenshot, which is then copied to my clipboard.
Then, if I open the Compose Post modal, and press Ctrl+V, I'd expect the screenshot I've taken to be attached to the post, like it happens with the default Mastodon frontend, or the default Akkoma frontend. Instead, nothing happens.
In the same way, if I drag-and-drop a file onto the Compose Post field, I'd expect it to be attached to the post, especially since the cursor changes to indicate that a file can be dropped there, but again, nothing happens once the file is dropped.
Describe alternatives you've considered
Clicking the attach file button and navigating to the file works, but it's slow and annoying compared to the other two methods.
Additional context
@Steffo99 what's the OS/browser + versions that you're using?
Firefox 129.0.1 (64-bit) from the Arch Linux packages!
If this is a bug, I haven't noticed anything unusual in the console logs... :thinking:
Definitely a bug (not necessarily in Phanpy - or configuration issue). The feature to paste images from the clipboard exists, and as an additional data point, is working fine for me on Firefox 129.0.2 on Ubuntu Linux - just tested using a screenshot.
Just tested with Vivaldi; it doesn't do anything there either. Huh...?
Vivaldi 6.8.3381.55 (Stable channel) stable (64-bit)
Revision bab02758ef95883226579569370a212f609f7100
OS Linux
JavaScript V8 12.6.228.30
User Agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Command Line /usr/bin/vivaldi-stable --flag-switches-begin --flag-switches-end --disable-smooth-scrolling --save-page-as-mhtml
Executable Path /opt/vivaldi/vivaldi
Profile Path /home/steffo/.config/vivaldi/Default
Variations Seed Type Null
Seems like the reason why attachments aren't working is that the mediaAttachments configuration key is undefined on my instance. Maybe it's just an https://github.com/cheeaun/phanpy/labels/akkoma thing?
I guess no mime types are provided because Akkoma accepts anything as post attachment?
Oh, it's documented behaviour!
https://akkoma.dev/AkkomaGang/akkoma/src/commit/3bb31117e65079d710e5129eb70c946d4ffe99ff/docs/docs/development/API/differences_in_mastoapi_responses.md#media-attachments
Now working on adding an error message if an attachment is rejected because of its mime type...