Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
mcdurdin
added a commit
that referenced
this pull request
Sep 11, 2024
The visual keyboard compiler was never finished in 17.0. This rewrites
it to:
1. Use the kmxplus data rather than reading from xml directly
2. Fill in `visualkeyboard.header.kbdname`
3. Support modifiers
4. Handle encoded characters like `\u{1234}`
5. Handle string variables like `${one}`*
Additional unit tests have been added to verify the behavior of the
visual keyboard compiler in more detail.
TODO-LDML: string variables appear to have a secondary bug -- they seem
to be returning the string 'undefined'. I have disabled the related
tests and will examine this separately, and enable those tests once
fixed.
TODO-LDML: we should probably add a compiler warning + unit test for
`<layers formId="us"><layer id="base">`, because this pattern does not
make sense: when using non-touch forms, the `<layer>` element should use
`modifiers` attribute, and correspondingly, `modifiers` attribute should
_not_ be used when `formId` is `touch`.
Other fixes:
1. The LDML XML reader was relying on its input being a Node.js `Buffer`
even though it was declared `Uint8Array`, as it implicitly used
`Buffer.toString()` to do text conversion. (`Buffer` subclasses from
`Uint8Array`). This breaks when using `Uint8Array` directly and means
we had an implicit dependency on Node.js. See also #12331.
2. XML errors were not captured in the LDML XML reader. See also #12331.
3. The unused and unfinished touch-layout-compiler.ts and
keymanweb-compiler.ts have been removed along with corresponding unit
tests and fixtures. These are replaced by Core implementations; see
#12291.
Fixes: #12395
mcdurdin
added a commit
that referenced
this pull request
Sep 12, 2024
The visual keyboard compiler was never finished in 17.0. This rewrites
it to:
1. Use the kmxplus data rather than reading from xml directly
2. Fill in `visualkeyboard.header.kbdname`
3. Support modifiers
4. Handle encoded characters like `\u{1234}`
5. Handle string variables like `${one}`*
Additional unit tests have been added to verify the behavior of the
visual keyboard compiler in more detail.
* String variable tests will be enabled in next commit (which is a
cherry-pick of #12404).
Other fixes:
1. The LDML XML reader was relying on its input being a Node.js `Buffer`
even though it was declared `Uint8Array`, as it implicitly used
`Buffer.toString()` to do text conversion. (`Buffer` subclasses from
`Uint8Array`). This breaks when using `Uint8Array` directly and means
we had an implicit dependency on Node.js. See also #12331.
2. XML errors were not captured in the LDML XML reader. See also #12331.
3. The unused and unfinished touch-layout-compiler.ts and
keymanweb-compiler.ts have been removed along with corresponding unit
tests and fixtures. These will be replaced by Core implementations;
see #12291.
Fixes: #12395
Cherry-pick-of: #12402
docs(core): update generated files This change updates the documentation files that get generated out of the the content in the source files. These files showed up as changed when building.
This implements `CoreKeyboardInterface.loadSerializedOptions` by getting the list of all variable store names from Core and then trying to load these. Also change `VariableStoreSerializer.loadStore` signature so that it can return `undefined`. This allows to return only those options from `loadSerializedOptions` that have a non-default value, i.e. were serialized before. Build-bot: skip build:web Test-bot: skip
…o-web-core auto: A19S27 merge master into web-core 🎼
Having a file header that mentions an old version can be confusing, so this change updates the file headers for the UI files with the current header. Build-bot: skip Test-bot: skip
Build-bot: skip build:web Test-bot: skip
Turns out that we can use `KeyboardStub` for both JS and KMX keyboards. Follows: #15888 Build-bot: skip build:web Test-bot: skip
`getKeyboardDetails` can return `null` if `stub` is falsy. This PR changes the return type accordingly to improve type safety. Follows: #15889 Build-bot: skip build:web Test-bot: skip
Consolidate test frameworks and cleanup, including: * all tests use Google Test * reorganize folders, esp. kmnkbd -> api * move all api tests into api folder * replace references to test_assert or test_color with gtest equivalents * leverage gtest patterns to remove boilerplate code * dramatically simplify meson.build files and localize variables * move shared helper code into helpers/ folder * make test names unique and add gtest protocol for reporting back to teamcity Fixes: * CLDR test keyboards had invalid unicodeset escapes (needs to be raised upstream also) - was not failing tests because files were not loading but returning success Test-bot: skip
feat(web): get list of store names from stores defined in core This implements `CoreKeyboardInterface.loadSerializedOptions` by getting the list of all variable store names from Core and then trying to load these. Also change `VariableStoreSerializer.loadStore` signature so that it can return `undefined`. This allows to return only those options from `loadSerializedOptions` that have a non-default value, i.e. were serialized before. Follow-up-of: #15470
Co-authored-by: Marc Durdin <marc@durdin.net>
refactor(web): rename variables and parameter names in KeymanEngine 🧼 🎼
This change will ignore keyboards where `getKeyboardDetails` returns `null` and will not push them to the `detailsForAllKeyboards` array. Addresses a code review comment.
…class This change moves code that was implemented in both `JSKeyboardProcessor` and `CoreKeyboardProcessor` to the `AbstractKeyboardProcessor`. This got renamed from `KeyboardProcessor` and is now a generic abstract class. Also removed some of the band-aids in `CoreKeyboardInterface` and `JSKeyboardInterface` that I put in before: Typescript allows implementations to have a slightly different method signature and still matches the interface as long as the used types are derived from the ones specified in the interface. Follows: #15870 Build-bot: skip build:web Test-bot: skip
feat(web): implement getting keyboard details for KMX keyboards 🧼 🎼 Turns out that we can use `KeyboardStub` for both JS and KMX keyboards. Follows: #15888
feat(web): clarify return type of `KeymanEngine.getKeyboardDetails` 🧼 🎼 `getKeyboardDetails` can return `null` if `stub` is falsy. This PR changes the return type accordingly to improve type safety. Follows: #15889
The export of `test-index.ts` were intended to be used by tests only, but over time they contained also exports that were consumed else where, e.g. in UI classes like `kmwuibutton.ts`. This change removes unused exports, moves test-only classes to a `unitTestEndPoints` container and marks test-only types with `@internal`. Build-bot: skip build:web Test-bot: skip
The convention is to use the `.d.ts` extension for typescript types, and that's what is used elsewhere in the `package.json` file. This change fixes the two instances that had `.d.js`.
Build-bot: skip build:web Test-bot: skip
refactor(web): move common code to abstract `KeyboardProcessor` base class This change moves code that was implemented in both `JSKeyboardProcessor` and `CoreKeyboardProcessor` to the `AbstractKeyboardProcessor`. This got renamed from `KeyboardProcessor` and is now a generic abstract class. Also removed some of the band-aids in `CoreKeyboardInterface` and `JSKeyboardInterface` that I put in before: Typescript allows implementations to have a slightly different method signature and still matches the interface as long as the used types are derived from the ones specified in the interface. Follows: #15870
chore(web): cleanup `web/src/app/browser/src/test-index.ts` exports The exports of `test-index.ts` were intended to be used by tests only, but over time they contained also exports that were consumed elsewhere, e.g. in UI classes like `kmwuibutton.ts`. This change removes unused exports, moves test-only classes to a `unitTestEndPoints` container and marks test-only types with `@internal`. Fixes: #15894
refactor(web): move context tests to typescript
Test-bot: skip Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
refactor(core): clean up unit tests 🎼
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for Keyman Core (incl. LDML keyboards) to KeymanWeb, bringing LDML keyboards to Android, iOS, and web platforms.
Note: this branch includes
epic/embed-osk-in-kmx, so be sure to check both TODO-WEB-CORE and TODO-EMBED-OSK-IN-KMX for outstanding work items.References
Seed PR:
Build-bot: build
Test-bot: skip