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

feat(app): add support for pinyin layout candidates in ODD keyboard #16873

Open
wants to merge 3 commits into
base: edge
Choose a base branch
from

Conversation

smb2268
Copy link
Contributor

@smb2268 smb2268 commented Nov 18, 2024

fix EXEC-885

Overview

This PR adds support for a pinyin keyboard on the ODD and ensures the language update modal doesn't automatically open on desktop unless the user's system language has changed to one that we support

Test Plan and Hands on Testing

With the enableLocalization feature flag on:

  1. Opened dev odd app, change language to chinese and open one of the four keyboard locations (name quick transfer, wifi network name, wifi password, name robot) and enter any of the keys in this layout candidates object. See the chinese characters populate above
  2. With the desktop app open, change your computer's system language to any locale in a supported language (english or chinese) and see a modal pop up that allows you to select to use the system's language. Change the system language to one we don't support and you shouldn't see the pop up
Screen Shot 2024-11-14 at 3 10 55 PM

Changelog

  1. Add simple-keyboard-layouts as a dependency and pass the pinyin layout object to FullKeyboard and Alphanumeric keyboard if the app language is Chinese. Add some styling for this, with 60x60 keys and enough width to show all of them
  2. Stop pop-up system language modal from showing in the app if the system has changed to a language we don't support

Review requests

Look over code, test this out if you can

Risk assessment

Low

@smb2268 smb2268 marked this pull request as ready for review November 19, 2024 19:59
@smb2268 smb2268 requested review from a team as code owners November 19, 2024 19:59
Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

lgtm with the one consideration!


// @ts-expect-error layout candidates exists but is not on the type
// in the simple-keyboard-layouts package
export const pinYinLayoutCandidates = chineseLayout.layoutCandidates
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, it might be a little cleaner to make this a record of appLanguage to layout, so like

{ 'zh-CN' : chineseLayout.layoutCandidates}

So that way in FullKeyboard, we can simply do

layoutCandidates={supportedLayouts[appLanguage]}

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

Successfully merging this pull request may close these issues.

2 participants