Hello,
I am currently improving accessibility of a view-based table with a single column. Here is an image how the cell view (a subclass of NSTableCellView) looks like:
<PastedGraphic-1.png>
In other words (and for those who cannot see the image), there are 4 elements inside the cell view (I number them in the desired order to be spoken):
- 1: “Autorelease Pool” - uneditable text field (i.e. label) containing the main information of this item (the name of the whole row); it’s the “textField” property of NSTableCellView
- 2: image with “S” sign - signifies the type of the item (in this case, this means that the item type is a Snippet); it’s the “imageView” property of NSTableCellView
- 3: “Objective-C > Idioms” - uneditable text field (i.e. label) that says which bundle (plugin) did this item (command) come from
- 4: “pool
“ - uneditable text field (i.e. label) that specifies the keyboard shortcut (in this case tab trigger) that invokes the item (snippet) should one want to learn it for quick access to the item (snippet)
Now the default accessibility I get from AppKit when VoiceOver cursor lands on the NSTableCellView as a whole is that it says “pool⇥, Autorelease Pool, Objective-C ▸ Idioms, Snippet image completion selected”. Here I list 2 steps I want to take
to improve this experience along with hurdles I met and how I unsuccessfully tried to overcome them:
1. Order of items
The desired order of the items is 1, 2, 3, 4, but VoiceOver speaks them in order 4, 1, 3, 2. No idea how VoiceOver arrived at that order, it’s not even the usual “visual” "left-right then next row” order. Note that I am not speaking about the
order VoiceOver traverses the items when interacting with the cell view, but about the order VoiceOver uses to create a “summary” of the cell view when not interacting with it.
What I tried: overriding accessibilityAttributeValue to supply the order 1, 2, 3, 4 for AXChildren attribute. (I did supply the views’ cells, not the views themselves)
Result: The order changed, but to 1, 3, 4, 2 - again no idea why. At least 1 is first. :-). Accessibility inspector shows order 1, 2, 3, 4 for AXChildren of the AXCell.
2. Summary (description) for the whole NSTableCellView
It would be ideal for me to be able to set the summary of the whole cell that VoiceOver speaks when not interacting with the cell. It would allow me more freedom to choose the most comprehensible description that is not just the comma-separated
descriptions of the cell’s subviews strings together in some order. E.g. I could do this: “Autorelease Pool, Snippet from Idioms section of Objective-C bundle, tab trigger is pool”. I don’t think that is ever achievable just by setting attributes of the individual
subviews of NSTableCellView.
The motivation for preferring this is that users will 98% of the time not interact with the individual rows, but go over them with arrows and try to quickly find the row they need. So the description spoken for the whole NSTableCellView must be
really optimized - include the most crucial “filtering” piece of information first, and should the user choose to continue to listen after this piece of information, the rest of the description should be comprehensible and friendly. If users interact with
the NSTableCellView and get a little bit of discomfort by having non-ideal order of items and a bit “robotic” descriptions (like “Snippet image”), that that’s acceptable as they will do so seldom.
What I tried: Setting AXDescription of the NSTableCellView (by overriding accessibilityAttributeValue: for AXDescription and at the same time returning AXDescription in accessibilityAttributeNames)
Result: no change at all when not interacting with the NSTableCellView. Just in Accessibility Inspector, the AXCell does show the AXDescription I specified.
Please advise preferably how to implement option 2. (custom description spoken for the whole NSTableCellView), and if not possible, at least option 1. (change order of subviews spoken in VoiceOver-autogenerated description of the NSTableCellView).
Thanks in advance for any suggestions,
Boris