๐ Fixed search navigating away during CJK IME composition
When using CJK input methods (Chinese, Japanese, Korean) in the sodo-search modal (Cmd+K), pressing Enter to confirm a character during IME composition incorrectly triggers navigation to the first search result. This makes search unusable for CJK users.
The keyboard handler in the Results component used keyup, but compositionend fires before keyup, so event.isComposing is already false by then. Switched to keydown where isComposing reliably reflects the composition state.
Demo
Before (main branch)
https://github.com/user-attachments/assets/248f9403-d896-4cdc-ac5b-6105379a9a42
- Type "ๆธฌ่ฉฆ" using zh-Hant IME while characters are still being composed
- Press Enter to confirm composition
- The search immediately redirects to the 1st result instead of finalizing the composed text and letting the user select their intented result
After (PR branch)
https://github.com/user-attachments/assets/d1f9e041-1e86-4549-a95b-7ece822e207b
- Type "ๆธฌ่ฉฆ" using zh-Hant IME while characters are still being composed
- Press Enter to confirm composition
- Search results remain, letting user manually pick search item
[!NOTE] Low Risk Low risk: small change to keyboard event handling in the search results list; main risk is unintended key handling differences between
keyupandkeydownfor navigation/Enter behavior.Overview Fixes Cmd+K search result navigation for CJK IME users by moving the results keyboard listener from
keyuptokeydownand ignoring events during composition (event.isComposing/ legacykeyCode === 229).This prevents Enter presses used to confirm IME text from triggering immediate navigation to the currently selected search result.
Written by Cursor Bugbot for commit 866ececceb6a4ce4b43c8b6a98f4b96c2743bd3a. This will update automatically on new commits. Configure here.
No actionable comments were generated in the recent review. ๐
โน๏ธ Recent review info
โ๏ธ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ee46ddfb-6beb-4b57-a532-de8fddf443be
๐ฅ Commits
Reviewing files that changed from the base of the PR and between 9f012d545af53bf925c0a5258e1269e7df53e83b and 8ac25313e1a4dcb2972e9fd7f75505838e1ffbaa.
๐ Files selected for processing (1)
apps/sodo-search/src/components/popup-modal.js
๐ง Files skipped from review as they are similar to previous changes (1)
- apps/sodo-search/src/components/popup-modal.js
Walkthrough
The change updates keyboard handling in the popup modal component: the handler was renamed from keyUphandler to keyDownHandler, keyup listeners were replaced with keydown listeners, and the handler now ignores IME composition when event.isComposing is true or event.keyCode === 229. The effect captures containerRef?.current?.ownerDocument into a local doc variable and adds/removes the keydown listener on that doc (cleanup removes keyDownHandler). Existing arrow/enter navigation logic is preserved.
๐ฅ 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 |
|---|---|---|
| Title check | โ Passed | The title clearly summarizes the main change: fixing a bug where CJK IME composition interferes with search navigation. |
| Description check | โ Passed | The description is well-related to the changeset, explaining the issue, root cause, solution, and providing before/after demos of the fix. |
โ๏ธ Tip: You can configure your own custom pre-merge checks in the settings.
โจ Finishing Touches
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
๐ Coding Plan
- [ ] Generate coding plan for human review comments
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.
Comment @coderabbitai help to get the list of available commands and usage tips.
You have used all of your free Bugbot PR reviews.
To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code