Skip to content

ia2TextMozilla: expose name as content for any non-contenteditable within a contenteditable. Required to report addresses in outlook.com / Modern Outlook To/CC/BCC fields.#16856

Merged
michaelDCurran merged 4 commits intobetafrom
i16631
Jul 15, 2024

Conversation

@michaelDCurran
Copy link
Member

@michaelDCurran michaelDCurran commented Jul 15, 2024

Link to issue number:

Fixes #16631

Summary of the issue:

In outlook.com or Modern Outlook (Monarch) app, when arrowing through the To/CC/BCC fields, NVDA only reports button graphic for email addresses, and does not report the actual name/ address.
This is because NVDA knows it is in a contenteditable / editable text field, and assumes that all the content can be moved through by character, and therefore does not include meta info such as name on ancestor elements.
However, in this case, the addresses are actually on-contenteditable buttons within the contenteditable, which means that each button only takes up one character stop, and its content does not contain the name / address.

Description of user facing changes

NVDA now reports addresses when arrowing through To/CC/BCC fields in outlook.com / the Modern Outlook app.

Description of development approach

In ia2TextMozilla compound textInfo: conrolFields or objects that are non-contenteditable (don't have the editable state) are within a contenteditable (do have the editable state), have their 'content' key set to the object's name. Which forces NVDA to report the name as the content.

Testing strategy:

In outlook.com / Modern Outlook, created a new email message. Focused on the To field and inserted several email addresses. Then arrowed between them with the left and right arrow keys, ensuring that the addresses were reported.

Known issues with pull request:

Reporting of these addresses is still quite verbose. E.g. "button available Michael Curran mick@nvaccess.org graphic available"
And then arrowing onto another one:
"out of graphic out of button button available Gerald Hartig gerald@nvaccess.org"

Perhaps outlook.com / Modern Outlook could hide the inner graphic from the accessibility tree. And or, NVDA could somehow for non-contenteditable fields, generate a control field that does not require reporting out of at the end. E.g. like a checkbox or separator.
But at very least, this pr is a necessary improvement as before the addresses were not being reported at all.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of specific control types for better compatibility with Outlook.com.

…thin a contenteditable. Required to report addresses in outlook.com / Modern Outlook To/CC/BCC fields.
@michaelDCurran michaelDCurran requested a review from a team as a code owner July 15, 2024 01:40
@michaelDCurran michaelDCurran requested review from SaschaCowley and removed request for a team July 15, 2024 01:40
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 15, 2024

Walkthrough

The changes in ia2TextMozilla.py aim to improve NVDA's handling of control types, specifically to enhance the screen reader’s ability to announce the names of recipients in Outlook.com’s To/CC/BCC fields. This includes importing necessary modules and updating logic to ensure proper identification and announcement of control elements.

Changes

Files/Modules Change Summary
source/NVDAObjects/IAccessible/ia2TextMozilla.py Added import for controlTypes and updated _getControlFieldForObject in FakeEmbeddingTextInfo to handle control types for Outlook.com issues.

Assessment against linked issues

Objective Addressed Explanation
NVDA should announce focused recipient name while navigating between recipients in Outlook.com (#16631)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

from compoundDocuments import CompoundTextInfo
import locationHelper
from logHandler import log
import controlTypes
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove redundant import statement.

The controlTypes import at line 27 is redundant as it is already imported at line 19.

- import controlTypes
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import controlTypes
Tools
Ruff

27-27: Redefinition of unused controlTypes from line 19

Remove definition: controlTypes

(F811)

seanbudd
seanbudd previously approved these changes Jul 15, 2024
@AppVeyorBot
Copy link

See test results for failed build of commit 85226a68e9

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.

3 participants