-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
Support for text review commands on object name in Visual Studio Code #16248
Conversation
Is the issue being fixed here only applicable to VSCode? |
The issue being fixed here seems the same as the one in #14088. |
Hi @CyrilleB79
I haven't investigated #14088 yet, could it be a duplicate of #15159? |
@cary-rowen, #14088 is about the menus in Chrome application itself, whereas #15159 is about web content displayed by the Chrome browser. Could you please have a deeper look at #14088 to see if it may be related to the current issue? |
#14088 can indeed be fixed using the same idea as this PR. But I'd like to hear some best practices on how to implement a more general fix. |
@coderabbitai can you suggest a more general fix using the idea from this PR to also fix #14088 Otherwise, I think this PR can be accepted as-is |
Tip For best results, initiate chat on the files or code changes. @seanbudd, after reviewing the details of issue #14088 and the modifications made in this PR, it appears that a generalized fix could indeed be applied to address similar issues in different applications, including Chrome. Analysis and Suggested General FixThe root cause in both issues (Visual Studio Code and Chrome menus) involves handling non-editable text elements where NVDA fails to provide detailed character-by-character or word-by-word navigation. The PR for Visual Studio Code addresses this by setting the For a more general fix applicable to both Visual Studio Code and Chrome, and potentially other applications, we could consider the following approach:
Implementation ExampleHere’s a pseudocode example of how this might look: def global_event_NVDAObject_init(obj):
if obj.role == ROLE_TEXT and not obj.state.editable:
# This is a simplification; actual implementation may need to be more sophisticated
obj.TextInfo = EnhancedNVDAObjectTextInfo if is_applicable(obj) else DefaultTextInfo
def is_applicable(obj):
# Determine if the object belongs to an application or a UI framework that requires enhanced handling
return obj.appModule.appName in ['chrome', 'code', 'other_app'] This approach centralizes the handling of non-editable text elements, making it easier to manage and extend to other applications as needed. Let me know if this aligns with your expectations for a general fix, or if further adjustments are needed! Analysis chainScripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Fetching the description and any relevant code snippets or comments for issue #14088 from GitHub
gh issue view 14088 --repo nvaccess/nvda --json body,comments
# Fetching the implementation details of the modifications made in this PR
gh pr view 16248 --repo nvaccess/nvda --json files
Length of output: 14280 |
@coderabbitai full review |
WalkthroughThe changes enhance visual accessibility support in NVDA for Visual Studio Code by introducing text review commands for inspecting object names character by character. Key modifications include importing Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant NVDA
participant VSCode
User->>VSCode: Navigate file tree
VSCode->>NVDA: Send an NVDAObject
NVDA->>NVDA: event_NVDAObject_init
NVDA->>VSCode: Request text info
VSCode-->>NVDA: Provide text info
User->>NVDA: Use text review commands
NVDA-->>User: Present text character by character
Assessment against linked issues
The modifications meet the specified objectives by facilitating character-wise text review for elements within Visual Studio Code, thus improving accessibility. 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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this 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
Outside diff range and nitpick comments (2)
source/appModules/code.py (1)
28-35
: Consider a more general solution for non-editable text elements.Based on the discussion in the PR comments, there's interest in a more generalized solution for handling non-editable text elements across different applications. This specific implementation for Visual Studio Code could be adapted into a more flexible, application-agnostic approach. Consider exploring the use of a decorator or a higher-order function that can be applied universally across different app modules.
user_docs/en/changes.t2t (1)
71-71
: Ensure consistency in documentation by maintaining a uniform format for all entries.Consider using a consistent format for all change log entries, including the mapping of keys and the description of bug fixes and feature enhancements.
@cary-rowen any thoughts on the general approach suggestions? |
I haven't tried it yet, based on the robot's suggestions:
Sounds reasonable, but I'm not sure if it's possible, I would really prefer to apply a more general approach to fix #14088 |
…ble controls in Visual Studio Code (#17573) closed #17525 Summary of the issue: In Visual Studio Code, NVDA was unable to correctly read certain non-standard editable text controls, specifically those with the SECTION role that have an editable state. These controls could be edited by users but were not recognized as EDITABLETEXT by NVDA. Description of user-facing changes: This fix ensures that NVDA correctly recognizes and reads non-standard editable text controls, such as those with the SECTION role and an editable state, in Visual Studio Code. Description of development approach: In #16248, we introduced support for text-review commands for objects in Visual Studio Code. Initially, we used obj.role == controlTypes.Role.EDITABLETEXT as the check for editable text fields. However, this caused a regression for some controls, specifically SECTION elements in VS Code that were editable but did not have the EDITABLETEXT role. These controls have an editable state but were overlooked by NVDA. This fix updates the logic to account for such cases, ensuring these elements are treated as editable controls.
Link to issue number:
Fixed #16246
Summary of the issue:
Most controls in Visual Studio Code do not support text review commands.
The most typical example is when the user wants to review the control name character by character, such as the file name in the file tree and the setting items on the settings page. Based on current experience, this is not easy to achieve.
Description of user facing changes
Users will be able to review control name in Visual Studio Code by NVDA’s text review commands.
Description of development approach
In the application module for Visual Studio Code, a modification has been made within the
event_NVDAObject_init
method to enhance the handling of objects.Specifically, for objects whose role is not
EDITABLETEXT
, theTextInfo
property is now explicitly set toNVDAObjectTextInfo
.Testing strategy:
Manual testing
Known issues with pull request:
unknown
Code Review Checklist:
Summary by CodeRabbit