-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Make config options and GUI settings match #14233
Make config options and GUI settings match #14233
Conversation
Issue found while working on #14233 (testing). Link to issue number: None Summary of the issue: When an error occurs while switching profile manually, a message box indicates that there has been an error, but nothing in the message box nor in the log indicates the source of error (no traceback...). Description of user facing changes When profile switching fails, the traceback of the error is logged. Description of development approach Added the log
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…controlled by only one parameter in the config: Line indentation in Document settings.
This comment was marked as outdated.
This comment was marked as outdated.
2be0b47
to
0da6472
Compare
This comment was marked as outdated.
This comment was marked as outdated.
It looks like |
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.
Thanks for picking this up and fixing this, looks pretty good
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
See test results for failed build of commit 93f0d78708 |
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.
Given some potential issues with upgrading of profiles have you considered modifying the upgrade steps, so that they accept profiles present lower in the stack as an additional parameter? While this introduces additional complexity breaking user config is hardly ideal, and we may encounter similar cases in the future, so solution of some kind would probably be needed later on.
Thanks @lukaszgo1 for the review.
The main problem is that the profiles stack is not always the same. For example, if you have created an application profile for Notepad and a manual profile. Then you upgrade NVDA to 2023.1, there are two scenarios:
We could make the assumption that only the default profile was active, what probably covers the majority of the cases. But frankly adding more complexity to it just to cover a few upgrades and even not be sure that they will all be correctly covered is not worth it IMO. @seanbudd your opinion on this?
If we ensure in the future that only one config item controls one GUI control, we should not get such problems in the future (hoping that I have not forgotten any problematic control). Did you have a specific situation in mind when writing this? |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@seanbudd I have added the type hint you suggested as well as other ones. Thanks. |
Note: I have edited the initial description, especially to make appear the main item in the change log that was not appearing before due to bad markdown formatting. |
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.
Do you plan to add tests for ambiguous multi profiles situations?
If so, or it's already covered and I'm not seeing it, then it would be good to highlight the issue and explain how it can affect developers.
No I do not plan to add more tests unless you ask to. I have only added two unit tests for the non-obvious cases where the upgrade is done on profiles that are assumed not to be the default one given the content of the profile's config:
It seems to me that further tests highlighting the issue with arbitrary stacking order of profiles were out of the scope of this PR (according to #14233 (comment)) |
In that comment I was trying to say that the more important test is the arbitrary stacking order behavior. Because it is the more surprising aspect. That said, if you don't want to write these tests, or they are difficult to write, then we can create a new github issue to track it as a problem that affects developers. |
Yes, I'd prefer have this PR merged as is, without these additional unit tests. The confusion that can remain is when the same option is defined in two profiles (e.g. application profile and manual profile), the value of the option will depend on which profile is activated last. If you don't mind, I'll let you create the new issue for this, so that you can express more clearly than I what you are expecting. Thanks. |
This comment was marked as outdated.
This comment was marked as outdated.
Link to issue number: Fixes #14527 May be considered a follow-up of #14233. Summary of the issue: When configuring NVDA Modifier Key for a non-default profile and for the default profile, we can end-up with no NVDA key defined at all in the non-default profile (see #14527 for detailed steps). This is due to the fact that the config stores one item per NVDA key but that there is a dependency between these values to honor the requirement that at least one key should be defined as NVDA key. These values are checked when changing NVDA keys via the GUI. But the requirement may be missed when switching profiles and stacking their configurations. There is also a second scenario allowing to have no NVDA key defined using only default profile: In keyboard settings enable only caps lock and disable both insert, then validate Open the NVDA startup dialog via Help menu, uncheck caps lock and validate. This scenario is quite unlikely but there is no check in NVDA startup dialog to prevent such situation. Description of user facing changes Situations where no NVDA key is defined will not be possible anymore. Description of development approach Use only one config item to store the used NVDA modifier keys. Define a config flag for NVDA key; each value corresponds to one bit so that all the values can be bitwise or-ed and the reesulting value can be stored in the config as an integer.
…laced by reportCellBorders See <nvaccess/nvda#14233>
…laced by reportCellBorders See <nvaccess/nvda#14233>
Link to issue number:
Closes #14170
Summary of the issue:
When setting line indentation reporting on tone in a profile (e.g. Notepad) and on speech for default profile, you end up with line indentation set on Speech and tones instead of tones only when turning back to Notepad (see #14170 for detailed steps).
The issue is due to the following:
Only one combo-box allows to set line indentation reporting in the UI. But the value of this combo-box is controlled by two items in the configuration. These two items are then managed separately when dealing with configuration profile switching.
The following combo-boxes in the GUI are impacted by this issue:
Description of user facing changes
The values of the following settings should not change unexpectedly anymore when switching profile:
Description of development approach
A note on profile upgrade
In some cases, the config does not allow to know the selected option. Let's take as an example the following config: reportIndent = True and reportIndentWithTones not present in the config.
In such situations where one cannot exactly know the option selected in the GUI, the implementation uses the following rules by order of priority:
Testing strategy:
Manual tests:
For each combobox:
Unit tests added for each GUI option selected from default profile as well as for other corner cases.
Known issues with pull request:
Issue 1: potential issues with the upgrade of non-default profiles
Some issues may remain when upgrading NVDA with profiles. Below is an example on a fresh NVDA:
Before upgrade, default profile's config will contain the following
[documentFormatting]
section:Before upgrade, test profile's config will contain the following
[documentFormatting]
section:Although indentation is reported by speech and tones in test profile,
reportLineIndentation = True
is not specified in test profile's config file since it is inherited from default profile.When upgrading, the test profile will have line indent set on "tones" instead of speech and tones.
This is because profiles are upgraded one at a time, but their config is defined according to the config on which they are stacked.
Should I indicate somewhere the following information?
Issue 2: changes for dev / API / deprecation
Change log entries:
Bug fixes
Deprecation:
API breaking changes:
Code Review Checklist: