Skip to content
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

Hit space to insert highlighted autocompletion #256

Closed
2 tasks done
andrewtavis opened this issue Dec 2, 2022 · 27 comments
Closed
2 tasks done

Hit space to insert highlighted autocompletion #256

andrewtavis opened this issue Dec 2, 2022 · 27 comments
Assignees
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@andrewtavis
Copy link
Member

Terms

Description

A feature of system keyboards is that a user can press space to insert an autocompletion if it's highlighted. This issue is to add this feature to Scribe 😊 We'd want to check if there is a highlighted word, which was completed in #250 (see that issue for how to check for the conditions that highlight). After this, we'd then want to add a condition to the actions that occur after space is pressed where if the conditions for highlighting are met, then we'd insert the word in the highlighted autocompletion followed by a space. The place where spaceBar actions are is here in the main KeyboardViewController:

case spaceBar, languageTextForSpaceBar:

Contribution

I'd be happy to support someone with this issue or work on it if no one else has interest 🙃

@andrewtavis andrewtavis added feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 2, 2022
@andrewtavis andrewtavis changed the title Hit space to insert autocompletion Hit space to insert highlighted autocompletion Dec 2, 2022
@cameronslee
Copy link

@andrewtavis could you please assign me to this? :)

@andrewtavis
Copy link
Member Author

Most definitely, @cameronslee23! Can’t think of a better person to work on this 😊

@cameronslee
Copy link

Hi @andrewtavis, The condition in #250 checks if currentPrefix == completionWords[0]. This assumes that the entire word is already typed in the proxy by the user. Does this issue look to insert another instance of that same word? Or should we be considering other words that are candidates of autocompletion?

@andrewtavis
Copy link
Member Author

@cameronslee23, I'd say that for now we can just do currentPrefix == completionWords[0] as this feature should only be triggered when the word is highlighted. There's no other instance of that now, so let's not worry about it 😊 We can expand what triggers the highlight later, and with that add them to this trigger :)

@SaurabhJamadagni
Copy link
Collaborator

Hey @andrewtavis, one instance that I can think of is for case correction. For instance, when the user types homburg then the completion suggestion is Homburg. So the completion can then again be highlighted and replaced on space bar. Would that be correct?

@andrewtavis
Copy link
Member Author

Ah yes, you're right @SaurabhJamadagni! So we'd have to lower case each of the strings in currentPrefix == completionWords[0]?

@SaurabhJamadagni
Copy link
Collaborator

Sort of @andrewtavis. Assuming that the autocompletion has the correct case, we change the case of the entered word or the currentPrefix to match the autocompletion. So in the case of homburg, when the user presses the space bar the completion with the correct case Homburg would be highlighted. On pressing space, homburg should be replaced by Homburg. This would mostly be applicable for German as if I remember correctly, the capitalization scheme capitalizes all nouns. Correct me if I am wrong 😅

@andrewtavis
Copy link
Member Author

Yes, this all makes sense, @SaurabhJamadagni 😊 Give me a quick second to get to #214, and then I think we should be ready to work on this. That's been sitting for a bit and needs some work, but definitely should be merged eventually as it does solve the issue at hand.

@SaurabhJamadagni
Copy link
Collaborator

Give me a quick second to get to #214, and then I think we should be ready to work on this.

Sounds good @andrewtavis. Any other issue you would like me to look at meanwhile?

@andrewtavis
Copy link
Member Author

Let me get to these things and then we can jump back in together, @SaurabhJamadagni :) Sorry, I'm kind of in the zone working on getting another project into alpha (hence all the private commits) 😊

@andrewtavis
Copy link
Member Author

andrewtavis commented Feb 1, 2023

@SaurabhJamadagni, #214 has now been finished :) Sorry for putting a hold on the this and other issues while I took some time to make sure that went well. Do you want to do a PR for this? (@cameronslee23, you'd also be welcome to - just give us a shout! 🙃)

Also, might be good if you looked into the KeyboardsBase/ToolTip directory that comes from #214 so we can discuss in the call. I left most of the original code in there, but I feel like some of it is potentially unnecessary 🤔 Would be good to discuss a bit :)

This one should be pretty quick, and then we can move to #51 as we now have the needed emoji data? From there back to #96? We can also discuss the plan in the call, but just wanted to outline what I'm thinking 😊

@SaurabhJamadagni
Copy link
Collaborator

Do you want to do a PR for this? (@cameronslee23, you'd also be welcome to - just give us a shout! 🙃)

Yeah no problem @andrewtavis. Let's see if @cameronslee23 would be interested. Else I'll get to it :)

Also, might be good if you looked into the KeyboardsBase/ToolTip directory that comes from #214

On it.

and then we can move to #51 as we now have the needed emoji data?

I think we would have to first figure out the data optimization problem from #96 before adding more data right?

@andrewtavis
Copy link
Member Author

andrewtavis commented Feb 2, 2023

We wouldn't release after #51 regardless, @SaurabhJamadagni, but happy to switch to #96 :) Let's figure it out in the call 😊

@SaurabhJamadagni
Copy link
Collaborator

Hey @andrewtavis, I'll take over this issue in that case. Will have a PR soon :)

@SaurabhJamadagni
Copy link
Collaborator

@andrewtavis I had a small question, consider the user wishes to type 'Homburg'.

The word would get highlighted after the user has completed typing it already right? So if the user has already typed the word, what would we be inserting on space? 😅

image

Here's what I was thinking:

  • If the user starts typing a word, and if it is the only autocompletion, then it gets highlighted.
  • That way the user doesn't have to type the entire word and can press space to insert the autocompletion.

Example:

image

  • Here we can assume that Homburg is the word the user wants to type as its the only suggestion.
  • So if they press space now, the autocompletion can be inserted.
  • We can also have a backspace to undo if they only wanted to use the partial word that was not supposed to be the autocompletion.

@andrewtavis
Copy link
Member Author

So if the user has already typed the word, what would we be inserting on space? 😅

I guess just a space :) There's no space after, so we can't do autosuggestions.

If the user starts typing a word, and if it is the only autocompletion, then it gets highlighted.

This is a great idea! 😊

We can also have a backspace to undo if they only wanted to use the partial word that was not supposed to be the autocompletion.

So does this mean if they press backspace it'll delete the part of the word that was inserted that they'd yet to have typed? Just checking :)

Another option on this could be that the first autosuggestion that we provide after this would be the word that they had typed before? So if they want Homb, then they can press that as an autosuggestion and that'll replace the word they had typed before and add a space? This would only be in cases where they did the space for autocomplete, and not when pressing the autocomplete button on the command buttons. (This seems to be a bit out of scope btw, but I just wanted to type it out as it seems to be a potentially good solution to the common problem of "No I did not want that damn autocompletion that you keep on inserting for me after I go back and type it, keyboard!").

Btw, are we meaning Hamburg in these examples? 🙃 There's also a Homburg, but I figure you meant the port city? 😊

@SaurabhJamadagni
Copy link
Collaborator

(This seems to be a bit out of scope btw, but I just wanted to type it out as it seems to be a potentially good solution

Yeah @andrewtavis, that could be a possibly good implementation. I'll try it that way.

Btw, are we meaning Hamburg in these examples? 🙃 There's also a Homburg, but I figure you meant the port city? 😊

Haha np I actually didn't mean any of it. I just couldn't think of any german words to try it with so I just picked one from the german JSONs. I don't even know what Homburg means 😂

@andrewtavis
Copy link
Member Author

Yeah @andrewtavis, that could be a possibly good implementation. I'll try it that way.

Sounds good!

I don't even know what Homburg means 😂

Just a small town in Germany where the people from there are doubtless like "I'm from Homburg, not Hamburg" 😅

@SaurabhJamadagni
Copy link
Collaborator

Hey @andrewtavis. Sorry I couldn't get to the pull request. A few things came up. I'll try to get it out tomorrow (Sunday) else, will get to it after my exam on Wednesday. I hope that's alright. Sorry for the delay.

@andrewtavis
Copy link
Member Author

No stress whatsoever, @SaurabhJamadagni :) Hope all is well 🙏 Get to it when you can, and after your exam is totally fine!

@Abdullahhh12
Copy link

Can I work on this issue ?

@andrewtavis
Copy link
Member Author

Hi @Abdullahhh12! :) Thanks for your interest in contributing! 😊 @SaurabhJamadagni already has changes for this finished in #259. I would be happy to suggest other issues if that’d be of interest to you :)

@andrewtavis
Copy link
Member Author

Closed via #259 😊

@andrewtavis
Copy link
Member Author

@SaurabhJamadagni, I'll get to the PR in Scribe-Data in the next few days and we can then jump into #51 😊

@SaurabhJamadagni
Copy link
Collaborator

Hey @andrewtavis, does anything in this issue need to be looked at? Or did you assign me this issue for documentation purposes 😅 ?

@andrewtavis
Copy link
Member Author

andrewtavis commented Apr 8, 2023

I was going through and assigning issues for documentation purposes, @SaurabhJamadagni 😊 Sorry for the distraction :)

@SaurabhJamadagni
Copy link
Collaborator

No worries :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants