-
-
Notifications
You must be signed in to change notification settings - Fork 716
Improve Paragraph Navigation - add single and multi line break style #13798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…natively support this functionality
This comment was marked as resolved.
This comment was marked as resolved.
I tested this and it looks good, |
This comment was marked as resolved.
This comment was marked as resolved.
Both normal and block styles give up after searching 250 lines. Can you tell me which editor you were using which made NVDA hang?
|
@rob-aph Here is the book file used for testing(You need to unzip the file to get the epub file): |
* Fix functions wich speak paragraphs to give up after searching 250 lines * stop collapsing TextInfo objects where appears unnecessary to save time
Can you please try again with my latest commit? I optimized a bit, and stopped trying to read more than the first 250 lines of paragraphs. I believe the paragraphs I detected in your book were much larger than I expected, and this caused the problem.
|
Hi, @rob-aph I tested the latest commit and there is a noticeable improvement in NVDA hang time, but there is still a lag in "block navigation". Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Default for paragraphStyle is now "auto" Co-authored-by: Sean Budd <[email protected]>
* Move paragraphHelper.py to utils * Add various annotations * Change bool next to nextParagraph
Sean,
I have tested with Notepad, Wordpad, Visual Studio Code, Notepad++, and TextPad. It doesn’t work with TextPad, but NVDA doesn’t work so well with TextPad anyway. There is an issue with VSCode where if using normal paragraph style, VSCode will wrap around to the top of the file if you attempt to move twice from the second to the last paragraph in the file to the next paragraph. I suspect this has something to do with the TextInfo used by VSCode, but I plan to see if I can improve the situation.
As I recall, the issue with Word was a sluggishness issue – something would take too long, even in small files, and NVDA would eventually fail the call. Actually, it was more Outlook’s reading pane I was trying to get to work, but I believe Outlook and Word use the same TextInfo. There may be more I can do with Word when I become more knowledgeable on the peculiarities of it’s TextInfo – I haven’t entirely given up.
I also recall this PR working in Visual Studio 2019 in the past, but I see now it doesn’t. I believe the issue may be that I require State.MULTILINE, and this value is not set in the focus object for VS 2019. Basically, I’m trying to avoid these commands getting run in single line edit fields, etc.
I would be happy to advertise this PR and let users test it, but I have no idea how to get the URL for it’s AppVeyor build, or how long the build remains available. Can you point me in the right direction?
|
This comment was marked as resolved.
This comment was marked as resolved.
…rn True to prevent passing command on
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
* This is currently too slow, because it depends on moving by line, which appears to be the most undesirable way to manipulate a TextInfo for a Word document. * To test in Word, please switch to Browse mode, as Focus mode support has not yet been added. * Also works in Outlook message views.
@seanbudd I have tried harder to get this to work in Word / Outlook. You asked if anything was blocking this, and I can now respond yes. It appears very inefficient to move by line in the TextInfo used by Word / Outlook. In fact, it can sometimes hang for reasons I currently do not understand. I worked around one issue, the fact that attempting to move to the next line when there is not another line returns 1 indicating that movement occurred, when in fact, nothing changed -- it should return 0. I should add that I only have access to Windows 10, so I have no idea of the I have updated my branch to add a demo of Word / Outlook support. I find that even when it doesn't hang, navigating by block paragraphs is extremely slow, even in very short messages. If you wish to try this in Word, you will have to switch to Browse mode, as I have not hooked up scripts for Focus mode yet, as this is really a test / demo. It works right out of the box in read-only Outlook messages. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@rob-aph I think the situation you mentioned belongs to another issue, and the relationship with this PR is not strongly related. |
@seanbudd, I do not know on which point you were expecting an input from me. So I have had a look on last comments of this PR. I have found new point to discuss or clarifys, sorry... Here is my feedback: Replace
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rob-aph, please also consider the slight changes suggested in this review. Thanks.
…les, and add script category for said command
This is ready to merge now. Is the pull request description up to date? Can you add a new section "Description of changes for the user".
|
@seanbudd I think it's ready to go. |
Thanks @rob-aph for all your work on this PR! |
Hi, @rob-aph |
@cary-rowen how do you know it is this pull request? could you create an issue to track this problem? |
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 (_).
@rob-aph first of all thanks for this huge work, really appreciated that you help us in making the world more accessible through your contribution. I came accross an issue while using this great feature, the speech and UI messages seem not to be translatable: @seanbudd, @michaelDCurran, @nvdaes maybe this needs a broader documentation in the developer guide? |
Adriani90 commented
IMO, this is well documented in the contributing. |
It might make sense to integrate a gettext linter to make this process more secure. Pylint is already included in flake8 so it should be relatively easy to include this plugin as well. |
@Adriani90 |
Ah thanks, I missed that one.Then only the string in globalcommands.py still needs to be made translatable.Reg your request to me, I created a new issue.Von meinem iPhone gesendetAm 10.04.2023 um 11:44 schrieb Rowen ***@***.***>:
@Adriani90
Doesn't #14751 already solve the untranslatable string issue you mentioned?
If you want to suggest that NV Access improve the documentation, can you open a separate Issue?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Could you also open an issue for this, if it is still outstanding? |
@Adriani90 I cannot see any untranslatable string in last alpha. |
It seems now everything is translatable from here, not sure which commit made line 3980 in globalCommands translatable but it seems this is fixed now. |
Link to issue number:
Closes #13797
Summary of the issue:
Not all applications support navigating by paragraph (
control + up/down arrow
) natively.A specific example is web browsers.
Description of how this pull request fixes the issue:
Add "Document Navigation" settings panel allowing explicit choice of strategy for navigating by paragraph:
Fallback to "Handled by application" when single line break or double line break fails.
Testing strategy:
Tested with the following applications:
Known issues with pull request:
Microsoft Word and Outlook are only supported when using UIA. Only searches forward or backward a maximum of 250 lines to keep performance reasonable.
TextInfo
used with this app, and not with this feature.TextInfo
used in this app.Change log entries:
New features
Description of changes for the user:
Paragraph navigation is now supported in editors, such as Notepad and Notepad++, which do not support this feature natively. For editors which already support paragraph navigation, such as WordPad, block style paragraphs (those separated by one or more blank lines) may now be navigated in addition to single line break paragraphs.
When selecting the default option, Handled by application, paragraph navigation performs exactly as it did before this feature was added.
Code Review Checklist: