scribe-org / Scribe-iOS

iOS app with keyboards for language learners
https://apps.apple.com/app/scribe-language-keyboards/id1596613886
GNU General Public License v3.0
128 stars 79 forks source link

Add command entry autocomplete #299

Open andrewtavis opened 1 year ago

andrewtavis commented 1 year ago

Terms

Description

Now that the data solution has been improved in #96, Scribe has dramatically more memory available to do some things that would have been difficult before. One great feature would be to add autocomplete to the command bar such that a user would be able to press to complete the rest of a word that's alphabetically the next word in the index column of the table being queried. Things to consider are:

With this in mind, to me the most obvious place for the user to click would be on the command bar itself. We could also show a similarly greyed out icon on the right side of the command bar to indicate that the bar can be clicked to enter the autocomplete text. The icon would only appear when a user begins typing in the command bar, and would disappear if they delete back to the prompt. A good option for an icon would be hand.tap from SF Symbols, which can be seen in the mockup below (note that the command bar cursor | would be between the entered and suggested text):

Screenshot_2023-04-30 00 15 40

Contribution

Happy to work on this myself or collaborate with someone on this :) I think this would be another really great feature to add!

andrewtavis commented 1 year ago

@SaurabhJamadagni, would be great to get your feedback on this! I think it could really improve the user experience as it would also mitigate how much people would enter in something wrong 🤔 Would be very grateful to hear if you think this is the best way to do this though 😊

andrewtavis commented 1 year ago

Suggestions for how best to implement this would also be welcome :D

MykytaBabanin commented 1 year ago

Hello, @andrewtavis I'd like to take this issue, so could you please assign it to me. It will be my first issue on this project. I have for now, only one question, is this feature might be in English keyboard, or in every keyboard?

andrewtavis commented 1 year ago

Hello @MykytaBabanin! 👋 Great to have your interest in Scribe! Happy to assign you :)

As of now Scribe actually doesn’t have an English keyboard, but we’ll be adding one in #7 once #16 is done. This feature would be available in all current keyboards though. Generally my thinking is that each time the user types in a command there is a new query of the corresponding SQLite database that returns the next word alphabetically (LIMIT 1 at the end). So a user presses the conjugate button after pressing the Scribe key and they’re asked to enter a verb to conjugate. As they type the word updates and they can press the icon on the side of the command bar or maybe the command bar itself to complete it.

Happy to answer more questions about where to look for things! This should be a fun issue and you’ll learn a lot about how the app works 😊

SaurabhJamadagni commented 1 year ago

Hey @andrewtavis, this sounds like a reasonable solution. My only concern with this is unintentional keyboard clicks when trying to tap the command bar. I think this would be a good solution. What about long pressing the spacebar? Could that be an option if we can't have just clicking the spacebar? The icon idea is great as well. 😄

andrewtavis commented 1 year ago

Maybe let's go with just clicking the icon and not the command bar itself? We can also reuse some of the mechanics from commandState = .invalid in that case :) I'm thinking that getting someone to know that they need to long hold the spacebar is something that would be too difficult to do without a full tutorial.

andrewtavis commented 1 year ago

@MykytaBabanin, checking in with you to see if there’s anything we can do to support you here. This is definitely a tough issue, so let us know if you need parts of the codebase explained or if we should break it down into smaller steps :)

SaurabhJamadagni commented 1 year ago

Yes @andrewtavis, I would be willing to assist @MykytaBabanin as well! Please let me know if there is any assistance I can provide :)