Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Support showing/reading image descriptions #11

Closed
IBBoard opened this issue Sep 1, 2019 · 2 comments
Closed

Support showing/reading image descriptions #11

IBBoard opened this issue Sep 1, 2019 · 2 comments
Labels
accessibility design UI and design issues enhancement New feature or request

Comments

@IBBoard
Copy link
Owner

IBBoard commented Sep 1, 2019

Related to #10 - since Twitter provides image descriptions (somewhere in the JSON) we should add them to the images when we display them.

Unless anyone has any better options, I'd plan to put them in as a tooltip.

@IBBoard
Copy link
Owner Author

IBBoard commented Apr 7, 2020

Alt text is accessible to any Twitter app and is requested using the include_ext_alt_text parameter.

The alt text will appear as a top-level key of each media object in the extended_entities object. For example:

"extended_entities": { "media": [ { "id_str": "696049944105320448", ... "ext_alt_text": "A Faema Urania lever espresso machine" } ] }

https://blog.twitter.com/developer/en_us/a/2016/alt-text-support-for-twitter-cards-and-the-rest-api.html

IBBoard added a commit that referenced this issue Aug 8, 2020
Also stripped back media parsing because images
were taking the non-extended media, which didn't include the
alt-text, and the docs say to just use the extended objects.
IBBoard added a commit that referenced this issue Aug 8, 2020
If there is no alt text (it's null) then no tooltip will show
IBBoard added a commit that referenced this issue Aug 8, 2020
Content from advertisers (and brands) might be embedded differently.
On Twitter it has a title in bold underneath and a description. That is
included in the JSON, so fall back to that if there's no alt text.
IBBoard added a commit that referenced this issue Aug 8, 2020
Some media has "additional_media_information" without a
title and description.
IBBoard added a commit that referenced this issue Aug 8, 2020
I'd rather have "letter i in circle" info, but we'll use whatever is in
the user's current theme so that we fit in.
@IBBoard
Copy link
Owner Author

IBBoard commented Aug 8, 2020

That'll do for an initial version. It even deals with long, multi-line descriptions! (e.g. https://twitter.com/IBBTwtr/status/1292118481333358592)

The icon we use is themed and hopefully provides an indicator for there being a description while not getting in the way.

Any issues with it can go in new tickets.

@IBBoard IBBoard closed this as completed Aug 8, 2020
IBBoard added a commit that referenced this issue Aug 9, 2020
Tooltips may not be enough (depending on screenreader settings)
so use the a11y API to set a description as well.
IBBoard added a commit that referenced this issue Aug 22, 2020
Also stripped back media parsing because images
were taking the non-extended media, which didn't include the
alt-text, and the docs say to just use the extended objects.
IBBoard added a commit that referenced this issue Aug 22, 2020
If there is no alt text (it's null) then no tooltip will show
IBBoard added a commit that referenced this issue Aug 22, 2020
Content from advertisers (and brands) might be embedded differently.
On Twitter it has a title in bold underneath and a description. That is
included in the JSON, so fall back to that if there's no alt text.
IBBoard added a commit that referenced this issue Aug 22, 2020
Some media has "additional_media_information" without a
title and description.
IBBoard added a commit that referenced this issue Aug 22, 2020
I'd rather have "letter i in circle" info, but we'll use whatever is in
the user's current theme so that we fit in.
IBBoard added a commit that referenced this issue Aug 22, 2020
Tooltips may not be enough (depending on screenreader settings)
so use the a11y API to set a description as well.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility design UI and design issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant