Skip to content

[Draft] Integrate the MathCAT add-on into NVDA #18323

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

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

RyanMcCleary
Copy link

@RyanMcCleary RyanMcCleary commented Jun 25, 2025

Link to issue number:

Closes #17667.

Summary of the issue:

The MathCAT add-on is not currently included in the core of NVDA. Integrating MathCAT into NVDA will give users access to mathematical content out of the box.

Description of user facing changes:

The core functionality of the add-on will remain the same, but MathCAT will be included without needing to install it as an add-on (replacing mathPlayer). An additional panel will be added in the NVDA preferences dialog containing the configuration that is currently handled in MathCAT's add-on configuration dialog. Additionally, the user docs will be updated to reflect the replacement of mathPlayer with MathCAT.

Description of developer facing changes:

The code from the MathCAT add-on has been refactored and cleaned up to conform to NVDA's coding standards, and that code is included in the mathPres/MathCAT directory with this PR. Dependencies have been added as a Git submodule in include/nvda-mathcat. Before this PR is ready for review, changes will also be made to the way MathCAT is initialized (currently, it is only set up to be loaded as an add-on), and YAML configuration will be replaced with configobj.

Description of development approach:

Developments will proceed in the following steps:

  • Update the initialization of MathCAT so that it is loading and running correctly in its current form.
  • Include MathCAT configuration into the NVDA preferences dialog.
  • Replace YAML configuration with configobj.
  • Add unit and system tests.

Testing strategy:

The add-on code after refactoring has been tested only by loading it into NVDA and testing it functionally. Discussion of more unit and system tests is ongoing.

Known issues with pull request:

  • Previously, libmathcat_py.pyd was included in that MathCAT directory. Now, it is located in include/assets, so it is not being imported correctly. This can be fixed by updating pyproject.toml with the new path.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@coderabbitai summary

@RyanMcCleary RyanMcCleary requested a review from a team as a code owner June 25, 2025 00:40
@RyanMcCleary RyanMcCleary requested a review from seanbudd June 25, 2025 00:40
@RyanMcCleary RyanMcCleary marked this pull request as draft June 25, 2025 00:45
@josephsl
Copy link
Collaborator

josephsl commented Jun 25, 2025 via email

@AppVeyorBot
Copy link

See test results for failed build of commit 28d9c66976

@AppVeyorBot
Copy link

  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit 4298ae7b2f

@AppVeyorBot
Copy link

  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit 7445b8eba5

@AppVeyorBot
Copy link

  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit 9427fd7aa8

@AppVeyorBot
Copy link

  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit 4ba7a139a0

@AppVeyorBot
Copy link

  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit 27b2f891ff

@AppVeyorBot
Copy link

  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit 0368c286bf

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jul 1, 2025
@AppVeyorBot
Copy link

  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit 111a571a00

@@ -47,6 +47,7 @@ dependencies = [
"mdx_truly_sane_lists==1.3",
"markdown-link-attr-modifier==0.2.1",
"mdx-gh-links==0.4",
"pyyaml==6.0.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hate to butt in on a draft PR, but can we consider using StrictYAML instead? It sidesteps several of the rather nasty issues with YAML while being mostly compatible with PyYAML.

(I'd suggest not using YAML at all, but I suspect that's rather out of scope)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would require upstream changes to https://github.com/nsoiffer/MathCAT/, which we don't intended on maintaining. We're just parsing rules for math designed in YAML files as set by Neil. Since we don't have control over the source yaml, I don't think we can change our parsing rules.

Comment on lines +45 to +50
[submodule "source/mathPres/MathCAT/nvda-mathcat"]
path = source/mathPres/MathCAT/nvda-mathcat
url = https://github.com/ryanmccleary/nvda-mathcat
[submodule "include/nvda-mathcat"]
path = include/nvda-mathcat
url = https://github.com/ryanmccleary/nvda-mathcat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update these to just a single submodule referencing https://github.com/nvaccess/nvda-mathcat/


[tool.uv.workspace]
members = [
"miscDeps",
"include/nvda-mathcat",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"include/nvda-mathcat",
"include/nvda-mathcat",

return os.path.join(os.path.dirname(os.path.abspath(__file__)), "Rules", "Braille")

@staticmethod
def languagesDict() -> dict[str, str]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should instead return a set of supported languages for MathCAT, and the language names should be derived from getLanguageDescription.
Any language code which is not supported by getLanguageDescription should get added to LANG_NAMES_TO_LOCALIZED_DESCS.

@@ -47,6 +47,7 @@ dependencies = [
"mdx_truly_sane_lists==1.3",
"markdown-link-attr-modifier==0.2.1",
"mdx-gh-links==0.4",
"pyyaml==6.0.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would require upstream changes to https://github.com/nsoiffer/MathCAT/, which we don't intended on maintaining. We're just parsing rules for math designed in YAML files as set by Neil. Since we don't have control over the source yaml, I don't think we can change our parsing rules.

@RyanMcCleary
Copy link
Author

RyanMcCleary commented Jul 2, 2025 via email

@AppVeyorBot
Copy link

  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit f7b9c5fce2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MathML is ignored by NVDA by default
5 participants