Skip to content

fix(hud): keyboard navigation in the language menu - #1050

Merged
EtienneLescot merged 1 commit into
mainfrom
fix/1015-hud-language-menu-keys
Oct 7, 2026
Merged

EtienneLescot merged 1 commit into
mainfrom
fix/1015-hud-language-menu-keys

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Related issue

Closes #1015

Type of change

  • Bug fix

Release impact

  • Patch

Desktop impact

  • Not platform-specific

Testing

  • New LaunchWindow tests: focus on open, arrows with wrap, Enter picks. They fail without the fix.
  • Targeted vitest (LaunchWindow, editor v4 top bar): 326 passed. Both tsc configs and Biome.
  • Not done: a real OS keyboard on the HUD, macOS.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Menus now move focus between items with the up and down arrow keys, wrapping between the first and last options.
    • The language menu focuses the currently active language when opened.
    • Pressing Enter selects the focused language and closes the menu. Arrow-key navigation does not change the selected language.

Opening the HUD language menu now focuses the language in use, and
ArrowUp/ArrowDown move between languages, wrapping. The arrow handling is
the editor wordmark menu's, moved to src/lib/menuKeyboard.ts so both
menus share it.
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 47321621-af61-4087-9c6a-3e892d3abfdd
📥 Commits

Reviewing files that changed from the base of the PR and between c3b2cad and b0a9c5c.

📒 Files selected for processing (4)
  • src/components/ai-edition/v4/EditorTopBar.tsx
  • src/components/launch/HudControls.tsx
  • src/components/launch/LaunchWindow.test.tsx
  • src/lib/menuKeyboard.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

A shared helper handles arrow-key focus movement in the editor app menu and HUD language menu. The HUD language menu focuses the active locale when it opens. Tests cover focus, navigation, and locale selection.

Changes

Menu keyboard focus

Layer / File(s) Summary
Arrow-key focus helper
src/lib/menuKeyboard.ts
Adds moveMenuFocus to handle ArrowUp and ArrowDown navigation between menu items, including wrapping.
Menu integration and validation
src/components/ai-edition/v4/EditorTopBar.tsx, src/components/launch/HudControls.tsx, src/components/launch/LaunchWindow.test.tsx
The editor app menu and HUD language menu use the shared helper. The HUD menu focuses the active locale on mount. Tests cover initial focus, wrapping navigation, and selecting a locale with Enter.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: my-denia

Merge Risk: ⚪ Minimal · up to b0a9c

The language menu’s keyboard navigation is covered by the supplied tests, with no established issue blocking merge.

🚥 Pre-merge checks | ✅ 3 | ❌ 1 | ❓ 1

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive [#1015] The PR adds HUD language-menu focus and wrapped arrow navigation, and its tests cover focus, wrapping, and Enter selection. The HUD Escape handler closes the menu and refocuses its trigger. Th… Provide reviewable source or test evidence that Escape closes the arrow annotation colour popover. The current description establishes Chromium behavior only and says the macOS check was not done.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the HUD language menu keyboard-navigation change.
Description check ✅ Passed The description covers the summary, related issue, change type, release impact, desktop impact, and testing. It also states that macOS keyboard checks were not done. The screenshots/video section is o…
Out of Scope Changes check ✅ Passed All changed code supports [#1015]. The shared arrow-key helper serves both the HUD language menu and the editor wordmark menu. The HUD focus change and added tests support keyboard navigation in the l…
Full details: Linked Issues check

Explanation

[#1015] The PR adds HUD language-menu focus and wrapped arrow navigation, and its tests cover focus, wrapping, and Enter selection. The HUD Escape handler closes the menu and refocuses its trigger. The editor wordmark menu also closes on Escape and returns focus to its trigger. The PR description reports that the annotation colour popover closes on Escape in Chromium, but provides no source or test evidence for that popover, and the macOS check remains undone. The full Escape requirement for all three surfaces is therefore not established.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EtienneLescot
EtienneLescot merged commit 1c58dad into main Oct 7, 2026
19 checks passed
@EtienneLescot
EtienneLescot deleted the fix/1015-hud-language-menu-keys branch October 7, 2026 10:08
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.

[Bug]: Esc does not close the HUD language menu, the wordmark menu or the colour popover

1 participant