Commit graph

1686 commits

Author SHA1 Message Date
Joshua Horton
0598e080bd change(web): import ordering, SearchSpace.inputSequence getter 2025-08-12 08:41:15 -05:00
Joshua Horton
b544aeff37
change(web): Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-08-12 20:32:28 +07:00
Joshua Horton
ab52938d96 docs(web): adds doc-comments for textToCharTransforms(), ContextToken class 2025-08-08 09:22:01 -05:00
Joshua Horton
063054a592 refactor(web): relocate textToCharTransforms method 2025-07-30 12:09:26 -05:00
Joshua Horton
e0c553d306 change(web): appliedSuggestionId should be undefined, not -1, when none are applied 2025-07-30 09:22:09 -05:00
Joshua Horton
0ceffce32e refactor(web): refactor ContextToken and usage pattern
Also places the class within its own separate source file.

This PR's changes aim to meet our _current_ needs while moving much closer to the design specified within the [Correction-Search + Context-Tracking design doc](https://docs.google.com/document/d/1RYwgW8zI8A7VLMq40BpWYkfJJQ-i6K0MIs4QcAMxglE/edit?tab=t.0).
2025-07-30 09:22:03 -05:00
Joshua Horton
145f34f434
Merge pull request #14384 from keymanapp/change/web/split-suggestion-transforms
change(web): split suggestion transforms into main-body + appended (whitespace) transforms 🚂
2025-07-24 22:00:03 +07:00
Joshua Horton
c4e0faa101
Merge pull request #14365 from keymanapp/refactor/web/attempt-match-context
refactor(web): rework `attemptMatchContext` to use new `attemptTokenizedAlignment` method 🚂
2025-07-24 21:59:48 +07:00
Joshua Horton
521aae9709
Merge pull request #14364 from keymanapp/refactor/web/attempt-tokenized-alignment
refactor(web): new method - attemptTokenizedAlignment 🚂
2025-07-24 21:59:38 +07:00
Joshua Horton
3c36ee2e73
change(web): fix typo (per PR review)
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-07-24 20:38:03 +07:00
Joshua Horton
7e88fa2c41 docs(web): enhance doc-comment for getEditPathLastMatch
Per review request by @ermshiperete
2025-07-23 13:43:26 -05:00
Joshua Horton
0f3130fbd4
fix(web): properly apply Transforms in sequence
Thanks to a PR review that caught an accidental restart that hid one of the Transforms

Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-07-22 23:48:37 +07:00
Joshua Horton
f264fca881 change(web): split suggestion transforms into main-body + appended (whitespace) transforms 2025-07-21 15:57:28 -05:00
Joshua Horton
cd59e1fffb
fix(web): correct typo in unit test name
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-07-21 22:12:17 +07:00
Joshua Horton
a1c10de821 refactor(web): reworks attemptMatchContext to use new attemptTokenizedAlignment method
Following from #14364, this PR integrates the new method with the main predictive-text context-tracking code, significantly reworking the `attemptMatchContext` method in the process.  While further refactoring of the latter method is planned, this step allows us to verify that the new methods integrate properly with the main codebase in their current form.

This also comes with the benefit of simplifying `attemptMatchContext` _significantly_ - large parts of its code were refactored into `attemptTokenizedAlignment`, and the new logic patterns are generally more straightforward to parse and understand.
2025-07-15 14:16:51 -05:00
Joshua Horton
8c052968ae refactor(web): new method - attemptTokenizedAlignment
Following from #14363, this method performs context alignment calculations that may be
used to match forms of the context before and after an edit by aligning their tokens and
validating any edits that may have occurred.

Note that no 'tracked context' states are manipulated or altered by this method - it
solely calculates the alignment deltas needed to align the two contexts.  Other methods
may then take these values and determine the edits that occurred during the associated
context transition as needed.

Note that the `attemptTokenizedAlignment` method is not integrated into the main codebase
for the predictive-text worker at this time.  That said, this method _does_ integrate
the `isSubstitutionAlignable` method introduced by #14363.
2025-07-15 13:55:21 -05:00
Joshua Horton
9bbed384e6 feat(web): adds isSubstitutionAlignable to assist validating context matches after edits
This adds one new method within the predictive-text worker space: isSubstitutionAlignable. The method is designed to report whether or not two words are "related enough" to consider as an appropriate word-level "substitution" when matching the incoming context against previously-seen contexts - a process useful for facilitating delayed reversions, among other things.

It is not yet integrated with the main body of worker code, however.
2025-07-15 13:41:38 -05:00
Joshua Horton
606c7e7767 change(web): do not set deleteRight when merging Transforms without it 2025-07-10 09:17:12 -05:00
rc-swag
fd71c6354a
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-06-09 14:11:55 +10:00
Eberhard Beilharz
19d808c6e5
refactor(web): clarify API of KeymanSentryManager
This change marks the functions of `KeymanSentryManager` as public
or private, depending on whether or not they are used outside of the
module.

Test-bot: skip
2025-06-02 18:37:22 +02:00
Marc Durdin
31c55159c3
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-05-30 08:23:56 +07:00
Eberhard Beilharz
623d9b1d95
Merge pull request #14034 from keymanapp/feat/web/cherry-pick/fixtests 2025-05-26 18:41:44 +02:00
Eberhard Beilharz
dba5108989
chore(web): mark some private methods as being private 2025-05-23 17:45:09 +02:00
Joshua Horton
245f2324df fix(web): update sentry-integration test page setup 2025-05-23 09:00:29 +07:00
Joshua Horton
2f3286b020 fix(web): updates android-harness test page setup to use module-bundled Sentry 2025-05-23 08:18:33 +07:00
Eberhard Beilharz
a3e919f4ac
chore(web): cleanup async methods in UI components
Cherry-pick of changes in #12291. Addresses code review comment.

Test-bot: skip
2025-05-22 19:15:54 +02:00
Joshua Horton
bfb97ca0c6 maint(web): upgrade Sentry to 8.55.0
Fixes: KEYMAN-WEB-RX
(It was produced artificially after this PR's changes to validate them.)

Cross-reference with https://github.com/getsentry/sentry-javascript/blob/master/docs/migration/v7-to-v8.md in regard to minimum supported versions.

@keymanapp-test-bot skip
2025-05-22 14:02:16 +07:00
Joshua Horton
437b2019e0
Merge pull request #13959 from keymanapp/fix/web/default-layout-font-scaling
fix(web): empty layout fontSize property should default to 1em
2025-05-19 08:43:48 +07:00
Joshua Horton
f499e155c1
Merge pull request #13683 from keymanapp/fix/web/flick-cancel-during-reset
change(web): cancel flicks when both returning to and releasing at original tap location
2025-05-19 08:43:24 +07:00
Joshua Horton
7b1310a7d5
Merge pull request #13899 from keymanapp/maint/update-mocha
maint: update mocha
2025-05-19 08:42:53 +07:00
Joshua Horton
35be4c1fe4
Merge pull request #13895 from keymanapp/fix/web/inspectable-test-script-mode
fix(web): inspectable test-script mode should not be auto-enabled in local-env tests
2025-05-19 08:42:06 +07:00
Joshua Horton
233f0c7345 change(web): apply suggestion from code review (strict '' check) 2025-05-16 13:58:50 +07:00
Joshua Horton
5a5cd20829 fix(web): empty layout fontSize property should default to 1em
Fixes: #13908
Fixes: KEYMAN-WEB-RK

Fun fact:  `Number('')` returns 0, not NaN!  I thought it would do the latter in #13838, which is what led to the issue this PR addresses.
2025-05-16 13:14:30 +07:00
Marc Durdin
48d61b9b03
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-05-16 12:12:05 +07:00
Eberhard Beilharz
29b6eaf630
refactor(web): rename generic type variables
This change renames the generic type variables in `KeymanEngineBase`
to make it clearer that they are generic types rather than the actual
types.
2025-05-15 17:02:35 +02:00
Eberhard Beilharz
7a162942aa
refactor(web): rename base KeymanEngine to KeymanEngineBase
(cherry picked from commit bd1c610d65)
2025-05-15 16:48:10 +02:00
Eberhard Beilharz
f80b3f9c13
refactor(web): rename HardKeyboard to HardKeyboardBase 2025-05-15 16:38:12 +02:00
Joshua Horton
155c1a2b12 maint: update mocha
Some of the npm audit warnings left after #13897 require an updated `mocha` version to remedy.  As we only really use `mocha` to do unit-testing, it should be safe to update if all of our existing tests pass with the new version.

Test-bot: skip
2025-05-13 14:02:02 +07:00
Joshua Horton
a783fbc902 maint(web): also fixes worker-thread inspectable browser test call 2025-05-13 12:44:26 +07:00
Joshua Horton
14dd36de4d fix(web): inspectable test-script mode should not be auto-enabled in local-env tests
This is a followup to the recent #13827, which automatically adds --debug to local-environment builds.  For web/ test scripts involving browser-based scripts, that same flag had been used to enable an _inspectable_ test mode that doesn't auto-return, which doesn't match the semantics of --debug for build configurations.

To rectify this, those scripts now have their --debug option renamed to --inspect, allowing them to be optionally turned on, but not automatically enabled.

Test-bot: skip
2025-05-13 12:38:47 +07:00
Joshua Horton
e9274d9874 change(web): permit flick cancellation
Fixes: #10876

This change blocks key output while a flick is in a "reset" state.  If the flick is in a direction-locked state, key output still results - be it the base key (if not slid far enough) or a target flick key.
2025-05-13 08:41:53 +07:00
Joshua Horton
e8630c2bf2 Merge branch 'master' into fix/web/flick-cancel-during-reset 2025-05-13 08:27:26 +07:00
Eberhard Beilharz
d307051836
Merge pull request #13854 from keymanapp/maint/common/versionvars
Previously the builder scripts defined a readonly `VERSION` environment variable for the Keyman version. That caused problems when another (external) script tried to define a `VERSION` variable. We encountered this problem when trying to move the TC build steps of a configuration into a single script (#13399) when we tried to source `~/.nvm/nvm.sh`.

This change uses a Keyman specific prefix for the version variables and renames `VERSION` → `KEYMAN_VERSION` etc. as well as `TIER` → `KEYMAN_TIER`. Unfortunately these variables are used in a lot of places, so this turned out to be a bit of a yak shave.
2025-05-12 08:58:19 +02:00
Joshua Horton
5d00ccdd53
Merge pull request #13860 from keymanapp/fix/web/sustain-batched-layout-on-swap
fix(web): sustain active batched-layout mode when keyboard is switched
2025-05-08 15:49:15 +07:00
Joshua Horton
dd563e8a11 fix(web): sustain active batched-layout mode when keyboard is switched
Fixes: #13859
Fixes: KEYMAN-WEB-R4
2025-05-08 13:56:23 +07:00
Eberhard Beilharz
4d81589f48
maint(common): use unique names for Keyman version variables
Previously the builder scripts defined a readonly `VERSION` environment
variable for the Keyman version. That caused problems when another
(external) script tried to define a `VERSION` variable. We encountered
this problem when trying to move the TC build steps of a configuration
into a single script (#13399) when we tried to source `~/.nvm/nvm.sh`.

This change uses a Keyman specific prefix for the version variables and
renames `VERSION` → `KEYMAN_VERSION` etc. Unfortunately these variables
are used in a lot of places, so this turned out to be a bit of a yak
shave.

Test-bot: skip
2025-05-07 18:46:51 +02:00
Eberhard Beilharz
460de65f0d
maint(common): use same TC variable everywhere
Standardize on `TEAMCITY_GIT_PATH` environment variable to detect
if we're running on TeamCity.

Test-bot: skip
2025-05-06 17:42:25 +02:00
Joshua Horton
7d5a83633d fix(web): fix var declaration affected by linter strictness + length-style fix
Test-bot: skip
2025-05-06 11:29:31 +07:00
Joshua Horton
c3286ce4e1
Merge pull request #13774 from keymanapp/fix/web/layout-fontsize-robustness
fix(web): add robustness for bad touch-layout fontsize specs
2025-05-06 09:46:17 +07:00
Joshua Horton
9976af6f6c
docs(web): tweak comment per review
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-05-06 08:18:42 +07:00