fix(search): keyboard search button on Android 12 CJK IMEs#602
Conversation
There was a problem hiding this comment.
rainxchzed has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
WalkthroughThe PR fixes keyboard search button behavior on Android 12 with Chinese IMEs and documents the fix. SearchRoot.kt now routes additional IME actions (Done, Go, Next, Send) to the search trigger handler. Release notes across 13 language variants document this fix alongside platform chip search filtering. ChangesAndroid 12 Chinese IME Search Button Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
rainxchzed has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchRoot.kt (1)
955-962: ⚡ Quick winConsider adding a brief inline comment explaining the IME action workaround.
Lines 958-961 route multiple IME actions (Done, Go, Next, Send) to the search trigger. While the code is correct, this workaround is non-obvious without context. Per coding guidelines, inline comments should be added for workarounds. A one-line note like
// Android 12 Chinese IMEs may emit Done/Go/Next/Send instead of Searchwould help future maintainers.Also note: this fix applies universally to all IMEs and Android versions, not just Android 12 with Chinese locales. Given the single-line search context (line 963) where these actions reasonably map to "trigger search," this broader scope is likely intentional, but worth confirming.
📝 Suggested inline comment
keyboardActions = KeyboardActions( + // Some Android 12 Chinese IMEs emit Done/Go/Next/Send instead of Search onSearch = { onAction(SearchAction.OnSearchImeClick) }, onDone = { onAction(SearchAction.OnSearchImeClick) }, onGo = { onAction(SearchAction.OnSearchImeClick) }, onNext = { onAction(SearchAction.OnSearchImeClick) }, onSend = { onAction(SearchAction.OnSearchImeClick) }, ),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchRoot.kt` around lines 955 - 962, Add a one-line inline comment above the KeyboardActions block (where KeyboardActions and the handlers onSearch, onDone, onGo, onNext, onSend all call onAction(SearchAction.OnSearchImeClick)) explaining why multiple IME actions are routed to the search trigger (e.g., "Android IMEs can emit Done/Go/Next/Send instead of Search; map these to trigger search for single-line search field"), so future maintainers understand this intentional workaround and its broader scope.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchRoot.kt`:
- Around line 955-962: Add a one-line inline comment above the KeyboardActions
block (where KeyboardActions and the handlers onSearch, onDone, onGo, onNext,
onSend all call onAction(SearchAction.OnSearchImeClick)) explaining why multiple
IME actions are routed to the search trigger (e.g., "Android IMEs can emit
Done/Go/Next/Send instead of Search; map these to trigger search for single-line
search field"), so future maintainers understand this intentional workaround and
its broader scope.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f0558f4d-81b9-4a22-9ab6-f20756002737
📒 Files selected for processing (14)
core/presentation/src/commonMain/composeResources/files/whatsnew/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ar/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/bn/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/es/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/fr/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/hi/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/it/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ja/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ko/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/pl/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/ru/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/tr/18.jsoncore/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/18.jsonfeature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchRoot.kt
Sprint 3 Task 9. Some Chinese-language IMEs on Android 12 emit
ImeAction.Done/Go/Nextfor the search/enter key instead ofSearch, leavingKeyboardActions.onSearchunfired. Mirror all five plausible actions onto the same trigger.Test plan
18.jsonvalidSource: 李泽洋 email, v1.8.1 Android 12 zh-Hans-CN.
Summary by CodeRabbit