Skip to content

Merge master to beta#14766

Merged
seanbudd merged 49 commits into
betafrom
master
Mar 30, 2023
Merged

Merge master to beta#14766
seanbudd merged 49 commits into
betafrom
master

Conversation

@seanbudd

Copy link
Copy Markdown
Member

No description provided.

seanbudd and others added 30 commits February 14, 2023 09:59
Summary of the issue:
braille.BrailleHandler.setDisplayname is too complex. It also relies on reentrancy and is difficult to grasp.

Description of user facing changes
See bug fixes below

Description of development approach
setDisplayByName is now split in three functions
setDisplayByName will no longer set noBraille as a fallback if noBraille is already active. This avoids reinitializing noBraille multiple times
BrailleHandler._detectionEnabled is removed, as it was supposed to be equal to the boolean value of BrailleHandler._detector and that value was checked anyway. Note that that's supposed to be private API
When configuration was set to auto detect, BrailleHandler.handleDisplayUnavailable relied on behavior in setDisplayByName to re-enable the detector when falling back to no braille. This logic is now simplified.
Fixes #13778
Supersedes #13777

Summary of the issue:
If Unicode braille occurs within text — for instance, ⠐⠣⠃⠗⠇⠐⠜ says "(braille)" in UEB — NVDA currently just skips over the braille entirely. This is because it is not included in symbols.dic

Description of user facing changes
Unicode braille symbols are now announced.
Fixes #14632

Summary of the issue:
The link to the NVDA Helper README in the Development Guide did not work.

Description of user facing changes
Fixed that link per suggested alternative given by @michaelDCurran in #14632 (comment).

While doing that, I noticed and fixed:

A couple links to the Translating NVDA wiki page, which had no link markup at all.
One case of a link which was written in markdown style instead of T2T style.

Description of development approach
Searched file for the helper readme reference, and replaced the broken file reference with the link given by @michaelDCurran .
Searched for other occurrences of "http", and verified that they were all in validly formatted link markup, and fixed them where found not to be.
Closes #13830

Summary of the issue:
In #13830, changing the "send to synthesizer" to "always" is suggested for dashes.
Dash and em-dash are proposed here.

Description of user facing changes
Changes defaults for synthesizer pronunciation

Description of development approach
Update symbols.dic

Co-authored-by: Cyrille Bougot <cyrille.bougot2@laposte.net>
…14531)

Related to #3564, #2315

Summary of the issue:
Currently, USB and Bluetooth devices are supported for braille display detection. Other devices using other protocols or software devices aren't supported. This pr intends to add support for this.

Description of user facing changes
None. User shouldn't experience anything different for now.

Description of development approach
Added Chain, a new extension point type that allows to register handlers that return iterables (mainly generators). Calling iter on the Chain returns a generator that iterates over all the handlers.
The braille display detector now relies on a new Chain. By default, functions are registered to the chain that yield usb and bluetooth devices. A custom provider can yield own driver names and device matches that are supported by that particular driver. A potential use case would be implementing automatic detection for displays using BRLTTY, for example. It will also be used to fix Braille does not work on secure Windows screens while normal copy of NVDA is running #2315 (see below)
Added a moveToEnd method on HandlerRegistrar, which allows changing the order of registered handlers. This allows add-ons to give priority to their handlers, which is especially helpful for both Chain and Filter. NVDA Remote should come for the braille viewer, otherwise controlling a system with braille viewer on with a 80 cell display connected to the controller would lower the display size to 40 unnecessarily. This will also be used to register a custom handler to bdDetect.scanForDevices to support auto detection of the user display on the secure screen instance of NVDA, which should come before USB and Bluetooth.
As a bonus, added type hints to extension points. For Filters and Chains, you could provide the value type and then a type checker can check validity.
As another bonus, all features are covered by new tests. So there are tests for the Chain extension point and for the specific use case in bdDetect
Testing strategy:
As this touches braille display auto detection quite a lot, probably merge this early in the 2023.2 cycle.

Known issues with pull request:
bdDetect.Detector does no longer take constructor parameters, rather queueBgScan should be called explicitly. This is because if we queue a scan in the constructor of Detector, the detector could switch to a display and disable detection before the _detector was set on the braille handler. Ideally we should use a lock as well, but that might be something as a follow up for both this pr and #14524. Note that though we're changing the constructor of a public class in bdDetect, the doc string of the class explicitly states that the Detector class should be used by the braille module only. That should be enough warning for users not to use this class and therefore I don't consider this API breaking.
Fixes #14556

Summary of the issue:
Dictionaries do not allow to use backslash character normally in the replacement field when regexp is not selected as entry type. When such a character is used, a message box complaining of a regexp error appears.

Description of user facing changes
The user can use backslash in replacement field normally when entry type is not regexp
Error messages are more precise and more specific when entering erroneous values in the fields for a regexp entry
Description of development approach
When the entry type is not regexp, escape the replacement string
When entries are created:
filter exception on re.error instead of the too global Exception to catch only exceptions related to regexps
separate the try/except statement in two in order to indicate in which field the regexp error lies
In case of a regexp error, after validating "OK" in the message box, the field where the error lies is re-focused
Reports the regexp error only in case of entry type = regexp; in the other cases,re-raise the exception, in order not to catch unrelated exceptions, e.g. code bug.
… rather than trying to work out if the caret is still within the last focus. (#14611)

NVDA sometimes fails to report focus in browseMode documents, as it is trying to filter out redundant focus events caused by moving the caret.
Particular cases:
• Focus moves from a control inside a gridcell or interactive list item, back to the ancestor gridcell or interactive list item.
• Focus moves from a gridcell or interactive list item, to the first control inside the gridcell or interactive list item.
Currently, NVDA chooses to ignore any focus in browseMode that overlaps with the browseMode caret. This is so that any focus event that results from moving the caret is not reported as this would be redundant. However, this rule is clearly too limiting as it stops the above examples from working.

Description of user facing changes
In Browse mode, NVDA will no longer incorrectly ignore focus moving to a parent or child control e.g. moving from a control to its parent lit item or gridcell.
Note however that this fix only applies when the Automatically set focus to focusable elements option in Browse Mode settings is turned off (which is the default).

Description of development approach
Rather than ignoring focus changes in browse mode if the new focus's range overlaps the existing caret position, focus is only ignored if it is the same object that NvDA has specifically requested setting focus to, such as when pressing the applications key or activating a control.
When pressing NVDA+F, for Chinese people, paragraph indent is reported in number of characters by default when NVDA is using Word object model to access Word documents. But it is reported in centimeter when NVDA is using UIA to access Word documents.
When using object model, the way NVDA reports indent in Word honours the two following advanced options of Word:
• "Show measurements in" (centimeters, inches, etc.)
• "Show measurements in character width" (Note: for this option to be available, you need to have an East-Asian language installed in Word's languages)
These options should be also honoured when using UIA for Word documents. Especially, Chinese people are used to express measurements in characters, what NVDA does not when using UIA for Word documents.

Description of user facing changes
Word's advanced options are now used instead of system options also when using UIA to access Word documents. Thus, the option "Show measurements in character width" in Word advanced options is now honoured also when using UIA for Word documents.

Description of development approach
The only way I've found to know how distances are reported in Word (according to this option) is to use Word object model. Thus, if possible, we use Word object model to access Word's options, even if NVDA uses UIA to access Word document.
When object model is not available however, Windows regional setting is used as a fallback as it was before this PR.
Fixup of #13857

Summary of the issue:
#13857 was merged assuming the system test failures were random false positives.
#13857 changed symbol pronunciation of the dash symbol, and as such, relevant system tests had to be updated.
Part of #14520

Description of development approach
added synthDriverHandler.synthChanged extension point, which behaves similar to braille.displayChanged. It includes an extension point.

Testing strategy:
Unit tests and manual testing using the python console.
Fix for #14531

Summary of the issue:
Error 'property' object is not iterable when enabling autodetect for the first time with Bluetooth on.

Description of user facing changes
None

Description of development approach
The detector was trying to save the bdDefsCache on the _DeviceInfoFfetcher class (not the instance).
…t expression of dictionary (#14664)

Fixes #14663
Fix-up of #14557

Summary of the issue:
When reading text containing a non-regexp dictionary entry, if the replacement field contains some special characters (such as space, +, etc.), these characters are escaped with a backslash. Thus this backslash is heard in the text spoken by NVDA.

Description of user facing changes
No unappropriated backslash will be spoken by NVDA when the replacement field of a dictionary entry contains space or other special character.

Description of development approach
Use theString.replace('\\', '\\\\') instead of re.escape(theString).

Indeed, it was well documented in the doc of re.escape:

This function must not be used for the replacement string in sub() and subn(), only backslashes should be escaped.
This is intended to deal with the NVDA buffer infinite loop issue tracked in Mozilla bug 1786676, but it may also address NVDA vbuf crashes tracked in Mozilla bug 1691928 and Mozilla bug 1737688 (also tracked here as Issue #13540).

Summary of the issue:
NVDA kills buffers for dead documents when a focus event is received. However, sometimes, when the user closes a tab, the closed document might die after the focus event for the newly active tab. Also, the focus event can be delayed sometimes; e.g. if loading a new document takes a while. When this happens, the buffer is still alive and listening for events, but the ids of nodes in that buffer might be reused by other documents! Trying to render those (completely arbitrary) nodes could cause a broken buffer tree (e.g. with loops), leading to instability later.

Description of user facing changes
Hopefully fixes occasional crashes and complete hangs in Firefox.

Description of development approach
Hold a COM reference to the document. When an event is received which ostensibly matches a node in the buffer, check if the document is alive. If it isn't, skip the node and clear the buffer.
To avoid excessive COM calls, only check this once per buffer update tick.
Another fix could be to have Firefox fire EVENT_OBJECT_DESTROY when a document dies. NVDA's vbuf could then catch that and clear the buffer. While I'm happy to look at implementing this in both Firefox and NVDA in future, this is currently rather tricky to do in Firefox because some of the information we need to get the HWND for the event is already gone by the time we destroy the document. I can probably cache this somehow, but there are obscure edge cases, made more complicated by supporting both the old and new accessibility engine architectures at the moment. I think this approach is going to be more reliable in the short term, plus it will work with existing versions of Firefox.
As part of Pull request #14531, I ordered display order in bdDetect alphabetically. However, it seems that querying Albatross first has a major negative impact on detecting other displays using the same Serial to USB converter (see Pull request #13045)

Description of user facing changes
Handy Tech displays such as the Modular Evolution instantly auto detect again.

Description of development approach
Restored the order, Albatross is last in the dictionary again. I'm pretty unhappy with how these displays work, but it looks like it's a design thing in the displays itself.
Fixes Issue #8442.

Summary of the issue:
Authors sometimes misguidedly mark editable text as a live region. This results in typed characters being echoed even if the user has speak typed characters turned off.

Description of user facing changes
In Firefox and Chrome (and derivatives thereof), Characters will no longer be echoed while typing in an editable text that is incorrectly marked as a live region.

Description of development approach
1. Use COM smart pointers in winEventProcHook to improve readability and maintainability. It's probably worth merging this as a rebase or full merge so this is separated from the second change.
2. If an object has IA2_STATE_EDITABLE, ignore live region updates.
…ead (#13542)

Fixes #8553

Summary of the issue:
When an app offers IAccessible2 as its accessibility interface, NVDA needs to install a COM proxy in the UI thread to utilize IA2. However, some apps, particular those that embed Chromium Embedded Controls, have a separate UI thread for the browser control. IAccessible2 and therefore browse mode doesn't work in these controls.

Description of how this pull request fixes the issue:
Register IA COM Proxy in all threads that ever send focus or foreground win events

Testing strategy:
Tested with the Chromium Embedded Framework test case from #13493 (comment)
#14677)

Related to #14660

Summary of the issue:
When starting NVDA installs a 'fake' gettext and pgettext functions which translates to the language set as the current Windows locale. Later in the startup process languageHandler overwrites these installed translation functions with a new one which translate strings to the language chosen by the user (either in the configuration or from the CLI). Unfortunately if there is a module with translatable strings at its top level and it is imported before languageHandler is initialized these strings are either translated to the default system language, or for locales for which Python's locale.getdefaultlocale fails they remain in English. Similar problems were reported in #7770 and in #14657. Both of these are fixed, but the main problem is that bugs like this are difficult to identify before the release, since most contributors either use both NVDA and Windows in English, or at least their NVDA is in the same language as their operating system.

Description of user facing changes
This should not have any user visible impact.

Description of development approach
When starting NVDA or nvda_slave gettext and pgettext are no longer installed before initializing languageHandler.
Merge translations from beta to master
Summary of the issue:
The string "has %s" is not translatable whereas it should.

This is due to the fact that the formatting has been included in the gettext (underscore function)'s argument.

Description of user facing changes
For translators: the translation of the string "has %s" should now be working.

Description of development approach
First call gettext _ (underscore) function, and then format the result.
Follow-up of #13045

Summary of the issue:
Driver sent to Albatross display byte string b"\xfe\xfd\xfe\xfd" to tell device that there is active connection and it should not send init packets anymore. Byte string contained two establishment packets, and one should be enough. It should not cause harm to send two packets because display ignores latter one but it is redundant anyway.

In stead of b"\xfe\xfd\xfe\xfd" driver sends now b"\xfe\xfd" to display.
…4709)

NVDA reports "sub menu" for all values of aria-haspopup, which is misleading at best.

Description of user facing changes
In Mozilla Firefox and Google Chrome, NVDA now reports when a control opens a dialog, grid, list or tree if the author has specified this using aria-haspopup.

Description of development approach
1. Created new states for HASPOPUP_DIALOG, GRID, LIST and TREE. The general HASPOPUP state is still used for menus.
2. Mapped the ARIA string values to states.
3. Modified both the IA2Web NVDAObject and the Gecko_ia2 vbuf to expose these new states based on the haspopup object attribute.
…ializing languageHandler (#14722)

When executing unit tests we're installing fake gettext and pgettext functions. In normal usage this is not happening (languageHandler is responsible for setting localization support).

Description of development approach
_ and pgettext are no longer installed in unit tests. It was also necessary to modify unit tests which verifies announcements of capital letters, in which we are using a fake translation. It was changed so that the translation restored after tests is the one created by languageHandler not the fake one as it was done previously.
…ey're needed (#14704)

A settings ring entry for a String setting caches its possible values when creating the StringSynthSetting object. This can be costly if it takes some time for the possible values to return, for example when they're coming from a remote system in my remote desktop add-on.

Description of development approach
Load and cache the available settings values the first time they're fetched. This shouldn't have any noticeable impact for most synths.that
When reporting the review cursor location in LibreOffice Writer, the announced position was not particularly useful to determine where in the document/page the cursor is currently located.

Description of user facing changes
Similar to how it is done for Microsoft Word, report the current cursor/caret location relative to the current page when that information is available for LibreOffice Writer.

Description of development approach
To retrieve the page-relative cursor/caret location, this introduces and makes use of a new SymphonyDocumentTextInfo class that retrieves the page-relative cursor position via accessible attributes from the document object.
These attributes are added to LibreOffice in this corresponding LibreOffice change:
https://gerrit.libreoffice.org/c/core/+/149051
The values returned by LibreOffice Writer are in twips, so convert that to inches or centimetres, depending on whether or not imperial measurement units are expected.
If the attributes are not available, fall back to the handling that was already used so far.
seanbudd and others added 19 commits March 23, 2023 09:56
Summary of the issue:
New version of liblouis.

Description of pull request
See release notes

Testing strategy:
Building and running from source.
NVDA doesn't announce the symbol that macs use to represent the mac "Option" key ("⌥") (see Mac keyboard shortcuts documentation).

Description of user facing changes
Adds a symbol description for this symbol ("mac Option key" announced at "none" level and up, similar to the existing entry for "mac Command key" at the "none" level for symbol "⌘").

Description of development approach
Followed the "Defining Symbol Information" developer documentation, using the existing "mac Command key" entry and similar recent PR #14548 as examples

Testing strategy:
Didn't attempt to adjust any automated tests (assumed they were already present generally for symbol pronunciation). Manually verified reading by:

runnvda.bat from this branch
Browse to Mac keyboard shortcuts docs
Read through the content under the "Mac keyboard shortcuts" H1, particularly the list item with content "Option (or Alt) ⌥"
Verify that the symbol is read out as "mac Option key" as expected
Change NVDA's "Settings > Speech > Punctuation/symbol level" to "none" and repeat above steps
…ead of after a delay. (#14701)

Currently, everything in NVDA, including responding to keyboard input and focus changes, goes through the core pump. The core pump is always run with a slight delay. Assuming nothing else is already queued, any input or focus change will not be processed for a minimum of 10 ms. In reality, it's potentially longer due to the system timer resolution and the fact that timers are low priority messages. We should be aiming for the fastest possible response to user input and focus changes.

Description of user facing changes
NVDA will respond slightly faster to commands and focus changes.

Description of development approach
The core pump has been refactored. Rather than using NonReEntrantTimer, it now uses wx.Timer directly and guards re-entry itself for better control. There is a main thread method (request) which manages scheduling/executing the pump to make state management easier.
requestPump has a new immediate argument which specifies whether the pump should happen as soon as possible or after the delay. Delayed pumps are still useful in most cases for rate limiting and filtering, so this defaults to False.
queueHandler.queueFunction has an _immediate argument which is passed to requestPump. It is _ prefixed to mitigate conflicts with keyword arguments intended for queued functions.
inputCore, scriptHandler, focus changes and live text output all request an immediate core pump.
…ds (#14714)

The Baum braille driver does not provide mappings for several common keyboard commands like other Braille drivers do. Examples being windows+d, tab, shift+tab etc.

Description of changes
As requested by Orbit for the Baum braille driver, Add several Braille gestures mapped to common keyboard commands
• shift+tab key | space+dot1+dot3 |
• tab key | space+dot4+dot6 |
• alt key | space+dot1+dot3+dot4 (space+m) |
• escape key | space+dot1+dot5 (space+e) |
• windows key | space+dot3+dot4 |
• alt+tab key | space+dot2+dot3+dot4+dot5 (space+t) |
• NVDA Menu | space+dot1+dot3+dot4+dot5 (space+n) |
• windows+d key (minimize all applications) | space+dot1+dot4+dot5 (space+d) |
• Say all | space+dot1+dot2+dot3+dot4+dot5+dot6 |
… punctuation level (2nd attempt) (#14558)

A first PR (#14459) had been merged to fix #14417. Unfortunately an issue was found (see #14473) so it has been reverted in #14477.

This PR is a second attempt to fix #14417 without causing #14473. It will remain a draft until I can have more information on #14473 from @OzancanKaratas, as requested in #14473 (comment), or from anyone else able to reproduce.

Link to issue number:
Fixes #14417

Summary of the issue:
Preliminary note for review
Keep in mind the following: in NVDA with CLDR enabled and with no custom user symbol defined, symbol level for symbol X is defined as follows:

look at locale symbol file:
If X is defined in this file and a symbol level is defined for X, then this level applies for X. Else, look at next file.
look at locale CLDR file:
If X is defined in this file and a symbol level is defined for X, then this level applies for X. Else, look at next file.
look at English symbol file:
If X is defined in this file and a symbol level is defined for X, then this level applies for X. Else, look at next file.
look at English CLDR file:
If X is defined in this file and a symbol level is defined for X, then this level applies for X. Else, use default symbol level (don't remember if it is None or All).
Description of the issue
Hindi has no symbol defined in its symbol file, only copyright header; seems that the file was prepared for translation but no actual symbol translation took place. But there is a Hindi CLDR file.

Currently, CLDR files are generated with level "None" for all symbols.

Usually, in locales with a CLDR file and a normal symbol files, less common characters that are only in CLDR are reported at level None, i.e. whatever the punctuation level setting of the user. But common punctuation symbols (dot, question marke, etc.) are added by translators in the locale symbol file what allows to have these symbols reported at a higher punctuation level.

For Hindi (or any language with no current symbol translated), all the characters present in CLDR file are reported at "None" level and above (i.e. at any level), because the level is not redefined in the locale (Hindi) symbol file.

In such situation, using the level of the locale CLDR (None) is not a good strategy. It would be better to take advantage of the levels defined for the symbols in the English symbol file.

Description of user facing changes
CLDR data will be available for languages which had no symbol file (am, et, kk, ne, th, ur) or empty symbol file (hi). For these languages, since there are no locale symbol file definition, the level defined in the English symbol file will be honoured.

Description of development approach
Update nvda-cldr repository to get the changes implemented in nvaccess/nvda-cldr#4.
The Standard HID Braille driver does not provide mappings to the arrow keys as expected.
Currently the joystick can be used for arrow keys and enter, but not the dpad. Some Braille devices, such as the Orbit Reader, only have a dpad and no joystick.
Also, currently space+dot1 and space+dot4 are mapped to nextLine and previousLine braille commands. Manufacturers would prefer that these gestures map to up and down arrow, so that they also work in lists and on the Desktop etc.
Description of changes
When using a Braille Display via the Standard HID braille driver, the dpad can be used to emulate the arrow keys and enter. Also space+dot1 and space+dot4 now map to up and down arrow respectively.
…nsiveness. (#14708)

NVDA frequently takes 30 to 45 ms to respond to cursor movement (arrow keys, etc.) in a text box. This doesn't seem like much, but anything we can do to improve responsiveness here makes for a better experience for the user.

Description of user facing changes
NVDA responds faster when moving the cursor in edit controls.

Description of development approach
1. Don't sleep or yield in KeyboardInputGesture.send. We sleep for 10 ms, which is at the upper end of acceptable audio latency for "instantaneous". Furthermore, the Windows timer resolution is only accurate to about 15.6 ms most of the time.
This sleep was apparently added to ensure NVDA's keyboard hook ignored the injected keys. In my testing, removing this didn't seem to have any negative impact. If this does turn out to be a problem, we could watch for the last injected key in the keyboard event hook and fire a Windows event when it arrives. This will be faster to wake than a 10-16 ms sleep.
2. When waiting for caret movement, spin the first few tries rather than sleeping. Again, we might sleep longer than we need to and sometimes apps respond much faster than we previously allowed for. Spinning for a very short while improves responsiveness without excessive resource usage.
3. The caret movement waiting code was also refactored a bit to better calculate the elapsed time. We were previously relying on multiplying the sleep amount, which was inaccurate because sleep is inaccurate. For example, if we retried 3 times with a 10 ms retry interval, we would report 30 ms elapsed. However, each 10 ms could have been up to 16 ms in reality, resulting an actual elapsed time of 48 ms. It also didn't account for the time it took to query the control. Now we use the system clock to measure the elapsed time.
4. Increase the use events timeout from 10 ms to 60 ms. As noted in 3), we were previously multiplying the sleep amount, which meant our supposed elapsed time was actually less than what had truly elapsed. This just updates the timeout to reflect reality. Without this, backspacing occasionally failed in UIA Notepad and the search box in File Explorer.
Note that this does alter some class variables in EditableText. However, these were private (underscore prefixed), so I don't think this should be considered API breaking.
If the updateCheckState pickle is set to "None", the state fails to load correctly.
This can cause a crash.
It is uncertain as to the cause of the pickle being set to None, but it is assumed to do with exiting NVDA during initialization.

Description of user facing changes
Should fix rare crash where updateCheck.pickle is written to with invalid state information (unknown cause).

Description of development approach
Add typing, handle the case where pickle.load loads None for the state.

Testing strategy:
Set %appdata%/nvda/updateCheckState.pickle to "N." which loads as "None"
Test if NVDA crashes on start up
In #14704, we introduced lazy loading of some settings ring settings. However, this resulted in error sounds being played when moving in the list of OneCore voices.

Description of user facing changes
Fix of the regression.

Description of development approach
The max value of a synth setting is based on the number of available settings. This is now dynamically fetched.
Supersedes #13133
Closes #8856 with nvaccess/mrconfig#83

Summary of the issue:
The generated HTML from t2t (changes, quick reference, user guide) has no lang attribute set.
So, it will not read in the correct TTS language.
Right to left languages also do not render correctly without an dir="rtl" attribute.

Description of user facing changes
When translators add values to the attributes, the correct TTS language will be used when reading NVDA documentation and the layout direction of text will be appropriate.

Description of development approach
 PR to mrconfig to support locale.t2tconf: add locale.t2tconf as a translatable file in nvaccess/mrconfig#83
 Create a base template for translators to add their own lang and dir attribute values.
Summary of the issue:
You can currently load a gesture map from a file or a dictionary, but you can only save it as a file, i.e. you can't go from gesture map to the flattened dictionary format.

Description of user facing changes
None

Description of development approach
Split out the save function into another function called export. The save function uses the export function internally. This can also be used for unit testing the code as demonstrated. Furthermore, it is useful for braille display driver authors to develop a gesture map in the user gesture map, then export it from the python console to include it in their driver in the proper format.
…ymbol pronunciation dialog (#14737)

Summary of the issue:
People are
In Punctuation/symbol pronunciation dialogue, in the level field, there is an options named "character". People are wondering what this option does since it is not documented in the user guide.

Description of user facing changes
Added a sentence in the doc to describe it.
Summary of the issue:
PR #13798 introduced paragraph navigation in documents. Unfortunately two message added by this PR are not translatable: "No next/previous paragraph" since the gettext (_) function call has been forgotten; the translators comments are already there though.

Description of user facing changes
The message will be translatable

Description of development approach
Just added the call to the gettext function (_).
… app releases via UIA decendants (#14622)

Closes #14573
Take 2 on #14573
Resolves a flaw discovered in #14574

Summary of the issue:
In #14574 and earlier, NVDA relied on child index when retrieving Windows 11 Notepad status bar contents. This is flawed: there are times when UI tree in Notepad can change if something opens and then closes. Specifically, when Notepad settings window (Alt+S) is opened and then closed, NVDA will announce something else when retrieving status bar contents.

Description of user facing changes
NVDA will announce status bar contents in newer Windows 11 Notepad releases (same as #14574).

Description of development approach
Use UIA's FindFirstBuildCache to retrieve status bar contents (Automation Id: ContentTextBlock). As long as the Automation Id stays the same, the descendants approach will work across Notepad 11 releases.

---
commits:

* appModules/notepad: use UIA descendants instead of child index when fetching status bar. Re #14573.

#14574 rework: Notepad 11.2301 introduces tabbed Notepad where multiple documents can be opened at once. This changes the Notepad UI tree so the old status bar chlid index no longer works. In the now reverted #14574 pull request, a different status bar index was used, but it had a critical flaw: when Notepad settings (Alt+S) opens and then closes, status bar command will say something, caused by UI tree changing once again. A more robust solution is using UIA descendants to look for a specific element, and provided that the Automation Id for the first status bar text stays the same (ContentTextBlock), the descendants approach will work. This is the same approach used in File Explorer app module to obtain status bar contents in File Explorer.

* appModules/notepad: restore copyright header and type hints. Re #14573

* appModules/notepad: uiItemWindow -> notepadWindow

* appModules/notepad: status bar/UIA descendatns now resembles File Explorer app module more closely. Re #14573.

Inspired by status bar getter in File Explorer app module: because Notepad foreground window is not a UIA element, tell UIA handler to obtain UIA element from foreground window handle. Apart from this and checking for AutomationId, Notepad status bar getter resembles File Explorer app module.

* appModules/notepad: catch value error if the status bar content UIA element is NULL.

UIA element for status bar contents wil be NULL (0x0) if status bar is not showing, therefore catch value error that can result from it.

* appModules/notepad: remove status bar location check.

Since status bar UIA element is not defined if invisible, there is no need to check its location.

* appModules/notepad: UIAHandler.handler.clientObject -> clientObject

* update changes

---------

Co-authored-by: Sean Budd <sean@nvaccess.org>
…lts while handling UIA notification event (#14745)

Closes #14679

Summary of the issue:
Portable NVDA does not announce results when Windows 10/11 Calculator is in compact overlay mode.

Description of user facing changes
Portable copy of NVDA will announce calculator expressions and results when Windows Calculator is in compact overlay mode (Alt+up arrow from standard calculator mode).

Description of development approach
Instead of using tree traversal, use UIA find descendants approach (employed in File Explorer) to obtain results element when Calculator is in normal and compact overlay mode. This also removes the need to check Calculator version as Windows 11 Calculator has made its way to Windows 10.

Commits:

* appModules/calculator: update copyright year. Re #14679

* Calculator/UIA notification: fetch results via UIA descendants. Re #14679.

If a portable copy of NVDA is running and compact overlay mode is active from Calculator, NVDA will not announce results as users type expressions, caused by index error stemming from tree traversal failure. As an alternative, use UIA descendants to locate results element, allowing portable NVDA to announce results when Calculator is in compact overlay mde. The find descendants code ultimately comes from the one employed in File Explorer when fetching status bar items.

* Calculator: remove app version variable as it is no longer used when fetching results element. Re #14679.

NVDA had to descend one more level when fetching results in Windows 11 Calculator. Now that the moer modern Calculator is available on Windows 10 along with use of UIA descendants to fetch results element, there is no need to check app version.

* update changes

---------

Co-authored-by: Sean Budd <sean@nvaccess.org>
…object (#14723)

Closes #14659

Summary of the issue:
In #14583 @XLTechie added a global commands which allows to report a URL for the link at the position of the navigator object. While this is a huge improvement compared to either having copy the URL to the clipboard or accessing the URL from the status bar from the web browser, the fact that these scripts report destination for the link at the navigator object rather than focus / caret position makes their usage impractical for people who prefer to work with review cursor / navigator object not following focus / caret.

Description of user facing changes
When user requests URL of a link NVDA reports URL of a link at the position of the caret / focus.

Description of development approach
Script for reporting URL was modified so that it first tries to get an object at the current caret position, and if that fails from the focused object. User guide and documentation for global commands were updated accordingly.
After @XLTechie's review it was noticed that the script fails to work for links without href attribute, as part of this PR I've added handling for such links.
…ouse chunk. (#14755)

Fixes #9235.

Summary of the issue:
In Firefox, when there is text before and after a link, mousing over the text after the link often doesn't read the text. This applies to other types of inline elements as well; e.g. buttons.

Description of user facing changes
In Mozilla Firefox, moving the mouse over text after a link, etc. now reliably reports the text.

Description of development approach
When handling unit_mouseChunk, the code in IA2TextTextInfo.expand first expands to the user configured resolution (line, paragraph, etc.). It then attempts to shrink the range so that it only covers the text between embedded objects before and after the origin, if any.

The code previously calculated the final end offset incorrectly. It used oldEnd - self._startOffset as the offset from which to search for an embedded object after the origin. However, self._startOffset had already been moved to the embedded object before the origin, so it was no longer related to the text string. This meant that the search offset was completely bogus and could even result in _endOffset being smaller than _startOffset.

Now, we use the same offset for both embedded object searches: our origin relative to the start of the expanded range of text. I've also added comments.
See #14610 (comment),

Summary of the issue:
Sometimes, people open PRs as a draft as required but do not seem to know that they need to transition it to "Ready for review" so that someone at NVAccess look at it.

In the PR template we can read:

Please initially open PRs as a draft. See https://github.com/nvaccess/nvda/wiki/Contributing

But nothing on when it should be set "Ready for review".
@seanbudd seanbudd requested review from a team as code owners March 30, 2023 02:00
@seanbudd seanbudd requested review from Qchristensen and michaelDCurran and removed request for a team March 30, 2023 02:00
@seanbudd seanbudd merged commit cbc1954 into beta Mar 30, 2023
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.