-
Notifications
You must be signed in to change notification settings - Fork 93
fix: Enhance IME Suggestions & UI — Bug Fixes, Refactors, and Performance Improvements #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Enhance IME Suggestions & UI — Bug Fixes, Refactors, and Performance Improvements #411
Conversation
Thank you for the pull request! ❤️The Scribe-Android team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) |
|
Thanks so much for this, @bhanu-dev82! Looking forward to the review as always as the quality of the information is so helpful 😊 |
|
Would you be able to fix the merge conflict with the code from #412, @bhanu-dev82? Maybe your solution also solves the plural annotation after the plural command as well, but if not then that was brought in from that PR 😊 |
I've resolved the merge conflict and confirmed that everything is working as expected. I tested the plural button with "book" and "boy" for English, and "Buch" for German. The gender suggestion feature for the German keyboard is also functioning correctly. I’d appreciate feedback on the implementation. Due to Detekt constraints (line and function limits), I had to adapt the original logic, which may have slightly altered the intended design—assistance on refining this would be helpful. Thank you for adding me as a collaborator to this project. |
|
Thanks for fixing the merge conflict and checking the functionality, @bhanu-dev82! Just checked the changes and all's working great in terms of the work for #398, but it looks like the change from #412 has been lost 🤔 Specifically for this we want the noun annotation to after commands. Here are two situations for the German keyboard that should function:
Please let us know if you have questions on the above! I'll let @angrezichatterbox provide feedback on the code specifics 😊 Thank you for being such a great contributor to this project! Your collaborator status was more than earned 😊 Looking forward to continuing to work with you! It really has been a pleasure :) |
|
yes i am just completing the fix for it, it will soon be pushed. Thankyou |
|
Amazing, @bhanu-dev82! Thanks for getting to all of this so quickly! 😊 |
|
i have fixed the errors:
I have made 2 new files namely SpaceKeyProcessor.kt and SuggestionHandler.kt just to make detekt forgive me 😜 here is a video showing the fix : Screen_Recording_20250530_024810_Keep.Notes.mp4 |
|
Thanks so much for the quick work here, @bhanu-dev82! We'll try to get to the final review in the coming days 😊 |
angrezichatterbox
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for refactoring the codebase while fixing the bug @bhanu-dev82.
There is a slight issue in the implementation that causes the emoji suggestions to disappear when the command bar suggestion shows up. The actual behavior would be that both would appear simultaneously.
|
@andrewtavis I assume the intended behavior would be both to be shown simultaneously. |
|
Assuming you mean noun annotation, @angrezichatterbox? Looking at the most recent video, it looks like we're just getting the annotations like |
Yes, Currently when we type |
|
Yes, it'd be important for us to show both :) Are the colored |
Apologies for the delayed response — I've been occupied with exams. The emoji issue will be addressed through the fix for #404, as it includes handling for emoji-related cases. If possible, could we proceed with this approach? if not i will fix it and push in the same PR. i will be working on #404 today. |
|
I guess if you're fine with it @bhanu-dev82, just send along the changes to this branch and we'll finalize both issues in one PR? That way we can check the functionalities together 😊 |
|
The recent merge was intended solely to integrate the latest changes. A major update is in progress, which significantly improves performance. Specifically, the complexity of generating suggestions has been optimized from O(n) to O(1), resulting in a much faster keyboard and an overall smoother user experience. |
|
Let us know when this is ready from your side, @angrezichatterbox :) |
|
I am doing some additional chores that I have noticed within the same PR. As I am already reviewing the codebase quite a bit. I hope that would be fine. |
5cfc362 to
82dfa83
Compare
|
@andrewtavis It is ready for review. I have tried seeing how the refactoring would be and refactored some of the components in PR. However for the complete refactoring we could have a separate issue as being discussed in #426. |
|
What do you think about some refactoring issues for the hackathon @andrewtavis |
|
[Removing the comment that was here - Git was buggy] |
|
Project isn't building on my end, even after clearing the caches. Are there other steps that I could do to get it working? I also just updated Android Studio to Meercat 🤔 |
|
|
Could you try running |
|
Could you check now. Or else I would revert back the entire |
|
The info that's in the problem report is: The build works now within Android Studio, then just the app loads, I can install a keyboard within the settings, but I can't use the keyboard 🤔 |
Are you using a Pixel Pro 9 API 35 itself ? |
|
For API 36 emulator none of the external downloaded keyboard works. Like I tried the fossify keyboard we can't switch to it as well. |
|
I'll try with a Pixel 9 and API |
andrewtavis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All's working with Pixel 9 and API 35 ✨🎉 Amazing work here, @bhanu-dev82! Really commendable how much we've progressed in this single PR 😊 Thanks also for the review and the refactoring/updates, @angrezichatterbox! 🙏
So glad to have this one in :) Let's focus on bringing in #395 and #420 now. You'd be welcome to start reviewing PRs too, @bhanu-dev82! Please let us know if this would be something you'd have interest in. As it suits you 😊
|
There's enough work in here that I'm not going to squash so it's a bit more reflective of the effort that went into this. Let's also discuss what's up with API 36... Likely is just something that will come in a forthcoming update. |
|
Great work here! @bhanu-dev82 Really inspiring ⭐🙌🏾✨ |


Contributor checklist
./gradlew lintKotlin detekt testcommand as directed in the testing section of the contributing guideDescription
Fixes: #398 (broken gender suggestions); also addresses plural and case suggestion issues.
This PR refactors and centralizes the word suggestion logic in
KeyHandler.ktto ensure consistent behavior for German noun type, plural, and case annotation suggestions — especially after space, delete, and regular key presses.✅ Key Changes
🔁 Unified Suggestion Handling
processWordSuggestions(currentWord)to encapsulate suggestion logic.⌨️ Space & Delete Logic
handleKeycodeSpace()now commits a space, then triggers suggestions.handleDeleteKey()updates or clears suggestions after a delete.🔤 Character Input
handleDefaultKey()disables suggestions during command bar usage.♻️ Suggestion Clearing
😊 Emoji Fallback
updateEmojiSuggestions().🐛 Bug Fixes
processWordSuggestions().🧪 Testing
"buch "→ correctly shows"N"(neuter)processWordSuggestions()🔍 Note and Demo
This issue was approached with a test-driven and results-oriented development process. Community feedback and additional testing are encouraged to ensure comprehensive coverage and robustness across use cases.
Screen_Recording_20250529_042309_Keep.Notes.mp4
Closes: #398