Commit graph

57 commits

Author SHA1 Message Date
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
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
Marc Durdin
31c55159c3
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-05-30 08:23:56 +07:00
Marc Durdin
48d61b9b03
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-05-16 12:12:05 +07: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
1438704ee0
Merge pull request #13819 from keymanapp/maint/web/use-builder_is_ci_build
chore(web): replace --ci flag with builder_is_ci_build
2025-05-06 08:16:37 +07:00
Joshua Horton
e382bf45ce
Merge pull request #13785 from keymanapp/change/web/drop-usvstring-alias
change(web): replace USVString with string in predictive-text engine
2025-05-06 08:16:28 +07:00
Joshua Horton
cb5e3035a7 chore(web): replace --ci flag with builder_is_ci_build
Fixes: #12640
2025-05-02 09:39:39 +07:00
Joshua Horton
e601d59b59 change(web): replace USVString with string in predictive-text engine
Fixes: #12046

It was only ever an alias (for `string`!) for its intended use, with actual `USVString` typing being unavailable in the browser.
2025-04-29 10:47:20 +07:00
Joshua Horton
dc450cde9e chore(web): finalize removal of side-effect KMWString implementation 2025-04-22 11:40:57 +07:00
Joshua Horton
f8ea902fd9 refactor(web): refactor _kmwCharAt 2025-04-22 11:40:57 +07:00
Joshua Horton
70c1920854 refactor(web): refactor _kmwSlice, _kmwSubstr, _kmwSubstring 2025-04-22 11:40:57 +07:00
Joshua Horton
418f3d6aec chore(web): update all Web engine uses of kmwLength, kmwCodePointToCodeUnit, kmwCodeUnitToCodePoint 2025-04-22 10:17:07 +07:00
Marc Durdin
29f0a20898
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-03-14 10:57:26 +07:00
Marc Durdin
a43a378be7
Merge pull request #13222 from keymanapp/chore/merge-master-into-autocorrect
chore: merge master into autocorrect 🚂
2025-02-14 05:29:34 +07:00
Joshua Horton
b2598e76ba chore(web): fix coverage-reporting artifact
Fixes: #13195
2025-02-12 15:56:54 +07:00
Joshua Horton
0e7b47e075
Merge pull request #12927 from keymanapp/fix/web/context-match-applied-suggestions
fix(web): correctly track context transitions caused by applying suggestions 🖲️
2025-02-03 15:11:01 +07:00
Joshua Horton
3c7ae5d7f6
Merge pull request #12925 from keymanapp/fix/web/context-match-path-ordering
fix(web): correct edit-path ordering at source 🖲️
2025-02-03 15:10:50 +07:00
Joshua Horton
316395a180
Merge pull request #12911 from keymanapp/change/web/context-tracker-backspaces-and-alignment
change(web): add context tracker bksp handling, alignment-offset calculations 🖲️
2025-02-03 15:10:36 +07:00
Marc Durdin
74db3c9833
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-01-30 18:50:17 +07:00
Joshua Horton
e97cd3094f fix(web): disabled correction state should prevent predictive corrections
Fixes: #12214
2025-01-29 10:12:53 +07:00
Joshua Horton
ce705500d7 chore(web): better cloning of cloned object's values 2025-01-22 08:27:20 +07:00
Joshua Horton
d9058adfae
Merge pull request #12930 from keymanapp/chore/merge-master-into-autocorrect
chore: merge master into autocorrect 🚂
2025-01-21 09:49:28 +07:00
Joshua Horton
44cb4044df fix(web): clone token replacement arrays properly 2025-01-21 09:06:27 +07:00
Joshua Horton
5a0e6a3b01 change(web): minor tweak in constructor for clarity 2025-01-21 09:04:52 +07:00
Joshua Horton
54e2e70c23
Merge pull request #12877 from keymanapp/change/web/prevent-autocorrect-for-numbers
change(web): add auto-correct filter that requires letter in initial position 🚂
2025-01-20 15:41:32 +07:00
Joshua Horton
5633b9ca36 fix(web): track shifts in context across applied suggestions 2025-01-17 10:40:56 +07:00
Joshua Horton
9b48385095 fix(web): correct edit-path ordering at source 2025-01-17 10:26:01 +07:00
Joshua Horton
817adffc70 fix(web): prevent array aliasing during context-token cloning 2025-01-17 10:15:18 +07:00
Joshua Horton
d798083c76 feat(web): track token shift counts during context tracking 2025-01-16 10:58:32 +07:00
Joshua Horton
e61e79e01b change(web): enable context-tracker matching to track across backspaces 2025-01-16 10:56:45 +07:00
Joshua Horton
84875cdc6e change(web): simplify context-tracker token cloning 2025-01-16 10:52:30 +07:00
Joshua Horton
bf9b601d7a change(web): keep transform pattern should match standard suggestion format 2025-01-16 08:36:23 +07:00
Joshua Horton
9796ab32a5
chore(web): apply suggestion from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-01-14 08:03:20 +07:00
Joshua Horton
ea466d7e5d change(web): adds auto-correct filter, requiring letter in existing text 2025-01-13 10:30:00 +07:00
Joshua Horton
064d753653 fix(web): better bad-context match handling due to tokenization shifts
Fixes: #12494.
2025-01-09 09:48:40 +07:00
Eberhard Beilharz
08b4b6c2eb
Merge pull request #12704 from keymanapp/chore/web/rename-tests
chore(web): rename test files and folders
2024-11-27 16:07:56 +07:00
Marc Durdin
b10634eb97 refactor(common): move all lexical model types into LexicalModelTypes container
Many of the types had very generic names (e.g. `Configuration`), and as
the types are now exported from `@keymanapp/common-types`, this was
unhelpful.

For units with many references, I used TypeScript's import-equals to
reduce the change impact. For units with only a few references, I added
the `LexicalModelTypes.` prefix to the references in source.

(Best reference I could find for import-equals: b722fa4e49)

Fixes: #12516
2024-11-27 09:46:09 +07:00
Eberhard Beilharz
432ab7055f
chore(web): rename test files and folders
This change renames the test files for Web according to the discussion at
the Keyman conference in November 2024. It also renames some folders from
`test` to `tests`.
2024-11-26 17:10:19 +01:00
Eberhard Beilharz
d4a049f614
refactor(web): move to web/src/tools/es-bundling
Addresses code review comments.
2024-09-11 09:44:58 +02:00
Eberhard Beilharz
c7a7ea2c51
Merge branch 'refactor/web/12025_web-utils' into refactor/web/12385_es-bundling 2024-09-11 09:28:19 +02:00
Eberhard Beilharz
d7f7ce9209
Merge branch 'refactor/web/12133_modelsWorkdbreakers' into refactor/web/12025_web-utils 2024-09-11 09:27:35 +02:00
Eberhard Beilharz
7e30dbf392
Merge remote-tracking branch 'origin/master' into refactor/web/12133_modelsWorkdbreakers 2024-09-11 09:21:59 +02:00
Eberhard Beilharz
cc21dda3cc
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2024-09-11 09:17:01 +02:00
Eberhard Beilharz
6553bd6233
refactor(web): move common/web/es-bundling → common/tools/es-bundling
Fixes: #12385
2024-09-10 18:57:42 +02:00