-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Add the ability to specify NVDA update check URL from within NVDA #17151
Conversation
# Conflicts: # user_docs/en/changes.md
@SaschaCowley I was able to "accidentally" type a letter, in this case "s", into the Update URL field. This is the result I expected, but it highlights two problems.
|
I'm not entirely sure I like the idea of automatically pinging the update check URL. This would, for example, make it difficult to change the update check URL while offline, which someone may wish to do if they had privacy concerns around using the default.
If this approach is to be used, I think it best to apply the same approach to the Add-on Store mirror URL as well. Here is what I am thinking for the UX:
What do you think? |
@SaschaCowley I like it. I would put the test button first, so it is the default button.
Thus encouraging testing before saving.
|
@XLTechie I've just pushed a proof of concept implementation of the UI pattern we discussed. Would you mind having a look and letting me know what you think? Note that this does need work before it's ready, but I'm finishing up for the day so won't be around to address any feedback until tomorrow. Note that if running from source you will need to modify |
I'm heading out myself, so I just grabbed the artifact and tested that real quick.
I definitely like the interface!
It fits the style of other such elements well, and covers all of the bases I hoped it would cover.
"None" is the setting at first, but if you set a URL, OK it, and then clear it, it will show as blank after that, instead of None. One of those probably shouldn't be the case.
|
Btw, do you happen to have a test URL for a working mirror?
|
You can use the mirror maintained by the Chinese community https://nvaccess.mirror.nvdadr.com/nvdaUpdateCheck. |
Co-authored-by: Luke Davis <[email protected]>
@SaschaCowley Two very minor points for consideration.
|
I think making this more robust would require refactoring
I think this can be saved as a refinement for later, as I think it wise to get this into alpha sooner than later. Perhaps once I get the new message dialog API working this will be a good test case, as the plan with that API is to allow one-off customisation without having to make a dialog subclass. |
STR:
Result:
Here is the log: |
@CyrilleB79 this is because the mirror URL text box is being populated by |
In the "Update mirror" field, when not using a mirror, it reads "(None)", which is of course correct, but could this cause confusion for some users who think it should be set to something to be able to check for updates? I was initially thinking of users who may not even know what a mirror is and think it should be set to something, so perhaps: Or another option might be simply: Since that matches the "No speech" and "No braille" options on those screens (Or do others not think it is a problem? I don't have any evidence that it WOULD confuse people.) |
Regarding @Qchristensen's comment: I like the "No mirror" option.
I think the confusion he points out is a definite potential.
|
…mirror' when blank to better align with existing controls
@Qchristensen @XLTechie I've updated the wording to "No mirror". |
Follow up to #17099 Summary of the issue: In PR #17099, the ability to set a mirror to use when accessing the Add-on Store was added. PR #17151 built upon this, adding the ability to set a mirror for NVDA update checks. However, it was decided that we needed a more robust way of checking the mirror URLs, and a means of protecting users from accidental changes to the URL. These UX improvements were implemented for the NVDA update mirror, but not for the Add-on Store server mirror, so as to keep PRs single-issue. Description of user facing changes: The Add-on Store mirror settings now use the same UI as the NVDA update check mirror. Description of development approach: * Added a `responseValidator` option to `_SetURLDialog`, which defaults to always returning True. * Added a validator for `request.Response` objects to check if they're a valid Add-on Store cache hash (JSON comprising a single non-empty string). * Copied the implementation of NVDA update mirror to the Add-on Store page, using the cache hash validator as the `responseValidator` function. * Made failure messages when setting a URL more descriptive. * Updated user guide, including consolidating the description of the NVDA update check and Add-on Store server mirror dialogs into one. Testing strategy: * Tested that using the new dialog sets the Add-on Store server mirror as expected. * Ran through the NVDA update mirror process and Add-on Store server mirror process, checking that context help works on all controls. Known issues with pull request: While not directly related to this issue, note that this work lays part of the groundwork for #17205.
Link to issue number:
None
Related to #17099
Summary of the issue:
The NVDA update check URL is currently hard-coded in NVDA. This presents problems for users who are unable to use the default URL for any reason. This particularly affects users in the People's Republic of China, many of whom are unable to access the update check server at an acceptable speed. A community add-on exists to work around this, but a means of specifying a mirror directly within NVDA is considered a better approach.
Description of user facing changes
Added controls similar to the speech synthesizer or braille display controls to NVDA's general settings page that allow the user to change the update server in use.
Added slightly more helpful wording to update check errors that encourages users to check the mirror URL if there are issues accessing the update check server and a custom URL is in use.
Description of development approach
update.serverURL
, which defaults to the empty string.updateCheck.py
which returns the configured URL if set, or the default otherwise. Made theCHECK_URL
constant private since it is no-longer needed. Updated references to the constant to use the new getter, and to use f-strings rather than strf style substitutions.updateCheck.UpdateChecker._error
to return more helpful messages.SetURLDialog
, togui.settingsDialogs
. This dialog allows for the input and testing of URLs, and saving them back to config. The dialog is flexible, with a view to using it for the mirror URL support in the Add-on Store added in Add ability to specify add-on store metadata URL from within NVDA #17099 .onPanelActivated
method rather than inmakeSettings
to avoid code duplication between the first population and when populating after the mirror URL is changed.Testing strategy:
Spoofed the NVDA version to 2024.1 stable by altering
buildVersion.py
andversionInfo.py
. Tested checking for updates with:Tested many scenarios in the new dialog to ensure it behaves as expected, including:
Known issues with pull request:
The read-only URL text control line wraps, causing NVDA to sometimes only read part of the URL, and potentially causing odd visual layout.
Code Review Checklist:
@coderabbitai summary