Repository navigation
Build the layer options menu with downshift instead of react-aria-menubutton - #2409
Merged
HarelM merged 2 commits intoDec 5, 2026
Conversation
react-aria-menubutton was only used for the layer options menu in the layer editor header. The menu is now a LayerEditorMenu component built on downshift's useSelect, which the project already uses, and react-aria-menubutton is removed. The menu keeps its items, test ids and the skip-link target id, and stays open after an action. The existing `disabled` flag on "Move layer up/down" is now honored.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2409 +/- ##
==========================================
+ Coverage 86.79% 86.82% +0.02%
==========================================
Files 107 108 +1
Lines 3409 3408 -1
Branches 892 882 -10
==========================================
Hits 2959 2959
+ Misses 449 448 -1
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
Did you test the menu in RTL context? I seem to remember issues back then... |
HarelM
reviewed
Dec 5, 2026
HarelM
reviewed
Dec 5, 2026
Use the shouldBeDisabled helper instead of a raw expect, and position the menu with inset-inline-end.
Contributor
Author
|
I hadn't, sorry. I've checked it now in Hebrew: the menu opens toward the inside of the layer editor. I replaced the |
HarelM
approved these changes
Dec 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #846.
react-aria-menubuttonwas only used for the "Layer options" menu in the layer editor header. This PR builds that menu withdownshift'suseSelect, which the project already uses for the autocomplete and sprite inputs, and removesreact-aria-menubuttonand its types frompackage.json.The menu is a new
LayerEditorMenucomponent:data-wd-keys, and the button keeps theskip-target-layer-editorid, so the skip link still focuses it.closeOnSelection={false}); it now usesuseSelect's default.inset-inline-end, which replaces the separate[dir="rtl"]rule.One more change: the items already had a
disabledflag for "Move layer up" on the first layer and "Move layer down" on the last one, butreact-aria-menubuttonnever used it.useSelectsupports it (isItemDisabled), so those two items are now dimmed and skipped.Screen readers now hear the button as a combobox with a listbox, the pattern
useSelectfollows, instead of a menu button.Both show the menu opened with the keyboard and the second item highlighted. The after image is on the first layer, so "Move layer up" is dimmed.
Performance: no measurable impact. It's one small menu that only renders its items while open, and the bundle loses one dependency.
Launch Checklist
layer-editor.spec.ts("layer options menu"): keyboard selection, closing after a click, Escape, the disabled item (newshouldBeDisabledhelper), and the menu staying inside the layer editor in Hebrew. The existing menu tests (delete and move via the menu, skip link) still pass.CHANGELOG.mdunder the## mainsection.Tested locally:
npm run lintandnpm run lint-cssclean,npx vitest run(59 passed), full e2e withnpx playwright test(231 passed). I also checked the menu by hand in English and Hebrew.Assisted-By: Claude Opus 5.5 (Claude Code). It helped write the component, the tests and this description. I've reviewed and tested the change and can answer questions about it.