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

Improve VoiceOver experience when reordering menus #18155

Merged
merged 14 commits into from
Apr 8, 2022

Conversation

twstokes
Copy link
Contributor

@twstokes twstokes commented Mar 17, 2022

Closes #17121

Description

This PR aims to improve the VoiceOver experience when reordering menu items:

  1. When a menu item drag handle is selected, VoiceOver should no longer say "dimmed" which implies that the button isn't enabled.
  2. When a menu item drag handle is selected, VoiceOver should now mention that lateral movements can change the item's hierarchy.
  3. When a menu item label is selected (the main button), the button's parent is now included to give a sense of hierarchy.
  4. When a menu item is moved, VoiceOver now announces if the item has a new parent and / or is above or below a sibling.
Before (contains audio) 🔈 After (contains audio) 🔈
Before.MP4
After.MP4

Testing

ℹ️ Note: It can be helpful to enable triple-clicking to toggle VoiceOver.

Prerequisites:

  • A WordPress theme with menu support (any of the basic free themes should work)
  • A WordPress user with the permissions to edit menus

Preconditions for each test:

  • Access the Menus view from the "My Site" view
  • Match the "Before" menu structure if a test defines it (it can be helpful to toggle VoiceOver temporarily off while structuring the menu)
  • VoiceOver is enabled when the test is started
Test 1 - Move Item C to be a child of Item A, under Item B

Before:

  • Item A
    • Item B
      • Item C

After:

  • Item A
    • Item B
    • Item C

Expected VO (VoiceOver): "Child of [Item A], after [Child B]"

Test 2 - Move Item A to be a child of Item B

Before:

  • Item A
  • Item B

After:

  • Item B
    • Item A

Expected VO: "Child of [Item B]"

Note: If an Item C exists after Item B that Item A is inserted above, we still only expect "Child of [Item B]" and not "Child of [Item B] above [Item C]."

Test 3 - Move Item B to become a sibling of its parent at the top level

Before:

  • Item A
    • Item B

After:

  • Item A
  • Item B

Expected VO: "Top level. After [Item A]"

Test 4 - Move Item C to become a sibling of its parent

Before:

  • Item A
    • Item B
      • Item C

After:

  • Item A
    • Item B
    • Item C

Expected VO: "Child of [Item A]. After [Item B]"

Test 5 - Move Item A after Item B

Before:

  • Item A
  • Item B

After:

  • Item B
  • Item A

Expected VO: "After [Item B]"

Test 6 - Move Item B above Item A

Before:

  • Item A
  • Item B

After:

  • Item B
  • Item A

Expected VO: "Before [Item A]"

⚠️ Known Limitations:

If Item A is moved quickly to be a child of Item B below existing children, VO will not announce the new parent. This is due to multiple VO events firing in quick succession and it's using the latest VO string (which is equivalent to Test 5).

Example:

Before:

  • Item A
  • Item B
    • Item C
    • Item D
    • Item E
    • Item F

After:

  • Item B
    • Item C
    • Item D
    • Item A
    • Item E
    • Item F

Expected VO: "After [Item D]"

The same applies in the opposite direction:

If Item A is moved quickly to be a child of Item B above existing children, VO will not announce the new parent. This is because multiple VO events fired due to the quick succession and it's using the latest VO string which is equivalent to Test 6.

Test 7 - Hover over the main button Main button for a menu item

If a child of a menu item:

Expected VO: "[Name of item] child of [parent menu item]. Button. Edits this menu item."

If the top level (no parent):

Expected VO: "[Name of item] top level. Button. Edits this menu item."

Test 8 - Hover over the drag handle Drag handle for a menu item

Move the VoiceOver focus to the drag handle on the right of a menu item.

Expected VO: "Move [name of item]. Button. Double-tap to move this menu item up or down. Move horizontally to change hierarchy."

VO no longer announces "Dimmed" as the button state. More context.

Test 9 - Saving reordered menu items
  1. Reorder menu items using VoiceOver and save the menu structure.
  2. Confirm that the new menu structure is reflected in the app and on the web.

Test cases:

- [ ] Test 1 - Move Item C to be a child of Item A, under Item B
- [ ] Test 2 - Move Item A to be a child of Item B
- [ ] Test 3 - Move Item B to become a sibling of its parent at the top level
- [ ] Test 4 - Move Item C to become a sibling of its parent
- [ ] Test 5 - Move Item A after Item B
- [ ] Test 6 - Move Item B above Item A
- [ ] Test 7 - Hover over the main button
- [ ] Test 8 - Hover over the drag handle
- [ ] Test 9 - Saving reordered menu items

Regression Notes

  1. Potential unintended areas of impact
  • Menu ordering
  • Menu saving
  • VoiceOver output on the Menus view
    • Creating menu items
    • Deleting menu items
    • Moving menu items
    • Hovering over menu items
  • Localization of VoiceOver strings

Functionality to the Menus view should be unchanged when VoiceOver is off.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)
    I manually tested all tests above.

  2. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@twstokes twstokes self-assigned this Mar 17, 2022
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 17, 2022

You can test the Jetpack changes on this Pull Request by downloading it from AppCenter here with build number: pr18155-5c4e4be. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 17, 2022

You can test the WordPress changes on this Pull Request by downloading it from AppCenter here with build number: pr18155-5c4e4be. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@twstokes twstokes force-pushed the feature/menu-vo-order branch from d4fc778 to faed559 Compare March 20, 2022 23:27
@twstokes twstokes force-pushed the feature/menu-vo-order branch from faed559 to 5c4e4be Compare March 21, 2022 20:49
@twstokes twstokes changed the title Improve VoiceOver experience in Menus view Improve VoiceOver experience when reordering menus Mar 21, 2022
@twstokes twstokes added the Menus label Mar 21, 2022
@twstokes twstokes added this to the 19.6 milestone Mar 21, 2022
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 29, 2022

You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below
  • Then installing the build number pr18155-c41c600 from App Center on your iPhone

The .ipa file can also be downloaded directly here.
If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 29, 2022

You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below
  • Then installing the build number pr18155-c41c600 from App Center on your iPhone

The .ipa file can also be downloaded directly here.
If you need access to App Center, please ask a maintainer to add you.

@twstokes twstokes force-pushed the feature/menu-vo-order branch 2 times, most recently from 8a6463f to f7275d5 Compare March 31, 2022 21:57
@twstokes twstokes force-pushed the feature/menu-vo-order branch from f7275d5 to 7cbfaf0 Compare March 31, 2022 21:57
@mokagio
Copy link
Contributor

mokagio commented Apr 3, 2022

I'm going to bump this to the next release because we'll be code freezing 19.6 next week and this is still a draft.

It doesn't seem the case, but if it's very important that this makes it into this release, let me know and we'll organize a new beta once ready.

@mokagio mokagio modified the milestones: 19.6, 19.7 Apr 3, 2022
@twstokes
Copy link
Contributor Author

twstokes commented Apr 3, 2022

Thanks @mokagio, 19.7 works just fine.

@twstokes twstokes marked this pull request as ready for review April 5, 2022 15:36
@guarani
Copy link
Contributor

guarani commented Apr 8, 2022

Test 4 - Move Item B to become a sibling of its parent

I think this should say "Item C", but I'm loving how neatly set out the test cases are.

@guarani guarani self-requested a review April 8, 2022 19:54
@twstokes
Copy link
Contributor Author

twstokes commented Apr 8, 2022

Test 4 - Move Item B to become a sibling of its parent

I think this should say "Item C", but I'm loving how neatly set out the test cases are.

Thanks @guarani! This is now fixed.

Copy link
Contributor

@guarani guarani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested using build pr18155-c41c600 and everything works as expected, nice work @twstokes!

  • Test 1 - Move Item C to be a child of Item A, under Item B
  • Test 2 - Move Item A to be a child of Item B
  • Test 3 - Move Item B to become a sibling of its parent at the top level
  • Test 4 - Move Item C to become a sibling of its parent
  • Test 5 - Move Item A after Item B
  • Test 6 - Move Item B above Item A
  • Test 7 - Hover over the main button
  • Test 8 - Hover over the drag handle
  • Test 9 - Saving reordered menu items

let entityName = MenuItem.classNameWithoutNamespaces()
let entity = NSEntityDescription.insertNewObject(forEntityName: entityName, into: context)

let menuItem = entity as! MenuItem
Copy link
Contributor

@guarani guarani Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick comment] XCTUnwrap(entity as? MenuItem) could be used here, but I'm not sure if it fits this context since this is a helper method and if the force-cast failed, it would be due to a programming error rather than a test failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good thought @guarani! Since the type shouldn't change and this is in the context of a test, I'm considering letting it stay as is. I believe this could only fail if some really bad stuff happened under the hood with Core Data.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

@twstokes twstokes merged commit 9dddadb into trunk Apr 8, 2022
@twstokes twstokes deleted the feature/menu-vo-order branch April 8, 2022 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility: Menus not draggable over VoiceOver
4 participants