[program-l] Screen readers and collapsed regions

  • From: "Dante Gagne" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "danteg" for DMARC)
  • To: "program-l@xxxxxxxxxxxxx" <program-l@xxxxxxxxxxxxx>
  • Date: Mon, 19 Apr 2021 23:30:00 +0000

Hey folks,

Item just came up on my list and I've got an IDEA on how it should be 
addressed, but I'd love feedback. Visual Studio provides "outlining" which 
allows the user to collapse or expand regions of code for ease of navigation. 

For instance consider the following (I'm including line numbers for 
understanding)

17 LineBeforeRegion()
18 #region MySample
19 CodeInRegion()
20 #endregion
21 LineAfterRegion()

In Visual Studio, you can use Ctrl+M, Ctrl+M to toggle outlining. If you were 
to do that on line 18 here, the sighted user would see:

17 LineBeforeRegion()
18 MySample
21 LineAfterRegion()

However, line 18 would have a visual adorner to show that it's a collapsed 
region. It's a single atomic unit, you can't use the cursor keys to navigate 
into it or anything like that.

The issue is that the visual adorner on line 18 is not actually part of the 
text buffer so it's completely invisible to the screen reader. To a screen 
reader user, this code is more like:

17 LineBeforeRegion()
18 
21 LineAfterRegion()

Which is probably quite frustrating. (If anyone has run into this, you can use 
Ctrl+M, Ctrl+L to toggle ALL outlining, which will expand everything. You can 
also use Ctrl+M, Ctrl+P to expand all the regions and disable outlining 
altogether).

Now to my question. I want to fix this issue. What would folks want to hear on 
line 18? I don't want to just say "MySample" since it would sound like code and 
be indistinguishable. I hesitate to say "Begin Collapsed Region MySample End 
Collapsed Region" since that feels like overkill. For the record, it is 
possible to have a collapsed region in the middle of text, so if you were to 
try really hard you could have

18 SomeCode() CollapsedRegion SomeOtherCode()

Where "CollapsedRegion" is a collapsed region, but the SomeCode() and 
SomeOtherCode() is legitimate code.

I should also point out that the Region identifiers won't be navigable by 
character or anything, so right now, it's effectively a single character. We 
are looking into a better fix there, but there are a lot of issues with that 
(e.g. what happens if you're inside one of those regions and type a letter. 
What would that do?). 

I currently don't have a solution better than saying "Collapsed: identifier", 
realizing that the string might have code before or after that would be rather 
ambiguous. So, that's what I'm going to currently go with. But if folks have 
something they think would be more useful, I would love to hear it.

As always, thanks for whatever advice you're willing to give!

--Dante
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: