Provide screen-reader feedback when Views UI filterable options are updated

Created on 23 September 2016, about 8 years ago
Updated 22 May 2023, over 1 year ago

Problem/Motivation

Many forms in Views UI have long lists of options which can be filtered by keyword or category (e.g. Add sort criteria dialog). When using these filter controls, the contents of the list change dynamically. The changes are easily noted visually, but are not conveyed to users with screen readers.

Proposed resolution

Use Drupal.announce() β†’ to convey a short message about the number of options now present in the filtered list.

We already do this with the module filter on the admin/modules page - see system.modules.js.

Remaining tasks

User interface changes

  • No visible changes intended.
  • Add a screen reader announcement to convey updates which are currently only apparent visually.
  • Introduces a new translatable string for Drupal.announce().

API changes

None expected.

Data model changes

None expected.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
Views UIΒ  β†’

Last updated 13 days ago

Created by

πŸ‡¬πŸ‡§United Kingdom andrewmacpherson

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • last update over 1 year ago
    Custom Commands Failed
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Reroll, plus #67 feedback, plus rename of the variable since this is used for more than just views filtering

    No interdiff because of reroll.

  • last update over 1 year ago
    Custom Commands Failed
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Attempt at fixing the linting.

    Also back to getting the number of expected values dynamically in the test, basically because of what I said in #61, the number can change and figuring out the right number is annoying.

  • last update over 1 year ago
    29,388 pass
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    I should really get linting to run at some point....

  • πŸ‡ΊπŸ‡ΈUnited States dww

    This came up for daily random #bugsmash triage, that's why @Lendude helpfully resurrected this and re-rolled to address the feedback. Thanks!

    I wish we fixed #3122231: Singular variant for plural string must contain @count β†’ so we stopped "doing it wrong" and all new code used @count for both the single and plural strings. Probably not worth holding this up to change it, so not setting NW. Close review of the code shows no other problems to complain about.

    The bot is happy. There's new test coverage. The issue title and summary are clear. I don't believe this needs / wants a CR or release note, but at least tagging that it's a "String change".

    RTBC!

    Thanks again,
    -Derek

  • Status changed to RTBC over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Removing credit for #27, a 1-off re-roll with failing tests that the author never came back to help fix.

    Adding credit to @BarisW, @mgifford and myself for helpful reviews.

    I think that should be pretty close to accurate, but of course the committer will have the final say.

    Thanks again, everyone!
    -Derek

  • πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario

    Adding tag for WCAG SC 3.2.7

  • last update over 1 year ago
    29,388 pass
  • last update over 1 year ago
    29,387 pass, 2 fail
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Seems like a random fail to me:

    Drupal\FunctionalTests\Installer\InstallerExistingConfigMultilingualTest
    exception: [Other] Line 0 of sites/default/files/simpletest/phpunit-408.xml:
    PHPUnit Test failed to complete; Error: PHPUnit 9.6.7 by Sebastian Bergmann and contributors.
    
    Testing Drupal\FunctionalTests\Installer\InstallerExistingConfigMultilingualTest
    E                                                                   1 / 1 (100%)
    
    Time: 00:08.944, Memory: 4.00 MB
    
    There was 1 error:
    
    1) Drupal\FunctionalTests\Installer\InstallerExistingConfigMultilingualTest::testConfigSync
    Exception: Drupal\language\Exception\DeleteDefaultLanguageException: Can not delete the default language
    Drupal\language\Entity\ConfigurableLanguage::preDelete()() (Line: 177)
    
  • last update over 1 year ago
    29,388 pass
  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States bnjmnm Ann Arbor, MI

    A few optimizations to do but this overall looks good.

    1. +++ b/core/modules/views_ui/js/views-admin.js
      @@ -573,12 +574,23 @@
      +          }
      

      The unary operator converts boolean to integers 0/1, so this can be a single line
      activeItems += found

    2. +++ b/core/modules/views_ui/tests/src/FunctionalJavascript/FilterOptionsTest.php
      @@ -66,6 +66,10 @@ public function testFilterOptionsAddFields() {
      +    $session->wait(10000, 'jQuery("#drupal-live-announce").html().indexOf("1 option is available in the modified list.") > -1');
      +    $web_assert->elementTextContains('css', '#drupal-live-announce', '1 option is available in the modified list.');
      

      These two lines can be consolidated by using waitForElementTextContains() see WidgetUploadTest in Media Library

    3. +++ b/core/modules/views_ui/tests/src/FunctionalJavascript/FilterOptionsTest.php
      @@ -81,6 +85,14 @@ public function testFilterOptionsAddFields() {
      +    $session->wait(10000, 'jQuery("#drupal-live-announce").html().indexOf("' . $block_row_count . ' options are available") > -1');
      +    $web_assert->elementTextContains('css', '#drupal-live-announce', $block_row_count . ' options are available in the modified list.');
      

      These two lines can be consolidated by using waitForElementTextContains() see WidgetUploadTest in Media Library

Production build 0.71.5 2024