On-demand speech mode - Do not speak anymore during sayAll when SayAll is not launched by a SayAll script#16826
Conversation
…l is not launched by a SayAll script
See test results for failed build of commit e9f5118b35 |
WalkthroughThe updates incorporate the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
| _isScriptRunning = False | ||
| if resumeSayAllMode is not None: | ||
| sayAll.SayAllHandler.readText(resumeSayAllMode) | ||
| sayAll.SayAllHandler.readText(resumeSayAllMode, startedFromScript=None) |
There was a problem hiding this comment.
Shouldn't this be
| sayAll.SayAllHandler.readText(resumeSayAllMode, startedFromScript=None) | |
| sayAll.SayAllHandler.readText(resumeSayAllMode, startedFromScript=False) |
There was a problem hiding this comment.
It's None meaning that sayAll.SayAllHandler.startedFromScript should not be modified with this action. It should not be modified because this call is to resume an existing say all action, not to start it.
Should I make it somewhat more explicit? With a comment or otherwise?
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
| shouldUpdateCaret: bool = True, | ||
| startedFromScript: bool | None = False, | ||
| ) -> None: | ||
| """Start or restarts the reader |
There was a problem hiding this comment.
@seanbudd, @LeonarddeR, not sure that my Sphinx formatting of docstring is OK. As requested in the past, an example directly in NVDA's codingStandards.md file would be appreciated; the Sphinx tutorial that is linked instead does not match exactly our recommendations since the examples are with types.
| """Start or restarts the reader | ||
| :cursor: the type of cursor used for say all | ||
| :startPos: start position (only used for table say all) | ||
| :nextLineFunc: function called to read the next line (only used for table say all) |
There was a problem hiding this comment.
@mltony some of the parameters of this functions have been introduced with table say all. Does the description seems OK to you or would you suggest something different or more precise? Thanks.
Link to issue number:
Fixes #16825
Summary of the issue:
While in on-demand speech mode, NVDA speaks during Say All. This is OK when Say All is launched by a specific Say All script, e.g.
NVDA+downArrow. But this should not happen when Say All occurs in other situations, i.e. when a new page is loaded in a browser, when an e-mail is opened or when we go forward in a PowerPoint slideshow.Description of user facing changes
In on-demand mode, NVDA will not talk anymore during Say All if Say All was not launched by an explicit Say All script.
Description of development approach
In
speech/sayAll.py, add a new parameter toSayAllHandler.readObjectsand toSayAllHandler.readTextto determine if the Say All was started from an explicit Say All script or not. This parameter can beNoneif SayAll is resumed after a script's execution (skim reading case); in this case the previous value ofstartedFromScriptis kept. This value is then used to know if the speech should be output or not.While at it, I have added to on-demand scripts an Eclipse script to read the documentation; this script seems to have been forgotten during on-demand development.
Testing strategy:
Manual tests in on-demand speech mode and in normal speech mode:
NVDA+t, `NVDA+numpad5NVDA+downArrow,numpad+,NVDA+B,NVDA+control+alt+downArrowNVDA+numpad4/6,NVDA+2Known issues with pull request:
None
Code Review Checklist:
Summary by CodeRabbit
Bug Fixes
New Features