Don't save mathCAT settings to yaml#19637
Merged
Merged
Conversation
Member
|
should we just remove this entirely if it just duplicates settings? |
Member
Author
Remove what? I've removed the YAML support, but the rest of |
Member
|
Sorry I misread the PR description. I thought we were still retaining a separate (non-YAML) file for settings in this PR |
seanbudd
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Follow-up to #18323, #19373 and #19613
Summary of the issue:
Since the introduction of MathCAT into NVDA in #18323, NVDA has persisted MathCAT settings to a YAML file . This is at odds with current project configuration standards, which use either configobj ini files, or JSON. This also duplicates settings, as they're also saved to
nvda.ini.Originally, these were stored in
%AppData%\MathCAT\prefs.yaml, but as of #19373, they are saved tomathcat.yamlin NVDA's config directory. In neither case wasshouldWriteToDiskchecked before saving the preferences. Additionaly, NV Access's Corporate & Government page states "To prevent NVDA users from modifying their configuration or add-ons directly, user write access to [%APPDATA%\nvda] must also be restricted". If implemented, this would have stopped users from changing their MathCAT settings in memory, as they had to be saved to YAML to be loaded by MathCAT.In #19613, the logic was changed to programmatically apply these settings with
libmathcat.SetPreference, which should solve the problem of users without write access to their NVDA config directory being able to change their MathCAT preferences. However, the code that wrote the settings to the YAML file was not removed, nor did it contain any error handling.Description of user facing changes:
None, but may avoid some errors in the logs.
Description of developer facing changes:
Pyyaml is no-longer a dependency.
mathPres.MathCAT.preferences.MathCATUserPreferences.savehas been renamed toapply, and no longer saves the settings to YAML. Settings persistance is handled by NVDA's configuration system.Description of development approach:
Removed the code that wrote MathCAT preferences to YAML, and any code that only it depended on. Renamed
savetoapplyusing VS Code's refactoring tool. Searched the repo foryamland after confirming that we don't rely onpyyamlanywhere else, ranuv remove pyyaml.Testing strategy:
Tested by loading the Wikipedia page on the quadratic formula in firefox. Located some math and read it. Changed settings one at a time and tested that they were applied correctly. Restarted NVDA and ensured that the new settings were still present.
Known issues with pull request:
None known
Code Review Checklist: