Scribe-Android
Scribe-Android copied to clipboard
Add invalid state to keyboard commands and show localized `Not in Wikidata`
Terms
- [X] I have searched open and closed feature requests
- [X] I agree to follow Scribe-Android's Code of Conduct
Description
This issue would add the invalid input functionality to Scribe-Android keyboards. In Scribe-iOS, when a user tries to execute a command on a word that's not a valid value in the given database, the localized version of the string Not in Wikidata is displayed to the user on the command bar.
- Note that this issue is blocked by either #272 or #266
A screenshot of this in Scribe-iOS is seen below:
The functionality is:
- The user selects the Scribe key
- The user selects a command like
Pluralthat will be made in #272 orTranslatein #266 - The user enters a word that's not in the given nouns or translations tables like
ANY_BUNCH_OF_RANDOM_LETTERS - The user hits the enter (return) key to execute the command
- The command bar shows
Not in Wikidatain the keyboard language- The current keyboard state is
invalid - The Scribe key is returned to it's base state so that the command can be tried again
- If the user starts typing again, then the command bar disappears and autocompletions are shown (i.e. keyboard state is
idle)
- The current keyboard state is
[!NOTE] The invalid state messages can be found in the interface files in the language directories of app/src/main/java/be/scri/helpers.
Contribution
Happy to discuss this and review when a PR is open! 🚀
@andrewtavis I would like to take this one. Also if possible, could you share the video of how it works in the iOS, that would make the things more clear 🙂
Thanks for your willingness to work on this, @smalik2811! Here's a video for how it works in iOS, as requested 😊
https://github.com/user-attachments/assets/ba9cbbfb-3bec-4384-a2f8-a8ce23190b44
Please let us know if there are further questions!
Thankyou for the video. Also I would like to clarify what happens when the user clicks the Scribe key in the Invalid state? Does it switch back to the Idle mode?
In file state the Scribe key will result in the command options being shown :) So when the "Not in Wikidata" message is shown, then the user can press the Scribe key to see the commands and maybe retry the one that didn't work.
Hello @andrewtavis, I have been working on the Invalid State and I have managed to get the current functionality by hiding the views from the command bar. However that's not enough I would also have to update the background drawable of the scribe key and restore it when the the keyboard exits the invalid state which makes the logic little complicated and does not follow SOLID principles.
I was wondering if we could create a seperate layout file for the Invalid state that would make the logic more clean and easy to maintain. What do you recommend?
Additionally, could you also share the colors that should be used for the info icon in the invalid state for both the light and dark mode.
https://github.com/user-attachments/assets/b1b3dba1-eb62-4c2a-9c99-b98998c40e59
Thanks for the great work here as always, @smalik2811!
I was wondering if we could create a seperate layout file for the Invalid state that would make the logic more clean and easy to maintain. What do you recommend?
I think a separate layout file for the invalid state would be great :) Feel free to go in that direction! 🚀
Additionally, could you also share the colors that should be used for the info icon in the invalid state for both the light and dark mode.
The color we use for this is the same as the placeholder text for the command bar - commandBarPlaceholderColor in iOS:
- Light mode:
#8A8A92 - Dark mode:
#777777
Let me know if there's anything else I can do to help!
Hey @smalik2811 👋 Quick check in here to see if there's anything we can do to support on this issue :) Hope all's well with you! 😊
Hi @andrewtavis ,
Thank you for checking in! I appreciate you reaching out. I've been engaged with some other tasks recently, and unfortunately, I won't be able to contribute to this particular issue at this time. Therefore, I'd like to remove myself from this issue.
I'm still very interested in contributing to the project in the future, and I'll keep an eye out for other opportunities.
Thanks again for your understanding.
Totally fine, @smalik2811! We hope to see you in the future :)
Hi, @andrewtavis! Can I give it a try on this one? Seems like an interesting feature
Assigned @linreal . Please do ask in case of any queries. Happy to help :)
@andrewtavis @angrezichatterbox PR is ready, looking forward for your review
Looking forward to the review, @linreal! 😊
Closed by #401 🚀 Heading over to #274 to unblock it 😊😊
hey @andrewtavis @linreal, I'm about to work on #274 but I can't seem to trigger the invalid state. Can you help showing me how to do so? Thank you.
hey @andrewtavis @linreal, I'm about to work on #274 but I can't seem to trigger the invalid state. Can you help showing me how to do so? Thank you.
hey, @catreedle! Just hit scribe key, select "Plural" command, type random letters and press Enter key
https://github.com/user-attachments/assets/c71a3443-b56d-4bbe-a3d9-6a2abc81cecb
hey @linreal . Thank you! I tried it on my emulator, but I can't trigger it. this is already merged to main, right?
hey @linreal . Thank you! I tried it on my emulator, but I can't trigger it. this is already merged to main, right?
yes, it's in main and I can not reproduce behavior from your video on a real device :( seems it deserves a separate issue, @andrewtavis fyi
Thanks for the discussion here! What emulator are you using, @catreedle? Maybe best to clear the Android Studio cash and reset it as much as possible to then see if the behavior improves?
I am using Pixel API 35 @andrewtavis . Have tried rebuilding the app, but same behavior. been trying to set up using a physical device with no success. 😅 any suggestion on which emulator to use?
Maybe we can open an issue for this then, @catreedle :) Could you do that and then we can investigate with the larger group?
ok @andrewtavis, on it 😊