Bugfix: display ampersand character in the message of nvdaControls.MessageDialog#14607
Conversation
|
Rather than changing this on |
Sorry, I am not sure to understand. Could you please be more specific? Could you indicate which message I should amend and where? Also, in the initial description, I have written:
If you disagree with this statement, could you explain why? |
|
I was hoping this could happen on the string injection side, rather than in MessageDialog, e.g. updating Generally we expect inputs to be correct, rather than fixed by the dialog. One risk of this is strings that already escaped, e.g. "foo && bar", getting escaped again into "foo &&&& bar" |
That was my idea, before realizing that the issue was broader.
Why do you consider that the "correct" input is a string where ampersand indicate an accelerator? The dialog is abstracted and from the point of view of a developer, the developer using this dialog does not need to know that the implementation uses a On the contrary, I consider that there is no sense putting an accelerator in this string. It makes sense to use an accelerator only with objects that can perform actions or be focused, or Going further with a comparisonNote also the following test on standard Windows MessageBox (for an illustrating comparison only). In the Python console, type: Visually, you can see that the message in the message box is "Hello &world" (with ampersand). Ampersand in the input string is not used to create an accelerator key. Be careful to check visually and not with ATs since there is another issue, see below. Additional issue with text reported in
|
|
This is a convincing argument. |
Issue similar to #14607. Summary of the issue: In the multi-category settings dialog, the panel takes the name of the corresponding category. This name is reported when tabbing from the category list to the panel. If the category name contains an ampersand, this character is not reported in the panel's name and it acts as an accelerator instead. This is the case for NVDA Dev & Test Toolbox add-on where the add-on's name is used as category in the multi-category settings dialog and thus also as panel name. Description of user facing changes The panel's name will match the category name, even in the case this name contains an ampersand (&) character. Description of development approach Double the ampersand in the panel's name.
Link to issue number:
None
Summary of the issue:
When a message containing ampersand has to be displayed in
nvdaControls.MessageDialog, the ampersand character is interpreted as an indication for accelerator key. Thus the ampersand character is not displayed and the following character is underlined.Putting here an accelerator key does not make sense here since the
wx.StaticTextused in this dialog is not the label of a focusable element.The real-life situation where this issue occurs is when installing NVDA Dev & Test Toolbox. The dialog indicates "Extension : NVDA Dev Test Toolbox 3.0" (without ampersand) instead of "Extension : NVDA Dev & Test Toolbox 3.0" (with ampersand).
Description of user facing changes
Messages displayed in
nvdaControls.MessageDialogwill be displayed correctly when the message contains ampersand character. E.g. add-on install dialog and add-on install errror dialogs will display correctly the name of add-ons containing ampersand character in their name.Description of development approach
Doubled the ampersand character when present in the message.
Testing strategy:
Manual test:
Check that the issue is fixed when installing NVDA Dev & Test Toolbox.
Known issues with pull request:
I have made this PR minimalist, fixing only the situation where both these statements are true:
wx.StaticTextcan contain ampersand character.wx.StaticTextis a standalone static text, i.e. not used as a label for another focusable element, e.g. edit field, combo-box or list following itThis PR is not waterproof to following hypothetical situations regarding standalone static text:
For reviewer(s):
Maybe I should also handle these cases? In this PR? Or in another one? Or is it not worth it (assuming that translators do not use ampersand when it is not used in English)?
Let me know what you think.
Change log entries:
Not needed for such a small change.
Code Review Checklist: