openboard-team/openboard

Suggestions not showing everywhere.

RHJihan opened this issue ยท 18 comments

Description
Suggestions should be shown everywhere except in password fields with PR #562. But in several apps, word suggestions are not showing, i.e. Facebook Messenger, Microsoft Edge, Google Play Store, Contact (Samsung), Google Maps, Spotify, Galaxy Store, Keepass2Android, and so on.

Screenshots

Google Play Store Google Maps Spotify Galaxy Store

Smartphone

  • Device: Samsung Galaxy m32 (SM-M325F)
  • OS: Android 12 (One UI 4.1)
    Tested OpenBoard version 1.4.5 (form F-Droid)

Possible Solution

mShouldShowSuggestions = !(mIsPasswordField || flagNoSuggestions);

This can be changed to mShouldShowSuggestions = !mIsPasswordField;
#562 (comment)

@Helium314, Would you please look at it?

There is not much I can do here... the solution is known, but it's a developer decision whether to ignore if the app uses TYPE_TEXT_FLAG_NO_SUGGESTIONS.
Some other keyboard apps seem to ignore the flag too, and in at least some of the listed apps I can't see at all why developers would want to show no suggestions.

Hello !
It could be done as @RHJihan mentioned indeed.
Or by a toggle in advanced setting like "Force correction everywhere".

I don't think I encounter this issue in version 1.4.3

Thanks!

Commenting just because I'm seeing the same issue

From a user's point of view, I would prefer to see suggestions everywhere. Implementing a toggle button for enabling this is like making it an experimental feature.
On Gboard, Microsoft SwiftKey, Samsung Keyboard the suggestion strip is always shown. So I think it would be better to do the same.

@RHJihan where does it happen in Keepass2Android? I checked in source, and the flag is set for credentials and filenames only.

@Helium314, Suggestions not showing on the Find button, but on Advanced Search in Keepass2Android.

Find Advanced Search

The advanced search field is using text as input type, but I can't even find the "Find" field in source...

So, what should be done? Is mShouldShowSuggestions = !mIsPasswordField; the correct way to resolve this? Or is it a workaround?

@RHJihan I dont think so, the suggestion bar is actually shown so 'mShouldShowSuggestions' is already set to true in our case.
I think we are missing another check somewhere closer to suggestions request logic that prevent any request to be sent, leading in empty suggestion views.

This might be (related to) the "Find" field in Keepass2Android: https://github.com/PhilippC/keepass2android/blob/master/src/keepass2android/Resources/xml/searchable.xml
Note the line android:searchSuggestAuthority="kp2a.keepass2android.SearchProvider". So my current guess it that @MajeurAndroid is right, as Keepass2Android wants to show its own suggestions.

@RHJihan there is android:searchSuggestThreshold="2". Does it actually show suggestions if you try to enter some existing entry and have more than 2 characters in the search field?

But anyway, not all screenshots show the suggestion bar, so even if we could somehow mix suggestions of OpenBoard and the ones provided by the app search provider it would not be a full solution.

@Helium314, Keepass2Android shows suggestions as a drop-down list. And yes, it starts to show its own drop-down suggestions after entering 2 or more characters.
Whatever the case, I am getting keyboard suggestions from other keyboards, such as Samsung Keyboard.
I am using OpenBoard changing it to mShouldShowSuggestions = !mIsPasswordField; as a workaround and it is working just the way other keyboards work. The suggestion strip with suggested words is visible everywhere (except the password) in my build, whereas the current merged version failed to show the suggestion strip in some cases.

Thanks! So mShouldShowSuggestions = !mIsPasswordField; helps in all the apps you mentioned, right?

Yes. I didn't face any problem related to suggestion strip on any app.

Kage1 commented

I would say this would fix my main aggravation with OpenBoard. In Vivaldi it shows no suggestions on the URL input and I'm horrible at spelling.

The proposed solution may be a workaround but if implemented as an advanced/experimental toggle that is off by default would allow time to find a better solution.

odmfl commented

@Kage1 My PR works correctly, I tested it on various apps where no suggestions appeared, while the suggestions were there with the aosp keyboard, I also tested vivaldi (note well, do not write in the url address bar, write from a page eg google , bing, duckduckgo etc), what I did is just follow the standard aosp keyboard behavior. Which in reality was already present in the old Openboard code only that it was deactivated, I only restored and activated it. There is no need for any other settings which may cause problems with this feature. If you want you can test this test apk, extract the zip and then install the apk. Uninstall the version installed before, while you're at it you can test the emoji search, just try to write something like "ok", "ice", etc..

https://github.com/odmfl/openboard/suites/10180027730/artifacts/497986544

@Kage1 My PR works correctly, I tested it on various apps where no suggestions appeared, while the suggestions were there with the aosp keyboard, I also tested vivaldi (note well, do not write in the url address bar, write from a page eg google , bing, duckduckgo etc), what I did is just follow the standard aosp keyboard behavior. Which in reality was already present in the old Openboard code only that it was deactivated, I only restored and activated it. There is no need for any other settings which may cause problems with this feature. If you want you can test this test apk, extract the zip and then install the apk. Uninstall the version installed before, while you're at it you can test the emoji search, just try to write something like "ok", "ice", etc..

odmfl/openboard/suites/10180027730/artifacts/497986544

WoW you nailed it thank you for fix the suggestions now it works everywhere expect password filed Also the emoji suggestion is amazing works like a charm ๐Ÿ‘

odmfl commented

@GoRaN909 Glad you like it, fixed it further, and also tweaked the keyboard height let's hope it gets merged

https://github.com/odmfl/openboard/suites/10183816163/artifacts/498264752

gcvl commented

@GoRaN909 Glad you like it, fixed it further, and also tweaked the keyboard height let's hope it gets merged

https://github.com/odmfl/openboard/suites/10183816163/artifacts/498264752

Hey, your mod works, although it won't learn new words (unlike SwiftKey or GBoard) in those input fields where suggestions didn't show up with the official app.