HeliBoard
HeliBoard copied to clipboard
auto toggle toolbar when suggestions are available
I added a new setting that makes the suggestions appear automatically as they become available without having to touch the expand toolbar key. If there is no character before the cursor (when starting input or after a newline), the main toolbar will be shown. This functionality is present in many other mainstream keyboards. I believe this fixes #449 Here is a short demo
https://github.com/Helium314/HeliBoard/assets/151087174/fa02c16b-3d97-4c2a-a380-4afc7c969bf7
I was about to open a feature request for exactly that! I use voice input a lot (with FUTO Voice - open / local on-device voice input) and so it was annoying to always click an unnecessary button 😅 at least annoying enough for me to go through all the settings multiple times 😂.
Thanks for the PR, I will look through it/test it and give feedback in the next days! 👍🏻
Could you also add a separate settings for just auto-hiding the toolbar when suggestions are available?
When you have pinned keys, they will flash when you type e.g. .... This needs to be fixed.
When there are default suggestions on opening an input field (with next-word-suggestions on), the toolbar shortly shows up, and then disappears once the suggestions arrive. Selecting text by long pressing on text and moving the marker, the pinned keys flash on every move. When trying to move through the text using left/right keys on toolbar, you can only do so until the first suggestions appears (auto-hide setting would help here).
sorry about the delay
There is really no need for that, here I'm much worse...
Could u please check if this is still an issue, my device may render it too fast for me to notice the flicker
Yes, it still happens
It was added in https://github.com/Helium314/HeliBoard/commit/e337f742b25e90a56a41e205ad3e360edfb0eacb. So it doesn't need to be set to gone, but at least that should be an option (that's what I mentioned with "happens curently" in https://github.com/Helium314/HeliBoard/issues/449#issuecomment-1920499825)
Flickering looks mostly good now. There are a few more cases where it happens, like when the toolbar was showing, you close the keyboard, and then tap inside some text field where toolbar should not show. But that's more obscure, and not necessary to fix. (with next word suggestions on, when set to off the toolbar is not auto-showing at all)
One think I noticed when re-reading: This does not show the tool bar when opening an input field and there are suggestions, which is requested in #449. Could be done by adding something like
boolean suppressResume = currentSettingsValues.mAutoShowToolbar
&& mInputLogic.mConnection.getTextAfterCursor(1, 0).length() == 0
&& mInputLogic.mConnection.getCodePointBeforeCursor() == Constants.NOT_A_CODE;
if (!suppressResume)
mHandler.postResumeSuggestions(true /* shouldDelay */);
right above the first needToCallLoadKeyboardLater = false;, i.e. don't try getting suggestions when the input field is empty and mAutoShowToolbar is on.
I can add the provided code, but then personalized predictions won't be suggested when the input starts.
I think it makes sense to also show it in this case, because (at least for me) those initial suggestions are rarely something I actually want to type. But no matter which way we do it, it's simple to switch.
it seems like it might not be right to depend on the return values of functions that use the position of a "lying" cursor
The code above essentially checks whether the text field is empty, which does not depend on the cursor position. (maybe that could be checked more efficiently)
A summary when the toolbar shows automatically, depending on other settings (auto-show and auto-hide enabled)
- next word & personalized suggestions enabled
- in non-text input fields
- after enter in multi-line field, except when having pressed delete right before (because suggestions show up inconsistently)
- when clicking to a place where suggestions for empty previous word are shown, and then entering e.g.
.- not when entering e.g.
and / or.when initially touching a word (suggestions are shown after, but go away after.)
- not when entering e.g.
- next word suggestions enabled, personalized suggestions disabled
- in non-text input fields
- when text input field is empty
- after enter in multi-line field
- when clicking to a place where no suggestions are shown, and then after entering e.g.
or.- not when entering e.g.
or.after a word (no suggestions are shown though)
- not when entering e.g.
- next word suggestions disabled or suggestions disabled
- never
Thanks for the detailed summary. I assume it is an observation of the current behavior? because I don't think that all of it is intended.
I wasn't sure whether everything was working as you intended, that's why I wrote the summary.
- It's the beginning of a line and only neutral suggestions are available
:+1:
- Input starts, even if the input field is not empty, as long as cursor does not touch word
Not sure about the "even if the input field is not empty" part, but at least some uses will want this.
- All suggestions were manually removed
This seems to be a very specific and rare situation. It should only be considered if it doesn't introduce much complexity.
- Text is selected
:+1:
The toolbar should be auto-hidden when actual suggestions are available (including inline suggestions)
I think hiding words properly already, didn't test inline suggestions though.
On a side note, it seems like a waste of screen estate that setNeutralSuggestions() sets empty suggestions if next-word suggestions are disabled. Do you think it would be possible to show the top 3 dictionary words with highest frequency instead?
Possible yes, but it might not be particularly useful (and then the app is showing next-word suggestions despite the setting being disabled).
Wouldn't it be better to have these settings in the new "Toolbar" page? 🤔
Wow. Sorry @codokie, GitHub didn't show me any of your comments from the past 2 days, only the pushes. So I was really confused first and then annoyed as it looked like you just pushed changes instead of answering my questions. I'll look at it again...
Wouldn't it be better to have these settings in the new "Toolbar" page? 🤔
The toolbar settings don't exist in https://github.com/codokie/HeliBoard/tree/autotoggle-toolbar, but the plan to move the settings should be somewhere in here.
feee2f2 is 100% going to cause a flicker on input start every time..
Under which conditions? I tried a quite a few different things, but never managed to get that flicker..