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(web): ios popup positioning and style #6383

Merged
merged 9 commits into from
Mar 27, 2022

Conversation

mcdurdin
Copy link
Member

@mcdurdin mcdurdin commented Mar 16, 2022

Fixes #5929.
Fixes #6381.

This fixes four separate issues with the longpress popups and key previews:

  1. The key preview was offset by a couple of pixels (unreported issue).
  2. The background 'shim' did not cover the key caps, which caused them to look startlingly white when the rest of the background greyed down (bug(web): longpress menus blend into underlying keyboard #5929).
  3. The popup menu was incorrectly wrapping to two rows due to sizing model mismatches (bug(web): longpress popup has incorrect shape #6381).
  4. The popup menu would be realigned incorrectly for the in-app keyboard, when moving it to keep it in the keyboard area (bug(web): longpress menus blend into underlying keyboard #5929).

Longpress iOS (Chrome simulation):

image

Key preview iOS (Chrome simulation):

image

User Testing

  • We need to verify the behaviour of the longpress menu and the key preview. If possible, capture screenshots of both of these elements when running the tests, so we can compare.

  • Suggest using sil_euro_latin keyboard for this test, as it has many big longpress menus.

  • Test single-row long presses, such as long-press m, and multi-row, such as long-press g or e.

TEST_IOS: Verify that the in-app keyboard and system keyboard both display longpress menus and key previews correctly. Note that the longpress menu will be constrained to fit within the keyboard area on iOS, due to limitations with iOS system keyboards. Please test on iPhone 13 Pro and iPhone SE. Consider other devices also. Please test with 4 and 5 row keyboards.
TEST_ANDROID: Verify that the in-app keyboard and system keyboard both display longpress menus and key previews correctly.
TEST_WEB_IOS: Verify that the web keyboard in unminified/testing, on an iOS simulator or device, displays longpress menus and key previews correctly. Please test on iPhone 13 Pro and iPhone SE. Consider other devices also. Please test with 4 and 5 row keyboards.
TEST_WEB_ANDROID: Verify that the web keyboard in unminified/testing, on an Android emulator or device, displays longpress menus and key previews correctly.

Fixes #5929.
Fixes #6381.

This fixes four separate issues with the longpress popups and key
previews:

1. The key preview was offset by a couple of pixels (unreported issue).
2. The background 'shim' did not cover the key caps, which caused them
   to look startlingly white when the rest of the background greyed
   down (#5929).
3. The popup menu was incorrectly wrapping to two rows due to sizing
   model mismatches (#6381).
4. The popup menu would be realigned incorrectly for the in-app
   keyboard, when moving it to keep it in the keyboard area (#5929).
@mcdurdin mcdurdin added this to the B15S4 milestone Mar 16, 2022
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed labels Mar 16, 2022
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Mar 16, 2022

User Test Results

Test specification and instructions

  • TEST_IOS (PASSED): ): I am comfortable with going ahead with that very minor artifact. Thank you for your attention to detail 😁
  • TEST_ANDROID (PASSED): Round 2 passed on Pixel 2 emulator with Android API 29 (notes)
  • TEST_WEB_IOS (PASSED): Tested this in Unminified page on iPhone 13 Pro Simulator and it seems to be working as expected. (notes)
  • TEST_WEB_ANDROID (PASSED): Re-tested this on Android emulator (API 30) in Unminified Page and it seems to be working as expected. (notes)

Test Artifacts

@darcywong00
Copy link
Contributor

darcywong00 commented Mar 16, 2022

Test Results

  • TEST_ANDROID (PASSED): Popup and longpress keys appear normal
    Tested on Pixel 2 emulator with Android API 29

In-app popup key
inapp-popup

In-app longpress keys
inapp-longpress

System popup key
system-popup

System longpress keys
system-longpress

@bharanidharanj
Copy link

  • TEST_IOS (PASSED): Tested on iOS 15.2 Simulator and it is working as expected.

In-App Key Preview

System Keyboard Key Preview

In-App Key Long Press (single row)

In-App Key Long Press (multiple rows)

System Keyboard Long Press (single row)

System Keyboard Long Press (multiple rows)

@bharanidharanj
Copy link

  • TEST_WEB_ANDROID (PASSED): Tested this on Android Emulator (API 29 - Version 10.0) and it is working as expected.

Key Preview - Unminfied Page

Long Press Single Row - Unminified Page

Long Press Multiple Rows - Unminified Page

@bharanidharanj
Copy link

  • TEST_WEB_IOS (PASSED): Tested this on iOS 15.2 Simulator in the Keyman Web page and it is working as expected.

Key Preview - Unminified Page

Long Press - Single row -Unminified Page

Long Press - Multiple rows - Unminified Page

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Mar 16, 2022
@mcdurdin
Copy link
Member Author

mcdurdin commented Mar 16, 2022

Hmm, the positioning is certainly better than before. But it doesn't look quite right on KeymanWeb in iOS and Keyman for iOS. So will have another round.

Note that the problem is that Safari's CSS is diverging from Chrome here. I haven't identified what is triggering the difference yet.

Key Preview, Keyman for iOS

image

image

Longpress, Keyman for iOS

image

Key Preview, KeymanWeb on Safari / iOS

image

Longpress, KeymanWeb on Safari / iOS

image

Final issue: some keys are misaligned, only in Safari, not in Chrome:

image

Font size adjustment needed an override for the key preview to prevent
it using the base key font size as a starting point.
On Safari, some keys were vertically misaligned, due to different
default vertical-align.
Adjusts calculations for key preview and ensures we use box-sizing:
content-box in all circumstances, to make it consistent across all
platforms.
Adjusts positioning calculations for longpress popups and corresponding
styles to make it consistent across all platforms, particularly iOS.
@mcdurdin
Copy link
Member Author

So I've done another round of tweaks to the positioning to try and get it working better. I have tested locally on my test build with Chrome on Windows (emulation and in developer frame), and in Safari on iOS, but not yet in iOS app.

But this sadly means retesting everything, so sorry @bharanidharanj and @darcywong00! The screenshots were very helpful, please keep them coming.

@keymanapp-test-bot retest all

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-required User tests have not been completed label Mar 16, 2022
@darcywong00
Copy link
Contributor

  • TEST_ANDROID (PASSED): Round 2 passed on Pixel 2 emulator with Android API 29

inapp keyboard - popup
inapp-popup

inapp keyboard - longpress
inapp-longpress

system keyboard - popup
system-popup

system keyboard - longpress
system-longpress

@bharanidharanj
Copy link

  • TEST_WEB_ANDROID (PASSED): Re-tested this on Android emulator (API 30) in Unminified Page and it seems to be working as expected.

Unminified Page - Popup

Unminified Page - Long Press

@bharanidharanj
Copy link

  • TEST_IOS (PASSED): Tested this on iPhone 13 Pro (iOS 15.2) Simulator and the long press functionality seems to be deviated from the alignment. I don't know whether my assumption is right or wrong.

In-App - Popup

In-App - Long Press

System Keyboard - Popup

System Keyboard - Long Press

@bharanidharanj
Copy link

  • TEST_WEB_IOS (PASSED): Tested this on iPhone 13 Pro Simulator (iOS 15.2) in Unminified Page and it seems to be working as expected.

System Keyboard - Popup

System Keyboard - Long Press (Single row)

System Keyboard - Long Press (Multiple row)

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Mar 18, 2022
Base automatically changed from fix/web/bounding-rect-offset to beta March 19, 2022 02:13
@mcdurdin
Copy link
Member Author

  • TEST_IOS (PASSED): Tested this on iPhone 13 Pro (iOS 15.2) Simulator and the long press functionality seems to be deviated from the alignment. I don't know whether my assumption is right or wrong.

Yes, this doesn't look right... 😢

TEST_IOS FAILED

@mcdurdin
Copy link
Member Author

Okay, I've fixed up the issues with the callout positioning on iOS.

@keymanapp-test-bot retest TEST_IOS

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-required User tests have not been completed label Mar 22, 2022
@MakaraSok
Copy link
Collaborator

TEST_IOS (FAILED): the alignment on the key when long pressed looks better, but the visible border between the base key and the subkey is still seen on the first row, i.e. key q, w, r, t, y and p.

in both in-app and system

The visible border between the preview key and its base key is seen on all rows. The preview key doesn't seen to be fully aligned center. The right part of the key looks longer than that of the left.
1st row
visible border - 1st row

2nd row
visible border - 2nd row

3 row
visible border - 3rd row

The visible border between the subkey and its base is seen on the 1st row only, but not the 2nd and 3rd. No alignment issue seen though, AFA I can tell.
1st row
visible border - 1st - sub:base

2nd row
no visble border - 2nd row - sub:base

3rd row
no visble border - 3rd - sub:base


Bonus screen recording if they help in anyway.

in-app

Screen.Recording.2022-03-22.at.9.27.16.AM.mov

system

Screen.Recording.2022-03-22.at.9.42.55.AM.mov

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Mar 22, 2022
Adjusts the dimensions to use pixel boundaries to prevent antialiasing
for some of the key preview and longpress popups, and adjusts horizontal
positioning of key preview to center more precisely, for iOS.
@mcdurdin
Copy link
Member Author

Okay, I've tweaked the positions slightly with the latest commit. Can you check these again per spec?

Sample key preview from Safari on iOS (zoomed):

image

@keymanapp-test-bot retest TEST_IOS TEST_WEB_IOS

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-required User tests have not been completed label Mar 22, 2022
@bharanidharanj
Copy link

bharanidharanj commented Mar 23, 2022

  • TEST_IOS (FAILED): Re-tested this in iPhone 13 Pro (iOS 15.2) Simulator with the new PR (iOS) and I noticed that while long pressing the top row buttons the base key goes behind the multiple rows view. (eg., long pressing e letter would open the multiple rows popup, but the base key e is not shown)

In-App - Popup:

In-App - LongPress (Single row):

In-App LongPress (Multiple rows):

System Keyboard - popup:

System Keyboard - Long Press (Single row):

System Keyboard - Long Press (Multiple rows):

@bharanidharanj
Copy link

  • TEST_WEB_IOS (PASSED): Tested this in Unminified page on iPhone 13 Pro Simulator and it seems to be working fine.
    Note: It is also working fine even in the Caps Lock is one.

Unminified Page : Popup

Unminified Page : Long Press (Single row)

Unminified Page : Long Press (Multiple rows)

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Mar 23, 2022
@mcdurdin
Copy link
Member Author

mcdurdin commented Mar 23, 2022

Please note that the longpress menu overlapping the e key is not a bug, but forced on us because iOS does not allow our longpress menu to be outside the keyboard frame.

But I'm still seeing some artifacts and alignment issues on your screenshots @bharanidharanj. I've highlighted a few of them from TEST_IOS; the TEST_WEB_IOS screenshots show the same issues. Neither the key preview nor the longpress are perfect.'

I tested on the iPhone SE 3rd Generation 15.4 Simulator and things looked pretty much pixel perfect there. However @bharanidharanj tested on iPhone 13 Pro and here things did not look right. So now to find out why.

Some examples:

  1. antialiasing lines in junction between key tip and key cap (In-App - Popup, m key, Eurolatin):

    image

  2. key tip has wrong bottom alignment (In-App - Longpress, m key, Eurolatin):

    image

  3. key tip has wrong bottom alignment (In-App - Longpress, e key, Eurolatin).:

    image

    (Same issues apply for o key, Long Press, System Keyboard)

  4. key cap does not correctly overlap the key tip (System Keyboard - popup, p key, Eurolatin):

    image

    A secondary issue here is that the key preview should probably be moved right by the border width?

  5. key tip has wrong bottom alignment (System Keyboard - Longpress, m key, Eurolatin):

    image

  6. key tip does not overlap the longpress menu (web, Longpress, m key, Eurolatin):

    image

  • TEST_IOS: FAILED due to artifacts described above
  • TEST_WEB_IOS: FAILED due to artifacts described above

@mcdurdin
Copy link
Member Author

Okay, I've tried again and tested locally on both iPhone SE 3rd gen and iPhone 13 Pro to cater to the different resolutions. We should probably test against both those devices and with more than one keyboard -- the subpixel calculations can mask issues on different resolutions.

@keymanapp-test-bot retest TEST_IOS TEST_WEB_IOS

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-required User tests have not been completed label Mar 23, 2022
@bharanidharanj
Copy link

Okay, I've tried again and tested locally on both iPhone SE 3rd gen and iPhone 13 Pro to cater to the different resolutions. We should probably test against both those devices and with more than one keyboard -- the subpixel calculations can mask issues on different resolutions.

@keymanapp-test-bot retest TEST_IOS TEST_WEB_IOS

@mcdurdin Okay.

@bharanidharanj
Copy link

  • TEST_IOS (FAILED): Re-tested this in iPhone 13 Pro (iOS 15.2) Simulator with the updated PR (iOS) and I noticed that while long pressing the top row buttons the key tip has wrong bottom alignment as mentioned by Marc. (in his previous comments)

In-App - Popup:

In-App - LongPress (Single row):

In-App - LongPress (Multiple rows):

System Keyboard - popup:

System Keyboard - Long Press (Single row):

System Keyboard - Long Press (Multiple rows):

@bharanidharanj
Copy link

  • TEST_WEB_IOS (PASSED): Tested this in Unminified page on iPhone 13 Pro Simulator and it seems to be working as expected.

Unminified Page : Popup

Unminified Page : Single row

Unminified Page : Multiple rows

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Mar 24, 2022
@mcdurdin
Copy link
Member Author

  • TEST_IOS (FAILED): Re-tested this in iPhone 13 Pro (iOS 15.2) Simulator with the updated PR (iOS) and I noticed that while long pressing the top row buttons the key tip has wrong bottom alignment as mentioned by Marc.

Good catch! I missed that when I was re-testing. Okay, I have put in a fix for that, can you retest please?

@keymanapp-test-bot retest TEST_IOS

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-required User tests have not been completed label Mar 25, 2022
@bharanidharanj
Copy link

  • TEST_IOS (FAILED): Re-tested this in iPhone 13 Pro (iOS 15.2) Simulator with the updated PR (iOS) and I noticed that while long pressing the top row buttons the key tip has wrong bottom alignment as mentioned by Marc.

Good catch! I missed that when I was re-testing. Okay, I have put in a fix for that, can you retest please?

@keymanapp-test-bot retest TEST_IOS

@mcdurdin Okay. I will re-test it. Thanks.

@bharanidharanj
Copy link

  • TEST_IOS (FAILED): Retested this with the attached PR build (Keyman 15.0.211-beta-6383) in iPhone SE and the key tip has wrong bottom alignment in Longpress (Multiple rows). I am seeing the same result in iPhone 13 Pro Simulator too.

In-App (Popup)

In-App - Long Press (Single row)

In-App - Long Press (Multiple rows)

System Keyboard - Popup

System Keyboard - Long Press (Single row)

System Keyboard - Long Press (Multiple rows)

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Mar 25, 2022
@mcdurdin
Copy link
Member Author

  • TEST_IOS (FAILED): Retested this with the attached PR build (Keyman 15.0.211-beta-6383) in iPhone SE and the key tip has wrong bottom alignment in Longpress (Multiple rows). I am seeing the same result in iPhone 13 Pro Simulator too.

TEST_IOS (PASSED): I am comfortable with going ahead with that very minor artifact. Thank you for your attention to detail 😁

@mcdurdin mcdurdin merged commit 295f251 into beta Mar 27, 2022
@mcdurdin mcdurdin deleted the fix/web/5929-ios-popup-positioning-and-style branch March 27, 2022 17:46
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 15.0.223-beta

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

Successfully merging this pull request may close these issues.

None yet

6 participants