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

No longer possible to tab between the SharpTreeView and AvalonEdit components #2577

Closed
glenrgordon opened this issue Dec 11, 2021 · 13 comments · Fixed by #2586
Closed

No longer possible to tab between the SharpTreeView and AvalonEdit components #2577

glenrgordon opened this issue Dec 11, 2021 · 13 comments · Fixed by #2586
Assignees
Milestone

Comments

@glenrgordon
Copy link

My intent was to fix the issue and submit a pull request, but after spending several hours trying to diagnose what's going on, I came away stumped. Hoping that you can devote a little time to investigating this.
As a screen reader user, the inability to tab between these two components makes using relatively recent ILSpy versions nearly impossible.
I was the one who added improved accessibility support to SharpTreeView and Avalon edit back in 2014. The UI seemed simpler back then.

@dgrunwald
Copy link
Member

ILSpy is now using AvalonDock for multi-document support.
Switching tabs with the keyboard apparently requires Ctrl+Tab (as in VS) but the UI for that seems to be quite broken.

@siegfriedpammer siegfriedpammer self-assigned this Dec 12, 2021
@siegfriedpammer
Copy link
Member

I will take a look why the NavigatorWindow behaves strange. Taking a look at https://github.com/Dirkster99/AvalonDock no such issue was reported before.

@glenrgordon
Copy link
Author

glenrgordon commented Dec 12, 2021 via email

@siegfriedpammer
Copy link
Member

@glenrgordon The issue should be fixed in the latest nightly build, you can get it from here. If you face any other problems when using ILSpy, please open an issue and we'll take a look. Thank you very much!

@glenrgordon
Copy link
Author

glenrgordon commented Dec 28, 2021 via email

@siegfriedpammer
Copy link
Member

OK, I think I see the problem you are facing:

  • If you want to switch from AvalonEdit to the TreeView you actually have to press Tab twice while holding down Ctrl: once to open the switch dialog window and another time to change the selection from AvalonEdit to the TreeView, when you release the keys, the dialog closes and the focus change is applied.
  • If you want to switch from the TreeView to AvalonEdit you only have to press Ctrl and Tab once, because the initially selected item is always the document (i.e., AvalonEdit).

@glenrgordon Is my analysis correct?

The behavior in VS is as follows:

  1. one key-press of Tab (while holding down Ctrl) immediately changes from the currently selected document to the next one.
    • that is, if the focus is currently applied to document;
    • if the focus is on a tool window, one key-press of ctrl+tab opens the dialog and places the initial selection on the document.
  2. to switch between documents (AvalonEdit) and pads (TreeView) you actually have to use the arrow keys, because Ctrl+Tab only cycles the documents

So, the ideal behavior of AvalonDock (for ILSpy) would be: (@Dirkster99 please add your thoughts, because I am going to provide a pull request with the changes, once we've agreed upon a solution, thanks!)

  1. Cycle all items (not just in the group of documents or tool windows separately) - which is currently the case with AvalonDock
    (note: VS behaves differently, the arrow keys are required to switch to the list of tool windows)
  2. The initial key-press moves to the next document/tool window (if there is more than one) - my previous fix actually breaks this, because I set the selection to the first document/tool window.
  3. If there is only one document, we move to the first tool window - this works already, but only by pressing twice, because the focus is always returned to the first document currently.
  4. The starting point of cycling should be the item that is currently focused - currently it's always the first document (tool windows are only considered, if there is no document, which is impossible in the case of ILSpy)

So the necessary changes:

  • Move the focus to the next item on the first Ctrl+Tab press
  • Consider the currently active type of content, when selecting the next item

@Dirkster99 would you accept a pull request implementing this behavior as default? The first change restores the correct behavior for multi-document use-cases. The second change would only be useful for ILSpy. As the tool window/document switching behavior was already different from VS, I would not see this as a problem and it would only be different if there is only one active document. Not sure, if the other users of AvalonDock would mind such a breaking change? Thank you for your feedback!

@glenrgordon Note, I haven't tried using Narrator with ILSpy/the switching dialog window yet. Does it work as you would expect? Thank you!

@glenrgordon
Copy link
Author

glenrgordon commented Dec 29, 2021 via email

@Dirkster99
Copy link

@siegfriedpammer
@glenrgordon

Hi Guys

Move the focus to the next item on the first Ctrl+Tab press

is fine with me since the user is most likely to use Ctrl+Tab to change to another document rather than a tool window (That's at least the underlying assumption of Ctrl+Tab in Visual Studio and I would argument that most AvalonDock Apps are document oriented in the same way).

Now I am not sure what you mean by:
'Consider the currently active type of content, when selecting the next item'

If this means you want to tab to the next Tool Window when the previously selected item was a Tool Window then I would agree that it would break the expected document centered behavior. Maybe we could make this either:

  1. an optional tabbing behavior - leaving the default as it is right now (always tabbing to a document first) but add an option to tab to another tool window if the last item was a tool window

or

  1. change the tabbing behavior to align with the cursor implementation of VS?

... but I admit 2) does not really help you since you seem to have an interest to tab from Tool Window to Tool Window rather than assuming with priority to a document - so, 1) seems to be a better option and might also be interesting for other Apps because I know there are even AvalonDock Apps out there that have no document at all - what do you think about these options?

@glenrgordon
Copy link
Author

glenrgordon commented Jan 6, 2022 via email

@siegfriedpammer
Copy link
Member

@Dirkster99 Thanks for your response. So, if @glenrgordon is fine with the VS behavior, I can provide a PR that changes the NavigatorWindow behaviour to work exactly as in VS, including our single document scenario.

This would mean that, we'd have to introduce shortcuts for our tool windows. @glenrgordon are you fine with having to use two different shortcuts to switch from documents to the treeview?

@glenrgordon
Copy link
Author

glenrgordon commented Jan 6, 2022 via email

@siegfriedpammer
Copy link
Member

What would you think of f6 as a hot key for toggling focus between the tree and the currently active document. When focused on a document, Ctrl+tab would allow switching to a different one? Assuming I’m properly understanding the ILSpy UI paradigm, this would be a great solution from an accessibility standpoint.

The latest release of ILSpy (7.2.1) uses F6 as hotkey for the "Assemblies" pad, Ctrl+Shift+F for the "Search" pad and Ctrl+R for the "Analyze" pad. As far as I can see, switching between multiple tabs and pads using Ctrl+Tab now works (almost?) exactly the same as in VS 2022. The Ctrl+Tab switcher window is now understood correctly by the Windows 10 built-in screen reader "Narrator".

@glenrgordon I hope that ILSpy is now usable via a screen reader. If there are any other bugs, please feel free to open another issue and I'll be glad to make further improvements.

@glenrgordon
Copy link
Author

glenrgordon commented Apr 10, 2022 via email

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants