You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rune-kit Menu and PopupList: submenus have no keys or hover-open, items are keyed by position, names can't differ from the drawn text, and list items take no rich label #1387
Context: Strata (lgse/strata), a file manager on Rune.
What's missing (67d73a5f):
Submenu keyboard & hover:MenuItem::submenu(entries, open) (rune-kit/src/overlays/menu.rs:103-106, 222-236) opens only when the app sets it open; VERTICAL_ROLES (runtime/input/focus.rs:6) gives "menu" only Up/Down/Page/type-select — no Right, Left, Enter or Space on a submenu row to enter/leave it, and no hover-open with delay.
Positional item keys:MenuItem is keyed by position {key}-item{i} (overlays/menu.rs:336), so a row inserted above the focused one moves focus.
Accessible names:Menu (overlays/menu.rs:244-322) takes no .label(...), and MenuItem uses its drawn text for .label(self.label) (:168), so a middle-elided breadcrumb item reads shortened.
Rich PopupList items & reuse:PopupItem (overlays/popup_list.rs:15-61) takes only a String label (no spans or label_with(El)), so a completion list can't bold/colour the matched part, and PopupListCore::build_list (:167) is pub(super), so an app can't reuse the list inside its own popup.
Ask. Right, Left, Enter and Space on submenu rows with focus moving into the submenu, and hover-open with a delay; MenuItem::key; Menu::label and MenuItem::label apart from the drawn text; PopupItem::label_with(El) (or spans) and a public PopupList::build_list.
MenuItem::key(impl Into<String>) for stable item keys (blank falls back to positional {menu_key}-item{i}, preserving focus when rows are inserted above and anchoring submenus to {key}).
Menu::label(impl Into<String>) and MenuItem::a11y_label(impl Into<String>) for accessible names independent of drawn text (following WAI-ARIA APG; MenuItem::a11y_label also drives menu typeahead and names open submenus, and role="menu" now mirrors with aria-label on the web). Named a11y_label rather than label so it stays distinct from the drawn text passed to MenuItem::new—let us know if you would prefer a different name.
PopupItem::label_with(El) (hides custom spans from assistive tech while keeping PopupItem::new's string as the option's accessible name) and PopupList::build_list(&Kit) -> El for standalone reuse.
let item = MenuItem::new("…/menu.rs").key("menu-rs").a11y_label("crates/rune-kit/src/overlays/menu.rs");let menu = Menu::new("file").label("File actions").item(item);let list = PopupList::<App>::new("cmds","").label("Commands").items([PopupItem::new("rev","/review").label_with(row().child(text("/rev")).child(text("iew")))]).build_list(&k);
Examples are in examples/kit-gallery (rune-menu--submenu-options and rune-popup-list--rich-inline).
Tested: headless layout, focus, AccessKit, and web-mirror tests on Windows and macOS, Linux aarch64 compile check, wasm32/WebGL2 compile checks, and headless Chromium software WebGPU/WebGL2 smoke checks.
Not run live: no live GUI window or real screen reader was launched.
Still open on this issue
Submenu keyboard navigation (Right/Left/Enter/Space to open/enter/leave a submenu).
Thanks for the detailed write-up. As noted above, #1964 already shipped MenuItem::key, Menu::label / MenuItem::a11y_label, PopupItem::label_with(El) and a public PopupList::build_list, so this issue now covers only the submenu interaction.
On current dev, MenuItem::submenu(entries, open) (crates/rune-kit/src/overlays/menu.rs) still opens only when the app sets open, and VERTICAL_ROLES (crates/rune/src/runtime/input/focus.rs) still gives "menu" only vertical navigation. I found no submenu key handling and no hover-open delay. What's left:
On a submenu row, Right / Enter / Space open the submenu and move focus to its first item; Left (and Escape inside it) closes the submenu and returns focus to the parent row. Left and Right swap for submenus placed on the left or in right-to-left layouts.
Pointer hover over a submenu row opens it after a short delay, and leaving closes it.
I'll keep this open as a feature request for that work.
I've opened a PR for the remaining submenu work. It adds MenuItem::on_submenu(|s, open| ..), which hands the menu your submenu open flag:
Keys on a submenu row: Right, Return or Space opens the submenu and moves focus to its first item.
Keys inside the submenu: Left or Escape closes just the submenu and puts focus back on the row. In a menu with on_close, the parent menu stays open.
Right to left: the arrows swap, matching the chevron. A submenu that flips sides only because it ran out of room keeps Right to open and Left to close.
Hover: resting the pointer 200 ms on the row opens its submenu, and resting on another row of the same menu (disabled rows included) closes it.
Closing the menu: Escape, a press outside, or picking an item (other than a checkbox or radio) also closes the open submenus through your callback, so the menu reopens with them closed. If you close the menu any other way, clear the flags yourself.
All on_submenu callbacks in one menu need to use the same state type. These were checked in headless tests only, not in a live window or with a screen reader.
Activity
Hona commentedon Nov 24, 2026
Part of this is now on
devin #1964 (cd4ad9a70), keeping this issue open for the remaining submenu interaction work.Shipped in #1964 (
cd4ad9a70)MenuItem::key(impl Into<String>)for stable item keys (blank falls back to positional{menu_key}-item{i}, preserving focus when rows are inserted above and anchoring submenus to{key}).Menu::label(impl Into<String>)andMenuItem::a11y_label(impl Into<String>)for accessible names independent of drawn text (following WAI-ARIA APG;MenuItem::a11y_labelalso drives menu typeahead and names open submenus, androle="menu"now mirrors witharia-labelon the web). Nameda11y_labelrather thanlabelso it stays distinct from the drawn text passed toMenuItem::new—let us know if you would prefer a different name.PopupItem::label_with(El)(hides custom spans from assistive tech while keepingPopupItem::new's string as the option's accessible name) andPopupList::build_list(&Kit) -> Elfor standalone reuse.Examples are in
examples/kit-gallery(rune-menu--submenu-optionsandrune-popup-list--rich-inline).Still open on this issue
Right/Left/Enter/Spaceto open/enter/leave a submenu).opencodejr commentedon Nov 25, 2026
Thanks for the detailed write-up. As noted above, #1964 already shipped
MenuItem::key,Menu::label/MenuItem::a11y_label,PopupItem::label_with(El)and a publicPopupList::build_list, so this issue now covers only the submenu interaction.On current
dev,MenuItem::submenu(entries, open)(crates/rune-kit/src/overlays/menu.rs) still opens only when the app setsopen, andVERTICAL_ROLES(crates/rune/src/runtime/input/focus.rs) still gives"menu"only vertical navigation. I found no submenu key handling and no hover-open delay. What's left:Right/Enter/Spaceopen the submenu and move focus to its first item;Left(andEscapeinside it) closes the submenu and returns focus to the parent row. Left and Right swap for submenus placed on the left or in right-to-left layouts.I'll keep this open as a feature request for that work.
opencodejr commentedon Nov 25, 2026
I've opened a PR for the remaining submenu work. It adds
MenuItem::on_submenu(|s, open| ..), which hands the menu your submenu open flag:on_close, the parent menu stays open.All
on_submenucallbacks in one menu need to use the same state type. These were checked in headless tests only, not in a live window or with a screen reader.Fixed in #2204.