feat: Implement emoji autosuggestion and refactor key handling - #671
feat: Implement emoji autosuggestion and refactor key handling#671Roniscend wants to merge 2 commits into
Conversation
Signed-off-by: Owm <owmdubey163@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes missing emoji autosuggestions by making emoji keyword loading more tolerant to schema/table-name differences and by normalizing keyword casing for lookup, while also refactoring IME key handling to be centralized in GeneralKeyboardIME via KeyHandler instead of per-language overrides.
Changes:
- Hardened emoji keyword DB loading (supports both
emoji_keywordsandemojikeywords; normalizes keyword casing). - Centralized key handling by delegating
onKey()inGeneralKeyboardIMEtoKeyHandler, removing duplicated overrides in individual language IMEs. - Adjusted suggestion state handling so emoji autosuggestion state is cleared when no match is found, and emoji suggestions can be shown when autocomplete completions are empty.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/java/be/scri/helpers/data/SQLiteExtensions.kt | Makes tableExists safer by using a parameterized query and case-insensitive matching. |
| app/src/main/java/be/scri/helpers/data/EmojiDataManager.kt | Loads emoji keywords from either legacy or current table name and normalizes keyword keys for lookup. |
| app/src/keyboards/java/be/scri/services/GeneralKeyboardIME.kt | Initializes and delegates key handling to KeyHandler; updates emoji autosuggestion behavior when autocomplete has no completions. |
| app/src/keyboards/java/be/scri/helpers/SuggestionHandler.kt | Clears autoSuggestEmojis when no emoji suggestion is available to avoid stale state. |
| app/src/keyboards/java/be/scri/services/SwedishKeyboardIME.kt | Removes per-language KeyHandler/onKey override in favor of base handling. |
| app/src/keyboards/java/be/scri/services/SpanishKeyboardIME.kt | Removes per-language KeyHandler/onKey override in favor of base handling. |
| app/src/keyboards/java/be/scri/services/RussianKeyboardIME.kt | Removes per-language KeyHandler/onKey override in favor of base handling. |
| app/src/keyboards/java/be/scri/services/PortugueseKeyboardIME.kt | Removes per-language KeyHandler/onKey override in favor of base handling. |
| app/src/keyboards/java/be/scri/services/ItalianKeyboardIME.kt | Removes per-language KeyHandler/onKey override in favor of base handling. |
| app/src/keyboards/java/be/scri/services/GermanKeyboardIME.kt | Removes per-language KeyHandler/onKey override in favor of base handling. |
| app/src/keyboards/java/be/scri/services/FrenchKeyboardIME.kt | Removes per-language KeyHandler/onKey override in favor of base handling. |
| app/src/keyboards/java/be/scri/services/EnglishKeyboardIME.kt | Removes per-language KeyHandler/onKey override in favor of base handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
# Conflicts: # app/src/keyboards/java/be/scri/services/GeneralKeyboardIME.kt
|
@angrezichatterbox PTAL |
|
Thanks for the PR, @Roniscend :) What's the plan here? Do we need to merge this before #660, or does this supersede it? |
Yes, this PR specifically addresses the emoji autosuggestion and key handling fixes from #637 |
|
Perfect! Really great to have this in :) |
./gradlew lintKotlin detekt testcommand as directed in the testing section of the contributing guideDescription
Implemented emoji autosuggestion functionality and refactored keyboard key handling

Fixes : #637