Skip to content

Adding commands to jump to first/last row/column in tables#13435

Merged
seanbudd merged 3 commits into
nvaccess:masterfrom
mltony:table_last
Apr 26, 2022
Merged

Adding commands to jump to first/last row/column in tables#13435
seanbudd merged 3 commits into
nvaccess:masterfrom
mltony:table_last

Conversation

@mltony

@mltony mltony commented Mar 6, 2022

Copy link
Copy Markdown
Contributor

Link to issue number:

fixes #957

Summary of the issue:

Introduce commands to jump to first/last row/column in current table.

Description of how this pull request fixes the issue:

Implements new commands in class DocumentWithTableNavigation.

Testing strategy:

Known issues with pull request:

Will cause merge conflicts with #13345 - will be happy to resolve them once it lands.

Change log entries:

New features

  • New table navigation commands: Control+Alt+Home/End to jump to first/last column; Control+Alt+PageUp/PageDown to jump to first/last row.
    Changes
    Bug fixes
    For Developers

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@mltony mltony requested a review from a team as a code owner March 6, 2022 17:53
@mltony mltony requested a review from seanbudd March 6, 2022 17:53
@mltony

mltony commented Mar 6, 2022

Copy link
Copy Markdown
Contributor Author

cc: @feerrenrut, @seanbudd

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 31d2e99ecf

@lukaszgo1 lukaszgo1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the newly introduced gestures to the user guide.

Comment thread source/documentBase.py Outdated
Comment thread source/documentBase.py Outdated
Comment thread source/documentBase.py Outdated
"""
result = origRow if axis == "row" else origCol
row, col = origRow, origCol
maxTableSize = 1000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment here explaining how you come with the 1000 as a right value would be nice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty much an arbitrary large number. I added a pretty obvious comment. There is no science behind it.

Comment thread source/documentBase.py

def script_firstRow(self, gesture):
self._tableMovementScriptHelper(axis="row", movement="first")
# Translators: the description for the first table row script on browseMode documents.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For new scripts script decorator should be used to set script's metadata. Obviously for documentBase this cannot be done at present as it would reintroduce #12399, but perhaps an issue should be created to at least avoid this problem being forgotten.

Comment thread source/virtualBuffers/gecko_ia2.py Outdated
Comment thread source/documentBase.py Outdated
def script_firstRow(self, gesture):
self._tableMovementScriptHelper(axis="row", movement="first")
# Translators: the description for the first table row script on browseMode documents.
script_firstRow.__doc__ = _("moves to the first table row")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the background on why this would be impossible, so I don't feel I can create a meaningful issue.

@mltony mltony requested a review from a team as a code owner March 6, 2022 21:53
@mltony mltony requested a review from Qchristensen March 6, 2022 21:53
@mltony

mltony commented Mar 6, 2022

Copy link
Copy Markdown
Contributor Author

@lukaszgo1, Addressed your comments.

@seanbudd

seanbudd commented Mar 7, 2022

Copy link
Copy Markdown
Member

The build is failing as linting needs to be fixed.

@seanbudd seanbudd marked this pull request as draft March 7, 2022 08:14
@Adriani90

Copy link
Copy Markdown
Collaborator

@mltony can the commands be reassigned by the user? Me personally for example I would prefer to use ctrl+alt+nvda+arrow keys to jump to last column or row. The thing is that my laptop keyboard does not have home, end, page up and page down keys, so I had to replace some f keys with sharp keys to acomplish this function. But is quite unconfortable to use them very often.

@CyrilleB79 CyrilleB79 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Tony

Really happy to see this PR arriving in core!

Some comments here:

  • You should test (and implement if needed) the same type of commands in list views where table navigation commands are also available.
    If this is not possible for any reason, you should document it and explain why in this PR's initial description.
    Note: IMO, if this is not possible for list views, it would already be a great improvement to merge this PR only for real tables.. But it must be clearly documented.
  • Testing: For Word, did you test with and without UIA enabled? Please update the test section in the initial description accordingly.

Thanks!

Comment thread user_docs/en/changes.t2t Outdated
- Added commands for toggling multiple modifiers simultaneously with a Braille display (#13152)
- The Speech Dictionary dialog now features a "Remove all" button to help clear a whole dictionary. (#11802)
- Added support for Windows 11 Calculator. (#13212)
- Added new commands to jump to first/last row/column in tables.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the change on this file. To avoid dealing with many merge conflicts on the change log, NVAccess prefers to update this file themselves. Once your PR is accepted, they will look at the change log section in the initial description of the PR and they will copy/paste its content to this file.

@Qchristensen Qchristensen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User Guide change is good, thanks - good work!

@seanbudd seanbudd requested a review from michaelDCurran March 9, 2022 05:04

@michaelDCurran michaelDCurran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible to write code to get the dimensions of the table without having to resort to hit testing to find the limits.
From any given textInfo position, you can expand to character, getTextWithFields, walk up the ancestor controlFields until reaching the inner most table controlField, and then fetch table-rowcount and table-columncount attributes.
Refer to _getTableCellCoords for a similar example of where attributes are fetched off a table controlField.

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit deaa2da59b

@mltony

mltony commented Mar 12, 2022

Copy link
Copy Markdown
Contributor Author

@seanbudd, fixed lint and build.
@Adriani90, no problem to reassign keystrokes.
@CyrilleB79, codepath is entirely different for list views (it is implemented in RowWithFakeNavigation class IIRC), so I'd rather separate that into another PR. Also, for word, I tried turning UIA on and off for word in NVDA settings, and it seems to be still using UIA even when turned off. But now with Michael's suggestion I feel this is irrelevant since we don't need to interact with low-level IA2/UIA API.
@michaelDCurran, thanks, changed code according to your suggestion. Also refactored a bit to avoid code reduplication.
The bot says system tests failed, but from what I can see, it appears that only 1 test is broken and it's probably transient and does not appear to be related:

[00:24:52] Starts from desktop shortcut :: Ensure that NVDA can start from de... | FAIL |
[00:24:52] Connection to remote server broken: [WinError 10061] No connection could be made because the target machine actively refused it

@mltony

mltony commented Mar 13, 2022

Copy link
Copy Markdown
Contributor Author

Also PR #13470 provides same keystrokes in list views and tree views.

@seanbudd seanbudd marked this pull request as ready for review March 15, 2022 00:39
@feerrenrut feerrenrut added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Mar 18, 2022
@seanbudd

Copy link
Copy Markdown
Member

@mltony - can you resolve the merge conflicts as you mentioned in the PR description. I've just merged #13345

@seanbudd seanbudd marked this pull request as draft March 25, 2022 02:37
@mltony

mltony commented Apr 9, 2022

Copy link
Copy Markdown
Contributor Author

@seanbudd, resolved conflicts!

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 7ef2fa439b

@mltony mltony marked this pull request as ready for review April 9, 2022 18:39

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some changes on documentation / types

Comment thread source/documentBase.py Outdated
Comment thread source/documentBase.py Outdated
@mltony

mltony commented Apr 23, 2022

Copy link
Copy Markdown
Contributor Author

@seanbudd, fixed and rebased.

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 1a80e13492

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @mltony.

please avoid rebases in future for minor changes if possible. After a rebase, GitHub no longer allows you to review pushed changes since your last review. This means the entire PR must be re-reviewed, instead of the changes.

@seanbudd seanbudd merged commit b5d2817 into nvaccess:master Apr 26, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.2 milestone Apr 26, 2022
seanbudd pushed a commit that referenced this pull request Jun 13, 2022
… fake table navigation in list views. (#13788)

Follow-up of #13435.

Summary of the issue:
In fake table navigation in list views, horizontal movements only move the navigator object, whereas vertical movements move the navigator object but also the focus. This was not reflected in input help for the newly introduced commands to jump to first/last row.

Description of how this pull request fixes the issue:
Updated the two scripts documentation.
While at it, I have also converted remaining fake table navigation scripts to syntax with decorator.
@CyrilleB79 CyrilleB79 mentioned this pull request Nov 20, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commands to facilitate navigation on the tables

10 participants