Skip to content

Use the current NVDA TextRegion API - #53

Open
serrebidev wants to merge 2 commits into
ABuffEr:masterfrom
serrebidev:fix/nvda-2026-text-region-api
Open

Use the current NVDA TextRegion API#53
serrebidev wants to merge 2 commits into
ABuffEr:masterfrom
serrebidev:fix/nvda-2026-text-region-api

Conversation

@serrebidev

@serrebidev serrebidev commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Use braille.regions.base.TextRegion when available, falling back to braille.TextRegion on older NVDA versions. This avoids the deprecated alias on current alpha builds while preserving compatibility with releases before the braille API split, as requested in review.

The import lives in the existing compatibility module. Empty-list announcements use the selected class without changing their speech or braille behavior.

Validation:

  • Three regression tests pass for a legacy braille module, a braille package without regions, and the current API. The current-API test rejects any access to the deprecated alias.
  • The complete unit suite passes (four passing tests and the template's one expected failure).
  • Add-on sources compile with SyntaxWarning treated as an error.
  • Ruff lint and formatting checks pass for the changed Python files.
  • Both the add-on package and translation template build successfully with SCons.

CI limitation: the build workflow has existing repository-wide failures. Upstream master at 58d4a0c reports 2,531 Pyright errors in the same local environment, including unresolved NVDA imports; the updated branch reports 2,536, with the new compatibility imports also subject to the missing NVDA environment. The previous CI run also found whitespace issues in the issue template, changelog, and pyproject. The missing trailing comma in the changed plug-in source is fixed here. Resolving the remaining template/type-check setup needs separate work; this PR does not disable those checks.

Compatibility tests use simulated NVDA modules; interactive testing on older NVDA releases remains outstanding. The original PR reported a clean startup on NVDA alpha-57759 before this fallback revision.

@ABuffEr

ABuffEr commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Hi,
as it is, this PR breaks compatibility with any versions prior 2027.1 (target version of latest alphas).
Can you fix keeping compatibility?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants