Problem/Motivation
Creating a view can be a trial-and-error endeavor. Make a change, check the preview, and then keep the change or revert it depending. For a blind user, the effects of a change to a view's definition are not immediately apparent.
Proposed resolution
We can use the Drupal.announce method on the front end to give the screen reader user a summation of the changes to the preview area. Or even just its current state after a change. Is it a list? Well, how many items are in the list? Is it a table? How many rows are in the table? With views, the change to a view often results in either some data or no data. Just knowing that you added one filter too many or of the wrong type and wiped out your results is super helpful.
Remaining tasks
Propose an initial patch.
User interface changes
Screen reader users will have some indication of what their changes to a view's definition did to the result set in the preview.
API changes
None.
Related Issues
#1806308: Review Views JavaScript + generic modals for accessibility
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | views-preview-2124415-13.patch | 1.39 KB | deepakaryan1988 |
| #2 | views-preview-2124415-2-do-not-test.patch | 2.65 KB | jessebeach |
Comments
Comment #1
dawehnerViews currently don't really has a concept of what changed beside a simple diff of the config file.
We kind of would need a full system to convert that to human language. Is there any other place in core where we do something like that?
Comment #2
jessebeach commenteddawehner, we might be able to put an
aria-live="polite"attribute on the container of the preview and have changes to its contents simply read to the user - not intervention needed. We would also addaria-relevant="all"so that DOM changes are announced, not just text changes.Some documentation on these attributes: https://developer.mozilla.org/en-US/docs/Accessibility/ARIA/ARIA_Live_Re...
AAAANNNNDDDD I tested that approach and it failed :(. VoiceOver never read the updated content and ChromeVox read the content inconsistently.
At the very least, we should clean up the heading structures. Here's a patch to start us off and do just that. Now the preview area has an
h2associated with it.Comment #3
Bojhan commentedDo we atleast inform people that the preview is updated?
If we can't inform them of the specific setting, can't we inform them of the "setting" that they updated affected the preview. Like "Field: Blababa, has been added to the preview" or "HTML Settings changed, and effected the preview"? Not sure how useful that is.
Comment #4
mgiffordNice to see this patch in #2 apply still. Not sure what to do to move this issue forward though.
Comment #5
mgiffordComment #6
mgiffordComment #7
mgiffordComment #8
mgiffordComment #9
mgiffordComment #11
mgiffordPatch no longer applies.
Comment #12
deepakaryan1988Comment #13
deepakaryan1988Rerolled #2
Comment #14
jessebeach commentedThe patch by @deepakaryan1988 in #13 fixes headings and adds a title. It's an improvement on the current code.
But the patch doesn't really address the ask in this issue. @deepakaryan1988, would you mind opening a new issue and associating your patch with it? That way we can get it in now rather than waiting for further improvements here?
Comment #16
manuel garcia commentedComment #17
Everett Zufelt commentedAs a blind user who configures Views with a screen-reader, I like the idea here. I think we really don't need a re-roll right away, but that we need to define the solution.
A few thoughts:
1. Reading the entire diff on every change to the View config would be a bit too much information.
2. Personally, if I want to see how the view has changed, I navigate to the preview and review.
3. There is likely some amount of information that sighted users "scan" for, rather than read, in order to assess the change to the View. A couple of items suggested here already are: that the preview has updated, number of results, and addition / removal of fields.
4. I like how Expedia announces that results are ready / a filter has been applied.
Perhaps a message like the following would be helpful?
"Preview updated. 20 of 243 results are displayed."
Or,
"Preview updated. 20 of 243 results are displayed. The field: Content: Title, has been removed."
Comment #18
andrewmacpherson commentedThanks for these suggestions Everett.
I think this one strikes a good balance.
Comment #19
mgiffordSounds good to me. We just need to build that summary now.
Comment #33
mgiffordI don't think this falls as a WCAG failure, but definitely a useful addition.