GeopJr / Tuba

Browse the Fediverse
https://tuba.geopjr.dev/
GNU General Public License v3.0
562 stars 59 forks source link

[Request]: Enhance the media support #472

Open gaussandhisgun opened 1 year ago

gaussandhisgun commented 1 year ago

Describe the request

So as I wrote in #468, pasting images is a nice feature. #413 (As It Obviously Turns Out) adds that, so I installed nightly flatpak to try it out. And IMHO, pressing Ctrl+V on the "Text" tab when an image is in the clipboard should go to the Image tab and do the paste there. Telegram for Android behaves exactly like this if you paste an image to it. Mastodon and Firefish (both of backends I've tried) do not require you to open the embed menu to paste an image either. Reddit, no matter how bad it is, just puts the image there if you Ctrl-V an image into the Text post. You name it.

Implementation Details

GeopJr commented 1 year ago

I'm not super-fond of this to be honest due to the way media-uploading works.

When you attach a file, it first gets uploaded to the server which returns an id that we later attach to the object we send when "Post" is clicked. I wasn't super-fond of Ctrl+V for the same reason but at least the user is somewhat aware by being on the Media page of the composer.

That means that if you accidentally press ctrl + v with sensitive media in your clipboard, they will be uploaded to your instance which has privacy issues. At the same time though, you are supposed to trust your instance somewhat and they do get cleaned-up after some time automatically.

However, when the new composer mockups drop, there probably won't be a "pages" system anyway. The solutions I propose are:

What do you think?

edit: Keeping the media in memory and uploading only on post is not appropriate either btw, Media uploading can easily fail even though we already keep track of the instance limits (on size and media types) for two reasons:

1) rate limits 2) random Mastodon media processing errors like "422 Video has no video stream"

+ if the files are big, the user will have to wait for them to be uploaded on post which might seem like Tuba has frozen

LukaszH77 commented 1 year ago

I like the option with confirmation better, but I think for some people that could be annoying

Maybe you can add an option to switch it off?

bragefuglseth commented 1 year ago

Maybe you can add an option to switch it off?

Obligatory link to Choosing our Preferences

jmaris commented 1 year ago

I do worry that creating a preference for this would be overkill. I'm not sure it's guideline compliant, but perhaps a confirmation dialogue with the yes option focussed by default. That way people can CTRL+V then ENTER to proceed.

Baralheia commented 1 hour ago

You could 100% wait until the user clicks Publish to upload the media. Simply show a "Uploading media..." message with a progress indicator, similar to other Mastodon clients, to show that Tuba hasn't frozen.

If you'd rather go the confirmation dialog option - an option to switch it off wouldn't contribute to preference bloat. A simple checkbox on each confirmation dialog that says something to the effect of "Don't warn me again" would give choice back to the user. Then you'd only need a single button/option in preferences to re-enable all confirmation dialogs. (This would be a wonderful addition to all confirmation dialogs in Tuba, btw - as a new user, overall I'm enjoying this application but it feels like there are tons of confirmation dialogs for things that personally I don't really need lol.)