Skip to content

Switch to focus mode if read-only list items and their list parents are focusable and gain focus#13357

Merged
michaelDCurran merged 12 commits into
nvaccess:masterfrom
MarcoZehe:i13221
Feb 20, 2022
Merged

Switch to focus mode if read-only list items and their list parents are focusable and gain focus#13357
michaelDCurran merged 12 commits into
nvaccess:masterfrom
MarcoZehe:i13221

Conversation

@MarcoZehe

@MarcoZehe MarcoZehe commented Feb 17, 2022

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #13221

Summary of the issue:

In the Microsoft Edge Downloads manager (CTRL+J), as well as in the channel and DM outputs of the Slack app, HTML lists and list items are used to display the items. These are made focusable via either aria-activedescendant, or the rowing tabIndex pattern. The reason is that for compatibility, these can be used to host rich content, such as whole sub documents or controls. Until now, NVDA would not automatically switch to focus mode when focus lands on such a focusable list item.

Description of how this pull request fixes the issue:

This PR adds a rule for enabling passthrough mode if a list item that is read-only, has state focused, and at the same time its paarent is of role list and is focusable.

Testing strategy:

  1. Run NVDA.
  2. Go into Microsoft Edge.
  3. Press Control+J to invoke Downloads Manager.
  4. Focus should be on the first downloaded item, and passthrough mode should automatically be enabled.

Known issues with pull request:

None known.

Change log entries:

New features
Changes
Bug fixes

For Developers

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation: Not needed since expected behavior is introduced where user would previously have to manually switch pass-through mode on.
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@trypsynth

Copy link
Copy Markdown
Contributor

Nice, looks good to me. In NVDA changelog entries though, it's typical to link to the issue that it solves (if applicable).

@MarcoZehe MarcoZehe marked this pull request as ready for review February 17, 2022 13:41
@MarcoZehe MarcoZehe requested a review from a team as a code owner February 17, 2022 13:41
@MarcoZehe

Copy link
Copy Markdown
Contributor Author

Thanks @TheQuinbox, I just updated the initial description with that, as well as the checkbox for the testing part, since the manual check checks out nicely.

@CyrilleB79

Copy link
Copy Markdown
Contributor

Typo to fix in the change log:
#13321 -> #13221

@lukaszgo1

Copy link
Copy Markdown
Contributor

Have you considered adding Chrome system test demonstrating the behavior based on the code snippet in #13221?

@MarcoZehe

Copy link
Copy Markdown
Contributor Author

Thanks @CyrilleB79, corrected the typo.

@lukaszgo1 I'll try that system test thing, but this is all still very confusing, so may take a while. And it's made difficult by the fact that I can't currently even run local builds, and that includes tests. See my message in the nvda-devel mailing list. But I'll try nevertheless.

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Thanks Marco, this is a nice improvement! One question: Isn't it just enough that a list item has focus? Why check the focusable state on the parent list as well??

@MarcoZehe

Copy link
Copy Markdown
Contributor Author

@LeonarddeR I was going with @michaelDCurran's statement from #13221 (comment):

We will switch to focus mode if a listItem gets focus, but only if the list itself is also focusable. I.e. the list has at least tabindex of -1.

This is how MS Edge's Download Manager list works, and it means that @kloots will have to make a slight adjustment in Slack to put tabindex="-1" on the actual list, which Slack currently doesn't do yet.

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit d2aff99624

@michaelDCurran

Copy link
Copy Markdown
Member

For reference, the reasoning behind requiring focusable on the list is to limit where this code will apply.

  1. Making ul (or role="list) and (li or role="listitem") interactive like this does not quite fit standards as really these are presentational read-only lists. Interactive lists should be role="listbox" and role="option".
  2. There may already exist some web pages that deliberately set focus to a presentational list item when the page is scrolled to an arbitrary location. In this case switching to focus mode would be annoying and inappropriate.

But, it has been made clear that the standard does not really fit some particular use cases, and therefore this change is needed. Therefore it is being added, but with the limitation that the list must also be focusable. This idea was proposed by Slack themselves.

Comment thread tests/system/robot/chromeTests.robot Outdated
@michaelDCurran

Copy link
Copy Markdown
Member

I think the title of this pr should refer to Focus mode, not Browse mode.

@MarcoZehe MarcoZehe changed the title Switch to browse mode if read-only list items and their list parents are focusable and have focus Switch to focus mode if read-only list items and their list parents are focusable and gain focus Feb 18, 2022
@MarcoZehe

Copy link
Copy Markdown
Contributor Author

I think the title of this pr should refer to Focus mode, not Browse mode.

Done.

Co-authored-by: Michael Curran <mick@nvaccess.org>
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit c59b1d1579

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit a6844f4d79

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 59e227bd53

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit f441d32e50

@MarcoZehe

Copy link
Copy Markdown
Contributor Author

Sorry this is going so slowly. I cannot run the tests on my local machine because it is not an English language Windows, and therefore all NVDA tests fall on their face. So I have to peel this like an onion.

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 91fb4e4aae

@MarcoZehe

Copy link
Copy Markdown
Contributor Author

@michaelDCurran I don't understand this error message. The previous test failures were clear, but this one confuses me. It says:

Error message:
focus mode - focus link in document and turn off focus mode
speech Actual != Expected: message
Todd Kloots link != message
Todd Kloots link
Browse mode

Any help is appreciated.

@michaelDCurran

Copy link
Copy Markdown
Member

Looks like we are not automatically switching back to browse mode when tabbing into the document and on to the first link. However, tabbing to the second link does switch.
This is definitely a bug in NVDA, no doubt to do with the fact that the list item and the start of the inner document are at exactly the same offset.
See issue #12896.
We do hope to put significant time into that and related focus issues in the very near future.
For now perhaps simplify the testcase to only handle the listitem and not tabbing into the document. Though you may want to instead add a link after the list and tab to that, and ensure that browse mode turns back on.

@MarcoZehe

Copy link
Copy Markdown
Contributor Author

I just extended the test case to tab to the second link, which does switch to browse mode, and then shift-tab twice. However, if that fails, I'll go with your suggestion and just do the very simple one, which now passes. Thanks!

@MarcoZehe

Copy link
Copy Markdown
Contributor Author

@michaelDCurran I went with your suggestion of simplifying the test case after all, and it now passes. I can't clear the "changes requested" flag from the issue even though I applied your suggested code change, and also updated the PR title. So, tossing this back for review in hopes that things look good so far. I'd also be happy to help out with #12896 if that's desired.

@michaelDCurran

Copy link
Copy Markdown
Member

Thanks for your work on this @MarcoZehe.
I shall review this sometime in the next couple of days.

@brunoprietog

brunoprietog commented Feb 19, 2022

Copy link
Copy Markdown

This is great! Do you think you can think of a way to fix #12266? It's a similar list focus problem. Thanks!

@MarcoZehe

Copy link
Copy Markdown
Contributor Author

I just commented on the issue: It is a different bug, which will not be fixed by this pull request. The bug is in the Chromium engine, not NVDA in that case. The markup is also radically different from what is being used here.

@michaelDCurran michaelDCurran merged commit 6310b86 into nvaccess:master Feb 20, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.1 milestone Feb 20, 2022
@kloots

kloots commented Mar 1, 2022

Copy link
Copy Markdown

@michaelDCurran I see this has been added to the 2022.1 release milestone. Does the team have a release date spec'd for 2022.1?

@michaelDCurran

Copy link
Copy Markdown
Member

@kloots perhaps end of March / early April.

@kloots

kloots commented Apr 18, 2022

Copy link
Copy Markdown

@michaelDCurran curious about the release date for this fix: any update as to when this will go out to production?

@michaelDCurran

michaelDCurran commented Apr 18, 2022 via email

Copy link
Copy Markdown
Member

@kloots

kloots commented Apr 18, 2022

Copy link
Copy Markdown

Great. Thanks @michaelDCurran. Dumb question: how do I get the beta?

@michaelDCurran

michaelDCurran commented Apr 18, 2022 via email

Copy link
Copy Markdown
Member

@kloots

kloots commented Apr 18, 2022

Copy link
Copy Markdown

Thanks @michaelDCurran. One last question, do you have a sense for how quickly NVDA users upgrade?

@michaelDCurran

michaelDCurran commented Apr 18, 2022 via email

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA doesn't toggle browse mode off when focus is moved to an interactive list

10 participants