Open filipesmedeiros opened 10 months ago
Wondering if you're aware of other clients doing special handling of this?
Adding my own quick notes here:
<aside>
is still quite generic. It's not contextual enough to have specialised styling, unless it has a special class name or we "understand" the text first 🫣. Semantically it could have been wrapped in a <small>
tag.media_attachments
key of the post object. On Mastodon, media attachments have urls from both local and remote. Most clients, including Phanpy, I assume, do multiple fallbacks to load the media due to cases like slow connection, broken image links, sometimes-missing local media URLs etc. Some Mastodon/non-Mastodon instances already have such (broken) cases. However, I do understand GTS does this inline note to prevent loading of remote media attachments due to privacy reasons.I will show them this post of yours! Since this issue is about styling <aside>
s, feel free to close it if you want!
Instead of inline non-user-generated "note", GTS could have stashed it inside media_attachments key of the post object.
We tried this but unfortunately this makes a few clients behave in glitchy ways, because they don't handle the unknown
media type properly, despite it being legit mastodon API stuff. So we went with injecting it into the post instead, since that's prettymuch guaranteed to be compatible across all clients. I'll try wrapping it in <small>
as well and see how it looks...
Also, let me just say, thank you to both of you for the work. In this case, especially @cheeaun because of the extra work on trying to support a server that technically is unsupported (GtS). It means a lot and I believe that this interoperability is amazing.
It kinda makes me sad that we are relying so much on Mastodon and their API, but I think it's a decent trade-off to make.
@tsmethurst ahh got it. I'm also aware that other clients not handling them well 😬. I had to fix the attachment bugs when I saw them on Phanpy too 😆
As for using <small>
, I think that there'll still be other clients that don't style or parse them as intended. Phanpy is not the most-widely-used client, compared to Mastodon apps, Ivory, Ice Cubes and Elk, so I'm not sure if this change would make much difference(?)
I'm also not sure if Mastodon whitelists <small>
in their HTML sanitization code. Mobile apps definitely have their own HTML parsers and whitelist specific tags too. Elk also has one to prevent XSS and render basic Markdown formatting. Phanpy doesn't have this (yet) 🫣
Just for the sake of conversation continuity I'll ask here, but move out to GoToSocial asap: @tsmethurst would it be worth it to have a toggle in the config/settings that allowed admins to choose between an <aside>
or media_attachments
? You implied the code for media_attachments
was already written (at least partially), so the effort to have the toggle might be relatively low? Not sure
would it be worth it to have a toggle in the config/settings
Hmmm I'm not sure, it seems a bit fiddly to add an extra setting just for that (which most folks will probably never touch). I'll discuss it with the other devs.
I'm also not sure if Mastodon whitelists in their HTML sanitization code
But that's fine, this text will never appear in Mastodon, it's only ever shown via the GoToSocial API, not federated. We specifically replace unknown attachment types in the JSON when serializing via the API.
@tsmethurst sounds good! Should we open an issue in GTS, or not worth it? Since this seems like more of a GTS discussion, do you want to close this one @cheeaun?
I'll make a GtS issue for it and link back to this one, no worries.
Is your feature request related to a problem? Please describe.
When using GoToSocial, sometimes media couldn't be federated for whatever reason, although the post itself was. Currently, in these cases, the server stores a link to the original media and presents a "fallback" text format of the media, as seen below.
This fallback presentation is put inside an
<aside>
tag. Right now it's rendered with the exact same CSS.This is the code (sorry I couldn't put it inside a
<details>
because it's code).Describe the solution you'd like Maybe we could give it a slightly less prominent look? Maybe faded color and smaller font size?
Describe alternatives you've considered Just dealing with it ahah
Additional context This is using GTS, but I suppose having a special more subtle style for
aside
s is good in general?