superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.85k stars 339 forks source link

[feature] Add Akkoma-style `preview` parameter to status creation #3492

Open tsmethurst opened 1 month ago

tsmethurst commented 1 month ago

See https://docs.akkoma.dev/stable/development/API/differences_in_mastoapi_responses/#post-apiv1statuses

This would allow clients to offer a nice preview of a status in-client so that users can edit the post to their heart's content before actually posting it.

vivlim commented 1 month ago

One thing I don't really like about preview being a parameter is that there isn't really a way for a client to know whether the implementation will respect 'preview' or not. In the worst case, a user will attempt to preview a post and the server will go ahead and publish it, while the client appears to show a preview- the user won't know they've published until they see the post elsewhere. (I don't know what GoToSocial does if 'preview' is specified today - if the request is rejected maybe that's ok.)

If this is going to be implemented using the same API as akkoma then I'd really like some way to know whether this parameter is supported or not.

tsmethurst commented 1 month ago

That's an excellent point! I'll have to check if akkoma has a way of revealing it. I thought they had something on their API for things like this -- I'll research it properly once I've finished off my current big chunk of work.

vivlim commented 1 month ago

Perhaps it’d be sufficient for a client to reference swagger but idk if there’s precedent for doing that (or there are other problems with doing that i haven't thought of)