-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
Update Add-on Store mirror to use new UX #17228
base: master
Are you sure you want to change the base?
Conversation
Added a new section to the settings section of the user guide describing the update mirror and add-on store mirror dialogs in one. Removed the specific section for the update mirror dialog. Changed the links that pointed to the add-on store dialog to refer to the new unified section. Changed references in source code to refer to the correct user guide sections.
message = _( | ||
# Translators: Message shown to users when testing a given URL has failed because the response was invalid. | ||
"The URL you have entered failed the connection test. The response received from the server was invalid. Check the URL is correct before trying again.", | ||
) | ||
elif isinstance(error, requests.HTTPError): | ||
message = _( | ||
# Translators: Message shown to users when testing a given URL has failed because the server returned an error. | ||
"The URL you have entered failed the connection test. The server returned an error. Check that the URL is correct before trying again.", | ||
) | ||
elif isinstance(error, requests.ConnectionError): | ||
message = _( | ||
# Translators: Message shown to users when testing a given URL has failed because of a network error. | ||
"The URL you have entered failed the connection test. There was a network error. Check that you are connected to the internet and try again.", | ||
) | ||
else: | ||
message = _( | ||
# Translators: Message shown to users when testing a given URL has failed for unknown reasons. | ||
"The URL you have entered failed the connection test. Make sure you are connected to the internet and the URL is correct.", | ||
) |
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.
I think perhaps this should be a datastructure such as an enum or dataclass.
I think it might also be good to translate the first sentence separately, and prepend it on.
@@ -62,7 +63,6 @@ | |||
Set, | |||
cast, | |||
) | |||
from url_normalize import url_normalize |
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.
can we remove this from requirements then?
self.addonMetadataMirrorTextbox = sHelper.addLabeledControl( | ||
self.addonMetadataMirrorLabelText, | ||
wx.TextCtrl, | ||
# Translators: The label for the server mirror on the Add-on store Settings panel. |
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.
# Translators: The label for the server mirror on the Add-on store Settings panel. | |
# Translators: The label for the server mirror on the Add-on Store Settings panel. |
self.addonMetadataMirrorLabelText, | ||
wx.TextCtrl, | ||
# Translators: The label for the server mirror on the Add-on store Settings panel. | ||
mirrorBoxSizer = wx.StaticBoxSizer(wx.HORIZONTAL, self, label=_("Server mirror")) |
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.
Pedantic/subjective but maybe this is more accurate phrasing right? Making the subject the server/URL, not the mirror
mirrorBoxSizer = wx.StaticBoxSizer(wx.HORIZONTAL, self, label=_("Server mirror")) | |
mirrorBoxSizer = wx.StaticBoxSizer(wx.HORIZONTAL, self, label=_("Mirror server")) |
# Add-on Store cache hash is a git commit hash as a string. | ||
return isinstance(data, str) and bool(re.fullmatch("[0-9a-fA-F]{7,40}", data)) |
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.
ah I don't think this has to be true - we use a commit hash but mirrors may want to use their own cache hash, like a new UUID every X minutes to cache break, or whenever they generate new data.
I would just ensure there is a non-empty string
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.
# Add-on Store cache hash is a git commit hash as a string. | |
return isinstance(data, str) and bool(re.fullmatch("[0-9a-fA-F]{7,40}", data)) | |
# Add-on Store cache hash must be a non-empty JSON string | |
return isinstance(data, str) and bool(re.fullmatch(".+", data)) |
This may be of use in locations where access to the NV Access Add-on Store server is slow or unavailable. | ||
|
||
Leave this blank to use the default NV Access Add-on Store server. | ||
The read-only text box shows the current mirror URL. | ||
If no mirror is in use (I.E. the NV Access NVDA Add-on Store server is being used), "No mirror" is displayed. |
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.
I think we lowercase i.e. more consistently, also maybe NVDA can be dropped
If no mirror is in use (I.E. the NV Access NVDA Add-on Store server is being used), "No mirror" is displayed. | |
If no mirror is in use (i.e. the NV Access Add-on Store server is being used), "No mirror" is displayed. |
@@ -3131,6 +3115,28 @@ This can be very useful when you want to monitor constantly changing content, su | |||
The refresh takes place every one and a half seconds. | |||
This option is disabled by default. | |||
|
|||
#### Set Mirror Dialog {#SetURLDialog} |
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.
I think this should go under "Advanced settings" or "misc settings" since all the other headers at this level are for settings panels
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.
I disagree. Putting it in sub-paragraphs of the advanced settings has no sense because this dialog is not accessible from the advanced settings panel. Regarding "Misc", would it be a new paragraph to create?
There are already other level 4 headings which are not settings panels:
- 12.1.3. Select Synthesizer
- 12.1.4. Synth settings ring
12.1.6. Select Braille Display
Though, I acknowledge that Select synthesizer / braille display dialogs are dialogs that can be opened independently as a setting dialog whereas the Set URL dialog cannotn i.e. it is always a sub-dialog of a setting panel.
My proposal is to keep this at level 4, even if it's not a stand-alone settings dialog. But state explicitly in the introduction text of this paragraph that this type of dialog may be opened to set the mirror URL and the add-on store URL.
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.
makes a lot of sense, this is quite similar to select synthesizer, settings ring and selecting a braille display. Though perhaps grouping those dialogs with this one separately might be worth doing
See test results for failed build of commit 739159131a |
Link to issue number:
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 server mirror settings now use the same UI as the NVDA update check mirror.
Description of development approach
responseValidator
option to_SetURLDialog
, which defaults to always returningTrue
.request.Response
objects to check if they're a valid Add-on Store cache hash (JSON comprising a single string of 7-40 hex digits ).responseValidator
function.Testing strategy:
Known issues with pull request:
While not directly related to this issue, note that this work lays part of the groundwork for #17205.
Code Review Checklist:
@coderabbitai summary