Skip to content

Menu bar keyboard/hover dispatch gaps (GTK arrow keys, TUI Alt conflicts, TUI hover) #308

Description

@JDonaghy

Context

Smoke testing the #301 menu bar → quadraui migration revealed three vimcode-side event dispatch gaps. None are quadraui primitive issues — they're all about how vimcode routes events to/from the menu bar.

Issues

1. GTK: Arrow keys don't navigate menu after Alt+F activation

Repro: GTK mode → Alt+F opens File menu → press Right arrow → cursor moves in editor instead of switching to Edit menu.

Cause: The GTK key handler doesn't check engine.menu_open_idx to route arrow keys (Left/Right/Up/Down/Enter/Escape) to the menu system when a dropdown is open. The handle_menu_bar_key() path is likely missing or not wired.

Fix: When engine.menu_open_idx.is_some(), intercept Left/Right (switch menu), Up/Down (navigate dropdown items), Enter (activate), Escape (close) before passing keys to the normal handler.

2. TUI: Some Alt+letter keys are already bound

Repro: TUI mode → Alt+E or other Alt+letter combos may trigger sidebar resize or other existing bindings instead of opening the corresponding menu.

Cause: vimcode's TUI key handler binds Alt+Left/Right for sidebar resize, and potentially other Alt combos. These take priority over menu bar Alt activation.

Fix: When menu_bar_visible, Alt+letter should check MenuBar::find_alt_target() first (or at least for the 7 menu letters: F/E/V/G/R/T/H). This may need a priority decision — menu bar Alt activation vs existing Alt bindings.

3. TUI: Hover-to-switch doesn't work

Repro: TUI mode → click File to open dropdown → move mouse to Edit label → dropdown doesn't switch.

Cause: The TUI mouse handler doesn't wire MouseMoved events to check MenuBarLayout::hit_test() for hover-to-switch when a dropdown is open. GTK has this via EventControllerMotion::connect_motion but TUI lacks the equivalent.

Fix: In the TUI handle_mouse() for MouseEventKind::Moved, when engine.menu_open_idx.is_some() and row == 0, hit-test against the cached menu_bar_layout and switch menus on MenuBarHit::Item(idx) where idx != current.

Notes

  • All three are pre-existing behavior gaps, not regressions from Migrate TUI menu bar to quadraui::MenuBar primitive #301. The old bespoke code had the same issues (GTK arrow keys never worked in menus, TUI never had hover-to-switch).
  • These are vimcode event-routing issues, not quadraui primitive gaps. quadraui#51 (CommandCenter) is correctly scoped to paint+layout+hit_test.

Priority

Low — menu bar keyboard navigation is a polish item, not a blocker for the Cross-Platform UI Crate milestone.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions