wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.68k stars 1.12k forks source link

Custom Calendar: accessibility issues #15722

Open leandroalonso opened 3 years ago

leandroalonso commented 3 years ago

Our custom calendar has accessibility issues. Both when scheduling a post and when selecting a date range from Activity Log:

How to reproduce

  1. Open Activity Log for any site with available filters
  2. Using Voice Over, test the aforementioned items

Prioritised tasks from investigation

startuptester commented 3 years ago

@shiki made excellent points about this. I want to highlight what he said about the importance of considering existing mental maps.

_I only know that we can ask VoiceOver to speak a custom message using UIAccessibility.post() with announcement. I’m not sure if we can turn off the automated VoiceOver announcement when scrolling. In any case, this would probably be a fairly custom implementation.

We also have to be mindful that when customizing a VoiceOver behavior, it may end up surprising regular VoiceOver users. Hearing “Page 1 of 132” may be something that they already expect and are fine with it.

My advice is that this is probably okay as long as there are appropriate heading accessibility traits so that the reader can navigate using headings by using the rotor. Navigating by headings is more useful than scrolling_. - @shiki

joshheald commented 2 years ago

I've done some investigation on this ticket, and wanted to share my thoughts before writing any code.

I've confirmed that the Calendar view is only used in Activity Log filters, and for scheduling a post's publishing time, as covered in the ticket.

Issues from ticket:

Further issues found:

Activity Log

Data entry

Should we consider providing a text field to enter dates as a further enhancement here? It would require more validation than the calendar selection, but is a straightforward way to enter the value desired.

joshheald commented 2 years ago

Prioritised tasks

joshheald commented 2 years ago

@leandroalonso @startuptester I'd like your thoughts on something... The biggest accessibility improvement to be made here might be to use system controls where we can, or at least where the custom calendar control gives us little benefit.

On Schedule Post, we only allow the user to select one date and time. This makes it an ideal case for using UIDatePicker, which supports this out of the box. I notice the app supports iOS 13.0 and above. From iOS 13.4 onwards, we can use UIDatePickerStyle.compact which provides a text field that expands when tapped to show a calendar, with a time component too: compact date picker in popover

From iOS 14 onwards, we can use UIDatePickerStyle.inline, which would let us put that same interface in a slide up view as we have in the code at the moment, without forcing it to be in a popover.

For post scheduling, UIDatePicker would likely be better for both people using VoiceOver/Dynamic Type, who would not face the issues we're trying to resolve here. It would also be better for people not using those assistive technologies, as it would give quicker options for navigating to a specific date using the month/year dropdowns which are available in the system control.

We could either fall back to the standard wheels for iOS 13.0-13.3, or use the custom calendar.

For the Activity Log filter, I think we should keep the custom calendar for its benefits in visualising a range of dates. Those benefits are significantly reduced for VoiceOver users, so we could change the interface to use two UIDatePickers when VoiceOver is in use.

leandroalonso commented 2 years ago

The biggest accessibility improvement to be made here might be to use system controls where we can, or at least where the custom calendar control gives us little benefit.

I agree! 100% for using system controls. :)

From iOS 13.4 onwards, we can use UIDatePickerStyle.compact which provides a text field that expands when tapped to show a calendar, with a time component too:

How would that look like when publishing a post in the bottom sheet? The sheet would increase its size?

I'd focus on the post flow given it's one of the core flows of the app. If you have time left later, then we can tackle Activity Log. Wdyt?

startuptester commented 2 years ago

I agree! 100% for using system controls. :)

Agreed!

without forcing it to be in a popover.

I like this part, but I'm having trouble visualizing it.

How would that look like when publishing a post in the bottom sheet? The sheet would increase its size?

This Kudos to you for thinking about both sides of the accessibility coin in this decision 👍

joshheald commented 2 years ago

@startuptester @leandroalonso Sorry for the lack of clarity on this. Here's an example of the default .compact behaviour – there's no increase to the size of the sheet, it's a popover above the sheet.

https://user-images.githubusercontent.com/2472348/149976054-2ced132c-8367-4f9f-b602-65aeb8b7d069.mp4

From iOS 14+, we have the option of using .inline, which would be much more like the existing view, you'd need to tap through from the initial publish sheet to a screen with a calendar on it. It would just use a system control.

Personally, I quite like removing the taps through the hierarchy, as in the video above, and think we could use that regardless of iOS version.

leandroalonso commented 2 years ago

Personally, I quite like removing the taps through the hierarchy, as in the video above, and think we could use that regardless of the iOS version.

I think the number of taps in the current solution only requires a single additional tap but I get when you mentioned the hierarchy (not to take into account the accessibility, which is the whole reason behind these changes).

There's only one thing I'm missing in your example which I'm quite not sure how to solve. The original has an option to reset this change by tapping "Publish immediately".

Any suggestions on how we would add this same feature here?

joshheald commented 2 years ago

I think the number of taps in the current solution only requires a single additional tap Yeah, agreed, it's not a lot less taps (unless you are changing the month quite a lot, which is unlikely for this use case!)

The original has an option to reset this change by tapping "Publish immediately". Any suggestions on how we would add this same feature here?

With it in the cell, as per the video, the only thing I can think of is a cell swipe action, which is a bit hidden. We could spread the Publish Date over two rows, giving space to include a "Publish immediately" or reset type button...

startuptester commented 2 years ago

I really love this idea.

a cell swipe action, which is a bit hidden.

Agreed, I definitely don't think we should go that way.

over two rows, giving space to include a "Publish immediately" or reset type button

Does it have to be a in a separate row? Is something like an undo icon/button beside the time field not feasible?

joshheald commented 2 years ago

Having just checked a smaller device, it will need more space regardless, because on the smallest devices the date picker already crashes in to the label. This will also be present (and worse) on larger devices when Dynamic Type is set to larger sizes.

iPod Touch Date Picker single row

I think an undo/clear button will work well though. I'm going to see what I can do with dynamically resizing the row to make it double height when it needs to be, and include a 🅧 button when there's a value set, i.e. allow people to reset to "publish immediately."

startuptester commented 2 years ago

I was thinking more like an undo icon, like ↩️ to signify that it will reset to default, rather than clear the field.

Other than that, it sounds good! Nice call on the screen sizes. 👍

joshheald commented 2 years ago

@startuptester @leandroalonso Closing the loop: #17799 changes this to use the UIDatePicker.inline on iOS 14 and above. Unfortunately, I wasn't able to get the approach above with the date picker in the cell to work well on all the different devices, it was just too constrained and AutoLayout was not my friend.

I hope you agree that the implementation I've gone with is still an improvement for those on iOS 14 and above, particularly in terms of accessibility.

joshheald commented 2 years ago

I'm going to drop this issue now, since my rotation has ended, but there's more stuff to do here when someone else has time to jump into it 😊

To whoever does pick this up: I'm more than happy to chat through the issue if that would be helpful.