Skip to content

Refactor MenuDropdown and replace sui.DropdownMenu in settings and docs #10726

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

riknoll
Copy link
Member

@riknoll riknoll commented Jul 1, 2025

this refactors the react-common MenuDropdown quite a bit and replaces the sui.DropdownMenu in the (?) and cog wheel icons in the top bar.

noticeable changes include:

  • pressing tab while the dropdown pane is open now closes the pane and navigates to the next element in the page. previously tab could be used to move to the next menuitem in the dropdown pane in addition to the arrow keys, but the standard behavior is to only allow navigation between menuitems with the arrow keys
  • all elements in the dropdown pane are now replaced with the semantically correct HTML elements:
    • the outer pane/focus trap is now a <ul role="menu">
    • each subgroup of items is a <li role="none"><ul role="group">
    • external link menuitems are now <a role="menuitem">
    • checkbox menuitems are <li role="menuitemcheckbox">
    • all other menuitems are <li role="menuitem">
  • the settings/docs menus now scroll instead of overflowing the page
  • focus styling for elements in the dropdown pane is now more consistent with our other elements (uses the standard 3 pixel focus border)

i referred heavily to the w3c navigation menubar and editor menubar examples to make sure i was matching their behavior/structure

this change also involved a lot of tweaks to the FocusTrap component, some of which make the FocusList component obsolete. after this is merged i think i'll rename FocusTrap to FocusManager (or something like that), get rid of FocusList and clean up some of the options to make them easier to understand

since this PR is pretty big, we might not want to take it for this release because we're so late in the current release cycle. that being said, we might be able to hotfix it later

here is an upload target: https://makecode.microbit.org/app/b593582fb02e4fb5b20cb4afd83ec59549642d1b-9835ad0d78

@microbit-matt-hillsdon FYI

@riknoll riknoll requested a review from a team July 1, 2025 22:34
@riknoll riknoll marked this pull request as draft July 1, 2025 22:44
@riknoll
Copy link
Member Author

riknoll commented Jul 1, 2025

making draft until we have a stable branch in pxt to work off of

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.

1 participant