Skip to content

Keyboard accessibility for the MelodySandbox field.#10591

Merged
riknoll merged 3 commits intomicrosoft:masterfrom
microbit-matt-hillsdon:melodysandbox-keyboard-accessibility
May 23, 2025
Merged

Keyboard accessibility for the MelodySandbox field.#10591
riknoll merged 3 commits intomicrosoft:masterfrom
microbit-matt-hillsdon:melodysandbox-keyboard-accessibility

Conversation

@glastonbridge
Copy link
Contributor

Demo link https://melodysandbox-keyboard-acces.review-pxt.pages.dev/

This makes the MelodySandbox and gallery easily navigable with the keyboard, including

  • keyboard handling
  • Tab and arrow key navigation as appropriate and with reference to WAI-ARIA including role information.
  • visible focus highlighting
  • keyboard focus trapping while working in the editor

Architecturally, it now shares common code with the LED matrix field, to facilitate consistent changes across accessible matrix elements.

Screen.Recording.2025-05-06.at.16.01.16.mov

Melody Editor interaction changes

The melody editor is a single tab stop, navigating with the arrow keys following the WAI-ARIA grid pattern. Up and down arrow keys immediately change the pitch of a note if it is enabled, space enables or disables the note on a given column. We tried several approaches and sought feedback from our accessibility advisor, and this was the most intuitive and playful.

Gallery interaction changes

The gallery is also in a grid pattern, and behaves similarly. It is a single tab stop with arrow navigation for selecting or previewing a note, and space to select.

Both the editor and gallery screens make use of a keyboard focus trap to ensure tabbing behaviour is consistent while using the component.

Common matrix refactor

There is now an abstract field_matrix from which field_ledmatrix and field_melodySandbox inherit to extend their own matrix interfaces. Many of the accessibility changes were being duplicated across both elements, such that sharing the common concerns made sense.

* Key navigation
* Focus behaviour
* Refactored common behaviour between MelodySandbox and LED Matrix to extend from abstract class
* Align gallery behaviour with Sound Effect editor
@glastonbridge
Copy link
Contributor Author

Hi @riknoll, thanks for the feedback! I've made the changes you suggested.

@riknoll riknoll enabled auto-merge (squash) May 23, 2025 16:45
@riknoll riknoll merged commit 3c87fa3 into microsoft:master May 23, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants