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

fix(android): no suggestions available when swapping pred-text target language ✨ #10061

Merged
merged 3 commits into from
Dec 1, 2023

Conversation

jahorton
Copy link
Contributor

@jahorton jahorton commented Nov 23, 2023

Addresses the issue documented here: #10017 (comment)

The net effect of that issue is that suggestions would appear to be disabled upon swapping to a language with an different 'dictionary' from the most recently-used one.

The full documentation of the underlying cause can be found in that linked comment, but the essence of it is that the banner can't display any suggestions because it's constantly being deactivated and reactivated. This is also generally considered "not good" for performance and device batteries.

User Testing

TEST_PICKER_SELECTION_ANDROID: Ensure suggestions are properly displayed after swapping keyboards with different language models.

  1. Install the Android Keyman app test build from this PR.
  2. Open Keyman App.
  3. Install Khmer Angkor and Tamil Keyboards using Settings / Install Keyboard or Dictionary / Install from keyman.com option.
    • The break & bug - occurs when swapping models.
  4. Verify all the Keyboards are installed under Installed languages menu.
  5. Return to main page.
  6. Verify that the default keyboard English -EuroLatin(SIL) is displayed on the page.
  7. Short-press the globe key and observe the keyboard change. There should be minimal adjustment while the keyboard loads.
  8. Now, long press the globe key, Click Khmer or Tamil Keyboard and observe the keyboard change. It should change as smoothly as it did after the globe-key short-press (step 7).
    • If suggestions for the suggestion banner do not appear after a second, type a single key. If no suggestions appear even then, FAIL the test.

TEST_PICKER_SELECTION_IOS: Ensure suggestions are properly displayed after swapping keyboards with different language models.

  1. Install the iOS Keyman app test build from this PR.
  2. Open Keyman App.
  3. Install Khmer Angkor and Tamil Keyboards using Settings / Install Keyboard or Dictionary / Install from keyman.com option.
    • The break & bug - occurs when swapping models.
  4. Verify all the Keyboards are installed under Installed languages menu.
  5. Return to main page.
  6. Verify that the default keyboard English -EuroLatin(SIL) is displayed on the page.
  7. Short-press the globe key and observe the keyboard change. There should be minimal adjustment while the keyboard loads.
  8. Now, long press the globe key, Click Khmer or Tamil Keyboard and observe the keyboard change. It should change as smoothly as it did after the globe-key short-press (step 7).
    • If suggestions for the suggestion banner do not appear after a second, type a single key. If no suggestions appear even then, FAIL the test.

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Nov 23, 2023

User Test Results

Test specification and instructions

  • TEST_PICKER_SELECTION_ANDROID (PASSED): Retested with the attached PR build keyman 17.0.216-alpha-test-10061 in Android 12 (API 31) emulator and here is my observation: 1. Intsalled Khmer Angkor keyboard followed by Tamil Keyboard using Settings / Install Keyboard or Dictionary /Install from keyman.com option. 2. Verified all the keyboards are installed under the Installed languages menu. Returned to the main page. Noticed that Tamil keyboard is displayed on the page. 3. Short-pressed the globe key and observed the keyboard changed immediately. 4. Long pressed the globe key. Clicked the Khmer Angkor (or Tamil keyboard) keyboard and observed that there was no flickering on the suggestion bar. Also, the Predictive text for Khmer Angkor or EuroLatin (SIL) appears correctly on the Suggestion banner. Seems to be working fine.
  • TEST_PICKER_SELECTION_IOS (PASSED): Retested in iOS 16.6 - iPhone 13 mobile device and here is my observation: 1. Installed the attached TestFlight internal PR build and noticed that it is showing keyman 17.0.215 version instead of showing keyman 17.0.216 version. However, I tried to test with this build. 2. Installed Khmer Angkor keyboard followed by Tamil Keyboard using Settings / Installed Languages menu. 2. Verified all the keyboards are installed under the Installed languages menu. Returned to the main page. Noticed that the Tamil keyboard is displayed on the page. 3. Noticed that the short-press or long-press the globe key only opens the 'Keyboards' menu. 4. Selecting the Khmer Angkor or EuroLatin(SIL) keyboard shows up the Predictive text on the suggestion banner. (notes)

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S26 milestone Nov 23, 2023
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-required User tests have not been completed label Nov 23, 2023
@jahorton jahorton changed the title fix(android): no suggestions available when swapping pred-text target language fix(android): no suggestions available when swapping pred-text target language ✨ Nov 23, 2023
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we've removed the isModelActive flag because the banner is always intended to be visible?

I don't really understand how change to languageProcessor.ts addresses the issue. Can you elaborate?

One change requested -- further cleanup with the removal of change parameter 😁

Comment on lines 152 to 154
if(change != 'configured') { // doesn't change the display; only initiates suggestions.
window.location.hash = 'refreshBannerHeight-'+fragmentToggle+'+change='+change;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So 'configured' will also trigger a refreshBannerHeight now, is that okay?

Copy link
Contributor Author

@jahorton jahorton Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I guess I did misread it slightly. Thought that it only affected the value of change sent in the message for some reason.

Should be fine anyway, but... 🤷

@bharanidharanj
Copy link

Test Results

  • TEST_PICKER_SELECTION_ANDROID (PASSED): Retested with the attached PR build keyman 17.0.216-alpha-test-10061 in Android 12 (API 31) emulator and here is my observation: 1. Intsalled Khmer Angkor keyboard followed by Tamil Keyboard using Settings / Install Keyboard or Dictionary /Install from keyman.com option. 2. Verified all the keyboards are installed under the Installed languages menu. Returned to the main page. Noticed that Tamil keyboard is displayed on the page. 3. Short-pressed the globe key and observed the keyboard changed immediately. 4. Long pressed the globe key. Clicked the Khmer Angkor (or Tamil keyboard) keyboard and observed that there was no flickering on the suggestion bar. Also, the Predictive text for Khmer Angkor or EuroLatin (SIL) appears correctly on the Suggestion banner. Seems to be working fine.

@bharanidharanj
Copy link

Test Results

  • TEST_PICKER_SELECTION_IOS (PASSED): Retested in iOS 16.6 - iPhone 13 mobile device and here is my observation: 1. Installed the attached TestFlight internal PR build and noticed that it is showing keyman 17.0.215 version instead of showing keyman 17.0.216 version. However, I tried to test with this build. 2. Installed Khmer Angkor keyboard followed by Tamil Keyboard using Settings / Installed Languages menu. 2. Verified all the keyboards are installed under the Installed languages menu. Returned to the main page. Noticed that the Tamil keyboard is displayed on the page. 3. Noticed that the short-press or long-press the globe key only opens the 'Keyboards' menu. 4. Selecting the Khmer Angkor or EuroLatin(SIL) keyboard shows up the Predictive text on the suggestion banner.

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Nov 23, 2023
@darcywong00 darcywong00 modified the milestones: A17S26, A17S27 Nov 27, 2023
Base automatically changed from change/android/flishy-flashy-mitigation to master December 1, 2023 02:12
@jahorton jahorton merged commit 8e272d8 into master Dec 1, 2023
2 checks passed
@jahorton jahorton deleted the fix/android/banner-event-loop branch December 1, 2023 02:13
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.221-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants