Skip to content

Report the presence of multiple annotations #14507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 5, 2023
Merged

Conversation

seanbudd
Copy link
Member

@seanbudd seanbudd commented Jan 4, 2023

Link to issue number:

Stacked against #14480
Supersedes #14426

Summary of the issue:

Currently, NVDA only announces the first annotation target, and only announces the first annotation summary.

#14480 introduces the ability to cycle through multiple annotations targets.
This PR introduces announcing the presence of multiple annotation targets.

When multiple annotation targets are present with different roles, NVDA should announce them.
Example:

  • A footnote, a comment, and a no-role annotation are present
  • NVDA should announce "has footnote, has comment, has details" to make it easier for the user to find the annotation they want to interact with.

Description of user facing changes

When the annotation feature is enabled, NVDA will now report all the unique annotation target roles.

Description of development approach

  • From the virtual buffer, exposed comma separated values for the roles of annotation targets via the "detailsRoles" property.
  • Converted all aria-details functions to plural form (handling a collection rather than a single optional value).
  • Removed usages of, and deprecated nvdaObject.hasDetails, nvdaObject.detailsSummary, nvdaObject.detailsRole
    • These are replaced with new Annotations types

Testing strategy:

Known issues with pull request:

It appears that an internally documented chrome bug has not been reported to Chromium/Google yet.

Change log entries:

New features

- The presence of multiple annotations are now reported.
For example, when text has a comment and a footnote associated with it.

For Developers

- ``NVDAObject.hasDetails``, ``NVDAObject.detailsSummary``, ``NVDAObject.detailsRole`` has been deprecated, instead use ``NVDAObject.annotations``.

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:
    • 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
  • Security precautions taken.

@seanbudd seanbudd mentioned this pull request Jan 4, 2023
8 tasks
@seanbudd seanbudd changed the base branch from master to annotationsBase January 4, 2023 02:28
@AppVeyorBot
Copy link

See test results for failed build of commit 5f8605573e

const bool isChrome = this->toolkitName.compare(L"Chrome") == 0;
if (isChrome) {
// A bug in Chrome causes a buffer overrun if numRelations is less than the total number of targets the node has.
// TODO: has this been reported?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth testing, confirming and reporting this bug to Chromium? I don't think we have yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was reported to Chromium in https://bugs.chromium.org/p/chromium/issues/detail?id=1399184
However, the bug only states that Chromium ignores numRelations and gives back all available. It does not mention any buffer overrun. If there is in deed an overrun, it would be within Chromium, as chromium is the one that allocates the buffer.
Either way though, the general issue has been reported and Google will no doubt look into it.
Our work around is sufficient here.

@seanbudd seanbudd marked this pull request as ready for review January 4, 2023 03:22
@seanbudd seanbudd requested a review from a team as a code owner January 4, 2023 03:22
@seanbudd seanbudd requested review from feerrenrut and michaelDCurran and removed request for a team and feerrenrut January 4, 2023 03:22
@michaelDCurran
Copy link
Member

This pr looks all good, except for the changes to braille.py. This is very large, and I am struggling to follow what was necessary to change verses a whole bunch of refactoring. Would it be at all possible to drop the refactoring from this pr and only include the ncessary changes to braille.py? If this is not possible and or if there is good reason and @seanbudd knows this history, then I'm put in a bit more effort to try and get through that particular file diff.

@seanbudd
Copy link
Member Author

seanbudd commented Jan 4, 2023

@michaelDCurran I've slightly amended braille.py. It should now be much easier to review when ignoring whitespace changes.
If it is still cumbersome, let me know, and I will move the refactor out of this PR.

Base automatically changed from annotationsBase to master January 5, 2023 01:20
seanbudd added a commit that referenced this pull request Jan 5, 2023
Supersedes #14389 and #14426.
Fixes #14360

Summary of the issue:
Before this PR, NVDA was only aware of the first annotation target.
NVDA announces the presence of an annotation target.
nvda+d is used to announce the summary of the first annotation target.

This PR introduces base code to support multiple annotation targets, and enables cycling though reporting each summary.
Similarly, #14507 introduces reporting the presence of multiple annotation targets.

Description of user facing changes
nvda+d now cycles through reporting each annotation target for an annotated item. For example reading the summary of each child comment.

Description of development approach
Creates abstractions for the relationships between annotation origins and targets.
The global command to report a summary of an annotation target has been updated.
@AppVeyorBot
Copy link

See test results for failed build of commit 9282cdf66c

@seanbudd seanbudd merged commit a34da14 into master Jan 5, 2023
@seanbudd seanbudd deleted the annotationsMultiPrescence branch January 5, 2023 02:50
@nvaccessAuto nvaccessAuto added this to the 2023.1 milestone Jan 5, 2023
@seanbudd seanbudd self-assigned this Jan 10, 2023
seanbudd added a commit that referenced this pull request Jan 13, 2023
…14526)

Follow up of #14507, #14480

Summary of the issue:
Firefox incorrectly throws an error when browsing annotated content with an unsupported role.
Instead an unknown role should be reported: i.e. "has details".

The typing for annotation data structures were incorrect.

Description of user facing changes
When browsing content in Firefox with an annotation with unsupported role, "has details" is reported instead of throwing an error.

Description of development approach
Update typing to be more accurate for annotation data structures, log and return None in the Firefox case to match Chromium behaviour.
Use Tuples rather than generators for annotations.targets and annotations.roles.
Drops the superfluous/unused annotations.summaries
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.

4 participants