Skip to content

Conversation

@MattGyverLee
Copy link
Contributor

@MattGyverLee MattGyverLee commented Dec 8, 2025

This is a pull request to resolve #9768

This change addresses a usability issue where subkey popup menus with
even-numbered columns (2, 4, 6, 8) create ambiguous default selection.
When there's an even number of columns, the centered position falls
between two options, making it less predictable which character will be selected.

The solution shifts the popup menu alignment based on the base key's
position on the keyboard:

  • Keys on the right side: shift popup menu left by half a key width
  • Keys on the left side: shift popup menu right by half a key width

This ensures one option always sits unambiguously under the default
touch position, following the pattern used by Google's Gboard.

It is noted that the shift may be larger (up to a limit) if the selected key has an unusual width.

Changes:

  • Added numColumns instance variable to track column count
  • Modified reposition() to apply shift for even-column layouts
  • Added comprehensive unit tests for even/odd column scenarios
  • Existing bounds checking prevents menu overflow

Closes #9768 (#9768)

User Testing:

  1. Open a keyboard with larger popup key menus like EuroLatin.
  2. Longpress the g, which has 6 glyphs in the popup (the code only activates when there is an even number of rows).
  3. If this code is working, the popup should have shifted to the side so that one key is unambiguously selected. If not, sliding your finger left and right over the centerline will toggle between 2 keys.

…app#9768)

This change addresses a usability issue where subkey popup menus with
even-numbered columns (2, 4, 6, 8) create ambiguous default selection.
When there's an even number of columns, the centered position falls
between two options, making it unclear which character will be selected.

The solution shifts the popup menu alignment based on the base key's
position on the keyboard:
- Keys on the right side: shift menu left by half a key width
- Keys on the left side: shift menu right by half a key width

This ensures one option always sits unambiguously under the default
touch position, following the pattern used by Google's Gboard.

Changes:
- Added numColumns instance variable to track column count
- Modified reposition() to apply shift for even-column layouts
- Added comprehensive unit tests for even/odd column scenarios
- Existing bounds checking prevents menu overflow

Closes keymanapp#9768
@MattGyverLee MattGyverLee requested a review from jahorton December 8, 2025 19:53
@github-project-automation github-project-automation bot moved this to Todo in Keyman Dec 8, 2025
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Dec 8, 2025
@keymanapp-test-bot
Copy link

User Test Results

Test specification and instructions

ERROR: user tests have not yet been defined

@keymanapp-test-bot keymanapp-test-bot bot added this to the A19S18 milestone Dec 8, 2025
@keyman-server
Copy link
Collaborator

This pull request is from an external repo and will not automatically be built. The build must still be passed before it can be merged. Ask one of the team members to make a manual build of this PR.

@MattGyverLee MattGyverLee marked this pull request as draft December 8, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat user-test-missing User tests have not yet been defined for the PR web/

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

feat(web): subkey menu realignment when subkey columns are even

3 participants