Skip to content

sayAll skim reading no longer keeps announcing exiting initial control fields#10878

Merged
michaelDCurran merged 3 commits into
masterfrom
i10706
Mar 17, 2020
Merged

sayAll skim reading no longer keeps announcing exiting initial control fields#10878
michaelDCurran merged 3 commits into
masterfrom
i10706

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #10706

Summary of the issue:

When skim reading in sayAll starting from inside a list or other container, NVDA may keep announcing exiting the list when rapidly arrowing out and away from the container.
This is due to two reasons:

  • in sayAllhandler's _nextLine method, the textInfo state was always a line behind when the _lineReached callback was executed, as the state was copied before the textInfo speech was actually generated and therefore the state was not updated for the new line.
  • sayAllhandler's _nextLine method was placing the _lineReached callback after any initial control fields had been spoken, rather than right at the very beginning of the speech sequence, as it was using speakTextInfo's _linePrefix argument, which is not quite correct.

Description of how this pull request fixes the issue:

  • sayAllHandler's _nextLine method: ensure that the TextInfoState reflects the state of the correct line when the _lineReached callback is executed, by copying the state before that function is defined, and ensuring that the new copy of the state is passed to the speech function that generates the speech.
  • speech.getTextInfoSpeech no longer handles speakWithoutPauses for sayAll itself. This was confusing as getTextInfoSpeech was not predictable and did not always return the exact speech sequence for the given input. Now speakWithoutPauses is only handled in speakTextInfo. This then means that the sequence from getTextInfoSpeech can be safely mutated or appended/prepended to as needed. (such as adding a callback to the beginning for example).
  • sayAllhandler's _nextLine method: use getTextInfoSpeech and speakWithoutPauses directly rather than speakTextInfo, inserting the _lineReached callback at the very start of the speech sequence output by getTextInfoSpeech.

Testing performed:

Ran through the steps in #10706. Ensured that the initial control fields were only announced the first time and did not continue to be repeated.

Known issues with pull request:

None.

Change log entry:

Bug fixes:

…ol fields when arrowing out and away from them.

* no longer have speech.getTextInfoSpeech handle speakWithoutPauses for sayAll, rather this is done in speakTextInfo. This means that gettextInfoSpeech is now more predictable in its output.
* sayAllHandler's nextLine method  ensures the _lineReached callback can see the TextInfoState after state for the line being spoken has been applied. Previously it was one line behind.
* sayAllHandler's nextLine method manually inserts the _reached callback at the very beginning of the speech sequence, as previously using _prefix on speakTextInfo would place it after initial controlFields were spoken.
Comment thread source/speech/__init__.py
@michaelDCurran michaelDCurran added the deprecated/2021.1 Label used to track deprecations due for removal in the 2021.1 release label Mar 17, 2020
@michaelDCurran michaelDCurran merged commit c8baa82 into master Mar 17, 2020
@michaelDCurran michaelDCurran deleted the i10706 branch March 17, 2020 08:06
@nvaccessAuto nvaccessAuto added this to the 2020.1 milestone Mar 17, 2020
michaelDCurran added a commit that referenced this pull request Mar 17, 2020
feerrenrut added a commit that referenced this pull request Apr 20, 2020
PRs #10878 and #10879 addressed some issues with Speech.speak
 being passed a Generator.
Rather than create a list from it, ensure that the generator
 is not passed in the first place.
The typing of several functions is no much more clear,
 in particular _flattenNestedSequences now no longer
 implicitly converts generators to lists.
However, in all places it is used, generators are explicitly
 converted to lists.
Logging of generator types has been added in several places,
 enabled via the advanced settings panel 'speech' debug
 logging category.
feerrenrut added a commit that referenced this pull request Apr 20, 2020
PRs #10878 and #10879 addressed some issues with Speech.speak
 being passed a Generator.
Rather than create a list from it, ensure that the generator
 is not passed in the first place.
The typing of several functions is no much more clear,
 in particular _flattenNestedSequences now no longer
 implicitly converts generators to lists.
However, in all places it is used, generators are explicitly
 converted to lists.
Logging of generator types has been added in several places,
 enabled via the advanced settings panel 'speech' debug
 logging category.
feerrenrut added a commit that referenced this pull request Apr 21, 2020
PRs #10878 and #10879 addressed some issues with Speech.speak
 being passed a Generator.

Fixed a bug in speakTextInfo. speakWithoutPauses does not accept a 
 generator as it needs to be able to get the number of items in the
 sequence and slice it.

Rather than create a list from the generator inside Speech.speak,
ensure that the generator is not used as an argument in the first place.

The typing of several functions has now been clarified,
 in particular _flattenNestedSequences now no longer
 implicitly converts generators to lists.

However, now all usages of _flattenNestedSequences explicitly
 convert to lists.

Logging of generator types has been added in several places
 including speakWithoutPauses which needs to be able to get
 the length of a sequence and slice it. The logging can be enabled
 via the advanced settings panel 'speech' debug logging category.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecated/2021.1 Label used to track deprecations due for removal in the 2021.1 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA keeps announcing "list item" when using say all

3 participants