Background
For experiment group C (Article flow), we want to prompt users to add missing alt text after they have published an edit on any article containing an image in need of alt text.
In order to know when to show the prompt, we need to
- Check whether there is an eligible image in the article. Surface the first eligible image in the article for the alt text prompt (What this task focuses on)
- Check whether an edit was eligible (any edit made by a logged-in user on an article in the mainspace).
- If there is an eligible image in that article, and the edit was eligible, show the Alt text prompt.
Sampling into control or group C should happen immediately after a user publishes an eligible edit from the main editor. If they are sorted into group C, they should see the alt text prompt.
Requirements
- Location & wikitext of one eligible image in need of alt text is identified
- Latency under 2 seconds for eligible image check and identification, to minimize the lag between when a user publishes the first edit, and when we show the prompt
- Localized parameters should be supported
- We should not suggest images to users for adding Alt text where any of the following are true
- The image is not linked to its common page, and has “|link=|alt=” or the local equivalent in magic words
- The image is below 100x100 pixels as defined in the wikitext, indicating it is an icon.
- The image images has any aria accessibility attributes such as ariahidden=true or role=presentation
Open question:
- Should we exclude images in templates due to the specific formatting required? (infoboxes, galleries, timelines, or math formulas from our suggestions as they have specific formats)
References
Spike: T344378: Spike: How to obtain articles that have images with missing alt text answered the questions:
- Question 1: If we have the wikitext of an article, how do we tell if it has images with missing alt text?
- Question 2: How do we insert alt text into an existing File link?
- Question 3: How do we get a list and/or queue of articles that have images with missing alt text?