Skip to content
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

Feature request: add indentation navigation commands #16230

Closed
mltony opened this issue Feb 27, 2024 · 76 comments
Closed

Feature request: add indentation navigation commands #16230

mltony opened this issue Feb 27, 2024 · 76 comments
Assignees
Labels
blocked/needs-product-decision A product decision needs to be made. Decisions about NVDA UX or supported use-cases. close/duplicate needs-triage

Comments

@mltony
Copy link
Contributor

mltony commented Feb 27, 2024

Is your feature request related to a problem? Please describe.

Most modern programming languages make use of indentation, so that sighted people can easily grasp the structure of program or function visually. Currently NVDA announces indentation level but doesn't offer any more advanced ways to leverage indentation to ease navigation in source code. I propose to add indentation navigation commands to NVDA.

Describe the solution you'd like

  1. I propose to add the following indentation navigation commands to NVDA:
    • Jump to next/previous/first/last line with the same indentation level within current block. Current block refers here to a chunk of code limited by lower indentation lines, e.g. if we're searching for same indentation lines within a python function, then all of these commands would only search for lines within the same function and will not jump to same indentation lines in adjacent functions.
    • Jump to next/previous line with lesser/greater indentation level.
    • Jump to next/previous line with the same indentation level, but not necessarily bounded by the limits of current block.
    • Jump to next/previous line with the same indentation level, but ignoring clutter. Let's define clutter here to be the lines composed of characters like "(){}:" (we will make this configurable). The motivation for this command is following: in C++ codebase for example, we have code like this:
      void my_function(
          int arg1
      ) {
          printf("x = %d\n", arg1);
      }
      
      So on the lowest indentation level, we can say that the first line is important, but lines 3 and 5 are just clutter and often times it it is worth skipping them when exploring functions in the current file on a given indentation level.
    • If this is triaged, in later feature requests I will also propose other indentation related features, such as selection of indented blocks, indent-aware pasting from clipboard.
  2. For keyboard shortcuts, I would really like to use NumPad block because four arrow keys are not enough to capture the semantics of all these commands. We really need to have keys for diagonal commands, therefore I think making use of NumPad would be ideal. Therefore, here is what I propose:
    • There is this rarely used Windows feature: when pressing alt+numpad number it prints a character by its ASCII or Unicode code. I propose to reuse these keystrokes for indentation navigation with an ability to exit indentation navigation mode in case someone wants to use original Windows functionality.
    • Alt+numLock: toggle between indentation navigation and ASCII/Unicode character modes.
    • Alt+numPad2/NumPad8/NumPad4/NumPad6: Jump to next/previous/first/last line with the same indentation level within current block.
    • alt+numPad1/numPad3/numPad7/numPad9: Jump to next/previous line with lesser/greater indentation level.
    • control+alt+numPad4/numPad6: Jump to next/previous line with the same indentation level, but not necessarily bounded by the limits of current block.
    • control+alt+numpad2/numPad8: Jump to next/previous line with the same indentation level, but ignoring clutter.

Describe alternatives you've considered

N/A

Additional context

  1. Prototype is already available in my IndentNav add-on.
  2. From technical point of view, I would need to optimize TextInfo.move(UNIT_LINE) function as its current implementation is way too slow in many programs when need to move by 100..1000 lines.
@cary-rowen
Copy link
Contributor

As far as I know, for NVDA, every desktop command has a corresponding laptop equivalent.
Assuming this request goes through, have you thought about gesture mapping for laptop?

@Brian1Gaff
Copy link

Brian1Gaff commented Feb 27, 2024 via email

@mltony
Copy link
Contributor Author

mltony commented Feb 27, 2024

@cary-rowen,
I am not very familiar with laptop layout. In my understanding in laptop layout numpad gestures for review cursor are mapped to some alphabetic characters arranged in a similar shape - maybe we can reuse those.

@Adriani90
Copy link
Collaborator

@mltony thank you very much for this proposal, I think this would really change the way people navigate the screen in many use cases and I think if implemented properly it helps alot in working together with sighted people and also in understanding better visually aligned structures while using the screen reader.

some questions:

Alt+numPad2/NumPad8/NumPad4/NumPad6: Jump to next/previous/first/last line with the same indentation level within current block.
How do you define a block in this case?

◦ alt+numPad1/numPad3/numPad7/numPad9: Jump to next/previous line with lesser/greater indentation level.
Why do you need here 4 hotkeys? Is this still within the limits of the same block? If not, i would recommend to use i.e. alt+numPad1/numPad3 for limiting lesser / greater indent navigation within the current block and alt+numPad7/numPad9: limiting lesser / greater indent navigation within the current clutter.

control+alt+numPad4/numPad6: Jump to next/previous line with the same indentation level, but not necessarily bounded by the limits of current block.
control+alt+numpad2/numPad8: Jump to next/previous line with the same indentation level, but ignoring clutter.

Previous / next line with same indentation is already handled via numpad2/numpad8 in your proposal above within the limits of the block, which is kind of a vertical navigation. so why not using something like ctrl+alt+Numpad2/numpad8 also for navigating at the same indent level between blocks and ctrl+alt+numad3/numpad9 to navigate at the same indent level ignoring clutter?

@Adriani90
Copy link
Collaborator

Adriani90 commented Feb 27, 2024

Regarding laptop keyboard layout, I agree it is a concern that we don't have an alternative. What do you think about following proposal?

Navigation Hotkeys laptop layout:

  • Alt+shift+up/down arrow / home / end: Jump to next/previous/first/last line with the same indentation level within current block.
  • Alt+shift+left/right arrow: Jump to next/previous line with lesser/greater indentation level within the current block.
  • Alt+shift+ctrl+left/right arrow: Jump to next/previous line with lesser/greater indentation level within the current clutter.
  • Alt+nvda+up/down arrow: Jump to next/previous line with the same indentation level, but not necessarily bounded by the limits of current block.
  • Alt+ctrl+nvda+up/down arrow: Jump to next/previous line with the same indentation level, but ignoring clutter.

So involving the ctrl key means we deal with clutter. Involving the NVDA key means we ignonre either the block or the clutter (in case the ctrl key is also involved).

@mltony
Copy link
Contributor Author

mltony commented Feb 27, 2024

@Adriani90 ,

How do you define a block in this case?

A block is a bunch of lines with higher indentation level bounded on either or both sides by lines with lower indentation level. Think of a Python or properly indented C++ function - function declaration line has lower offset than its entire body, so function body would be a single block. Blocks can also be also nested, so if your cursor is within an if statement or a ``for` loop within function, then that would also define a nested block within.

Why do you need here 4 hotkeys? Is this still within the limits of the same block? If not, i would recommend to use i.e. alt+numPad1/numPad3 for limiting lesser / greater indent navigation within the current block and alt+numPad7/numPad9: limiting lesser / greater indent navigation within the current clutter.

There is this diagonal navigation intuition. We can either find previous or next line (think up or down) and at the same time we can find a line with lesser or greater indentation level (think left/right). Therefore the most intuitive way would be to make use of four corners.
Finding previous/next lines with greater indentation level would operate within current block. On the other hand, finding lines with lesser indentation level would have to go outside of current block - since by definition there are no lines with lesser indentation within current block.

Previous / next line with same indentation is already handled via numpad2/numpad8 in your proposal above within the limits of the block, which is kind of a vertical navigation. so why not using something like ctrl+alt+Numpad2/numpad8 also for navigating at the same indent level between blocks and ctrl+alt+numad3/numpad9 to navigate at the same indent level ignoring clutter?

Because NumPad3 and NumPad9 are reserved for diagonal commands - finding greater indentation level. If I reuse them with control modifier for previous/next - this would be counterintuitive. On the other hand, jumping to the first line with same indentation level goes well together with finding previous line with the same indentation level outside of the block - in the sense that these two would often be used together.

Re: laptop keybindings, if we go back to arrow keys, we would loose diagonal intuition. Also you propose to make use of shift - I was hoping to make use of shift for selection commands - that's typically what shift is used for.
TBH I don't see a good intuitive mapping for laptop mode. There's just not enough keys to play with. Personally I'd rather leave those commands without default keyboard bindings in laptop mode by default. But yeah if we have to assign somehting - then anything would do.

@XLTechie
Copy link
Collaborator

XLTechie commented Feb 27, 2024 via email

@XLTechie
Copy link
Collaborator

XLTechie commented Feb 27, 2024 via email

@mltony
Copy link
Contributor Author

mltony commented Feb 27, 2024

@XLTechie ,

I guess you are basing this off of object navigation, and the windows keymap?

No. I base this off of my IndentNav add-on. Except I am proposing a new set of keyboard shortcuts. Because the one that I used in IndentNav is flawed specifically in the sense that it's only using four arrow keys and so it doesn't have diagonal intuition, and so itit's more tedious to use in certain cases. That's why I am proposing to make use of numpad block here. Based on my 5+ years working with IndentNav - that's going to be more convenient.

Personally, I think I would find it more logical to base it off of review keys.

I can see the logic with numPad 7 and 9 keys. But Using numPad 1,3,4,6 doesn't follow any logic. Moreover, what gesture would you use for jump to first/last line with same indentation level? And for skip clutter commands?

Also I think I agree with the direction @Adriani90's thinking is going with that, as far as a cycling hotkey to change modes, instead of putting nav keys on every possibility separately.

Not sure what you're referring to here - could you clarify?

Text editors such as NotepadPlusPlus, can do indenting (many, such as nano in Linux, also can).

What do you mean by "indenting"?
Quick search shows that both Notepad++ and Nano only has autoindent feature, which is orthogonal to current proposal. Notepad++ has 3rd party add-ons that do something related to indentation - but not sure if you meant those.

I believe NP++ can also do various kinds of navigation by blocks and indent nav, especially with Derek's add-on.

Please explain. I am not aware of any such functionality.

@seanbudd
Copy link
Member

At this stage, we do not think this can be accepted in NVDA core.
The use case for this is quite limited, most modern IDEs support this natively.
If this is to be accepted at a later stage, gestures should remain unassigned by default.

@seanbudd seanbudd added blocked/needs-product-decision A product decision needs to be made. Decisions about NVDA UX or supported use-cases. needs-triage labels Feb 27, 2024
@Adriani90
Copy link
Collaborator

@seanbudd I think people use indentnav for other use cases as well (i.e. navigating on redit by comment level). So this is something that is already known in the community and is by far not limited to IDEs. Still we can use the IDEs as use case to build something upon a practical example.

@mltony
Copy link
Contributor Author

mltony commented Feb 27, 2024

@seanbudd

most modern IDEs support this natively.

Which IDEs are you talking about? I am not aware of a single IDE that supports this.

The use case for this is quite limited

True, this is mostly limited to blind developers. But developers do this feature invaluable. I'm going to collect all the mentions of IndentNav on the NVDA mailing lists to show you how many people use IndentNav and recommend it to other users.

@ruifontes
Copy link
Contributor

@mltony, and why not keep the commands of indentNav?

@Adriani90
Copy link
Collaborator

@mltony

There is this diagonal navigation intuition. We can either find previous or next line (think up or down) and at the same time we can find a line with lesser or greater indentation level (think left/right). Therefore the most intuitive way would be to make use of four corners.

I see your point.

@mltony regarding my proposal, I originally wanted to propose a way where users can toggle between block limited indent navigation, clutter limited intend navigation or no limit indent navigation (i.e. toggling via nvda+i). But still we would have this diagonal navigation problem.

Could you please explain in more details why this diagonal navigation is so useful? Is same indent or greater/lesser indent not sufficient for higher efficiency?

You say:

On the other hand, finding lines with lesser indentation level would have to go outside of current block - since by definition there are no lines with lesser indentation within current block.

If diagonal navigation causes this, is it not counter-intuitive to fly out of the block / clutter accidentally?

@mltony
Copy link
Contributor Author

mltony commented Feb 28, 2024

@seanbudd,

The use case for this is quite limited,

I compiled for you all positive feedback as well as people looking for or suggesting IndenNav that I have received in the last 6 years. The deduped list below contains 43 users - 3 of whom are Jaws users looking for IndentNav functionality in Jaws, the rest are NVDA users either praising IndenNav, or recommending it to others or reporting issues or saying something that suggests that they are using it. Most of these are from public email lists and github, so these are all verifiable - except for the last section, that lists people sending private emails to me. I hope this serves as evidence that the add-on is quite popular in NVDA community and people do have legitimate use cases for it.

program-l

  • Pratyush Kaushal

    12/31/2023, 6:08 AM

    [program-l] Achieve similar behavior for JAWS as IndentNav extension in NVDA

    I want to achieve the same behavior in JAWS, is there any way to achieve the same?

  • Jacob Kruger

    [program-l] Command in VS Code to Jump Between Paragraphs

    Wed, Feb 7, 1:56 AM

    While not necessarily helpful at all, under NVDA, I use IndentNav add-on to let me jump around python code blocks in VS code - it will not read out the line it lands on, but, does allow me to navigate through indentation levels, and thus code blocks easily enough - only trade-off at moment is will use one of it's keystrokes and then use normal read line keystroke to make sure where I am?

  • Florian Beijers

    Wed, Feb 23, 2022, 5:06 PM

    [program-l] Accessible Python IDES

    Another one that might be of use is this one:
    IndentNav - Visual Studio Marketplace

  • joeldodson

    Thu, Jan 20, 2022, 9:14 AM

    [program-l] text editor for beginner

    Also, the IndentNav addon from Tony Malykh is very helpful.

  • Florian Beijers

    Wed, Jan 12, 2022, 2:23 PM

    [program-l] VS Code + VoiceOver

    yes, we do have some third-party addons that help with this.. I t might be a good idea to add a page to the accessibility docs that lists some VS Code extensions that augment VS Code for screen reader users. IndentNav comes to mind, but I think there's a couple others as well.

  • Fawaz abdul rahman

    Tue, Aug 24, 2021, 4:42 AM

    [program-l] how do you guys code in python efficiently and is there a way to catch errors easily

    Also if you are an NVDA user, you can ajudgest the indentation announcement, and install Indentnav addon for NVDA.

  • jacob kruger

    Aug 24, 2021, 4:54 AM

    [program-l] how do you guys code in python efficiently and is there a way to catch errors easily

    BTW, Fawaz, hadn't thought of the actual NVDA indentNav add-on in terms of code-block navigation - thanks for that one, since it does seem to work quite well in tems of code block navigation.

  • Florian Beijers

    Sun, Jul 11, 2021, 2:45 PM

    [program-l] Line numbers

    https://marketplace.visualstudio.com/items?itemName=TonyMalykh.indent-nav // lets you navigate a file by indentation level which can be quite useful particularly in HTML and PHP code

  • Stefan Moisei

    Tue, Mar 9, 2021, 8:58 AM

    [program-l] Getting a panoramic view of code

    For python in any text editor, you could use indentnav. It is an nvda addon which makes indentation look like a tree view. The only place it doesn't work is vs code, and the author has written an vs code extension with the same functions.

  • Ben Humphreys

    Thu, Jan 7, 2021, 11:28 AM

    [program-l] Moving to VS Code from edsharp

    Tony's IndentNav works nicely to move between indent levels with both JAWS and NVDA

  • Dzhovani Chemishanov

    Wed, Nov 18, 2020, 1:13 AM

    [program-l] VSCode: moving per functions.

    No way as far as I know. Toni's "indent nav" does not work in VSCode

  • Gabriele Battaglia

    Wed, Nov 18, 2020, 11:53 PM

    [program-l] VSCode: moving per functions.

    Try my IndentNav VSCode extension then!
    Thank you Tony.

  • Carter Temm

    Wed, Jan 22, 2020, 12:16 PM

    [program-l] Reading JSON Files For Normal People

    Personally, I use NVDA's indentNav add-on along with python.

  • dzhovani.chemishanov

    Tue, Apr 9, 2019, 11:52 AM

    [program-l] accessible way of reading json files

    There was an indent nav addon for nvda that might further improve the experience.

  • Duong Tuan Nam

    (This one is not IndentNav per se, however, OP seems to be asking precisely functionality of IndentNav and they turned down IndentNav in later replies because they don't use NVDA)

    Mar 19, 2019, 10:57 PM

    [program-l] Navigating hotkey between same indention in Visual Studio

    Is there hotkey to jump to next and previous lines which are same level indention in Visual Studio?

  • Sanchit Ghule

    Mar 10, 2019, 12:53 PM

    IndentNav add-on for programmers

    Thank you So Much! You always come up with grate add-ons.

  • Rejin Jose k

    Mon, Mar 11, 2019, 4:19 AM

    IndentNav add-on for programmers

    Thanks for your ad-on. I have been using it in my work place. It really enable  easy navigation through python code.

  • Corbett, James

    Mar 11, 2019, 5:05 AM

    IndentNav add-on for programmers

    Can this add on be used while Jaws is the primary screan reader?

  • Parthy Siva

    Wed, May 2, 2018, 12:56 PM

    [program-l] Introduction from a new member

    There is a NVDA add-on called indentNav.
    With that add-on you can use NVDA + alt + the up and downarrow to move to previous and next line with the same indentation and use NVDA + alt + left and right arrow to move to the previous and next levels of indentation.

  • [email protected]

    Sat, Dec 17, 2022, 10:03 PM

    [program-l] Visual studio code: python: outdenting a block of code

    Many thanks, I'll try your add-on [IndentNav].

NVDA and NVDA-addons

  • Mike Sedmak

    Mon, Mar 6, 2023, 9:11 AM

    [nvda] NVDA 2023.1 Release Candidate now available

    Any idea if someone is working on Indent Nav and Notepad++ I use those constantly for my work, so I may have to learn hoe to modify addins if those are orphaned.

  • Bruno Aníbal Prieto González

    Wed, Jan 12, 2022, 4:31 AM

    Tony's add-ons: updates and new features

    Thank you so much for your awesome complements. Especially I am really appreciating the noticeable improvement of indent nav speed in VS Code. It's great!

  • [email protected]

    Oct 23, 2022, 7:31 PM

    Tony's add-ons: updates and new features

    Which version of IndentNav is your recommendation right now, vs code add-on one, or nvda add-on one?

  • Rui Fontes

    Sat, May 21, 2022, 8:12 AM

    [nvda] Problem of NVDA while working with python language

    Try using IndentNav add-on...

  • Bruno Aníbal Prieto González

    Mon, Jan 11, 2021, 7:24 PM

    Tony's add-ons: new and updated

    you could correct that same error for IndentNav?

  • Bruno Aníbal Prieto González

    Jun 4, 2020, 6:39 PM

    Tony's addons - updates

    With indent nav in apps like the ones I mentioned, quick notes or onenote, so does the same, NVDA says selected. Both add-ons work, but it's tedious that NVDA verbalize that in these cases.

  • Greg Wocher

    Sat, Jan 25, 2020, 5:48 AM

    [nvda] Indent nav addon question

    When I try and install the indent nav add-on from the website NVDA won’t let me. It keeps telling me it is incompatible with 2019.3. Is there a 2019.3 compatible version of this add-on?

  • Adriani Botez

    Sun, Jan 20, 2019, 3:27 PM

    [nvda] NVDA keyboard navigation keyboard commands

    add-ons sentencenav, indentnav and textnav which gives you even more features. You can find them here:
    Indentnav:
    https://addons.nvda-project.org/addons/indentNav.en.html

  • William

    Wed, Mar 15, 2023, 2:43 AM

    [nvda-addons] Any update on addons developed by Tony, e.g. BrowserNav

    Hello, I am a heavy user of addons which are developed by Tony, e.g. BrowserNav, WordNav, etc.

  • Cyrille

    Wed, Mar 15, 2023, 3:08 AM

    [nvda-addons] Any update on addons developed by Tony, e.g. BrowserNav

    • IndentNav has been reported not to be working when only updating the manifest. This is probably due to changes in the configuration to report indentation in 2023.1.
  • Rui Fontes [email protected]

    Mar 15, 2023, 5:00 AM

    [nvda-addons] Any update on addons developed by Tony, e.g. BrowserNav

    I have modified the IndentNav add-on to work in NVDA 2023.1.

  • Han Solo

    Apr 23, 2023, 12:09 PM

    [nvda-addons] Any update on addons developed by Tony, e.g. BrowserNav

    Can you share IndentNav again?

  • Jacob Kruger

    Apr 6, 2023, 3:19 AM

    [nvda-addons] Is Notepad++ addon still developing?

    ...and, I use indent nav add-on to allow me to then navigate between indentation levels in my code, etc., but,

  • Norberto Sousa

    May 19, 2019, 11:47 AM

    [nvda-addons] Volume Manager v0.1

    some of such functionalities shoud have been already included to NVDA core.
    The addons are:
    IndentNav

  • Brandon Cross

    Tue, Nov 27, 2018, 10:39 AM

    [nvda-addons] Indent Nav not working in VS code

    I'm not able to get indent nav to work in vs code,

  • dingpengyu

    Fri, Jun 15, 2018, 6:21 AM

    [nvda-addons] Mostly for Tony Malykh: indentNav: Should indentNave be translated using the NVDA

    I support adding the translation of these two plug-ins to the NVDA translation workflow

  • Norberto Sousa

    Jan 20, 2018, 2:34 PM

    [nvda-addons] Welcome to the NVDA Community Add-ons website - IndentNav #feed

    Hi i would like .
    So far I've used it, it is working fine.

  • David Moore

    Sun, Jan 21, 2018, 12:55 AM

    [nvda-addons] Welcome to the NVDA Community Add-ons website - IndentNav #feed

    I have used Indent Nav as well, and it really works well.

  • MJW [email protected]

    Mon, Jan 1, 2018, 5:57 PM

    New add-on - IndentNav

    Tony, a v useful add-on; good thinking, good work.

Github issues

Personal emails

  • carter temm [email protected]

    Thank you for your work with the NVDA community over the years. Addons like IndentNav and BluetoothAudio have become necessities in the workflows of myself and many others I talk to now.

  • SkyDreamer [email protected]

    Fri, Apr 21, 2023, 12:33 AM

    Czy możesz uaktualnić IndentNav?

    Please update because it doesn't work for me in NVDA

  • Andrew Downie [email protected]

    Tue, Mar 14, 2023, 6:11 PM

    IndentNav and SentenceNav

    Are you planning to update these?  I am reluctant to upgrade NVDA without them.
    Both are so valuable to me.

  • Mike Sedmak [email protected]

    Fri, Mar 10, 2023, 12:36 PM

    IndentNav Addon for NVDA

    I am a huge fan of your IndetNav addon for NVDA.

  • [email protected]

    Fri, Nov 25, 2022, 8:38 AM

    [program-l] Navigating with Visual Studio

    I actually am already using NVDA with your addon :). ... I am using it for visual studio code to navigate by method

  • Peter Lecky [email protected]

    Wed, Mar 13, 2019, 6:20 AM

    Indent nav

    I am a happy user of your indent nav addon. It seems that it does not work in akelpad since version 1.6.

  • Olexandr Gryshchenko [email protected]

    Feb 17, 2021, 1:13 PM

    Перевод дополнений

    Знаешь, действительно IndentNav очень удобен для навигации по коду.
    (Translation from Russian) You know, IndentNav is really very convenient for navigating through code.

vmahdi abedi [email protected]

Wed, Feb 12, 2020, 10:51 AM

nvda addons

> please compatible the following add-ons to work with nvda 2019.3, thanks
> IndentNav
  • David Mehler [email protected]

    Mon, Feb 10, 2020, 5:23 AM

    indent nav and sentence nav nvda addons

    Love your addons, indent nav is really helping me with my python journey.

  • Marlon Brandão de Sousa [email protected]

    Sun, Oct 14, 2018, 9:58 AM

    Questions and possible bug about IndentNav add-on

    I am grateful for your add-on. It makes reading / working with python viable and I want to thank you for the work you have put on it.

  • Samuel Kacer [email protected]

    Sat, Aug 4, 2018, 4:50 AM

    great job with indent nav and sentence nav!!!

    I just wanted to say how great your two addons, Sentence Nav and Indent Nav, are. I have been thinking there should be something like those two for a long time, ever since I got back into programming after losing my eyesight. For a long time I relied on using EdSharp for coding in python, since no other editor or IDE allowed me to navigate around by indentation and in a language like python that is fundamentally necessary. I really wished there was a addon for NVDA that would allow me to use whatever editor and be able to nav around byindentation.
    Really great job on that one!
    ... indent nav is a must for any programmer.

Deduped list of users from the sections above:

Pratyush Kaushal, Jacob Kruger, Florian Beijers, joeldodson, Fawaz abdul rahman, Stefan Moisei, Ben Humphreys, Dzhovani Chemishanov, Gabriele Battaglia, Carter Temm, Duong Tuan Nam, Sanchit Ghule, Rejin Jose k, Corbett, James, Parthy Siva, [email protected], Mike Sedmak, Bruno Aníbal Prieto González, lcong5946, Rui Fontes, Greg Wocher, Adriani Botez, William, Cyrille, Han Solo, Norberto Sousa, Brandon Cross, dingpengyu , David Moore, MJW matthewjwilliams101, André-Abush Clause, legle, TheQuinbox, Thiago Seus, davidacm, SkyDreamer, Andrew Downie, timothyjb310, Peter Lecky, Olexandr Gryshchenko, vmahdi abedi, David Mehler, Marlon Brandão de Sousa, Samuel Kacer

@mltony
Copy link
Contributor Author

mltony commented Feb 28, 2024

@seanbudd,

most modern IDEs support this natively.

I did a thorough investigation of modern IDEs and I couldn't find a single one that would come with indentation navigation functionality. I am pretty familiar with all IDEs below - except for IntelliJ Idea, so I'm rather confident that when phind.com AI says there is no such function, it doesn't hallucinate, I also double checked with traditional Google search.

VSCode

AI says that the way to go is my IndentNav VSCode extension, that is nearly identical to IndentNav add-on. The rationale for writing VSCode extension was that back in 2019 or 2020 VSCode exposed only 10 lines of code at a time through accessibility API, so IndentNav add-on was completely broken in VSCode - the situation with Monaco accessiblity improved significantly since then and the VSCode extension is kind of abandoned at this point.

I would argue that between NVDA functionality (either core NVDA or an add-on) and a VSCode extension, the right way would be to use NVDA functionality, since this way indentation navigation can be brought to all supported text editors at once.

Another option for VSCode is an extension IndentNavKit, that its author says is a fork of my IndentNav extension by what appears to be a non-blind user, so it's not clear that it would work with NVDA.

Besides extensions, AI thinks there are a few indentation-related features in VSCode core, but none of them as you can see has anything to do with navigation by indentation level.

Finally, what AI didn't mention is that in VSCode there is symbols lookup feature that allows you to jump between functions defined in a file. That's the closest I can think of, but the problemn with this approach is that it only works on one level - that is top-level functions, while IndenNav works at all levels of indentation. So symbols lookup, while indeed present in most IDEs, can't replace IndentNav.

Visual Studio

In Visual Studio, there isn't a built-in keystroke specifically for jumping to the next line with the same indentation level.

Eclipse

In Eclipse, there isn't a direct keystroke specifically for jumping to the next line with the same indentation level.

IntelliJ IDEA

In IntelliJ IDEA, there isn't a direct keystroke to jump to the next line with the same indentation level as the current line. The IDE focuses on code structure and indentation primarily for readability and maintainability rather than navigating through lines with the same indentation level.

@mltony
Copy link
Contributor Author

mltony commented Feb 28, 2024

Finally, I would like to mention some of my personal use cases where I find IndentNav indispensable. I hope other IndentNav users - (I know many of them are lurking here on github :) ) - can chime in with their use cases as well.

  1. Navigation around Python and C++ code - that's the main functionality of IndentNav. I probably wouldn't be able to hhold my job in faang without IndentNav as my company is quite demanding.
  2. Large SQL queries. I have to often work with 500+ lines SQL queries at work. Trying to navigate around this big query without IndentNav is going to be very painful. However SQL queries are typically well-indented, so with IndentNav you can easily skip over non-relevant clauses and jump directly to the relevant ones. Without IndentNav I would probably need to be using search function a lot, specifically search with regexps to find lines iwth given indentation levels, but that would be much more tedious. Given that often times SQL clauses are nested into one another exacerbates the problem of navigation even more. I would estimate that without IndentNav my productivity with SQL queries would plummet by at least a factor of 2.
  3. Large config files, like JSON and XML files; also HTML files - often I have to dig into those. Some of them have 20..30 nested levels. Often times you need to find a tag, then see its siblings, or parent, or children. IndentNav offers keystrokes to perform that. Without indentNav I would have to resort to counting indentation spaces manually and write giant regular expressions to search, and probably do a lot of copy-pasting to make sure none of my searches go outside of the current hierarchical block. Here I would estimate my productivity would fall by a factor of 3 or more.
  4. Note taking: I use similar-styled hierarchical format for my personal note taking. This way I can easily work with 10000+ lines text file and with IndentNav I can always find what I want. Again, searching with regexp would be an alternative here. I think note taking without IndentNav is also possible, although it would be more tedious, but I would say still manageable.

@LittleStar-VIP
Copy link

I am also happy if nvda can include this function in nvda

@pranavlal
Copy link

Hi all,
I would find this feature set invaluable. It helps not only in development environments but also in ensuring that documents, whether they contain code or only plain text are accurately formatted. As for support from IDEs, visual studio code and perhaps visual studio are the only environments that may have any kind of indented navigation support. Please remember, a universal solution is being given here which would work across any edit control that supports the reporting of indents.
Please also do not overlook the possible optimization of the text info object in terms of speed and efficiency. I do not have a specific use case where I find it slow but welcome any efficiency gains that the work on this feature may yield.

@LitianT80
Copy link

LitianT80 commented Mar 2, 2024

I am a visually impaired software engineer and I have been in tech industry for almost 20 years. I feel being able to do indentation navigation is critical to my daily work, from coding to notes taking. Honestly, this is one of key features I switched from JAWS.
So I definitely support that it becomes part of NVDA core.

@towebo
Copy link

towebo commented Mar 3, 2024

When I discovered IdentNav my productivity got a real kick in the butt. In addition to the other arguments I would like to highlight the ease which I can find matching braces or discover that they don't match...
I don't really understand the argument that this already is supported in IDEs, which doesn't seem to be the case. Regardless if indentation navigation would be supported in the core you would be able to use it in solutions that make use of NVDA such as Remote Incident Manager that doesn't have support for addons. If you use Remote Incident Manager to help someone there probably won't be any kind of IDE installed and you have to jump through a lot of hoops to have indentation navigation at your fingertips.
Indentation navigation is, mentioned before, is useful in forums and other websites.

I remember the resistance when I proposed implementing a screen curtain in NVDA. The argument was that it didn't affect screen reader users. Fortunately it whent through and is essential for us so we can retain privacy.
I hope this feature can make it into the core so non-developers can discover the benefits.

@niranjan-differenzsystem

Being a VI software engineer, The indent nav add-on is the most useful add-on that I've ever used. It just bumped-up my productivity drastically. Jumping between the large block of code is just very easy and intuitive. I don't know why? if something is valuable for the users, then why it cannot be the part of the NVDA core it self.

@jacob-kruger-work
Copy link

Know of very few IDE's that actually support indent-level navigation by default - yes, if they know you are working with a specific programming language, they might attempt to automatically implement it, but, not everyone uses the same IDE at all, and, I would also generally prefer to have full control over where I landed when navigating through blocks of code - lots of us work in different forms of text editors, where it is also unlikely they would support it by default, without having installed another plugin per editor, so, having it available, even without a keystroke initially being assigned to it would definitely be beneficial - malso provides us with the means to remember a single keystroke across environments?

@krperry
Copy link

krperry commented Mar 4, 2024

I wish this was not added by a screenr eader and that people would write addins to things like VSCod enad IntelliJ to do this. I am not even sure there is not one. With that said this would be a good addon to NVDA.

@akash07k
Copy link

akash07k commented Mar 4, 2024

It will definitely a godsend if it gets added into NVDA

@mcsedmak
Copy link

mcsedmak commented Mar 5, 2024

am a blind developer, and indent nav was a huge help to my work flow. I use it in the notepad++ editor with C++, Ruby, Perl, Python, etc...
It is also useful for structured data sources that make use of indentation.

@seanbudd
Copy link
Member

seanbudd commented Mar 5, 2024

It appears we were mistaken on the limited functionality of indent navigation in IDEs.
However, this feature still serves an extremely limited audience, which brings in the question of maintenance cost and scope creep.
Could you explain what value incorporating this into core brings, when an add-on is available?

We need to draw the boundary between core features and add-ons somewhere, and it is not clear what value this brings to most NVDA users, particularly while this add-on serves the minority who use this.

@Adriani90
Copy link
Collaborator

Adriani90 commented Mar 5, 2024 via email

@Adriani90
Copy link
Collaborator

@seanbudd #16236 is certainly a slight improvement for browse mode only, but it doesn't allow to navigate to greater or lesser indentation levels, nor it proides a way to restrict the navigation to the current block. This is needed for navigating websites such as Redit or other complex websites such as concept boards. And all the use cases where browse mode is not available are not covered at all, i.e mathematical expressions written in tabular structure including complex divisions, applications where quick navigation is not supported, etc.

So the use cases above still stand.

@Adriani90
Copy link
Collaborator

However, I am not sure the diagonal navigation @mltony talks about is really needed. I don't understand the real efficiency gain from that navigation patern. @mltony can you elaborate to my #16230 (comment) ?

@mltony
Copy link
Contributor Author

mltony commented Mar 12, 2024

Let me clarify. There are two separate use cases:

  1. Indentation navigation in editables. That's what IndentNav add-on does.
  2. Indentation navigation in browse mode. That's what my BrowserNav add-on does.
    As I figured out over the years these two patterns are very different despite superficial similarity.
    TL;DR: Use case 1 was turned down by Sean and use case 2 is essentially vertical navigation that has already been merged.
    Now more details:
    For use case 1. it's important to stay within a block (such as function). It's also important to have diagonal navigation commands to jump to previous/next line with greater/lesser indentation level. These are all useful commands and I se them being used primarily by software developers. I can see another use case of writing text documents structured by indentation levels but that would also cater to minority of users.
    Use case 1 is essentially this feature request and Sean turned it down, and I respect Sean's opinion.
    For use case 2, the only useful command I found was just vertical navigation that doesn't respect current block, whatever definition of block we can come up with. I already prepared this as PR Vertical QuickNav #16236 that has already been merged.
    In usecase 2 it doesn't make any sense to stay within current block due to nature of HTML pages. For example if you try to jump vertically between same level comments within block on reddit, there will be some other paragraph, such as username, timestamp, or just some stupid button that has lesser indentation level, that is lesser x coordinate and it would limit our current block. If we constraint ourselves with vertical navigation only within current block, then it won't work on reddit because current comment will always be the only thing in current block and also it won't work on majority of HTML websites that I tried. I tried that before in BrowserNav, it didn't work, trust me.
    In use case 2 it also doesn't make much sense to do diagonal navigation due to the same reason. If you want to find a paragraph with lesser indentation level, you'll find some stupid button. If you press the same command again, you'll likely to find some other clutter paragraph. In practice if you want to find a parent comment, it's much easier to do with just arrows then trying to find a paragraph with lesser indentation. I tried that too in BrowserNav. It was very confusing and I gave up.
    So use case 2 is really only limited to vertical navigation without any block limitation and is already merge in the core.

mathematical expressions written in tabular structure including complex divisions

Could you clarify this one - I didn't understand this use case.

@Adriani90
Copy link
Collaborator

@mltony thanks for this good explanation.
I try to come up with some concrete examples. After broader testing the indent navigation as implemented in your add-ons does not work reliably with them yet, but still I think we could discuss a UX design to make indent navigation working in these cases.
Example 1: concept board:

  • This is a concept board with an onboarding journey, contains mainly a calender where at every date there are meetings scheduled. Meetings can be group meetings, workshops or individual tasks. There is a second area where questions and answers can be discussed.
    https://app.conceptboard.com/board/qryg-e2xi-io36-nzci-qtuo?pk_vid=0610559da2b37fac1710276604295045
    I cannot interactively work with the board due to lack of accessibility from Concept board, but your browser nav add-on using lesser and greater indent navigation and parent / child paragraph navigation with greater / lesser indent (nvda+alt+arrow keys as well as nvda+alt+home, end, pg-up, pg-down) helped me to understand better the structure of this board and the concept behind it. Although I couldn't reliably get to every meeting on a specific date, and it is still far from perfect, it gave me an idea of how this looks like. Every small aid which helps understanding the structure is helpful When working together with sighted people on such boards.

Example 2: Google docs document (applies also for other type of documents where browse mode is not really supported like Libreoffice:

  • Here is a user guide for a synthesizer containing many lists and headings. Lists might also have 2 or 3 indent levels.
    https://docs.google.com/document/d/1hVfCD0LSOiKM6dEhux3tWjQprlDifQ76Hy2nSXf-NxA/edit?pli=1
    With the indent Nav add-on I could earlier navigate this document in Google Docs very efficient by headings and finding the lists very fast wihtout having to change back and forth between browse and focus mode because in Google docs browse mode is not covering the whole document if it is not completely visible on the screen.
    Same happens when you copy this document into Libreoffice, where browse mode is not supported at all. Indent nav add-on helped me to skim read this document and find what I am looking for in a very efficient way.
    However, indent Nav add-on now gives me an error and it doesn't work anymore.
    I don't think this use case impacts only a limited number of people, actually it is more often needed than the software development use case.

Example 3: mathematics

  • I attached two Libreoffice open foundation documents with cost calculation guidances for financial / controlling / project management. You can find tables but also some divisions.
  • Table navigation is not supported in Libreoffice or Open office with NvDA, so indent navigation helps in this regard a lot. However, as I said before, the add-on doesn't work anymore.

You can basically build up every cost calculation formula which contains a division as a tabular structure or as a table. Cost calculations can contain more than one level, that means you can have more than one indentation level for the tabular structure depending on the production cycle and the costs that are involved.
RM6257-KPI_Paymech-Model-Instructions-Information-including-FAQs-v3.0.odt
PIMHIE_-_eligible_cost_guidance.odt

@mltony
Copy link
Contributor Author

mltony commented Mar 13, 2024

  1. Regarding diagonal navigation in browsers, although initially I implemented that as a feture in IndentNav, I moved this feature to BrowserNav long time ago, like maybe 5 years ago. If you find it useful I can keep it there. As for whetehr it should be merged into core, I personally think that it's not useful enough, but I can be convinced otherwise.
  2. Regarding Google Docs - accessibility model of Google Docs is just terrible. None of indent-nav related commands are going to work reliably in Google Docs, just because it only exposes a part of document at a time. This affects both browse and focus mode. So no, neither indentNav for editables, nor indentation navigation in browse mode will work correctly with Google Docs and this can't be fixed unless for example Feature request: build JavaScript accessibility bridge to improve accessibility of web applications #15995 happens.
  3. Regarding LibreOffice, since it doesn't support browse mode, then BrowserNav indentation navigation must have never worked there. We can think about porting vertical navigation QuickNav command to non-browse-mode documents. But then I'd have to ask the question of utility - are we only doing this for LibreOffice? Wouldn't it make more sense to add browse mode to LibreOffice instead?

@Adriani90
Copy link
Collaborator

Adriani90 commented Mar 13, 2024 via email

@LeonarddeR
Copy link
Collaborator

Even though I'm a passionate user of Indent Nav, I'm inclined to say that it is out of scope for core. I find the concerns from @seanbudd perfectly valid.
As suggested in #16056 (comment), I'd rather see investment in proper rating of add-ons in the store, so if the add-on is as often used as claimed, it can be part of a recommended add-ons category. In that case, it is pretty easy for users to install it.

@Adriani90
Copy link
Collaborator

Adriani90 commented Mar 13, 2024 via email

@LeonarddeR
Copy link
Collaborator

In addition, I may be asking a somewhat controversial question, but it seems to me as if the Indent Nav add-on is hardly maintained. Latest commits on https://github.com/mltony/nvda-indent-nav are from two years ago.
That really gives me the impression that the broad use as claimed by some is somewhat exaggerated. I for me had to tweak the manifest and the code to use it in 2024.1 alpha. for example.I think there are quite a few alpha or beta testers around here who have had to perform a similar trick.
Not trying to be harsh here, just sharing some facts that really worry me with regard to maintenance of the code, especially when it breaks. As stated elsewhere, it should not be the intention that various features come to core at the insistence of the community, while NV Access ultimately becomes responsible for their maintenance. This is just to further support @seanbudd's objections.

@LeonarddeR
Copy link
Collaborator

And what about my very concrete use cases above? I still don‘t see why they should be just ignored. Can you provide a strong argument?

Happy to see them incorporated in the add-on 😉

@Adriani90
Copy link
Collaborator

Adriani90 commented Mar 13, 2024 via email

@Adriani90
Copy link
Collaborator

Adriani90 commented Mar 13, 2024 via email

@ruifontes
Copy link
Contributor

@Adriani90, in Portugal and Brasil, indentNav is almost used only by developers...
And if we go only by add-on usage, why not include ClipSpeak, more used than indentNav?

@Adriani90
Copy link
Collaborator

@Adriani90, in Portugal and Brasil, indentNav is almost used only by developers...

@ruifontes this is most probably due to the communication strategy in your communities. If you describe the add-on of being useful only for developers, ofcourse only developers will feel addressed. In our communities this add-on has been applied in multiple use cases from the beginning on, ofcourse we also targeted developers when promoting it, but not only.

And if we go only by add-on usage, why not include ClipSpeak, more used than indentNav?

It is not just about add-on usage, it is about the potential this kind of feature has on the entire community.
Clipspeak does announce the operation indeed, but as outlined by Michael Curran in different cases, applications do not send the information that something went to the clipboard, so NVDA cannot make sure this operation really succeeded. Reporting to the user "copied to clipboard" or whatever, if the operation did not succeed, does not make sense in every use case. So that's why we in general let the application provide the operation message. We try to only provide a message where we are sure that it can succeed. For example in the virtual document in browsers.

@TheQuinbox
Copy link
Contributor

I'm seconding everything said by @Adriani90 and @brunoprietog. I've incorporated indent navigation into my workflow in such a heavy way and it's helpful in so many cases, including reading code, structured text, diagrams, trees, etc.
I'm afraid I don't see what @seanbudd and @LeonarddeR are talking about. We added indent beeping to core, and that's arguably more useful for developers only, although I think it should stay in core too.

@lukaszgo1
Copy link
Contributor

While I am not using indent nav and quite frankly could not care less if it is in included into the core or not, conclusions drawn by @LeonarddeR and @ruifontes do worry me:

In addition, I may be asking a somewhat controversial question, but it seems to me as if the Indent Nav add-on is hardly maintained. Latest commits on https://github.com/mltony/nvda-indent-nav are from two years ago.
That really gives me the impression that the broad use as claimed by some is somewhat exaggerated.

There are also several different conclusions which can be drawn from this data:

  • The add-on does work well enough in terms of functionality ,so that most of its users are fine with its current state. Since NV Access allows users to override compatibility they do not really care how often it is updated.
  • The point above also shows that the code is written in a way which does not require constant maintenance - otherwise simple compatibility override will not work
  • The point about indent nav not being compatible with 2024.1 proves only that its users are not using Alpha version of NVDA, which given how few Alpha users there are is hardly surprising.
  • Finally there are many users who, due to yearly add-ons breakage, are not keeping current with NVDA, so they do not really care with what version indent nav is compatible, as long as it works with the version they're using. This is inevitable unless many more add-ons are included into the core, or yearly compatibility breaks are stopped.

Not trying to be harsh here, just sharing some facts that really worry me with regard to maintenance of the code, especially when it breaks. As stated elsewhere, it should not be the intention that various features come to core at the insistence of the community, while NV Access ultimately becomes responsible for their maintenance.

As explained above it is your interpretation of the current state of affairs in terms of maintenance, rather than facts.

And if we go only by add-on usage, why not include ClipSpeak, more used than indentNav?

This is not about add-on usage - without any statistics we have to trust @Adriani90 that indent nav is used as often as they claim. The difference is that indent nav eliminates one of the advantages directly caused by blindness i.e. comprehending indented content is easier, whereas ClipSpeak gives a notification in cases where sighted people don't get one.

@mltony
Copy link
Contributor Author

mltony commented Mar 14, 2024

@Adriani90,

Your indent nav addon worked well in non browse mode scenarios

There is still perhaps some confusion here. After 2019 IndentNav only works by indentation level in plain text editors. If it worked in LibreOffice/MSOffice - that's not by design. This feature is only for developers and therefore as Sean pointed out we shouldn't include this in core.

Navigation by x axis has always been supported in browse mode only. This was part of IndentNav before 2019 and part of BrowserNav after 2019.
Since you're saying that LibreOffice never supported browse mode, this makes me think that it must have never supported use case 2, and if it has ever supported use case 1 - that must have been a bug. Even if you claim it had worked I don't see how that would have been useful since people don't often write code in LibreOffice.

As for vertical navigation in LibreOffice without browse mode, perhaps you convinced me, that might be a reasonable feature request.

As for Google docs, they only expose tiny part of the document through accessibility API. Sometimes less than a page. So if you do vertical navigation, you'd be limited to a small subset of the document. Bug reports guaranteed.

@Adriani90
Copy link
Collaborator

Adriani90 commented Mar 14, 2024

@mltony I still would like to challenge your argument that it is useful only for developers.
We converted files such as odf files to plain text files with software that preserve indentations and table structures either by adding tabs in the coresponding lines or vertical lines to split cells. People used this practice to read tables and other indentation related structures with your add-on in a plain text file when they didn't have money to invest in MS Office and because of lack of other alternatives which support table navigation. I think you limited the functionality of this add-on to developers, but indeed the use case is far broader.

After 2019 IndentNav only works by indentation level in plain text editors.

This was your design choice, but still this feature is not relevant for plain texxt only.
If NV access decides to implement this in the core, the community will challenge anyway why this should be implemented for plain text editors only. Did you have a technical limitation that led you to this decision?

I don't see how that would have been useful since people don't often write code in LibreOffice.

It is again not about writing code. It is about understanding structures on the screen whether they are in a plain text editor or not. And visually structuring something means always you use indentations in every kind of form.

As for Google docs, they only expose tiny part of the document through accessibility API. Sometimes less than a page. So if you do vertical navigation, you'd be limited to a small subset of the document.

I am quite sure there should be a technical possibility to work around this, you can scroll the document while using the system caret, that's what happens when you navigate with arrow keys only. The document scrolls, making other parts of the document visible. Why should this not be possible for indent navigation? You move the system caret to certain positions in the document, so the screen could be scrolled there as it happens in MS Word for example.

I think you have exposed your add-on only to a use case and people did more out of it without giving further feedback, maybe this is the reason you still limit the use case.

@mltony
Copy link
Contributor Author

mltony commented Mar 14, 2024

We converted files such as odf files to plain text files with software that preserve indentations and table structures either by adding tabs in the coresponding lines or vertical lines to split cells. People used this practice to read tables and other indentation related structures with your add-on in a plain text file when they didn't have money to invest in MS Office and because of lack of other alternatives which support table navigation. I think you limited the functionality of this add-on to developers, but indeed the use case is far broader.

Sure, I can see that IndentNav can be used in this case. I'll leave it up to Sean to decide how important this case is.

Did you have a technical limitation that led you to this decision?

people don't typically use spaces to indent things in MS Word. I didn't work much with LibreOffice, but I would assume it's similar. MSWord got better tools to do layout. IIRC tab doesn't even work as a character in MSWord. So the point is I can hardly imagine VIP people using MSWord to do indentation like programmers do in plain text editors. It's possible in theory, but that would be inconenient. I personally think that would be a very weird use case. You can argue that a properly indented document can always be copied into MSWOrd, but it doesn't make it less weird. During6 years of INdentNav I had many people suggesting features, but MSWOrd support wasn't one of them. So I still maintain my opinion that indentNav for MSWord doesn't make much sense. I think we're already talking about minority of users who use IndentNav - those are developers plus few non-developers who work with indentation-formatted documents, and those who would want to use formatted documents in MSWOrd would be minority among minority.

you can scroll the document while using the system caret

No you can't. Delay would measure in seconds, sometimes dozens of seconds. I tried that approach in IndentNav for VSCode and it failed miserably, I didn't even do a public release.

@Adriani90
Copy link
Collaborator

Adriani90 commented Mar 14, 2024

Thanks @mltony your last comment helps to understand better the limitations you faced when desiging this add-on.

At least for MS Word and Libreoffice 24.0, they expose the distance of characters from the left edge of the screen, so you have a x-achsis that is always available. Could we not use that information to define the indentation in these applications?
Or is there a way to define a regexp for NVDA to recognize the characters for indentations such as white space, space or tab characters? i.e. in combination with the distance of the first character from the left edge of the screen I can imagine that the failure of indent detection will be quite minimal. what do you think?
Moreover NVDA already recognizes indentation when enabling this in document formating settings, so why not implementing the navigation patern by this kind of property?
I still think at least in LO but also in MS Word people will use indent navigation for several scenarios as they would not have to convert these files in plain text as they do now with the use cases described above.

You might have the perception that is a minority of people, but this perception is definitely due to the way this add-on has been promoted over the last years, and it doesn't really tell the full truth of this functionality. just because programatical languages use indentations this doesn't mean that other fields do not use indentation to structure information on the screen.

@mltony
Copy link
Contributor Author

mltony commented Mar 15, 2024

At least for MS Word and Libreoffice 24.0, they expose the distance of characters from the left edge of the screen, so you have a x-achsis that is always available. Could we not use that information to define the indentation in these applications?

This is how indentation has always been defined in browse mode. It has never been defined like this in IndentNav. That's why I'm saying that the best course of action seems to me to implement maybe imperfect browse mode in LO. In MSWord this should already be working since browse mode is working. If you feel that there is enough demand to have vertical navigation in LO without browse mode - I might agree here - perhaps you know better what users watn.

Or is there a way to define a regexp for NVDA to recognize the characters for indentations such as white space, space or tab characters?

Sure that must be possible. And sure, NVDA beeps indent level in MSWord. But again my point is I am not convinced that this would be very useful to anyone. NVDA beeps progress most likely because beeping has been implemented in editableText class, which MSWord inherits. Not because someone desperately needed to hear indentation level specifically in mSWord. Also, MSWord has word wrap enabled by default - IDK if there's even a way to disable it - and with word wrap indentation navigation would be broken the first time your line wraps.

i.e. in combination with the distance of the first character from the left edge of the screen I can imagine that the failure of indent detection will be quite minimal. what do you think?

Trying to combine two approaches is not a good idea. Way too confusing.

@Adriani90
Copy link
Collaborator

@mltony wrote:

If you feel that there is enough demand to have vertical navigation in LO without browse mode - I might agree here - perhaps you know better what users watn.

It is not only useful to have vertical naivgation both in focus and browse mode, it is even very useful to have this working also by lesser or greater indent level. I have been using NVDA for more than 10 years and I have been building the german community as well as contributing to the romanian community, and definitely indent navigation both in browse and focus mode would make life easier for many users in many use cases.
If the x axis can be used both in focus and browse mode to make this navigation patern possible, at least this will improve things alot.

NVDA beeps progress most likely because beeping has been implemented in editableText class, which MSWord inherits. Not because someone desperately needed to hear indentation level specifically in mSWord.

MS Word was just an example. Beeping indent level definitely has a lot of use cases, although at the time of implementation developers did not have all of them in mind. Lots of users are thankful to this feature, especially when reviewing or desiging well structured documents in different applications.
I think it is quite clear that navigation patern by indent level makes even more sense because it affects global functionality in many editable areas but not only.

with word wrap indentation navigation would be broken the first time your line wraps.

Generally speaking, there are a lot of cases where in MS Word indentation is broken, e.g. when wrapping lists around a table. But this is an issue for sighted people as well, and if this should be solved, then it needs an external fix.
Given navigation by indentation should be a global feature for editable areas and browse mode, I don't see why MS Word should hold us back from having such a feature.

@Adriani90
Copy link
Collaborator

Adriani90 commented Mar 25, 2024

I think I have found a proposal that might make sense for the laptop keyboard layout as well:

  1. Implement an indentation mode which can be toggled via nvda+i between
  • limited to Block
  • Limited to clutter
  • No limit
    The indent modes can be technically ignored if the keyboard has a numpad.
    The indent level is detected by the location coordinates of object from left edge of a screen (x-axis) if available, otherwise fall back to number of tabs or space characters.

Now on the keyboard commands for laptop keyboard layout which would work in all of three indent modes:
2. Use table navigation command concept to navigate vertically and horizontally with diagonal navigation from top left to lower right of the screen:

  • NVDA+alt+windows+up and down arrow: navigate by same indent level vertically up and down
  • NVDA+alt+windows+left and right arrow: navigate by lesser or greater indent level from top left to lower right
  1. Without using the Windows key, navigate diagonally from top right to lower left of the screen as follows:
  • NVDA+alt+right and left arrow: navigate by lesser or greater indent level from top right to lower left

This approach should work both in browse and focus mode in editable areas and in the virtual document.
Having this feature implemented globally would make life in tons of use cases much easier.
Even though there are documents or websites which don't have a structure that fits into indent navigation, there are definitely a lot of cases where the structure fits into this navigation patern and the users will definitely find the relevant structures where this patern makes sense.

@CyrilleB79
Copy link
Collaborator

@Adriani90, I am not a user of such type of navigation and, for now, have no opinion on its inclusion in NVDA core.

However, reading your last comment, some questions come to my mind:

The indent modes can be technically ignored if the keyboard has a numpad.

Do you mean:

  • NVDA will ignore the indent mode if the keyboard has a numpad
  • or the user will ignore the indent mode if the keyboard has a numpad

Note that NVDA cannot test if the keyboard has a numpad and make a decision depending on this; indeed, what happens with a laptop without numpad having an external keyboard with numpad plugged in? Both keyboard can be considered.

  • NVDA+alt+ctrl+up and down arrow: navigate by same indent level vertically up and down
  • NVDA+alt+ctrl+left and right arrow: navigate by lesser or greater indent level from top left to lower right

Note that these gestures are already taken by read row/column commands. Do you have this in mind? Do you expect to have a different behaviour in table and out of tables?

@Adriani90
Copy link
Collaborator

@CyrilleB79 wrote:

• or the user will ignore the indent mode if the keyboard has a numpad

That's what I mean, because for the numpad there are enough key combinations to cover indent navigation in a logical way for block, clutter and no limitation and also to cover the diagonal navigation in case of top right to lower left of the screen.

My understanding is that NVDA can make the difference whether someone presses arrow keys or numpad keys, so the indent modes would only impact the use of x+y+z+arrow keys. This is how it works with review modes for example.

Note that these gestures are already taken by read row/column commands. Do you have this in mind?

Good catch, thanks I didn't have this in mind. In this case an additional toggle would be needed for NVDA+i which turns off the indent navigation feature completely so people who need this command in tables can use it without problems.
Alternatively, we could change my proposed commands to include the windows key instead of the nvda key.

Do you expect to have a different behaviour in table and out of tables?

Not really. In browser nav add-on you can currently navigate tables by using the indent navigation instead of ctl+alt+arrow keys, so there is no conflict so far. The advantage is with indent navigation you even can navigate tables row by row or column by column whether they are css tables or properly defined tables. So it works in situations where NVDA doesn't support table navigation.

@Adriani90
Copy link
Collaborator

I edited my #16230 (comment)
to include key commands that are not conflicting with NVDA or Windows commands.

@Adriani90
Copy link
Collaborator

Closing in favor of #16467.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/needs-product-decision A product decision needs to be made. Decisions about NVDA UX or supported use-cases. close/duplicate needs-triage
Projects
None yet
Development

No branches or pull requests