elm / error-message-catalog

A catalog of broken Elm programs / data to improve error messages
BSD 3-Clause "New" or "Revised" License
173 stars 17 forks source link

using ^ to indicate position in a line is bad for accessibility #312

Open mikolysz opened 4 years ago

mikolysz commented 4 years ago

A message like this one (from the Elm 0.19.1 blog post):

1| import * as Set from 'set'
          ^

Is hard to understand for people using screen readers. Screen readers are mostly useful for blind computer users. They read aloud the contents of the screen (code included), allowing them to do many things, including programming. However, the position of the ^ below a particular place in the line is a very visual thing. The screen reader will read that the ^ exists, but not underneath what character it's lcated, obviously. One possible fix is to include the column number next to the line number (there are editor facilities to check what column we're in), or, better, to put some indication in the line itself, not underneath.

szabi commented 4 years ago
1:8| import >*< as Set from 'set'

Adding the column number after the line number seems fair, but a marker in the line distracts as now you have the mental load of parsing invalid syntax and a harder time matching it up with a line. (Because the display is not identical with the line in your file).

evancz commented 4 years ago

Can you link to some documentation about best practices for screen readers of terminal output?

When I run git --help I see:

usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

Which seems like it'd be hard for a screen reader as well. Are there guidelines for terminal output in general?

Storyyeller commented 3 years ago

Use of ^ seems to be common among different compilers. For example, clang error messages also use ^ to indicate position. However, clang's errors do include the column number as well.