Make support for search suggestions more generic, supporting Excel comment mentions and Google Chrome location bar suggestions#14222
Conversation
…the object this method is called on is a descendant of the given obj argument. The base method raises NotImplementedError. Efficient implementations for UIA and Ia2Web have been provided.
…se of IAccessible2 relations
…lowing it to be supported in more places without having to specifically choose particular overlay classes. This adds support for reporting @mention suggestions in Microsoft Excel comments, and reporting of suggestions and related controls in the Google Chrome location bar. Specific changes: * Implement event_selection on the base NVDAObject, which reports the object being selected, if the current focus is controlling an ancestor of the selected object. This replaces SuggestionListItem UIA NVDAObject's event_UIA_elementSelected logic. Now it is more generic, and works purely on tree topology, rather than checking the name and appModule etc. * Remove event_selection implementation from IAccessible NvDAObject as the base handles this now. * Add an event_controllerForchange method to the base NVDAObject which does nothing. * UIA NVDAObject: implement event_UIA_controllerforchange to directly call event_controllerforchange, allowing for more generic code, but still backwards compatibility for subclasses to still override event_UIA_controllerforchange if they need to. * behaviours: * Rename EditableTextWithSuggestions to InputFieldWithSuggestions and inherit directly from NVDAObject making this class more generic. * InputFieldWithSuggestions class: implement event_controllerForChange which will fire the suggestionsOpened and suggestionsClosed events based on whether there are objects in the controllerfor list. this code was taken from SearchField UIA NVDAObject's event_UIA_controllerforchange. * Rename EditableText to EditabletextBase * Add a replacement EditableTextWithSuggestions class that inherits from both InputFieldWithSuggestions and EditableTextBase * Add a replacement EditableText class which inherits from EditableTextwithSuggestions and EditableTextBase. Essentially all this builds suggestion support into EditableText, but keeps the EditableTextWithSuggestionsClass specifically available for compatibility. # Please enter the commit message for your changes. Lines starting
|
Hi, Preliminary test results: works well in People app where contacts are announced automatically (test condition: Windows App Essentials add-on is disabled). I'll take a look at code this weekend. Thanks. |
josephsl
left a comment
There was a problem hiding this comment.
Should we mark empty classes as deprecated and targeted for removal in 2024.1? Also, I think it woudl be best to talk about NVDAObject.isDescendantOf and the reorganized class hierarchy in behaviors module somewhere in "changes for developers" section. Thanks.
|
By the way, for @jcsteh, do you think if the approach taken in this PR can be adopted for use in Firefox and other Mozilla products? I imagine it will help when reviewing suggestions in Firefox address bar. CC @derekriemer in case you would like to employ this change in Notepad++ enhancements. Thanks. |
|
Firefox already exposes the controllerFor relation on the address bar. That should mean this already works, but I"m guessing it doesn't based on your comment and the fact that Firefox wasn't mentioned in the PR description. Perhaps Firefox doesn't fire the selection event on the first item; I'd need to check. If that's true, the reason would be that the list gets shown with the item already selected, so we don't fire the selection event because it would be redundant given that it was always selected since the list came into existence. I can see why that's a problem for NVDA, but I'm also not really sure how to solve it without special casing or causing a bunch of redundant events elsewhere. That said, per the ARIA spec for autocompletes, Firefox fires focus on the selected item when you use the up and down arrow keys, which would override this new code for items other than the first. I'd love to see this changed, but it can't be changed without breaking backwards compatibility all over the place. I've had an idea for a while to hack around this in NVDA, ignoring those focus events and instead keeping focus on the text box, but that's a much bigger and riskier change.
It's worth noting that Firefox exposes the collapsed/expanded state on the address bar depending on whether the list is showing and fires a stateChange event when that changes. That seems like a reasonable proxy for the lack of a native controllerForChange event. Chrome doesn't expose the expanded/collapsed state, but it seems like something they might be willing to do.
I'm curious as to why users wouldn't expect this. Is this simply because of the previous state of things or is there some broader reason here? It seems to me that the lack of consistency would be unexpected, particularly for new users. |
The current policy is that if aliases for deprecated objects can remain without a major maintenance cost, then they shouldn't be removed. |
seanbudd
left a comment
There was a problem hiding this comment.
general approach looks good, only minor fixes/questions raised
|
@jcsteh just the previous state of things. I think I'm just trying to
say that I wouldn't hold back this pr simply because we can't make the
sounds play, that's all.
|
|
Hi, Update: this PR also resolves #13772. Thanks. |
Co-authored-by: Sean Budd <sean@nvaccess.org>
See test results for failed build of commit 0d477a32af |
|
@seanbudd have I missed any review actions from you here? |
seanbudd
left a comment
There was a problem hiding this comment.
frustratingly I noticed my pending review never published
Co-authored-by: Sean Budd <sean@nvaccess.org>
See test results for failed build of commit 5e6e0b3f60 |
Link to issue number:
Fixes #13772
Fixes #13764
Fixes #13522
Summary of the issue:
Description of user facing changes
Description of development approach
Make support for suggestions on editable text fields more generic, allowing it to be supported in more places without having to specifically choose particular overlay classes.
This adds support for reporting @mention suggestions in Microsoft Excel comments, and reporting of suggestions and related controls in the Google Chrome location bar.
Specific changes:
Essentially all this builds suggestion support into EditableText, but keeps the EditableTextWithSuggestionsClass specifically available for compatibility.
Testing strategy:
Known issues with pull request:
Change log entries:
New features
Changes
Bug fixes
For Developers
Code Review Checklist: