-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
support code folding with screen reader support enabled #43262
Comments
After discussions with @alexandrudima he explained that we disable code folding because there is no good way to communicate to the screen reader that a code area is folded. Another issue is that we are not properly reading out the line numbers so the user is not aware that there is a big change in line numbers and he can not infer that he just navigated over a folder area. Also the code folding + is not accessible via keyboard. One way how we could communicate to the user that a code area is folder is via |
I think having proper UIA support in Chromium would make this a lot easier, since it allows exposure of rich formatting data of text ranges. If I'm not mistaken, Microsoft is contributing code to Chromium to add support for UIA so that the new Edge will work well with Narrator. |
while uia support would be the best option, in the due time we might consider allowing the user to decide whether they can tolerate issues mentioned (lack of proper feedback & line numbers confusion) by maybe introducing a setting which will override current default to disable folding entirely. Another way to overcome current lack of folding with screen reader might be to introduce commands for jumping to next/previous blocks of folding of different level (without actually folding anything in the editor). should I create an issue for this? |
@OSadovy feel free to create new feature requests for folding. However please first double check if there are currently no folding commands in the command palette that cover this - since there are quite some. |
In Visual Studio, I believe folded code is indicated with an elypsis (...) at the end. Sometimes, the text of the spoken/Brailled line will include more than one actual line. It's okay that the line numbers aren't read out. Those would get in the way of interesting content very quickly. And for the short term, it might be better to allow folding as long as there is an easy way to unfold everything in a file. That would be my preference. I find folding very useful in navigating code. |
@RobGallo thanks for the feedback. @RobGallo And yes there is an easy way to unfold everything I will assign this issue to September so I look into what further improvements we could do regarding folding. |
I have tried this out, and my initial feeling is that when the text is unfolded we should not announce anything. The points where code can be folded can be infered by the user. Overall I think this would be a good experience as it is if we had microsoft/monaco-editor#410
@alexandrudima let me know what you think or if you have a better idea |
I don't think writing Since we don't have any semantic way to communicate folded regions, I don't see anything else than possibly using aria.alert, but even that I'm not sure when it would alert and what it would say. |
Hi, Let me lay out my case for letting the screen reader user control their own destiny with folding. I think I qualify, because of having used a screen reader since about 1987. Here goes. When writing code, the screen reader user should know which lines are folded by context. For example, in Python, the user would read words such as if, else, while, class, function, etc., and the lines would end with colons, unless there was a comment. If we arrow up or down and encounter another line with a keyword like the above, we know we have jumped across a fold. Python also has the extra benefit of indentation. If the screen reader can speak indentations, we know which level we are on when we land on a line. With C-like languages, we would encounter similar words, but the punctuation would be different. We may or may not encounter a { character at the end of the line that marks the fold, but I do not see this as a problem either, because, again, we know by context. With these languages, indentation is not a factor, except for code-formatting reasons, visually. With the C-like languages, though, I feel that if VS Code would indicate which level we are examining, this would be very nice to have, and almost essential. This is because the user can only count on knowing levels if the code is formatted and the screen reader is set up to react to the formatting. A lot of us format code with tabs, rather than spaces for that reason. It's easy: one tab character per level. With JAWS, by default, there is a generic indentation speaking setting that either counts tabs or spaces. the user can undertake setting up what is called a sound scheme and force JAWS to say specialized messages or, if they are lucky enough to be able to hear musical tones and associate them with levels, play notes that were sampled from a piano. IF the user is using spaces, they must do the math quickly, and equate spaces with levels. This is not the worse thing in the world, but why increase the cognative overload when you do not have to. NVDA can indicate indentation by counting tabs or spaces. It can also play tones, but the tones are not tuned to, for instance, the C Major scale. For completeness, NVDA can speak indentation and play tones at the same time. Someone could also come up with an add-on that plays musical tones. Then we have VoiceOver, which I have not tried in VS Code yet, but have found that in other editors, also says the number of spaces or tabs, when Punctuation is set to all, as needs to be the case with the other screen readers, but when we write code, we must do that anyway. I rest my case. :) |
Hi, |
Hi, Is it possible to add an audio notification for folded state? So when i navigate to a folded line a beep or beep or indeed any sound is used as a notification point? |
@andadapt our approach in general is that VS Code does not produce custom sounds, we try to annotate everything and leave up the creation of sound to the screen reader. I am open for other ideas, however to have a rich experience we would probably need this #97154 @MarcoZehe maybe you have some creative ideas? |
Unfortunately, I don't. Such announcements always run the risk of drowning out the actual reading out of the line, e. g. you navigate onto the line with the arrow keys, and whichever fires first, e. g. the announcement or the reading of the line the cursor lands on, interrupts the other. The only true solution would be rich annotations. |
GitHubTags:#A11y_VSCode;#A11ySev1;#A11yTCS;#DesktopApp;#Visual Studio Code Client;#keyboard;#WCAG2.1.1;#Win10;#VisualStudioCode-Win32-Apr2021;#A11yMAS; |
@isidorn could the screen reader announce "Folded" or "Unfolded" when the user uses the keyboard shortcut to fold/unfold a region? That is also what Sublime Text reads out when you use the shortcut. I checked with VS, and they have a keystroke that lets users know what adornments are available on the line (e.g. Errors, Warnings, Quick Actions, Breakpoints, etc...) and collapsed regions are also included in that. |
@sana-ajani thanks for trying it out! I think the problem here is not that it user is not aware of the state after they execute an action, but if they later return to that location how will we announce that something is folded. Can you check what Sublime and VS announce in that case? I like the VS approach of command to announce adornments, but that is a workaround, which we might need to introduce as well. |
@isidorn at least with VoiceOver, Sublime doesn't announce that you're on a folded region if you come back to that location. In VS, when the user reads the text via navigation or keyboard command, they detect if the line contains a collapsed region and then append that to the text that’s read out i.e. "public class Foo (contains collapsed region)" |
@sana-ajani the VS behaviour is proper. The technical problem for us is that we can not easily append text to the content of the editor, we could also announce "contains collapsed region" using an alert however that has the problems as Marco pointed out above. |
Another way that I found in jetbrains product is to output the whole
collapsed region content on the line where it is collapsed. e.g. when you
navigate to a line that starts the import sectionand is collapsed by
default, NVDA reads as like all the imports are on that single line. so you
can quickly navigate over collapsed regions, but at the same time hear
their full contents if you just do nothing.
…On Fri, 12 Nov 2021 at 15:54, Isidor Nikolic ***@***.***> wrote:
@sana-ajani <https://github.com/sana-ajani> the VS behaviour is proper.
The technical problem for us is that we can not easily append text to the
content of the editor, we could also announce "contains collapsed region"
using an alert however that has the problems as Marco pointed out above
<#43262 (comment)>.
Thus we should go with the producing a short sound and we are working on
that. In the meantime can you file an exception for this? Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#43262 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4RZIERSBV3S6I5HIZP6DTULUMDBANCNFSM4EP4WRDQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I do not favor the concept of having the entire contents of a folded region rendered when one navigates to the line with the fold. The idea of folding is to move information that isn't relevant at the moment out of the way -- to keep cognitive load down. Having content which isn't relevant rendered is antithetical to that. |
Code folding is now enabled with screen readers. |
Issue Type
Bug
Description
Actual result:
the class will not be collapsed, cursor goes to next line in the file
Expected result:
Cursor should navigate to the next definition at the same level, e.g. class B:
additional info:
I'd like to be able to skip long blocks of code. Please make code folding work with screen reader enabled.
VS Code Info
VS Code version: Code 1.20.0 (c63189d, 2018-02-07T17:09:39.780Z)
OS version: Windows_NT x64 10.0.16299
System Info
Extensions (2)
The text was updated successfully, but these errors were encountered: