Skip to content

Refactor COM Registration Fixing Tool part 2: remove bugs, return Windows errors, improve UX#12355

Merged
SaschaCowley merged 71 commits into
nvaccess:masterfrom
XLTechie:CRFTRefactor
Sep 20, 2024
Merged

Refactor COM Registration Fixing Tool part 2: remove bugs, return Windows errors, improve UX#12355
SaschaCowley merged 71 commits into
nvaccess:masterfrom
XLTechie:CRFTRefactor

Conversation

@XLTechie

@XLTechie XLTechie commented Apr 30, 2021

Copy link
Copy Markdown
Collaborator

Link to issue number:

Fixes #10799
Fixes #12345
Fixes #12351
Replaces #12349

Summary of the issue:

User facing changes:

  • Initial dialog given a more friendly message, with a more beginner-themed explanation.
  • User may now press Escape/Alt+F4 to leave the dialog, as well as hitting Cancel.
  • There is now a visual close control (red X).
  • F1 context help is now available.
  • Errors are reported to the user by error code.
  • The tool no longer reports success if it fails.
  • The tool no longer reports success if the process is cancelled by UAC.

Development details:

  • Refactored this code to be in line with current coding standards, fix the above issues, and to give the tool a better over all UX.
  • Catch the Windows error generated on UAC cancel, and log that the process was stopped at the UAC.
  • Show other Windows errors to the user via a dialog, instead of just in the log.
  • Switched from using YES and NO buttons, to Continue and CANCEL.
  • Added a docstring. Linted and added more logging.
  • In order to implement the Continue and Cancel paradigm, created gui.nvdaControls._ContinueCancelDialog.

Testing strategy:

  • Tested all buttons by tabbing and pressing, and by keyboard shortcuts.
  • Tested that all windows appear when and where they should.
  • Confirmed that the "completed" message no longer appears on failure or cancellation.
  • Simulated a Windows error to prove that a message would appear to show the error to the user.

Known issues with pull request:

  1. Upon UAC cancel, or upon successful completion, focus is moved from desktop or where ever it was, to the NVDA systray icon. That seems a little strange to me, although it is not new behavior. gui.postPopup is supposed to fix this, but it doesn't.
  2. Even after being deleted, the progress window's speech appears to hang around until after the completion window is cleared, although this speech seems to be cancelled or interrupted. Again, not new behavior. Log fragment showing this below:
IO - speech.speak (02:07:07.616) - MainThread (8368):
Speaking ['COM Registration Fixing Tool', 'dialog', 'The COM Registration Fixing Tool has completed successfully.', CancellableSpeech (still valid)]
IO - speech.speak (02:07:07.621) - MainThread (8368):
Speaking ['OK', 'button', CancellableSpeech (still valid)]
IO - inputCore.InputManager.executeGesture (02:07:09.326) - winInputHook (6992):
Input: kb(desktop):enter
IO - speech.speak (02:07:09.406) - MainThread (8368):
Speaking ['COM Registration Fixing Tool', 'dialog', "Please wait while NVDA attempts to fix your system's COM registrations...", CancellableSpeech (still valid)]
IO - speech.speak (02:07:09.411) - MainThread (8368):
Speaking ['COM Registration Fixing Tool', CancellableSpeech (still valid)]

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual tests.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.

Summary by CodeRabbit

  • New Features

    • Introduced a custom dialog with "Continue" and "Cancel" buttons for better user interaction.
  • User Experience Improvements

    • Updated messaging in the COM Registration Fixing Tool for better clarity and guidance.
    • Enhanced error handling and logging for a more reliable user experience.
    • Users can now exit the initial window using the escape key or alt+f4.

@michaelDCurran

Copy link
Copy Markdown
Member

What is the status of this pr now that pr #12560 has been merged? Has this one been replaced, or is there extra work in this pr?

@XLTechie

XLTechie commented Mar 15, 2022 via email

Copy link
Copy Markdown
Collaborator Author

@XLTechie XLTechie changed the title Refactored the COM Registration Fixing Tool code to remove bugs and for better UX Refactor COM Registration Fixing Tool part 2: remove bugs, return Windows errors, improve UX Mar 24, 2022
@LeonarddeR

Copy link
Copy Markdown
Collaborator

@XLTechie any chance you can continue this any time soon?

@XLTechie

This comment was marked as outdated.

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 054795cbe5

@CyrilleB79

Copy link
Copy Markdown
Contributor

Ping @XLTechie:
Do you plan to push forward this PR soon?

More specifically, I was about to implement a fix for #12345 when I remembered of your PR.

@XLTechie

This comment was marked as outdated.

@CyrilleB79

Copy link
Copy Markdown
Contributor

For issues with compile setup, feel free to ask on nvda-devel mailing list where such issues are usually discussed and addressed.

@AppVeyorBot

Copy link
Copy Markdown
  • FAIL: Translation comments check. Translation comments missing or unexpectedly included. See build log for more information.
  • PASS: Unit tests.
  • FAIL: Lint check. See test results for more information.
  • PASS: System tests (tags: installer NVDA).
  • Build (for testing PR): https://ci.appveyor.com/api/buildjobs/kxhhr2g7x6tp2gsj/artifacts/output/nvda_snapshot_pr12355-31588,b7653daa.exe
  • CI timing (mins):
    INIT 0.0,
    INSTALL_START 1.1,
    INSTALL_END 0.9,
    BUILD_START 0.0,
    BUILD_END 30.0,
    TESTSETUP_START 0.0,
    TESTSETUP_END 0.4,
    TEST_START 0.0,
    TEST_END 2.4,
    FINISH_END 0.2

See test results for failed build of commit b7653daab8

@seanbudd seanbudd added conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. merge-early Merge Early in a developer cycle labels Jun 17, 2024
@seanbudd

seanbudd commented Sep 2, 2024

Copy link
Copy Markdown
Member

@XLTechie - do you plan to finish this work? Otherwise I think it should be closed

@XLTechie

XLTechie commented Sep 2, 2024 via email

Copy link
Copy Markdown
Collaborator Author

@seanbudd

seanbudd commented Sep 2, 2024

Copy link
Copy Markdown
Member

No problem - draft PRs are totally fine - we just want to make sure theyre not fully abandoned

Luke Davis and others added 5 commits September 2, 2024 19:55
    gui.onRunCOMRegistrationFixesCommand:
    - No longer shows success dialog on failure, or when the UAC is canceled or declined (#12345)..
    - We now catch the Windows error that signals user cancel of UAC, and return as if "NO" had been initially chosen.
    - If there is a Windows error other than cancel of UAC, alert the user and show the error in a dialog.
    - Rewrote initial dialog message to be more friendly and helpful, and removed warning icon (#12351).
    - Switched from using YES and NO buttons, to OK and Cancel (CANCEL button provides visual closure and escape key use).
    - Added a docstring and fully linted code. Added more debug logging.
@XLTechie XLTechie marked this pull request as ready for review September 3, 2024 01:06
@XLTechie XLTechie requested a review from a team as a code owner September 3, 2024 01:06
@coderabbitai

coderabbitai Bot commented Sep 3, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The changes introduce enhancements to the NVDA software, focusing on the COM Registration Fixing Tool. Key updates include improved user interface elements, refined error handling, and better user guidance. The tool's dialog now allows for closure via keyboard shortcuts, enhances logging for cancellations, and provides clearer messaging regarding its functionality and implications.

Changes

Files Change Summary
source/gui/__init__.py Enhanced onRunCOMRegistrationFixesCommand method with improved docstring, type hints, and error handling.
source/gui/utilityDialogs.py Introduced ContinueCancelDialog class with custom button logic for a tailored user experience.
user_docs/en/changes.md Updated documentation to reflect user interface improvements and bug fixes related to NVDA functionality.

Assessment against linked issues

Objective Addressed Explanation
Allow dialog to be closed with ALT+F4 or ESC (#[10799])
Prevent success message if UAC is cancelled (#[12345])
Improve messaging in the COM Registration Fixing Tool (#[12351])

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>, please review it.
    -- 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Comment thread source/gui/__init__.py Outdated
@XLTechie XLTechie marked this pull request as draft September 3, 2024 01:13
Comment thread user_docs/en/changes.md Outdated
Comment thread user_docs/en/userGuide.md Outdated
Comment thread user_docs/en/userGuide.md Outdated
Comment thread source/gui/__init__.py Outdated
Comment thread source/gui/__init__.py
Comment thread source/gui/__init__.py Outdated
Comment thread source/gui/__init__.py Outdated
XLTechie and others added 3 commits September 18, 2024 21:32
Co-authored-by: Sascha Cowley <16543535+SaschaCowley@users.noreply.github.com>
@XLTechie

XLTechie commented Sep 19, 2024

Copy link
Copy Markdown
Collaborator Author

@SaschaCowley I have addressed your latest review. I'm not sure I like the user guide reordered as you requested, but I do agree with your reason for wanting to do it. In the end, all of the same information is there, which ever order it is presented in, so I'm fine with whatever.

Comment thread source/gui/__init__.py Outdated
@SaschaCowley

Copy link
Copy Markdown
Member

@XLTechie I agree it really doesn't read very well now. Perhaps we could rewrite it to be a little less technical and more to the point of what users are likely to care about? What do you think of something like this?

Installing and uninstalling programs on a computer can sometimes cause problems with the Windows registry that result in NVDA behaving abnormally.
This can happen, for example, after installing and uninstalling Adobe Reader, Math Player and other programs.
It can also happen after Windows updates, or during other events that access the registry.
THE COM Registration Fixing Tool attempts to fix these issues by repairing accessibility entries in the registry.

The types of issues this tool can fix include:

* NVDA reporting "unknown" or "pane" when navigating in browsers such as Firefox or Edge, mail programs such as Thunderbird, Windows Explorer, the task bar, and other programs.
* NVDA failing to switch between focus mode and browse mode when you expect it to.
* NVDA being very slow when navigating in browsers while using browse mode.

Because this tool corrects entries in the Windows registry, it requires administrative access to work, just like when installing a program.
If you have UAC (User Access Control) enabled, as most users do, you will need to follow whatever prompts are presented by UAC to run the tool successfully.

@XLTechie

XLTechie commented Sep 19, 2024

Copy link
Copy Markdown
Collaborator Author

@SaschaCowley How about this? Not quite what you wrote, but closer. @Qchristensen you might want to get in on this user guide discussion.

@Qchristensen Qchristensen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Updated user guide and dialog intro text reads well. Great work everyone

@SaschaCowley SaschaCowley merged commit 593d81f into nvaccess:master Sep 20, 2024
@github-actions github-actions Bot added this to the 2025.1 milestone Sep 20, 2024
@coderabbitai coderabbitai Bot mentioned this pull request Nov 11, 2024
@coderabbitai coderabbitai Bot mentioned this pull request Dec 9, 2024
31 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Jan 23, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. merge-early Merge Early in a developer cycle

Projects

None yet