Commit graph

4939 commits

Author SHA1 Message Date
Marc Durdin
b5615e3a4b fix(web): error in floating osk view when no keyboard active
This fixes an issue that arises when loading the Keyman Developer Server
home page and there are registered keyboards, but no keyboards active.
The floating osk view would throw an exception because it would attempt
to set the title of the view from the active keyboard, which is `null`.
2022-03-02 08:46:10 +11:00
Marc Durdin
6734d824a5 fix(web): stop repeated CSS injection 2022-03-02 06:37:51 +11:00
Keyman Build Agent
7dbf3ee7e2 auto: increment master version to 15.0.205 2022-03-01 13:02:38 -05:00
Marc Durdin
e9baffb50e chore(android): Merge branch 'master' into feat/android/android-web-test-harness 2022-03-01 08:10:12 +11:00
Marc Durdin
6e9969b27c
Merge pull request #6272 from keymanapp/fix/web/5853-selection-not-working
fix(web): properly handle selection 🎢
2022-03-01 08:08:02 +11:00
Marc Durdin
79328eabab
Merge pull request #6249 from keymanapp/fix/web/5853-selection-is-damaged-by-newcontext-event
fix(web): add readonly mode for rule behavior finalization 🎢
2022-03-01 08:07:48 +11:00
Keyman Build Agent
7faf71d1a8 auto: increment master version to 15.0.204 2022-02-26 13:02:45 -05:00
Marc Durdin
7273028192 chore(web): add unit test for selection and matching rule 2022-02-25 15:06:11 +11:00
Marc Durdin
c331758ec1 chore: address review suggestions 2022-02-25 08:52:20 +11:00
Marc Durdin
b1ba2d24d7 chore: enable all test cases 2022-02-25 08:47:14 +11:00
Keyman Build Agent
40df30749c auto: increment master version to 15.0.203 2022-02-24 13:02:56 -05:00
Marc Durdin
bf2270aa69 chore(web): add smp tests for text selection 2022-02-24 15:59:16 +11:00
Marc Durdin
6ba75c54f5 chore(web): disable text selection tests on mobile 2022-02-24 14:14:15 +11:00
Marc Durdin
b58ce45ef7 fix(web): add Input text selection tests 2022-02-24 11:29:34 +11:00
Marc Durdin
9b84af8a2f fix(web): add unit tests for selection
This adds a set of unit tests for the TextArea element, initially, to
verify that selection and context are working as expected.
2022-02-24 11:25:21 +11:00
Marc Durdin
003665b6df chore(web): disable legacy edge testing
Legacy edge struggles with selection direction. We
no longer support it anyway, so disable testing.
2022-02-23 15:13:10 +11:00
Marc Durdin
b05fda1c6a fix(web): selection direction and tests
Selection direction was not maintained in mutations, which could have
unexpected consequences. Added support for selection direction to input
and textarea.

The functions `getTextBeforeCaret()` and `getTextAfterCaret()` are named
somewhat incorrectly, as they actually get the text before and after the
active selection (and a collapsed zero-length selection is equivalent to
the caret). It would be worth renaming these in a future refactor.

This PR fixes the unit tests so that caret position is tested correctly
with an active selection -- the caret can be at either the start or the
end of the selection, corresponding with the direction in which the user
originally selected the text. It also fixes the assumptions around the
above named functions for `input` and `textarea` types.

Note that selection interactions are still buggy with prediction
selections; these bugs were present in 15.0.118-alpha and I will tackle
them in an upcoming commit.
2022-02-23 15:13:07 +11:00
Marc Durdin
4bcfe37432 chore: add khmer_angkor to web test pages 2022-02-23 15:13:02 +11:00
Marc Durdin
cacbbee5cc fix(web): properly handle selection
Relates to #5853 and others.

Selection management was not working properly with the various
OutputTargets:

1. When there is a non-empty selection, rules have no context -- it's
   like new text.
2. Backspace over a selection deletes just the selection.
3. Typing a character replaces the selection, of course, and collapses
   the caret to the end of the new text.
4. `hasSelection` is a very strange name for `OutputTarget` descendants.
   It doesn't mean "has an active selection" but rather, kinda means
   "supports selection internally".
5. Added `isSelectionEmpty` which is used for some of the new selection
   rules above.

Note that the `touchAlias` OutputTarget class does not currently support
selection. I hope we can deprecate `touchAlias` with the use of
`inputMode` (#3030) in the future, rather than adding support for
selection.
2022-02-23 15:12:58 +11:00
Marc Durdin
6315d61ad9 chore(web): note chrome mobile emulation req
For android-harness, it must run in Chrome mobile emulation.
2022-02-23 08:30:59 +11:00
Marc Durdin
ac2cc93f2a fix(web): add readonly mode for rule behavior finalization
Relates to #5853.

Two things happened here:

1. Construction of Mocks made an assumption that the selection should
   always be deleted (outputTarget.ts:363). However, for NewContext and
   PostKeystroke processes, we don't want to change anything.

2. Even if nothing is changed, the transcription would emit what is
   in theory a no-op ruleTransform (insert="", deleteLeft=0,
   deleteRight=0). But apps would treat this as deleting the selection.

This fix goes a little broader than I would have preferred, but adds a
readonly mode to the transcription and mock model, so that we can
control explicitly when changes are applied to the text store.
2022-02-22 10:42:20 +11:00
Marc Durdin
6cd0f5d49a chore: add web_context_tests keyboard 2022-02-22 10:41:42 +11:00
Marc Durdin
c1c6c8ac84 feat(android): Android web-based test harness
This small harness simulates the Android app. I used it to try and
dig deeper into the interactions with selected text in #5853.

It is very rough, but with some extra effort we could use this
relatively easily for some low-level testing of KeymanWeb embedded
integration.
2022-02-22 10:38:20 +11:00
Keyman Build Agent
de8a1fe220 auto: increment master version to 15.0.202 2022-02-21 13:02:21 -05:00
Keyman Build Agent
149fba62b6 auto: increment master version to 15.0.201 2022-02-20 13:02:45 -05:00
Keyman Build Agent
10e7e4a4c4 auto: increment master version to 15.0.200 2022-02-18 13:13:14 -05:00
Marc Durdin
35dc7b89bb
Merge pull request #6248 from keymanapp/fix/web/non-integer-cached-osk-size
fix(web): Non-integer OSK sizes
2022-02-18 11:17:38 +11:00
Keyman Build Agent
93c19d9adb auto: increment master version to 15.0.199 2022-02-13 13:02:58 -05:00
Keyman Build Agent
a1e1ab86c0 auto: increment master version to 15.0.198 2022-02-12 13:03:29 -05:00
Marc Durdin
da5d00c284 fix(web): Non-integer OSK sizes
If the OSK had a non-integer width or height stored in the OSK cookie,
then the width and height would be parsed incorrectly and the OSK would
fail to be sized correctly on first load; this also caused a script
error and made the OSK impossible to interact with.
2022-02-12 19:06:12 +07:00
Marc Durdin
96277a46a2
Merge pull request #6236 from keymanapp/dependabot/npm_and_yarn/web/testing/regression-tests/karma-6.3.14
chore(deps-dev): bump karma from 6.3.4 to 6.3.14 in /web/testing/regression-tests
2022-02-12 20:41:47 +11:00
dependabot[bot]
46d0e7dc98
chore(deps): bump follow-redirects in /web/testing/regression-tests
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.7.0 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.7.0...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-12 08:05:59 +00:00
dependabot[bot]
187f77a121
chore(deps-dev): bump karma in /web/testing/regression-tests
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.4 to 6.3.14.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.4...v6.3.14)

---
updated-dependencies:
- dependency-name: karma
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-11 18:03:53 +00:00
Keyman Build Agent
be12166f49 auto: increment master version to 15.0.197 2022-02-11 13:02:23 -05:00
Keyman Build Agent
dd1fbe1cac auto: increment master version to 15.0.196 2022-02-09 13:02:42 -05:00
Keyman Build Agent
6eaf6487d1 auto: increment master version to 15.0.195 2022-02-08 13:02:53 -05:00
Keyman Build Agent
d177fb3902 auto: increment master version to 15.0.194 2022-02-07 13:02:51 -05:00
Keyman Build Agent
9d12fae415 auto: increment master version to 15.0.193 2022-02-04 13:02:21 -05:00
Keyman Build Agent
c8e00045fb auto: increment master version to 15.0.192 2022-02-03 13:02:38 -05:00
Keyman Build Agent
fbd9a0d6fa auto: increment master version to 15.0.191 2022-02-02 13:02:14 -05:00
Keyman Build Agent
755be48876 auto: increment master version to 15.0.190 2022-02-01 13:02:30 -05:00
Keyman Build Agent
3ea411280a auto: increment master version to 15.0.189 2022-01-28 13:03:59 -05:00
Keyman Build Agent
ec3cfc3941 auto: increment master version to 15.0.188 2022-01-27 13:02:51 -05:00
Keyman Build Agent
a3b59448de auto: increment master version to 15.0.187 2022-01-26 13:01:27 -05:00
Keyman Build Agent
e4694fe298 auto: increment master version to 15.0.186 2022-01-25 13:02:21 -05:00
Keyman Build Agent
d886cff0a7 auto: increment master version to 15.0.185 2022-01-24 13:01:35 -05:00
Keyman Build Agent
291e0db232 auto: increment master version to 15.0.184 2022-01-21 13:01:34 -05:00
Keyman Build Agent
b55d7fc0cf auto: increment master version to 15.0.183 2022-01-20 19:58:29 -05:00
Marc Durdin
64d9634b86 fix(web): crash in setTitleFromKeyboard when no keyboard active 2022-01-20 07:54:59 +11:00
Keyman Build Agent
89e48cd688 auto: increment master version to 15.0.182 2022-01-19 13:01:27 -05:00