Page MenuHomePhabricator

For gallery images "use the caption as the alternative text" checkbox must not be offered
Open, Needs TriagePublic

Description

On the VisualEditor form for <gallery> elements there is a checkbox labeled with system message visualeditor-dialog-media-alttext-checkbox. It is checked by default, so most people who add images to a gallery with VisualEditor will use it.

Using the caption as alternative text is questionable, as they serve different semantic purposes. A screenreader will also wind up repeating itself when this is done, which is probably quite annoying.

Per PerfektesChaos, dewiki is going to be removing all gallery alt attributes where they duplicate the caption.

It may make sense to remove this checkbox entirely, and bring the gallery-image dialog closer in line with the regular media dialog.

Event Timeline

It's not clear to me what you're asking for. Are you saying we should remove the ability to input alt attribute for gallery images?

For reference, this is what the interface looks like today:

image.png (1×1 px, 122 KB)

Yes, the ticbox creating a duplicate of the legend is entirely pointless.

  • The legend is already told by screenreader.
  • A duplicate of this text, telling the same story a second time, is annoying.
  • German Wikipedia is going to run a bot for removing all short |alt= from file transclusion and gallery which are a copy of the legend or media descriptor.

From a more general view, both gallery and file transclusion might offer a textarea to permit lengthy literary descriptions.

  • This requires that appropriate user guidance is available in all wikis.
  • enwiki has a more or less sufficient lesson in creative writing, how to make a suitable audio description.
  • dewiki has a rather operational one in user space.
  • This textarea needs special skills and a basic understanding of the purpose. That cannot be asked from every person first editing a wiki without a11y background.
  • Therefore best idea is to omit any capability here and in all other places. At least they shall be collapsed, available to experienced people only on demand.
  • The current ticbox is copying the legend by default. This is close to vandalism by innocent users.

The entire |alt= issue is going to get pointless in 2024.

  • On mobile phones there are AI apps in daily business now.
  • They send the photo taken in the street to the server. The server responds with audible story that there are three houses, in a two lane street, with a butcher, a tailor and a barber shop. Next stage is to start an audible dialog and ask how the name of the tailor is, which colour that house, how many storeys, which house number, text on street plate etc.
  • On web pages there are experimental versions under development, which will sent the image URL to the server. One day perhaps local on device. Then you can chat with the AI, the general impression is a sailing ship in a river, with some people on the left bank and a wind mill on the right bank. What does the heaven look like, which wheather, clouds? How many masts at the ship, partially or fully under sails?
  • A static |alt= story, especially if written by someone who did not catch the target of those descriptions, is no langer desired.

To summarize: current behavior for the gallery image dialog is that when you add a new image to a gallery we check the "use caption as alternative text" box by default. PerfektesChaos would like that box to not be checked by default.

Notably we don't do this for the regular media dialog, which lacks this checkbox entirely. I think there's a solid argument that these two image dialogs should have their behavior synced up, though I don't have a preference in which direction that should be. In general I think that having alt text is good, but duplicating the caption isn't the right way to encourage that.

Really, we should fix the markup that galleries output to be closer to the regular image markup -- as-is gallery is entirely lacking all the useful <figure> + <figcaption> stuff that would let a screenreader smartly cope.

I don't think the "AI will fix this" argument is relevant for removing all usage of alt from mediawiki, unless we see evidence of it being adopted in a widespread fashion by screenreaders -- at which point we can reevaluate. (I'm also skeptical that AI is going to quickly get to a point where it can provide useful contextual information about the way the image is being used, rather than just literal descriptions of image contents. The "Darmok and Jalad at Tanagra" problem, if you will.)

DLynch renamed this task from Bad checkbox and demand in VisualEditor for gallery and alt= image description to For gallery images don't check the "use the caption as the alternative text" box automatically.Wed, Jun 26, 3:02 PM
DLynch updated the task description. (Show Details)

To summarize: current behavior for the gallery image dialog is that when you add a new image to a gallery we check the "use caption as alternative text" box by default. PerfektesChaos would like that box to not be checked by default.

To clarify: I do not want that the ticbox is not checked by default – no copy of the legend shall be established ever as “starting point” for |alt=, neither by default nor on request.

The legend or “caption” is always told to blind people for gallery and thumbnail transclusions. It is absolutely pointless to tell the same story again. That automatic copy is only bothering and confusing.

The |alt=, if ever provided, is an entirely different story, which might need 1000 or 2000 characters while the legend or caption is usually less than 100.

If providing any |alt= in any wiki page, this should be offered to guided people only who caught the purpose. You will need a <textarea> for 1000 characters and some five or ten minutes. Nothing by just tic and fine.

The same goes for alt= in:

  • image transclusion
  • gallery items
  • media uploading

And yes, these should be synced.

PerfektesChaos renamed this task from For gallery images don't check the "use the caption as the alternative text" box automatically to For gallery images "use the caption as the alternative text" checkbox must not be offered.Wed, Jun 26, 4:14 PM

From an accessibility point of view, repetition is just as bad as not having alt text. So if we encourage people to use the same alt as we use as a caption, then we should stop doing that.

Some quick history checking shows that it was added in T311677/T310624 in 2022. Specifically, it was set to default to true in T310624 because the only way to stop a <gallery> from having the caption duplicated into the alt attribute is to explicitly provide a blank alt (|alt=), so the UI currently represents the default state of just having added a line to the gallery with the image name.

i.e.

<gallery>
File:Red eyed tree frog edit2.jpg|A caption
</gallery>

...will produce the double "a caption" alt + label situation.

As such, it's worth noting that.

German Wikipedia is going to run a bot for removing all short |alt= from file transclusion and gallery which are a copy of the legend or media descriptor.

...as-written, isn't going to change anything in the output for galleries because File:Red eyed tree frog edit2.jpg|A caption and File:Red eyed tree frog edit2.jpg|A caption|alt=A caption produce the same output. If we actually want to suppress the doubling, we currently have to output an empty alt into the gallery definition.

I think if we want to change this behavior in VE's dialog, we might want to do it in tandem with changing mw-core's Parser.php (and parsoid) to not do this alt-fallback when a caption is being output. That requires a bit more consultation outside of Editing, though.

...as-written, isn't going to change anything in the output for galleries because File:Red eyed tree frog edit2.jpg|A caption and File:Red eyed tree frog edit2.jpg|A caption|alt=A caption produce the same output. If we actually want to suppress the doubling, we currently have to output an empty alt into the gallery definition.

This statement is not clear to me.

  • An assignment |alt=| does mean that this image is not helpful, just presentational and shall be omitted from audible page.
  • This is the same as <img src="..." alt="" /> which is signalling that the existence of this image must not be mentioned.
  • Same is expected if we mark a [[File:...svg|alt=|info]] as visual only.

I do expect that <gallery> items will behave exactly in this way. Everything else would be most confusing for all authors.

Furthermore we do want slim source text.

  • Almost two decades no |alt= assignment was used in <gallery> items.
  • We do expect that an |alt= assignment is exactly told by screenreader.
  • There is no reason at all to start adding |alt=A caption|A caption anywhere to tell the parser anything.

Another issue is that there might be a minimal difference between legend=caption and |alt= assignment. Please compare:

  • |alt=A caption.|A caption
  • |alt=John Doe|[[John Doe]]
  • |alt=[[John Doe]]|[[John Doe]]

Since alt texts are plain text rather than wikisyntax, the third one which is the intended ticbox copy of the legend will be read as: John Doe Opening square bracket opening square bracket John Doe closing square bracketclosing square bracket