Skip to content

[codex] Fix model shortcut in non-English locales#22

Merged
diyor28 merged 1 commit into
mainfrom
codex/fix-model-shortcut-non-english-locales
Mar 30, 2026
Merged

[codex] Fix model shortcut in non-English locales#22
diyor28 merged 1 commit into
mainfrom
codex/fix-model-shortcut-non-english-locales

Conversation

@diyor28

@diyor28 diyor28 commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make the BiChat model-rotate shortcut match the physical M key instead of the localized character
  • keep the existing Cmd/Ctrl + Shift + M behavior while making it work on non-English keyboard layouts

Root Cause

The shortcut handler compared KeyboardEvent.key to 'm'. On non-English layouts, key reflects the localized character rather than the physical key position, so the shortcut did not fire.

Testing

  • pnpm typecheck
  • pnpm build

Summary by CodeRabbit

  • Bug Fixes
    • Improved keyboard shortcut detection for model rotation to ensure more reliable key recognition.

@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

Enhanced keyboard shortcut detection in the ModelSelector component by replacing platform-specific modifier checks with more robust key matching using e.code === 'KeyM' and case-insensitive key comparison, while adding an !e.altKey guard and introducing intermediate variables for clarity.

Changes

Cohort / File(s) Summary
Model Rotation Shortcut
ui/src/bichat/components/ModelSelector.tsx
Improved keyboard shortcut detection for model rotation with more robust key matching (e.code === 'KeyM' or case-insensitive e.key), added !e.altKey gating, and refactored logic into intermediate isModifierPressed/isShortcutKey variables.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit taps with nimble paw,
Shortcut keys refined without a flaw,
Meta and shift no longer fight—
KeyM now gleams with perfect sight,
Modifiers dance, the logic's tight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing the model shortcut to work in non-English locales by adjusting keyboard detection logic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-model-shortcut-non-english-locales

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 and usage tips.

@diyor28 diyor28 marked this pull request as ready for review March 30, 2026 11:37
@diyor28 diyor28 merged commit b23b7fc into main Mar 30, 2026
1 of 2 checks passed
@diyor28 diyor28 deleted the codex/fix-model-shortcut-non-english-locales branch March 30, 2026 11:39
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