Skip to content

Added ability to report spelling errors in braille#18641

Merged
SaschaCowley merged 35 commits into
nvaccess:masterfrom
nvdaes:brailleErrors
Oct 3, 2025
Merged

Added ability to report spelling errors in braille#18641
SaschaCowley merged 35 commits into
nvaccess:masterfrom
nvdaes:brailleErrors

Conversation

@nvdaes

@nvdaes nvdaes commented Aug 7, 2025

Copy link
Copy Markdown
Collaborator

Link to issue number:

Fixes #7608

Summary of the issue:

Currently, spelling errors aren't presented in braille. This may negatively impact deaf-blind people and other braille users.

Description of user facing changes:

If NVDA is configured to report format changes with tags in braille, and to report spelling errors in braille, these mistakes would be presented in braille with the "e" and "e with dot 7" tag.
An unassigned command has been added to toggle the reporting of spelling errors in braille. This can also be configured from the Document Formatting dialog.

Description of developer facing changes:

None.

Description of development approach:

Added a new item in the fontAttributeFormattingMarkers dictionary of braille.py for spelling errors (invalid-spelling).
A shouldBeUsed method has been added to the FormattingMarkerclass, to determine if an attribute should be reported.

Testing strategy:

Tested locally in Microsoft Word and Notepad, typing text detected as spelling errors.

Known issues with pull request:

None.

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

@josephsl

josephsl commented Aug 7, 2025 via email

Copy link
Copy Markdown
Contributor

@nvdaes nvdaes marked this pull request as ready for review August 7, 2025 18:29
@nvdaes nvdaes requested review from a team as code owners August 7, 2025 18:29
@CyrilleB79

Copy link
Copy Markdown
Contributor

@nvdaes, I have not tested this PR myself.

I acknowledge the need to have spelling errors reported in brailles, especially, but not only, for deaf blind users.
Though I am concerned by the UX provided in this PR. Having "Font attribute" setting controlling reporting spelling errors in braille makes Document formatting reporting confusing, more than today, I'd say.

Until now:

These 2 items were not linked. Now, the UX proposed in this PR links them, making the definition of a font attribute much less clear, and actually inexact.

And what if I want to have spelling errors reported in braille but not by speech?

IMO, to be able to customise how additional text information is reported in braille (font attributes, spelling mistakes, we need a specific dedicated panel for Braille formatting reporting.

@SaschaCowley

Copy link
Copy Markdown
Member

@nvdaes I agree with @CyrilleB79 that this should not be controlled by the "font attributes" option. I suggest that we change the "spelling errors" option to allow the user to select speech and/or braille as can be done with font attributes. This will require changing the way NVDA calculates the indicators in braille. I think the approach I would take would be to add a callable to FormattingMarker that returns True if the marker should be used if appropriate, and False if not. We can then refactor the code to use that callable rather than the overarching check as done currently. What do you think?

@SaschaCowley SaschaCowley marked this pull request as draft August 8, 2025 01:18
@nvdaes

nvdaes commented Aug 8, 2025

Copy link
Copy Markdown
Collaborator Author

@SaschaCowley and @CyrilleB79 , I see what Cyrille means and I agree with you, Sascha. I like your idea and I'll try to implement it.
@josephsl , m is delimited by unicode patterns like other attributes.

@CyrilleB79

Copy link
Copy Markdown
Contributor

Why did you use "m" letter while we have "Spelling errors" in the UI, and not "Mistakes"? Have you considered using "e" instead?
It's worth noting that "s" cannot be used since it is already used by "strikethrough"

@nvdaes

nvdaes commented Aug 8, 2025

Copy link
Copy Markdown
Collaborator Author

Why did you use "m" letter while we have "Spelling errors" in the UI, and not "Mistakes"? Have you considered using "e" instead? It's worth noting that "s" cannot be used since it is already used by "strikethrough"

Yes, in fact I have considered using "e". I'll change this and will continue my work when your PR to add ability to use audio is merged.
I think we can use a single line in the changelog mentioning our names and the corresponding issues, something like:

@CyrilleB79

Copy link
Copy Markdown
Contributor

@SaschaCowley you wrote:

@nvdaes I agree with @CyrilleB79 that this should not be controlled by the "font attributes" option. I suggest that we change the "spelling errors" option to allow the user to select speech and/or braille as can be done with font attributes.

What do you suggest regarding the GUI and taking into account the work in #17997 (see more specifically #17997 (comment))?

@nvdaes you wrote:

I think we can use a single line in the changelog mentioning our names and the corresponding issues, something like:

* Added ability to report spelling errors with audio and braille (@CyrilleB79, @nvdaes)

Feel free to do so when the final design is clearer and if you still find it appropriate.

@SaschaCowley

Copy link
Copy Markdown
Member

@CyrilleB79 thanks for bringing that to my attention. I'm not sure of a good solution at present. I'll talk to the team about it.

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Aug 12, 2025
@SaschaCowley

Copy link
Copy Markdown
Member

@CyrilleB79 @nvdaes We think that a check list with "speech", "sound" and "braille" options is most appropriate in this case. These could be internally stored as a bit flag.

@nvdaes

nvdaes commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator Author

Sascha wrote:

We think that a check list with "speech", "sound" and "braille" options is most appropriate in this case. These could be internally stored as a bit flag.

I agree with this proposal. I'll continue my work, as mentioned, when Cyrille's work about sound and speech is merged.

@CyrilleB79

Copy link
Copy Markdown
Contributor

How would you modify the toggle script?

@nvdaes

nvdaes commented Aug 13, 2025

Copy link
Copy Markdown
Collaborator Author

Cyrille wrote:

How would you modify the toggle script?

Probably I would remove it, but I would study other similar cases to decide the best way to proceed.

@SaschaCowley

Copy link
Copy Markdown
Member

@CyrilleB79 we could remove it, make the script cycle between all options, or add new scripts to toggle braille and speech/sound

@seanbudd

This comment was marked as off-topic.

@seanbudd seanbudd closed this Sep 2, 2025
@seanbudd seanbudd reopened this Sep 2, 2025
@seanbudd

This comment was marked as off-topic.

@CyrilleB79

Copy link
Copy Markdown
Contributor

@nvdaes #17997 has just been merged. You can now continue with this PR if you wish.

Regarding the toggle script, I suggest:

  • keep the existing script and adapt it to cycle through all possible audio feedback.
  • if you wish/find it useful, add a toggle script, still unassigned, to have spelling mistake reported in braille or not.

@nvdaes

nvdaes commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator Author

@CyrilleB79 , though I like a lot your proposed script, unfortunately, for now I'm getting critical errors. I'll test in more detail.

@nvdaes

nvdaes commented Sep 11, 2025

Copy link
Copy Markdown
Collaborator Author

@CyrilleB79 , perhaps your script failed due to something wrong in my local system. But I've realised about this after modifying my previous script, since it failed too and I have run scons source again. Then the script worked
I think that now the script is clearer than my original one, and both, yours and mine are valid.
I will test again since, the first time that I've tested, it seemed not to work properly, but perhaps I didn't test well since after that all seems to work as expected.

@nvdaes nvdaes marked this pull request as ready for review September 22, 2025 19:03

@SaschaCowley SaschaCowley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, just a few suggestions.

Comment thread source/globalCommands.py Outdated
Comment thread source/globalCommands.py Outdated
Comment thread source/globalCommands.py
Comment thread source/config/configFlags.py Outdated
Comment thread user_docs/en/userGuide.md Outdated
@nvdaes

nvdaes commented Sep 30, 2025

Copy link
Copy Markdown
Collaborator Author

Thanks a lot @SaschaCowley ! I love these simplifications in the code. I'll test this later just to be asbolutely sure, and I'll provide feedback here.

@nvdaes

nvdaes commented Sep 30, 2025

Copy link
Copy Markdown
Collaborator Author

@SaschaCowley , thanks for your suggestions. I think that this is ready for review.

@SaschaCowley SaschaCowley enabled auto-merge (squash) October 3, 2025 01:25

@Qchristensen Qchristensen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reads well.

@SaschaCowley SaschaCowley merged commit 9935428 into nvaccess:master Oct 3, 2025
40 checks passed
@github-actions github-actions Bot added this to the 2026.1 milestone Oct 3, 2025
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.

Have spelling errors indicated in Braille when supported

6 participants