Make the length limit for speaking selected text configurable (#21066)
Closes #20954
Summary of the issue:
NVDA speaks selected text only if it has fewer than 512 characters. Longer selections are reported as a character count. The limit is hard-coded and not able to be changed by the end user.
Description of user facing changes:
There is a new spin control setting in Voice settings, "Speak selected text if it has fewer characters than", that adjusts the limit. The default is 512. The range is 1 to 10000.
This same limit applies when the read selection command (NVDA+shift+upArrow) is pressed twice or three times to spell the selection.
Description of developer facing changes:
This change deprecates the speech.speech.MAX_LENGTH_FOR_SELECTION_REPORTING constant. Until it is removed (possibly in NVDA 2028.1), it returns the value of config.conf["speech"]["maxSelectionReportingLength"]. Add-ons that read this constant keep working, but a deprecation warning is logged.
Description of development approach:
Added maxSelectionReportingLength to the [speech] section of the config spec.
Added speech.speech._isSelectionShortEnoughToSpeak, which both callers now use.
Added a spin control with context sensitive help to the Voice settings panel.
Replaced the constant with a RemovedSymbol deprecation through utils._deprecate.handleDeprecations.
Documented the setting in the User Guide.
No changelog entry has been added due to the feature freeze.
I expect this PR to stay open until planning begins for the next release, or until the feature is ready.