Skip to content
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

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

Merged
merged 71 commits into from
Sep 20, 2024

Conversation

XLTechie
Copy link
Collaborator

@XLTechie XLTechie commented Apr 30, 2021

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
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
Copy link
Collaborator Author

XLTechie commented Mar 15, 2022 via email

@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
Collaborator

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

@XLTechie

This comment was marked as outdated.

@AppVeyorBot
Copy link

See test results for failed build of commit 054795cbe5

@CyrilleB79
Copy link
Collaborator

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
Collaborator

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

@XLTechie XLTechie force-pushed the CRFTRefactor branch 2 times, most recently from 65efc5c to becd99a Compare April 12, 2024 11:28
@AppVeyorBot
Copy link

  • 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
Copy link
Member

seanbudd commented Sep 2, 2024

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

@XLTechie
Copy link
Collaborator Author

XLTechie commented Sep 2, 2024 via email

@seanbudd
Copy link
Member

seanbudd commented Sep 2, 2024

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

Luke Davis added 2 commits September 2, 2024 19:55
    gui.onRunCOMRegistrationFixesCommand:
    - No longer shows success dialog on failure, or when the UAC is canceled or declined (nvaccess#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 (nvaccess#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
user_docs/en/userGuide.md Outdated Show resolved Hide resolved
user_docs/en/userGuide.md Outdated Show resolved Hide resolved
user_docs/en/changes.md Outdated Show resolved Hide resolved
user_docs/en/userGuide.md Outdated Show resolved Hide resolved
user_docs/en/userGuide.md Outdated Show resolved Hide resolved
source/gui/__init__.py Outdated Show resolved Hide resolved
source/gui/__init__.py Show resolved Hide resolved
source/gui/__init__.py Outdated Show resolved Hide resolved
source/gui/__init__.py Outdated Show resolved Hide resolved
@XLTechie
Copy link
Collaborator Author

XLTechie commented Sep 19, 2024

@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.

source/gui/__init__.py Outdated Show resolved Hide resolved
@SaschaCowley
Copy link
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
Copy link
Collaborator Author

XLTechie commented Sep 19, 2024

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

Copy link
Member

@Qchristensen Qchristensen left a comment

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
4 checks passed
@github-actions github-actions bot added this to the 2025.1 milestone Sep 20, 2024
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