-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fix validateIcon function for federation_icon_url #605
Comments
Let's do that.
That would give a false sense of "success" for cases where an image URL isn't "valid", like e.g. for more complex meta fields like Fedi mods. In an ideal world we'd have a schema language to describe the meta fields and would automatically build UI from that. I wonder how hard that would be to do with JSON Schema? That way we could load different "extensions" for e.g. Fedi meta fields without coupling the definitions too tightly to the Fedimint UI. |
Yeah that makes sense. The automatically built UI will still need to 1) check some condition on the key or value of the meta field and 2) if condition is met, fetch and display an image preview. @dpc actually made a good point that the image url fetch leaks privacy which might be interesting to think about I can't think of many use cases where an image preview wouldn't be useful. I don't think there's much validation logic that indicates success in those UI components right now it is pretty loose but haven't looked closely at the code |
We could e.g. add a custom field to the JSON schema that tells us if an URL is expected to point to an image. If so we fetch the image and show an error if e.g. it isn't an image. |
I noticed this behavior for the federation_icon_url meta field which is nice because it displays a little image box if the url is valid
However there is a discrepancy with the meta fields because technically
federation_icon_url
is not in the list of meta fields defined by Fedimint the protocol: https://github.com/fedimint/fedimint/tree/master/docs/meta_fieldsSo for the Fedi app we wanted to use a lot more meta fields and followed the guidance to namespace them with a
fedi:
prefix to future-proof them against collisions by other third party extensionsbut
fedi:federation_icon_url
does not trigger the image preview so when making recommendations on how to manage meta for the best in-app experience, this creates some slight confusion/discrepancySo I have 2 ideas
https::
prefix + apng/jpg/svg
suffix and trigger the image preview box. this would be useful for any other potential use of images in these meta fields so maybe that approach is cleaner?The text was updated successfully, but these errors were encountered: