Commit graph

556 commits

Author SHA1 Message Date
Marc Durdin
ed63b70bb4
Merge branch 'epic/web-core' into auto/A19S22-merge-master-into-web-core 2026-02-13 11:08:05 +07:00
Joshua Horton
b3e045a7a8 change(web): define, utilize cleaner Web test-resource import paths
Build-bot: skip build:web
Test-bot: skip
2026-02-05 10:11:14 -06:00
Eberhard Beilharz
933361a520
feat(web): add and use RTL test keyboard
Build-bot: skip:all, build:web
Test-bot: skip
2026-01-29 14:52:56 +01:00
Eberhard Beilharz
4992268b77
feat(web): add unit test for RTL
This change stubs out `KMXKeyboard.isRTL` and adds a unit test for RTL
with .js and  .kmx (currently skipped) keyboards. Also change some code
to use `Keyboard` instead of `JSKeyboard` and stub out additional methods.

The RTL functionality will have to be completed when the necessary
extensions to the Core API are implemented (#15482).

Fixes: #15288
Test-bot: skip
2026-01-29 14:52:55 +01:00
Eberhard Beilharz
84aedb8616
refactor(web): rename keyboard.tests.ts → jskeyboard.tests.ts
Test-bot: skip
2026-01-29 14:52:55 +01:00
Eberhard Beilharz
bfa6dfa412
Merge pull request #15477 from keymanapp/fix/web/tests
fix(web): fix problem with tests if KEYMAN_ROOT is not set 🎼

When running mocha without starting it through `build.sh`/`test.sh` the tests failed if the `KEYMAN_ROOT` environment variable was not set. Things were almost correct, but the undefined `KEYMAN_ROOT` variable added an extra `undefined` subdirectory. This change fixes this problem by setting `KEYMAN_ROOT` relative to the current file. This gets removed by `pathToFileURL` which also adds the absolute path to the current directory since we pass a relative path as argument.
2026-01-26 11:30:22 +01:00
Eberhard Beilharz
fd2a43de95
Update web/src/test/auto/headless/engine/loadKeyboardHelper.ts
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-01-26 08:49:20 +01:00
Eberhard Beilharz
7e972ab49a
Merge pull request #15465 from keymanapp/refactor/web/ProcessorInitOptions
refactor(web): refactor `ProcessorInitOptions` 📏 🎼

This addresses a web-core TODO comment.

This change makes the `options` parameter in the `JSKeyboardProcessor` constructor no longer optional. Also `baseLayout` and `defaultOutputRules` are now required in `ProcessorInitOptions`. For testing purposes we export `DEFAULT_OPTIONS` in a testing endpoint.

The `options` parameter in the `InputProcessor` constructor is no longer optional. Also removes the `DEFAULT_OPTIONS` from
`InputProcessor`.

This change also moves the `ProcessorInitOptions` interface to a separate file and makes `keyboardInterface` a required field.

An alternative approach would have been to get rid of `ProcessorInitOptions` and instead set the `JSKeyboardProcessor` fields after creating the instance. Doing it the implemented way seemed cleaner.
2026-01-22 17:34:08 +01:00
Eberhard Beilharz
7f110d15c5
feat(web): fix build 2026-01-22 17:14:01 +01:00
Eberhard Beilharz
7d57e839ac
chore(web): Merge branch 'epic/web-core' into feat/web/15287_doModifierPress 2026-01-22 17:03:19 +01:00
Eberhard Beilharz
26542576ee
feat(web): address code review comments and fix build 2026-01-22 17:00:33 +01:00
Eberhard Beilharz
54e6a8adef
fix(web): fix problem with tests if KEYMAN_ROOT is not set
When running mocha without starting it through `build.sh`/`test.sh`
the tests failed if the `KEYMAN_ROOT` environment variable was not set.
Things were almost correct, but the undefined `KEYMAN_ROOT` variable
added an extra `undefined` subdirectory. This change fixes this problem
by setting `KEYMAN_ROOT` to the current directory (`.`). This gets
removed by `pathToFileURL` which also adds the absolute path to the
current directory since we pass a relative path as argument.

Build-bot: skip
Test-bot: skip
2026-01-21 15:25:35 +01:00
Eberhard Beilharz
40ce71a63f
refactor(web): address code review comments
The definition of `DEFAULT_PROCESSOR_INIT_OPTIONS` got lost in
last PR.

Test-bot: skip
2026-01-21 13:07:43 +01:00
Eberhard Beilharz
2b56e871f8
chore(web): Merge branch 'epic/web-core' into feat/web/persistopts 2026-01-21 12:44:33 +01:00
Eberhard Beilharz
ad10627e1c
chore(web): Merge branch 'refactor/web/defaultRules' into refactor/web/ProcessorInitOptions 2026-01-20 12:12:22 +01:00
Eberhard Beilharz
8ecaae5f21
refactor(web): address code review comments
- remove confusing comment
- move default ProcessorInitOptions to tests folder
- add jsdoc comments to ProcessorInitOptions

Test-bot: skip
2026-01-20 12:10:25 +01:00
Eberhard Beilharz
485ea55800
chore(web): Merge remote-tracking branch 'origin/epic/web-core' into feat/web/15287_doModifierPress 2026-01-20 11:41:05 +01:00
Eberhard Beilharz
03eba3cf55
Merge pull request #15463 from keymanapp/refactor/web/test-index
refactor(web): use unitTestEndpoint pattern in OSK 🎼

This changes the exports for unit testing to the unitTestEndpoint pattern.

Part-of: #15292
2026-01-20 08:41:40 +01:00
Eberhard Beilharz
b8d2dc5726
Merge pull request #15462 from keymanapp/refactor/web/exports
refactor(web): remove web-utils exports from keyboard 🎼

Types defined in keyman/common/web-utils were re-exported in keyman/engine/keyboard. This change removes the re-export.

Part-of: #15292
2026-01-20 08:39:58 +01:00
Eberhard Beilharz
8d3a6da260
fix(web): fix baseline tests
Previously the cookies for the baseline tests were set to a fixed time
which might be in the past. This change now calculates the expiration
time and sets them to expire in 60s.

Test-bot: skip
2026-01-19 18:17:03 +01:00
Eberhard Beilharz
2e404390c0
Merge pull request #15437 from keymanapp/feat/web/findStores
feat(web): add `findStores` functions 🍪

This change adds a static `findStores` function to `VarStoreSerializer` and `VariableStoreCookieSerializer` as well as to the `VariableStoreSerializer` interface.

Also add unit tests for `VariableStoreCookieSerializer`.

Part-of: #13426
2026-01-19 13:01:03 +01:00
Eberhard Beilharz
77b4bd8037
refactor(web): options parameter mandatory in JSKeyboardProcessor c'tor
This makes the `options` parameter in the `JSKeyboardProcessor`
constructor no longer optional.
Also `baseLayout` and `defaultOutputRules` are now required in
`ProcessorInitOptions`.

For testing purposes we export `DEFAULT_OPTIONS` in a testing endpoint.

Test-bot: skip
2026-01-16 17:48:40 +01:00
Eberhard Beilharz
aea2e2ab98
refactor(web): use unitTestEndpoint pattern in OSK
This changes the exports for unit testing to the unitTestEndpoint pattern.

Part-of: #15292
Test-bot: skip
2026-01-16 16:37:49 +01:00
Eberhard Beilharz
9930a8cbae
refactor(web): remove web-utils exports from keyboard
Types defined in keyman/common/web-utils were re-exported in
keyman/engine/keyboard. This change removes the re-export.

Part-of: #15292
Test-bot: skip
2026-01-16 16:25:32 +01:00
Eberhard Beilharz
7c05ac8239
Merge pull request #15431 from keymanapp/chore/web/e2e
chore(web): fix e2e tests 🍪

The Playwright tests occasionally failed complaining about `Page` and `Locator` not being defined. The solution is to import them as types.

The test failures probably happened when running the tests with a node version > 20.16.0.
2026-01-15 12:53:11 +01:00
Eberhard Beilharz
5e380c0f72
feat(web): implement persisting keyboard options
- move `CoreKeyboardInterface` to separate file
- add variable store to `CoreKeyboardInterface` to manage variable stores
  for active keyboard
- Add `VariableStoreSerializer` parameter to `CoreKeyboardProcessor.init()`
- Implement `process_persist_action()` to save options to persistent
  storage
- Update keyboard activation to load stored options from serializer

Closes: #13426
Test-bot: skip
2026-01-15 12:49:28 +01:00
Eberhard Beilharz
aa0a02cdb3
feat(web): small changes to test keyboards
- in `baseline.tests.html` default to keyboard name if `id` is not set
- in `kmxkeyboard.html` allow to pass the keyboard name (as `keyboard`
  query parameter), and rename existing `keyboard` query parameter to
  `type`.

Test-bot: skip
2026-01-15 12:49:28 +01:00
Eberhard Beilharz
a8c68711da
feat(web): add findStores functions
This change adds a static `findStores` function to `VarStoreSerializer`
and `VariableStoreCookieSerializer` as well as to the
`VariableStoreSerializer` interface.

Also add unit tests for `VariableStoreCookieSerializer`.

Part-of: #13426
Test-bot: skip
2026-01-15 12:28:56 +01:00
Eberhard Beilharz
f8546c0e5f
feat(web): address code review comments
Test-bot: skip
2026-01-15 11:57:41 +01:00
Eberhard Beilharz
4e1b7730e4
chore(web): fix e2e tests
The Playwright tests occasionally failed complaining about `Page`
and `Locator` not being defined. The solution is to import them as
types.

Test-bot: skip
2026-01-14 18:16:57 +01:00
Eberhard Beilharz
ac22e0b1c5
feat(web): add CookieSerializer.loadAllMatching function
- rename tests from `cookies.tests.ts` → `cookieSerializer.tests.ts`
- add test for new function

Part-of: #13426
Test-bot: skip
2026-01-14 11:08:23 +01:00
Eberhard Beilharz
d0c7810348
Merge pull request #15370 from keymanapp/test/web/optbaseline
test(web): add option setting/verification to baseline tests 

Also enable some .js tests that are now passing with these changes.
2026-01-07 15:30:30 +01:00
Eberhard Beilharz
afe6f467e3
Merge branch 'epic/web-core' into test/web/problem 2026-01-07 11:37:49 +01:00
Eberhard Beilharz
5666b4296e
Merge branch 'epic/web-core' into test/common/baseline 2026-01-06 18:54:37 +01:00
Eberhard Beilharz
65642ae2d4
Merge pull request #15341 from keymanapp/test/web/jsbaseline
test(web): add baseline tests for .js keyboards

This change adds baseline tests for .js keyboards. Several of those tests fail and so are skipped for now (#15342).

This test also includes the .js files of the baseline keyboards because they can't easily be generated on non-Windows platforms. This is similar to the .kmx files that are also included in the repo for the same reason.
2026-01-06 18:52:45 +01:00
Eberhard Beilharz
79cc8e7258
test(web): address code review comments 2026-01-06 18:42:58 +01:00
Eberhard Beilharz
f65a752b47
test(web): address code review comments 2026-01-06 18:19:07 +01:00
Eberhard Beilharz
5f2e72749a
test(web): address code review comments 2026-01-06 17:43:27 +01:00
Eberhard Beilharz
4ba1fcbfb3
Merge pull request #15376 from keymanapp/refactor/web/keyboard-storage
refactor(web): remove defaults in keyboard-storage

- Also renamed `prefixed` and `withoutPrefix` functions to use the name   that was aliased on most cases: `toPrefixedKeyboardId` and   `toUnprefixedKeyboardId`. 
- Renamed `ModelManager` class to `ModelCache` which was the name used   everywhere except in comments.

Part-of: #15292
2025-12-22 14:53:28 +01:00
Eberhard Beilharz
5b38557227
refactor(web): remove defaults in keyboard-storage
- Also renamed `prefixed` and `withoutPrefix` functions to use the name
  that was aliased on most cases: `toPrefixedKeyboardId` and
  `toUnprefixedKeyboardId`.
- Renamed `ModelManager` class to `ModelCache` which was the name used
  everywhere except in comments.

Part-of: #15292
Test-bot: skip
2025-12-19 18:43:02 +01:00
Eberhard Beilharz
7a1964034c
test(web): add another test to testsToFix for .kmx keyboards
Adding the option verification caused another .kmx test to fail because
the feature is not yet implemented.

Test-bot: skip
2025-12-19 12:16:58 +01:00
Eberhard Beilharz
ba16fc7033
test(web): add option setting/verification to baseline tests 🧪
Test-bot: skip
2025-12-18 19:36:46 +01:00
Eberhard Beilharz
e6a6b75115
test(common): add new baseline test k_0202___alt.kmn
This is basically the same test as `k_0201___ralt_2.kmn` but uses
ALT instead of RALT in the rule.

Also update `k_0201___ralt_2.kmn` to be a bit more extensive.

Note: since the change in `k_0201___ralt_2.kmn` is only in the test
data, i.e. the comments, the .js and .kmx files don't change.

Related-to: #15358
Test-bot: skip
2025-12-16 16:52:13 +01:00
Eberhard Beilharz
6de40e903b
test(common): better group baseline tests
This change groups similar tests together. Also update `build.sh` to
compile .js files.

Follow-up-of: #15341
Test-bot: skip
2025-12-15 18:12:01 +01:00
Eberhard Beilharz
80c1f8864a
test(web): add baseline tests for .js keyboards
Test-bot: skip
2025-12-12 18:23:39 +01:00
Eberhard Beilharz
68de61ad9c
feat(web): implement doModifierPress
Fixes: #15287
Test-bot: skip
2025-12-11 19:29:23 +01:00
Eberhard Beilharz
dbb05e3fcc
refactor(web): use constants instead of hard coded values
And some other refactorings.

Test-bot: skip
2025-12-11 19:27:03 +01:00
Eberhard Beilharz
d1ddff8b56
refactor(web): cleanup and clarifications
Build-bot: skip
Test-bot: skip
2025-12-09 20:15:50 +01:00
Eberhard Beilharz
654f1b2103
chore(web): Merge remote-tracking branch 'origin/epic/web-core' into feat/web/15283_keydown 2025-12-09 20:06:48 +01:00
Eberhard Beilharz
c87f29648b
Merge pull request #15278 from keymanapp/test/web/tcreporter 2025-12-09 20:04:27 +01:00